Merge branch 'release/5.3.4'
|
|
@ -0,0 +1,490 @@
|
|||
<?php
|
||||
/*
|
||||
Plugin Name: Advanced Custom Fields Pro
|
||||
Plugin URI: http://www.advancedcustomfields.com/
|
||||
Description: Customise WordPress with powerful, professional and intuitive fields
|
||||
Version: 5.3.4
|
||||
Author: elliot condon
|
||||
Author URI: http://www.elliotcondon.com/
|
||||
Copyright: Elliot Condon
|
||||
Text Domain: acf
|
||||
Domain Path: /lang
|
||||
*/
|
||||
|
||||
if( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
if( ! class_exists('acf') ) :
|
||||
|
||||
class acf {
|
||||
|
||||
// vars
|
||||
var $settings;
|
||||
|
||||
|
||||
/*
|
||||
* __construct
|
||||
*
|
||||
* A dummy constructor to ensure ACF is only initialized once
|
||||
*
|
||||
* @type function
|
||||
* @date 23/06/12
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param N/A
|
||||
* @return N/A
|
||||
*/
|
||||
|
||||
function __construct() {
|
||||
|
||||
/* Do nothing here */
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* initialize
|
||||
*
|
||||
* The real constructor to initialize ACF
|
||||
*
|
||||
* @type function
|
||||
* @date 28/09/13
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $post_id (int)
|
||||
* @return $post_id (int)
|
||||
*/
|
||||
|
||||
function initialize() {
|
||||
|
||||
// vars
|
||||
$this->settings = array(
|
||||
|
||||
// basic
|
||||
'name' => __('Advanced Custom Fields', 'acf'),
|
||||
'version' => '5.3.4',
|
||||
|
||||
// urls
|
||||
'basename' => plugin_basename( __FILE__ ),
|
||||
'path' => plugin_dir_path( __FILE__ ),
|
||||
'dir' => plugin_dir_url( __FILE__ ),
|
||||
|
||||
// options
|
||||
'show_admin' => true,
|
||||
'show_updates' => true,
|
||||
'stripslashes' => false,
|
||||
'local' => true,
|
||||
'json' => true,
|
||||
'save_json' => '',
|
||||
'load_json' => array(),
|
||||
'default_language' => '',
|
||||
'current_language' => '',
|
||||
'capability' => 'manage_options',
|
||||
'uploader' => 'wp',
|
||||
'autoload' => false,
|
||||
'l10n' => true,
|
||||
'l10n_textdomain' => '',
|
||||
'l10n_field' => array('label', 'instructions'),
|
||||
'l10n_field_group' => array('title'),
|
||||
);
|
||||
|
||||
|
||||
// include helpers
|
||||
include_once('api/api-helpers.php');
|
||||
|
||||
|
||||
// api
|
||||
acf_include('api/api-value.php');
|
||||
acf_include('api/api-field.php');
|
||||
acf_include('api/api-field-group.php');
|
||||
acf_include('api/api-template.php');
|
||||
|
||||
|
||||
// core
|
||||
acf_include('core/ajax.php');
|
||||
acf_include('core/field.php');
|
||||
acf_include('core/input.php');
|
||||
acf_include('core/json.php');
|
||||
acf_include('core/local.php');
|
||||
acf_include('core/location.php');
|
||||
acf_include('core/media.php');
|
||||
acf_include('core/revisions.php');
|
||||
acf_include('core/compatibility.php');
|
||||
acf_include('core/third_party.php');
|
||||
|
||||
|
||||
// forms
|
||||
acf_include('forms/attachment.php');
|
||||
acf_include('forms/comment.php');
|
||||
acf_include('forms/post.php');
|
||||
acf_include('forms/taxonomy.php');
|
||||
acf_include('forms/user.php');
|
||||
acf_include('forms/widget.php');
|
||||
|
||||
|
||||
// admin
|
||||
if( is_admin() ) {
|
||||
|
||||
acf_include('admin/admin.php');
|
||||
acf_include('admin/field-group.php');
|
||||
acf_include('admin/field-groups.php');
|
||||
acf_include('admin/update.php');
|
||||
acf_include('admin/settings-tools.php');
|
||||
//acf_include('admin/settings-addons.php');
|
||||
acf_include('admin/settings-info.php');
|
||||
}
|
||||
|
||||
|
||||
// pro
|
||||
acf_include('pro/acf-pro.php');
|
||||
|
||||
|
||||
// actions
|
||||
add_action('init', array($this, 'init'), 5);
|
||||
add_action('init', array($this, 'register_post_types'), 5);
|
||||
add_action('init', array($this, 'register_post_status'), 5);
|
||||
add_action('init', array($this, 'register_assets'), 5);
|
||||
|
||||
|
||||
// filters
|
||||
add_filter('posts_where', array($this, 'posts_where'), 10, 2 );
|
||||
//add_filter('posts_request', array($this, 'posts_request'), 10, 1 );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* init
|
||||
*
|
||||
* This function will run after all plugins and theme functions have been included
|
||||
*
|
||||
* @type action (init)
|
||||
* @date 28/09/13
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param N/A
|
||||
* @return N/A
|
||||
*/
|
||||
|
||||
function init() {
|
||||
|
||||
// bail early if a plugin called get_field early
|
||||
if( !did_action('plugins_loaded') ) return;
|
||||
|
||||
|
||||
// bail early if already init
|
||||
if( acf_get_setting('init') ) return;
|
||||
|
||||
|
||||
// only run once
|
||||
acf_update_setting('init', true);
|
||||
|
||||
|
||||
// vars
|
||||
$major = intval( acf_get_setting('version') );
|
||||
|
||||
|
||||
// redeclare dir
|
||||
// - allow another plugin to modify dir (maybe force SSL)
|
||||
acf_update_setting('dir', plugin_dir_url( __FILE__ ));
|
||||
|
||||
|
||||
// set text domain
|
||||
load_textdomain( 'acf', acf_get_path( 'lang/acf-' . get_locale() . '.mo' ) );
|
||||
|
||||
|
||||
// include wpml support
|
||||
if( defined('ICL_SITEPRESS_VERSION') ) {
|
||||
|
||||
acf_include('core/wpml.php');
|
||||
|
||||
}
|
||||
|
||||
|
||||
// field types
|
||||
acf_include('fields/text.php');
|
||||
acf_include('fields/textarea.php');
|
||||
acf_include('fields/number.php');
|
||||
acf_include('fields/email.php');
|
||||
acf_include('fields/url.php');
|
||||
acf_include('fields/password.php');
|
||||
acf_include('fields/wysiwyg.php');
|
||||
acf_include('fields/oembed.php');
|
||||
acf_include('fields/image.php');
|
||||
acf_include('fields/file.php');
|
||||
acf_include('fields/select.php');
|
||||
acf_include('fields/checkbox.php');
|
||||
acf_include('fields/radio.php');
|
||||
acf_include('fields/true_false.php');
|
||||
acf_include('fields/post_object.php');
|
||||
acf_include('fields/page_link.php');
|
||||
acf_include('fields/relationship.php');
|
||||
acf_include('fields/taxonomy.php');
|
||||
acf_include('fields/user.php');
|
||||
acf_include('fields/google-map.php');
|
||||
acf_include('fields/date_picker.php');
|
||||
acf_include('fields/color_picker.php');
|
||||
acf_include('fields/message.php');
|
||||
acf_include('fields/tab.php');
|
||||
|
||||
|
||||
// 3rd party field types
|
||||
do_action('acf/include_field_types', $major);
|
||||
|
||||
|
||||
// local fields
|
||||
do_action('acf/include_fields', $major);
|
||||
|
||||
|
||||
// action for 3rd party
|
||||
do_action('acf/init');
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* register_post_types
|
||||
*
|
||||
* This function will register post types and statuses
|
||||
*
|
||||
* @type function
|
||||
* @date 22/10/2015
|
||||
* @since 5.3.2
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function register_post_types() {
|
||||
|
||||
// vars
|
||||
$cap = acf_get_setting('capability');
|
||||
|
||||
|
||||
// register post type 'acf-field-group'
|
||||
register_post_type('acf-field-group', array(
|
||||
'labels' => array(
|
||||
'name' => __( 'Field Groups', 'acf' ),
|
||||
'singular_name' => __( 'Field Group', 'acf' ),
|
||||
'add_new' => __( 'Add New' , 'acf' ),
|
||||
'add_new_item' => __( 'Add New Field Group' , 'acf' ),
|
||||
'edit_item' => __( 'Edit Field Group' , 'acf' ),
|
||||
'new_item' => __( 'New Field Group' , 'acf' ),
|
||||
'view_item' => __( 'View Field Group', 'acf' ),
|
||||
'search_items' => __( 'Search Field Groups', 'acf' ),
|
||||
'not_found' => __( 'No Field Groups found', 'acf' ),
|
||||
'not_found_in_trash' => __( 'No Field Groups found in Trash', 'acf' ),
|
||||
),
|
||||
'public' => false,
|
||||
'show_ui' => true,
|
||||
'_builtin' => false,
|
||||
'capability_type' => 'post',
|
||||
'capabilities' => array(
|
||||
'edit_post' => $cap,
|
||||
'delete_post' => $cap,
|
||||
'edit_posts' => $cap,
|
||||
'delete_posts' => $cap,
|
||||
),
|
||||
'hierarchical' => true,
|
||||
'rewrite' => false,
|
||||
'query_var' => false,
|
||||
'supports' => array('title'),
|
||||
'show_in_menu' => false,
|
||||
));
|
||||
|
||||
|
||||
// register post type 'acf-field'
|
||||
register_post_type('acf-field', array(
|
||||
'labels' => array(
|
||||
'name' => __( 'Fields', 'acf' ),
|
||||
'singular_name' => __( 'Field', 'acf' ),
|
||||
'add_new' => __( 'Add New' , 'acf' ),
|
||||
'add_new_item' => __( 'Add New Field' , 'acf' ),
|
||||
'edit_item' => __( 'Edit Field' , 'acf' ),
|
||||
'new_item' => __( 'New Field' , 'acf' ),
|
||||
'view_item' => __( 'View Field', 'acf' ),
|
||||
'search_items' => __( 'Search Fields', 'acf' ),
|
||||
'not_found' => __( 'No Fields found', 'acf' ),
|
||||
'not_found_in_trash' => __( 'No Fields found in Trash', 'acf' ),
|
||||
),
|
||||
'public' => false,
|
||||
'show_ui' => false,
|
||||
'_builtin' => false,
|
||||
'capability_type' => 'post',
|
||||
'capabilities' => array(
|
||||
'edit_post' => $cap,
|
||||
'delete_post' => $cap,
|
||||
'edit_posts' => $cap,
|
||||
'delete_posts' => $cap,
|
||||
),
|
||||
'hierarchical' => true,
|
||||
'rewrite' => false,
|
||||
'query_var' => false,
|
||||
'supports' => array('title'),
|
||||
'show_in_menu' => false,
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* register_post_status
|
||||
*
|
||||
* This function will register custom post statuses
|
||||
*
|
||||
* @type function
|
||||
* @date 22/10/2015
|
||||
* @since 5.3.2
|
||||
*
|
||||
* @param $post_id (int)
|
||||
* @return $post_id (int)
|
||||
*/
|
||||
|
||||
function register_post_status() {
|
||||
|
||||
// acf-disabled
|
||||
register_post_status('acf-disabled', array(
|
||||
'label' => __( 'Disabled', 'acf' ),
|
||||
'public' => true,
|
||||
'exclude_from_search' => false,
|
||||
'show_in_admin_all_list' => true,
|
||||
'show_in_admin_status_list' => true,
|
||||
'label_count' => _n_noop( 'Disabled <span class="count">(%s)</span>', 'Disabled <span class="count">(%s)</span>', 'acf' ),
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* register_assets
|
||||
*
|
||||
* This function will register scripts and styles
|
||||
*
|
||||
* @type function
|
||||
* @date 22/10/2015
|
||||
* @since 5.3.2
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function register_assets() {
|
||||
|
||||
// vars
|
||||
$version = acf_get_setting('version');
|
||||
$lang = get_locale();
|
||||
$min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
|
||||
|
||||
|
||||
// scripts
|
||||
wp_register_script('acf-input', acf_get_dir("assets/js/acf-input{$min}.js"), array('jquery', 'jquery-ui-core', 'jquery-ui-sortable', 'jquery-ui-resizable'), $version );
|
||||
wp_register_script('acf-field-group', acf_get_dir("assets/js/acf-field-group{$min}.js"), array('acf-input'), $version );
|
||||
|
||||
|
||||
// styles
|
||||
wp_register_style('acf-global', acf_get_dir('assets/css/acf-global.css'), array(), $version );
|
||||
wp_register_style('acf-input', acf_get_dir('assets/css/acf-input.css'), array('acf-global'), $version );
|
||||
wp_register_style('acf-field-group', acf_get_dir('assets/css/acf-field-group.css'), array('acf-input'), $version );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* posts_where
|
||||
*
|
||||
* This function will add in some new parameters to the WP_Query args allowing fields to be found via key / name
|
||||
*
|
||||
* @type filter
|
||||
* @date 5/12/2013
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $where (string)
|
||||
* @param $wp_query (object)
|
||||
* @return $where (string)
|
||||
*/
|
||||
|
||||
function posts_where( $where, $wp_query ) {
|
||||
|
||||
// global
|
||||
global $wpdb;
|
||||
|
||||
|
||||
// acf_field_key
|
||||
if( $field_key = $wp_query->get('acf_field_key') ) {
|
||||
|
||||
$where .= $wpdb->prepare(" AND {$wpdb->posts}.post_name = %s", $field_key );
|
||||
|
||||
}
|
||||
|
||||
|
||||
// acf_field_name
|
||||
if( $field_name = $wp_query->get('acf_field_name') ) {
|
||||
|
||||
$where .= $wpdb->prepare(" AND {$wpdb->posts}.post_excerpt = %s", $field_name );
|
||||
|
||||
}
|
||||
|
||||
|
||||
// acf_group_key
|
||||
if( $group_key = $wp_query->get('acf_group_key') ) {
|
||||
|
||||
$where .= $wpdb->prepare(" AND {$wpdb->posts}.post_name = %s", $group_key );
|
||||
|
||||
}
|
||||
|
||||
|
||||
// return
|
||||
return $where;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
function posts_request( $thing ) {
|
||||
|
||||
return $thing;
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* acf
|
||||
*
|
||||
* The main function responsible for returning the one true acf Instance to functions everywhere.
|
||||
* Use this function like you would a global variable, except without needing to declare the global.
|
||||
*
|
||||
* Example: <?php $acf = acf(); ?>
|
||||
*
|
||||
* @type function
|
||||
* @date 4/09/13
|
||||
* @since 4.3.0
|
||||
*
|
||||
* @param N/A
|
||||
* @return (object)
|
||||
*/
|
||||
|
||||
function acf() {
|
||||
|
||||
global $acf;
|
||||
|
||||
if( !isset($acf) ) {
|
||||
|
||||
$acf = new acf();
|
||||
|
||||
$acf->initialize();
|
||||
|
||||
}
|
||||
|
||||
return $acf;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// initialize
|
||||
acf();
|
||||
|
||||
|
||||
endif; // class_exists check
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,140 @@
|
|||
<?php
|
||||
|
||||
class acf_admin {
|
||||
|
||||
/*
|
||||
* __construct
|
||||
*
|
||||
* Initialize filters, action, variables and includes
|
||||
*
|
||||
* @type function
|
||||
* @date 23/06/12
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function __construct() {
|
||||
|
||||
// actions
|
||||
add_action('admin_menu', array($this, 'admin_menu'));
|
||||
add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'), 0);
|
||||
add_action('admin_notices', array($this, 'admin_notices'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* admin_menu
|
||||
*
|
||||
* This function will add the ACF menu item to the WP admin
|
||||
*
|
||||
* @type action (admin_menu)
|
||||
* @date 28/09/13
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function admin_menu() {
|
||||
|
||||
// bail early if no show_admin
|
||||
if( !acf_get_setting('show_admin') ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// vars
|
||||
$slug = 'edit.php?post_type=acf-field-group';
|
||||
$cap = acf_get_setting('capability');
|
||||
|
||||
|
||||
// add parent
|
||||
add_menu_page(__("Custom Fields",'acf'), __("Custom Fields",'acf'), $cap, $slug, false, 'dashicons-welcome-widgets-menus', '80.025');
|
||||
|
||||
|
||||
// add children
|
||||
add_submenu_page($slug, __('Field Groups','acf'), __('Field Groups','acf'), $cap, $slug );
|
||||
add_submenu_page($slug, __('Add New','acf'), __('Add New','acf'), $cap, 'post-new.php?post_type=acf-field-group' );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* admin_enqueue_scripts
|
||||
*
|
||||
* This function will add the already registered css
|
||||
*
|
||||
* @type function
|
||||
* @date 28/09/13
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function admin_enqueue_scripts() {
|
||||
|
||||
wp_enqueue_style( 'acf-global' );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* admin_notices
|
||||
*
|
||||
* This function will render any admin notices
|
||||
*
|
||||
* @type function
|
||||
* @date 17/10/13
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function admin_notices() {
|
||||
|
||||
// vars
|
||||
$admin_notices = acf_get_admin_notices();
|
||||
|
||||
|
||||
// bail early if no notices
|
||||
if( empty($admin_notices) ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
foreach( $admin_notices as $notice ) {
|
||||
|
||||
$open = '';
|
||||
$close = '';
|
||||
|
||||
if( $notice['wrap'] ) {
|
||||
|
||||
$open = "<{$notice['wrap']}>";
|
||||
$close = "</{$notice['wrap']}>";
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="notice is-dismissible <?php echo $notice['class']; ?>"><?php echo $open . $notice['text'] . $close; ?></div>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// initialize
|
||||
new acf_admin();
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,786 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* ACF Admin Field Groups Class
|
||||
*
|
||||
* All the logic for editing a list of field groups
|
||||
*
|
||||
* @class acf_admin_field_groups
|
||||
* @package ACF
|
||||
* @subpackage Admin
|
||||
*/
|
||||
|
||||
if( ! class_exists('acf_admin_field_groups') ) :
|
||||
|
||||
class acf_admin_field_groups {
|
||||
|
||||
// vars
|
||||
var $url = 'edit.php?post_type=acf-field-group',
|
||||
$sync = array();
|
||||
|
||||
|
||||
/*
|
||||
* __construct
|
||||
*
|
||||
* This function will setup the class functionality
|
||||
*
|
||||
* @type function
|
||||
* @date 5/03/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function __construct() {
|
||||
|
||||
// actions
|
||||
add_action('current_screen', array($this, 'current_screen'));
|
||||
add_action('trashed_post', array($this, 'trashed_post'));
|
||||
add_action('untrashed_post', array($this, 'untrashed_post'));
|
||||
add_action('deleted_post', array($this, 'deleted_post'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* current_screen
|
||||
*
|
||||
* This function is fired when loading the admin page before HTML has been rendered.
|
||||
*
|
||||
* @type action (current_screen)
|
||||
* @date 21/07/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function current_screen() {
|
||||
|
||||
// validate screen
|
||||
if( !acf_is_screen('edit-acf-field-group') ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// customize post_status
|
||||
global $wp_post_statuses;
|
||||
|
||||
|
||||
// modify publish post status
|
||||
$wp_post_statuses['publish']->label_count = _n_noop( 'Active <span class="count">(%s)</span>', 'Active <span class="count">(%s)</span>', 'acf' );
|
||||
|
||||
|
||||
// reorder trash to end
|
||||
$wp_post_statuses['trash'] = acf_extract_var( $wp_post_statuses, 'trash' );
|
||||
|
||||
|
||||
// check stuff
|
||||
$this->check_duplicate();
|
||||
$this->check_sync();
|
||||
|
||||
|
||||
// actions
|
||||
add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
|
||||
add_action('admin_footer', array($this, 'admin_footer'));
|
||||
|
||||
|
||||
// columns
|
||||
add_filter('manage_edit-acf-field-group_columns', array($this, 'field_group_columns'), 10, 1);
|
||||
add_action('manage_acf-field-group_posts_custom_column', array($this, 'field_group_columns_html'), 10, 2);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* admin_enqueue_scripts
|
||||
*
|
||||
* This function will add the already registered css
|
||||
*
|
||||
* @type function
|
||||
* @date 28/09/13
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function admin_enqueue_scripts() {
|
||||
|
||||
wp_enqueue_script('acf-input');
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* check_duplicate
|
||||
*
|
||||
* This function will check for any $_GET data to duplicate
|
||||
*
|
||||
* @type function
|
||||
* @date 17/10/13
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function check_duplicate() {
|
||||
|
||||
// message
|
||||
if( $ids = acf_maybe_get($_GET, 'acfduplicatecomplete') ) {
|
||||
|
||||
// explode
|
||||
$ids = explode(',', $ids);
|
||||
$total = count($ids);
|
||||
|
||||
if( $total == 1 ) {
|
||||
|
||||
acf_add_admin_notice( sprintf(__('Field group duplicated. %s', 'acf'), '<a href="' . get_edit_post_link($ids[0]) . '">' . get_the_title($ids[0]) . '</a>') );
|
||||
|
||||
} else {
|
||||
|
||||
acf_add_admin_notice( sprintf(_n( '%s field group duplicated.', '%s field groups duplicated.', $total, 'acf' ), $total) );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// import field group
|
||||
if( $id = acf_maybe_get($_GET, 'acfduplicate') ) {
|
||||
|
||||
// validate
|
||||
check_admin_referer('bulk-posts');
|
||||
|
||||
|
||||
// duplicate
|
||||
$field_group = acf_duplicate_field_group( $id );
|
||||
|
||||
|
||||
// redirect
|
||||
wp_redirect( admin_url( $this->url . '&acfduplicatecomplete=' . $field_group['ID'] ) );
|
||||
exit;
|
||||
|
||||
} elseif( acf_maybe_get($_GET, 'action2') === 'acfduplicate' ) {
|
||||
|
||||
// validate
|
||||
check_admin_referer('bulk-posts');
|
||||
|
||||
|
||||
// get ids
|
||||
$ids = acf_maybe_get($_GET, 'post');
|
||||
|
||||
if( !empty($ids) ) {
|
||||
|
||||
// vars
|
||||
$new_ids = array();
|
||||
|
||||
foreach( $ids as $id ) {
|
||||
|
||||
// duplicate
|
||||
$field_group = acf_duplicate_field_group( $id );
|
||||
|
||||
|
||||
// increase counter
|
||||
$new_ids[] = $field_group['ID'];
|
||||
|
||||
}
|
||||
|
||||
|
||||
// redirect
|
||||
wp_redirect( admin_url( $this->url . '&acfduplicatecomplete=' . implode(',', $new_ids)) );
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* check_sync
|
||||
*
|
||||
* This function will check for any $_GET data to sync
|
||||
*
|
||||
* @type function
|
||||
* @date 9/12/2014
|
||||
* @since 5.1.5
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function check_sync() {
|
||||
|
||||
// message
|
||||
if( $ids = acf_maybe_get($_GET, 'acfsynccomplete') ) {
|
||||
|
||||
// explode
|
||||
$ids = explode(',', $ids);
|
||||
$total = count($ids);
|
||||
|
||||
if( $total == 1 ) {
|
||||
|
||||
acf_add_admin_notice( sprintf(__('Field group synchronised. %s', 'acf'), '<a href="' . get_edit_post_link($ids[0]) . '">' . get_the_title($ids[0]) . '</a>') );
|
||||
|
||||
} else {
|
||||
|
||||
acf_add_admin_notice( sprintf(_n( '%s field group synchronised.', '%s field groups synchronised.', $total, 'acf' ), $total) );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// vars
|
||||
$groups = acf_get_field_groups();
|
||||
|
||||
|
||||
// bail early if no field groups
|
||||
if( empty($groups) ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// find JSON field groups which have not yet been imported
|
||||
foreach( $groups as $group ) {
|
||||
|
||||
// vars
|
||||
$local = acf_maybe_get($group, 'local', false);
|
||||
$modified = acf_maybe_get($group, 'modified', 0);
|
||||
$private = acf_maybe_get($group, 'private', false);
|
||||
|
||||
|
||||
// ignore DB / PHP / private field groups
|
||||
if( $local !== 'json' || $private ) {
|
||||
|
||||
// do nothing
|
||||
|
||||
} elseif( !$group['ID'] ) {
|
||||
|
||||
$this->sync[ $group['key'] ] = $group;
|
||||
|
||||
} elseif( $modified && $modified > get_post_modified_time('U', true, $group['ID'], true) ) {
|
||||
|
||||
$this->sync[ $group['key'] ] = $group;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// bail if no sync needed
|
||||
if( empty($this->sync) ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// import field group
|
||||
if( $key = acf_maybe_get($_GET, 'acfsync') ) {
|
||||
|
||||
// disable JSON
|
||||
// - this prevents a new JSON file being created and causing a 'change' to theme files - solves git anoyance
|
||||
acf_update_setting('json', false);
|
||||
|
||||
|
||||
// validate
|
||||
check_admin_referer('bulk-posts');
|
||||
|
||||
|
||||
// append fields
|
||||
if( acf_have_local_fields( $key ) ) {
|
||||
|
||||
$this->sync[ $key ]['fields'] = acf_get_local_fields( $key );
|
||||
|
||||
}
|
||||
|
||||
|
||||
// import
|
||||
$field_group = acf_import_field_group( $this->sync[ $key ] );
|
||||
|
||||
|
||||
// redirect
|
||||
wp_redirect( admin_url( $this->url . '&acfsynccomplete=' . $field_group['ID'] ) );
|
||||
exit;
|
||||
|
||||
} elseif( acf_maybe_get($_GET, 'action2') === 'acfsync' ) {
|
||||
|
||||
// validate
|
||||
check_admin_referer('bulk-posts');
|
||||
|
||||
|
||||
// get ids
|
||||
$keys = acf_maybe_get($_GET, 'post');
|
||||
|
||||
if( !empty($keys) ) {
|
||||
|
||||
// disable JSON
|
||||
// - this prevents a new JSON file being created and causing a 'change' to theme files - solves git anoyance
|
||||
acf_update_setting('json', false);
|
||||
|
||||
// vars
|
||||
$new_ids = array();
|
||||
|
||||
foreach( $keys as $key ) {
|
||||
|
||||
// append fields
|
||||
if( acf_have_local_fields( $key ) ) {
|
||||
|
||||
$this->sync[ $key ]['fields'] = acf_get_local_fields( $key );
|
||||
|
||||
}
|
||||
|
||||
|
||||
// import
|
||||
$field_group = acf_import_field_group( $this->sync[ $key ] );
|
||||
|
||||
|
||||
// append
|
||||
$new_ids[] = $field_group['ID'];
|
||||
|
||||
}
|
||||
|
||||
|
||||
// redirect
|
||||
wp_redirect( admin_url( $this->url . '&acfsynccomplete=' . implode(',', $new_ids)) );
|
||||
exit;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// filters
|
||||
add_filter('views_edit-acf-field-group', array($this, 'list_table_views'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* list_table_views
|
||||
*
|
||||
* This function will add an extra link for JSON in the field group list table
|
||||
*
|
||||
* @type function
|
||||
* @date 3/12/2014
|
||||
* @since 5.1.5
|
||||
*
|
||||
* @param $views (array)
|
||||
* @return $views
|
||||
*/
|
||||
|
||||
function list_table_views( $views ) {
|
||||
|
||||
// vars
|
||||
$class = '';
|
||||
$total = count($this->sync);
|
||||
|
||||
// active
|
||||
if( acf_maybe_get($_GET, 'post_status') === 'sync' ) {
|
||||
|
||||
// actions
|
||||
add_action('admin_footer', array($this, 'sync_admin_footer'), 5);
|
||||
|
||||
|
||||
// set active class
|
||||
$class = ' class="current"';
|
||||
|
||||
|
||||
// global
|
||||
global $wp_list_table;
|
||||
|
||||
|
||||
// update pagination
|
||||
$wp_list_table->set_pagination_args( array(
|
||||
'total_items' => $total,
|
||||
'total_pages' => 1,
|
||||
'per_page' => $total
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
|
||||
// add view
|
||||
$views['json'] = '<a' . $class . ' href="' . admin_url($this->url . '&post_status=sync') . '">' . __('Sync available', 'acf') . ' <span class="count">(' . $total . ')</span></a>';
|
||||
|
||||
|
||||
// return
|
||||
return $views;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* trashed_post
|
||||
*
|
||||
* This function is run when a post object is sent to the trash
|
||||
*
|
||||
* @type action (trashed_post)
|
||||
* @date 8/01/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $post_id (int)
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function trashed_post( $post_id ) {
|
||||
|
||||
// validate post type
|
||||
if( get_post_type($post_id) != 'acf-field-group' ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// trash field group
|
||||
acf_trash_field_group( $post_id );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* untrashed_post
|
||||
*
|
||||
* This function is run when a post object is restored from the trash
|
||||
*
|
||||
* @type action (untrashed_post)
|
||||
* @date 8/01/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $post_id (int)
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function untrashed_post( $post_id ) {
|
||||
|
||||
// validate post type
|
||||
if( get_post_type($post_id) != 'acf-field-group' ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// trash field group
|
||||
acf_untrash_field_group( $post_id );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* deleted_post
|
||||
*
|
||||
* This function is run when a post object is deleted from the trash
|
||||
*
|
||||
* @type action (deleted_post)
|
||||
* @date 8/01/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $post_id (int)
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function deleted_post( $post_id ) {
|
||||
|
||||
// validate post type
|
||||
if( get_post_type($post_id) != 'acf-field-group' ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// trash field group
|
||||
acf_delete_field_group( $post_id );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* field_group_columns
|
||||
*
|
||||
* This function will customize the columns for the field group table
|
||||
*
|
||||
* @type filter (manage_edit-acf-field-group_columns)
|
||||
* @date 28/09/13
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $columns (array)
|
||||
* @return $columns (array)
|
||||
*/
|
||||
|
||||
function field_group_columns( $columns ) {
|
||||
|
||||
return array(
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'title' => __('Title', 'acf'),
|
||||
'acf-fg-description' => __('Description', 'acf'),
|
||||
'acf-fg-status' => '<i class="acf-icon -dot-3 small acf-js-tooltip" title="' . __('Status', 'acf') . '"></i>',
|
||||
'acf-fg-count' => __('Fields', 'acf'),
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* field_group_columns_html
|
||||
*
|
||||
* This function will render the HTML for each table cell
|
||||
*
|
||||
* @type action (manage_acf-field-group_posts_custom_column)
|
||||
* @date 28/09/13
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $column (string)
|
||||
* @param $post_id (int)
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function field_group_columns_html( $column, $post_id ) {
|
||||
|
||||
// vars
|
||||
$field_group = acf_get_field_group( $post_id );
|
||||
|
||||
|
||||
// render
|
||||
$this->render_column( $column, $field_group );
|
||||
|
||||
}
|
||||
|
||||
function render_column( $column, $field_group ) {
|
||||
|
||||
// description
|
||||
if( $column == 'acf-fg-description' ) {
|
||||
|
||||
if( $field_group['description'] ) {
|
||||
|
||||
echo '<span class="acf-description">' . $field_group['description'] . '</span>';
|
||||
|
||||
}
|
||||
|
||||
// status
|
||||
} elseif( $column == 'acf-fg-status' ) {
|
||||
|
||||
if( isset($this->sync[ $field_group['key'] ]) ) {
|
||||
|
||||
echo '<i class="acf-icon -sync grey small acf-js-tooltip" title="' . __('Sync available', 'acf') .'"></i> ';
|
||||
|
||||
}
|
||||
|
||||
if( $field_group['active'] ) {
|
||||
|
||||
//echo '<i class="acf-icon -check small acf-js-tooltip" title="' . __('Active', 'acf') .'"></i> ';
|
||||
|
||||
} else {
|
||||
|
||||
echo '<i class="acf-icon -minus yellow small acf-js-tooltip" title="' . __('Disabled', 'acf') . '"></i> ';
|
||||
|
||||
}
|
||||
|
||||
// fields
|
||||
} elseif( $column == 'acf-fg-count' ) {
|
||||
|
||||
echo acf_get_field_count( $field_group );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* admin_footer
|
||||
*
|
||||
* This function will render extra HTML onto the page
|
||||
*
|
||||
* @type action (admin_footer)
|
||||
* @date 23/06/12
|
||||
* @since 3.1.8
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function admin_footer() {
|
||||
|
||||
// vars
|
||||
$www = 'http://www.advancedcustomfields.com/resources/';
|
||||
|
||||
?><script type="text/html" id="tmpl-acf-column-2">
|
||||
<div class="acf-column-2">
|
||||
<div class="acf-box">
|
||||
<div class="inner">
|
||||
<h2><?php echo acf_get_setting('name'); ?> <?php echo acf_get_setting('version'); ?></h2>
|
||||
|
||||
<h3><?php _e("Changelog",'acf'); ?></h3>
|
||||
<p><?php _e("See what's new in",'acf'); ?> <a href="<?php echo admin_url('edit.php?post_type=acf-field-group&page=acf-settings-info&tab=changelog'); ?>"><?php _e("version",'acf'); ?> <?php echo acf_get_setting('version'); ?></a>
|
||||
|
||||
<h3><?php _e("Resources",'acf'); ?></h3>
|
||||
<ul>
|
||||
<li><a href="<?php echo $www; ?>#getting-started" target="_blank"><?php _e("Getting Started",'acf'); ?></a></li>
|
||||
<li><a href="<?php echo $www; ?>#updates" target="_blank"><?php _e("Updates",'acf'); ?></a></li>
|
||||
<li><a href="<?php echo $www; ?>#field-types" target="_blank"><?php _e("Field Types",'acf'); ?></a></li>
|
||||
<li><a href="<?php echo $www; ?>#functions" target="_blank"><?php _e("Functions",'acf'); ?></a></li>
|
||||
<li><a href="<?php echo $www; ?>#actions" target="_blank"><?php _e("Actions",'acf'); ?></a></li>
|
||||
<li><a href="<?php echo $www; ?>#filters" target="_blank"><?php _e("Filters",'acf'); ?></a></li>
|
||||
<li><a href="<?php echo $www; ?>#how-to" target="_blank"><?php _e("'How to' guides",'acf'); ?></a></li>
|
||||
<li><a href="<?php echo $www; ?>#tutorials" target="_blank"><?php _e("Tutorials",'acf'); ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer footer-blue">
|
||||
<ul class="acf-hl">
|
||||
<li><?php _e("Created by",'acf'); ?> Elliot Condon</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="acf-clear"></div>
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
(function($){
|
||||
|
||||
// wrap
|
||||
$('#wpbody .wrap').attr('id', 'acf-field-group-wrap');
|
||||
|
||||
|
||||
// wrap form
|
||||
$('#posts-filter').wrap('<div class="acf-columns-2" />');
|
||||
|
||||
|
||||
// add column main
|
||||
$('#posts-filter').addClass('acf-column-1');
|
||||
|
||||
|
||||
// add column side
|
||||
$('#posts-filter').after( $('#tmpl-acf-column-2').html() );
|
||||
|
||||
|
||||
// modify row actions
|
||||
$('#the-list tr').each(function(){
|
||||
|
||||
// vars
|
||||
var $tr = $(this),
|
||||
id = $tr.attr('id'),
|
||||
description = $tr.find('.column-acf-fg-description').html();
|
||||
|
||||
|
||||
// replace Quick Edit with Duplicate (sync page has no id attribute)
|
||||
if( id ) {
|
||||
|
||||
// vars
|
||||
var post_id = id.replace('post-', '');
|
||||
|
||||
|
||||
// create el
|
||||
var $span = $('<span class="acf-duplicate-field-group"><a title="<?php _e('Duplicate this item', 'acf'); ?>" href="<?php echo admin_url($this->url . '&acfduplicate='); ?>' + post_id + '&_wpnonce=<?php echo wp_create_nonce('bulk-posts'); ?>"><?php _e('Duplicate', 'acf'); ?></a> | </span>');
|
||||
|
||||
|
||||
// replace
|
||||
$tr.find('.column-title .row-actions .inline').replaceWith( $span );
|
||||
|
||||
}
|
||||
|
||||
|
||||
// add description to title
|
||||
$tr.find('.column-title .row-title').after( description );
|
||||
|
||||
});
|
||||
|
||||
|
||||
// modify bulk actions
|
||||
$('#bulk-action-selector-bottom option[value="edit"]').attr('value','acfduplicate').text('<?php _e( 'Duplicate', 'acf' ); ?>');
|
||||
|
||||
|
||||
// clean up table
|
||||
$('#adv-settings label[for="acf-fg-description-hide"]').remove();
|
||||
|
||||
|
||||
// mobile compatibility
|
||||
var status = $('.acf-icon.-dot-3').first().attr('title');
|
||||
$('td.column-acf-fg-status').attr('data-colname', status);
|
||||
|
||||
})(jQuery);
|
||||
</script>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* sync_admin_footer
|
||||
*
|
||||
* This function will render extra HTML onto the page
|
||||
*
|
||||
* @type action (admin_footer)
|
||||
* @date 23/06/12
|
||||
* @since 3.1.8
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function sync_admin_footer() {
|
||||
|
||||
// vars
|
||||
$i = -1;
|
||||
$columns = array(
|
||||
'acf-fg-description',
|
||||
'acf-fg-status',
|
||||
'acf-fg-count'
|
||||
);
|
||||
|
||||
?>
|
||||
<script type="text/html" id="tmpl-acf-json-tbody">
|
||||
<?php foreach( $this->sync as $field_group ): $i++; ?>
|
||||
<tr <?php if($i%2 == 0): ?>class="alternate"<?php endif; ?>>
|
||||
<th class="check-column" scope="row">
|
||||
<label for="cb-select-<?php echo $field_group['key']; ?>" class="screen-reader-text"><?php printf( __( 'Select %s', 'acf' ), $field_group['title'] ); ?></label>
|
||||
<input type="checkbox" value="<?php echo $field_group['key']; ?>" name="post[]" id="cb-select-<?php echo $field_group['key']; ?>">
|
||||
</th>
|
||||
<td class="post-title page-title column-title">
|
||||
<strong>
|
||||
<span class="row-title"><?php echo $field_group['title']; ?></span><span class="acf-description"><?php echo $field_group['key']; ?>.json</span>
|
||||
</strong>
|
||||
<div class="row-actions">
|
||||
<span class="import"><a title="<?php echo esc_attr( __('Synchronise field group', 'acf') ); ?>" href="<?php echo admin_url($this->url . '&post_status=sync&acfsync=' . $field_group['key'] . '&_wpnonce=' . wp_create_nonce('bulk-posts')); ?>"><?php _e( 'Sync', 'acf' ); ?></a></span>
|
||||
</div>
|
||||
</td>
|
||||
<?php foreach( $columns as $column ): ?>
|
||||
<td class="column-<?php echo $column; ?>"><?php $this->render_column( $column, $field_group ); ?></td>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
(function($){
|
||||
|
||||
// update table HTML
|
||||
$('#the-list').html( $('#tmpl-acf-json-tbody').html() );
|
||||
|
||||
|
||||
// modify bulk actions
|
||||
$('#bulk-action-selector-bottom option[value="edit"]').attr('value','acfsync').text('<?php _e('Sync', 'acf'); ?>');
|
||||
$('#bulk-action-selector-bottom option[value="trash"]').remove();
|
||||
|
||||
})(jQuery);
|
||||
</script>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
new acf_admin_field_groups();
|
||||
|
||||
endif;
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
<?php
|
||||
|
||||
class acf_settings_addons {
|
||||
|
||||
var $view;
|
||||
|
||||
|
||||
/*
|
||||
* __construct
|
||||
*
|
||||
* Initialize filters, action, variables and includes
|
||||
*
|
||||
* @type function
|
||||
* @date 23/06/12
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function __construct() {
|
||||
|
||||
// actions
|
||||
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* admin_menu
|
||||
*
|
||||
* This function will add the ACF menu item to the WP admin
|
||||
*
|
||||
* @type action (admin_menu)
|
||||
* @date 28/09/13
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function admin_menu() {
|
||||
|
||||
// bail early if no show_admin
|
||||
if( !acf_get_setting('show_admin') )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// add page
|
||||
$page = add_submenu_page('edit.php?post_type=acf-field-group', __('Add-ons','acf'), __('Add-ons','acf'), acf_get_setting('capability'),'acf-settings-addons', array($this,'html') );
|
||||
|
||||
|
||||
// actions
|
||||
add_action('load-' . $page, array($this,'load'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* load
|
||||
*
|
||||
* description
|
||||
*
|
||||
* @type function
|
||||
* @date 7/01/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $post_id (int)
|
||||
* @return $post_id (int)
|
||||
*/
|
||||
|
||||
function load() {
|
||||
|
||||
// vars
|
||||
$this->view = array(
|
||||
'json' => array(),
|
||||
);
|
||||
|
||||
|
||||
// load json
|
||||
$request = wp_remote_post( 'http://assets.advancedcustomfields.com/add-ons/add-ons.json' );
|
||||
|
||||
// validate
|
||||
if( is_wp_error($request) || wp_remote_retrieve_response_code($request) != 200)
|
||||
{
|
||||
acf_add_admin_notice(__('<b>Error</b>. Could not load add-ons list', 'acf'), 'error');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->view['json'] = json_decode( $request['body'], true );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* html
|
||||
*
|
||||
* description
|
||||
*
|
||||
* @type function
|
||||
* @date 7/01/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $post_id (int)
|
||||
* @return $post_id (int)
|
||||
*/
|
||||
|
||||
function html() {
|
||||
|
||||
// load view
|
||||
acf_get_view('settings-addons', $this->view);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// initialize
|
||||
new acf_settings_addons();
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
<?php
|
||||
|
||||
class acf_settings_info {
|
||||
|
||||
/*
|
||||
* __construct
|
||||
*
|
||||
* Initialize filters, action, variables and includes
|
||||
*
|
||||
* @type function
|
||||
* @date 23/06/12
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function __construct() {
|
||||
|
||||
// actions
|
||||
add_action('admin_menu', array($this, 'admin_menu'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* admin_menu
|
||||
*
|
||||
* This function will add the ACF menu item to the WP admin
|
||||
*
|
||||
* @type action (admin_menu)
|
||||
* @date 28/09/13
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function admin_menu() {
|
||||
|
||||
// bail early if no show_admin
|
||||
if( !acf_get_setting('show_admin') ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// add page
|
||||
add_submenu_page('edit.php?post_type=acf-field-group', __('Info','acf'), __('Info','acf'), acf_get_setting('capability'),'acf-settings-info', array($this,'html'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* html
|
||||
*
|
||||
* description
|
||||
*
|
||||
* @type function
|
||||
* @date 7/01/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $post_id (int)
|
||||
* @return $post_id (int)
|
||||
*/
|
||||
|
||||
function html() {
|
||||
|
||||
// vars
|
||||
$view = array(
|
||||
'version' => acf_get_setting('version'),
|
||||
'have_pro' => acf_get_setting('pro'),
|
||||
'tabs' => array(
|
||||
'new' => __("What's New", 'acf'),
|
||||
'changelog' => __("Changelog", 'acf')
|
||||
),
|
||||
'active' => 'new'
|
||||
);
|
||||
|
||||
|
||||
// set active tab
|
||||
if( !empty($_GET['tab']) && array_key_exists($_GET['tab'], $view['tabs']) ) {
|
||||
|
||||
$view['active'] = $_GET['tab'];
|
||||
|
||||
}
|
||||
|
||||
|
||||
// load view
|
||||
acf_get_view('settings-info', $view);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// initialize
|
||||
new acf_settings_info();
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,445 @@
|
|||
<?php
|
||||
|
||||
class acf_settings_tools {
|
||||
|
||||
var $view = 'settings-tools',
|
||||
$data = array();
|
||||
|
||||
|
||||
/*
|
||||
* __construct
|
||||
*
|
||||
* Initialize filters, action, variables and includes
|
||||
*
|
||||
* @type function
|
||||
* @date 23/06/12
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function __construct() {
|
||||
|
||||
// actions
|
||||
add_action('admin_menu', array($this, 'admin_menu'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* admin_menu
|
||||
*
|
||||
* This function will add the ACF menu item to the WP admin
|
||||
*
|
||||
* @type action (admin_menu)
|
||||
* @date 28/09/13
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function admin_menu() {
|
||||
|
||||
// bail early if no show_admin
|
||||
if( !acf_get_setting('show_admin') ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// add page
|
||||
$page = add_submenu_page('edit.php?post_type=acf-field-group', __('Tools','acf'), __('Tools','acf'), acf_get_setting('capability'),'acf-settings-tools', array($this,'html') );
|
||||
|
||||
|
||||
// actions
|
||||
add_action('load-' . $page, array($this,'load'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* load
|
||||
*
|
||||
* This function will look at the $_POST data and run any functions if needed
|
||||
*
|
||||
* @type function
|
||||
* @date 7/01/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function load() {
|
||||
|
||||
// all export pages should not load local fields
|
||||
acf_disable_local();
|
||||
|
||||
|
||||
// run import / export
|
||||
if( acf_verify_nonce('import') ) {
|
||||
|
||||
$this->import();
|
||||
|
||||
} elseif( acf_verify_nonce('export') ) {
|
||||
|
||||
if( isset($_POST['generate']) ) {
|
||||
|
||||
$this->generate();
|
||||
|
||||
} else {
|
||||
|
||||
$this->export();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// load acf scripts
|
||||
acf_enqueue_scripts();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* html
|
||||
*
|
||||
* This function will render the view
|
||||
*
|
||||
* @type function
|
||||
* @date 7/01/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function html() {
|
||||
|
||||
// load view
|
||||
acf_get_view($this->view, $this->data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* export
|
||||
*
|
||||
* This function will export field groups to a .json file
|
||||
*
|
||||
* @type function
|
||||
* @date 11/03/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function export() {
|
||||
|
||||
// vars
|
||||
$json = $this->get_json();
|
||||
|
||||
|
||||
// validate
|
||||
if( $json === false ) {
|
||||
|
||||
acf_add_admin_notice( __("No field groups selected", 'acf') , 'error');
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// set headers
|
||||
$file_name = 'acf-export-' . date('Y-m-d') . '.json';
|
||||
|
||||
header( "Content-Description: File Transfer" );
|
||||
header( "Content-Disposition: attachment; filename={$file_name}" );
|
||||
header( "Content-Type: application/json; charset=utf-8" );
|
||||
|
||||
echo acf_json_encode( $json );
|
||||
die;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* import
|
||||
*
|
||||
* This function will import a .json file of field groups
|
||||
*
|
||||
* @type function
|
||||
* @date 11/03/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function import() {
|
||||
|
||||
// validate
|
||||
if( empty($_FILES['acf_import_file']) ) {
|
||||
|
||||
acf_add_admin_notice( __("No file selected", 'acf') , 'error');
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// vars
|
||||
$file = $_FILES['acf_import_file'];
|
||||
|
||||
|
||||
// validate error
|
||||
if( $file['error'] ) {
|
||||
|
||||
acf_add_admin_notice(__('Error uploading file. Please try again', 'acf'), 'error');
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// validate type
|
||||
if( pathinfo($file['name'], PATHINFO_EXTENSION) !== 'json' ) {
|
||||
|
||||
acf_add_admin_notice(__('Incorrect file type', 'acf'), 'error');
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// read file
|
||||
$json = file_get_contents( $file['tmp_name'] );
|
||||
|
||||
|
||||
// decode json
|
||||
$json = json_decode($json, true);
|
||||
|
||||
|
||||
// validate json
|
||||
if( empty($json) ) {
|
||||
|
||||
acf_add_admin_notice(__('Import file empty', 'acf'), 'error');
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// if importing an auto-json, wrap field group in array
|
||||
if( isset($json['key']) ) {
|
||||
|
||||
$json = array( $json );
|
||||
|
||||
}
|
||||
|
||||
|
||||
// vars
|
||||
$added = array();
|
||||
$ignored = array();
|
||||
$ref = array();
|
||||
$order = array();
|
||||
|
||||
foreach( $json as $field_group ) {
|
||||
|
||||
// check if field group exists
|
||||
if( acf_get_field_group($field_group['key'], true) ) {
|
||||
|
||||
// append to ignored
|
||||
$ignored[] = $field_group['title'];
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// remove fields
|
||||
$fields = acf_extract_var($field_group, 'fields');
|
||||
|
||||
|
||||
// format fields
|
||||
$fields = acf_prepare_fields_for_import( $fields );
|
||||
|
||||
|
||||
// save field group
|
||||
$field_group = acf_update_field_group( $field_group );
|
||||
|
||||
|
||||
// add to ref
|
||||
$ref[ $field_group['key'] ] = $field_group['ID'];
|
||||
|
||||
|
||||
// add to order
|
||||
$order[ $field_group['ID'] ] = 0;
|
||||
|
||||
|
||||
// add fields
|
||||
foreach( $fields as $field ) {
|
||||
|
||||
// add parent
|
||||
if( empty($field['parent']) ) {
|
||||
|
||||
$field['parent'] = $field_group['ID'];
|
||||
|
||||
} elseif( isset($ref[ $field['parent'] ]) ) {
|
||||
|
||||
$field['parent'] = $ref[ $field['parent'] ];
|
||||
|
||||
}
|
||||
|
||||
|
||||
// add field menu_order
|
||||
if( !isset($order[ $field['parent'] ]) ) {
|
||||
|
||||
$order[ $field['parent'] ] = 0;
|
||||
|
||||
}
|
||||
|
||||
$field['menu_order'] = $order[ $field['parent'] ];
|
||||
$order[ $field['parent'] ]++;
|
||||
|
||||
|
||||
// save field
|
||||
$field = acf_update_field( $field );
|
||||
|
||||
|
||||
// add to ref
|
||||
$ref[ $field['key'] ] = $field['ID'];
|
||||
|
||||
}
|
||||
|
||||
// append to added
|
||||
$added[] = '<a href="' . admin_url("post.php?post={$field_group['ID']}&action=edit") . '" target="_blank">' . $field_group['title'] . '</a>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
// messages
|
||||
if( !empty($added) ) {
|
||||
|
||||
$message = __('<b>Success</b>. Import tool added %s field groups: %s', 'acf');
|
||||
$message = sprintf( $message, count($added), implode(', ', $added) );
|
||||
|
||||
acf_add_admin_notice( $message );
|
||||
|
||||
}
|
||||
|
||||
if( !empty($ignored) ) {
|
||||
|
||||
$message = __('<b>Warning</b>. Import tool detected %s field groups already exist and have been ignored: %s', 'acf');
|
||||
$message = sprintf( $message, count($ignored), implode(', ', $ignored) );
|
||||
|
||||
acf_add_admin_notice( $message, 'error' );
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* generate
|
||||
*
|
||||
* This function will generate PHP code to include in your theme
|
||||
*
|
||||
* @type function
|
||||
* @date 11/03/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function generate() {
|
||||
|
||||
// prevent default translation and fake __() within string
|
||||
acf_update_setting('l10n_var_export', true);
|
||||
|
||||
|
||||
// vars
|
||||
$json = $this->get_json();
|
||||
|
||||
|
||||
// validate
|
||||
if( $json === false ) {
|
||||
|
||||
acf_add_admin_notice( __("No field groups selected", 'acf') , 'error');
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// update view
|
||||
$this->view = 'settings-tools-export';
|
||||
$this->data['field_groups'] = $json;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* get_json
|
||||
*
|
||||
* This function will return the JSON data for given $_POST args
|
||||
*
|
||||
* @type function
|
||||
* @date 3/02/2015
|
||||
* @since 5.1.5
|
||||
*
|
||||
* @param $post_id (int)
|
||||
* @return $post_id (int)
|
||||
*/
|
||||
|
||||
function get_json() {
|
||||
|
||||
// validate
|
||||
if( empty($_POST['acf_export_keys']) ) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// vars
|
||||
$json = array();
|
||||
|
||||
|
||||
// construct JSON
|
||||
foreach( $_POST['acf_export_keys'] as $key ) {
|
||||
|
||||
// load field group
|
||||
$field_group = acf_get_field_group( $key );
|
||||
|
||||
|
||||
// validate field group
|
||||
if( empty($field_group) ) continue;
|
||||
|
||||
|
||||
// load fields
|
||||
$field_group['fields'] = acf_get_fields( $field_group );
|
||||
|
||||
|
||||
// prepare for export
|
||||
$field_group = acf_prepare_field_group_for_export( $field_group );
|
||||
|
||||
|
||||
// add to json array
|
||||
$json[] = $field_group;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// return
|
||||
return $json;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// initialize
|
||||
new acf_settings_tools();
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,547 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* ACF Admin Update Class
|
||||
*
|
||||
* All the logic for updates
|
||||
*
|
||||
* @class acf_admin_update
|
||||
* @package ACF
|
||||
* @subpackage Admin
|
||||
*/
|
||||
|
||||
if( ! class_exists('acf_admin_update') ) :
|
||||
|
||||
class acf_admin_update {
|
||||
|
||||
/*
|
||||
* __construct
|
||||
*
|
||||
* A good place to add actions / filters
|
||||
*
|
||||
* @type function
|
||||
* @date 11/08/13
|
||||
*
|
||||
* @param N/A
|
||||
* @return N/A
|
||||
*/
|
||||
|
||||
function __construct() {
|
||||
|
||||
// actions
|
||||
add_action('admin_menu', array($this,'admin_menu'), 20);
|
||||
add_action('network_admin_menu', array($this,'network_admin_menu'), 20);
|
||||
|
||||
|
||||
// ajax
|
||||
add_action('wp_ajax_acf/admin/data_upgrade', array($this, 'ajax_upgrade'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* network_admin_menu
|
||||
*
|
||||
* This function will chck for available updates and add actions if needed
|
||||
*
|
||||
* @type function
|
||||
* @date 2/04/2015
|
||||
* @since 5.1.5
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function network_admin_menu() {
|
||||
|
||||
// bail early if no show_admin
|
||||
if( !acf_get_setting('show_admin') ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// vars
|
||||
$prompt = false;
|
||||
|
||||
|
||||
// loop through sites and find updates
|
||||
$sites = wp_get_sites();
|
||||
|
||||
if( $sites ) {
|
||||
|
||||
foreach( $sites as $site ) {
|
||||
|
||||
// switch blog
|
||||
switch_to_blog( $site['blog_id'] );
|
||||
|
||||
|
||||
// get site updates
|
||||
$updates = acf_get_updates();
|
||||
|
||||
|
||||
// restore
|
||||
restore_current_blog();
|
||||
|
||||
|
||||
if( $updates ) {
|
||||
|
||||
$prompt = true;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// bail if no prompt
|
||||
if( !$prompt ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// actions
|
||||
add_action('network_admin_notices', array($this, 'network_admin_notices'), 1);
|
||||
|
||||
|
||||
// add page
|
||||
add_submenu_page('update-core.php', __('Upgrade ACF','acf'), __('Upgrade ACF','acf'), acf_get_setting('capability'),'acf-upgrade', array($this,'network_html'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* network_admin_notices
|
||||
*
|
||||
* This function will render the update notice
|
||||
*
|
||||
* @type function
|
||||
* @date 2/04/2015
|
||||
* @since 5.1.5
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function network_admin_notices() {
|
||||
|
||||
// bail ealry if already on update page
|
||||
if( acf_is_screen('admin_page_acf-upgrade-network') ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// view
|
||||
$view = array(
|
||||
'button_text' => __("Review sites & upgrade", 'acf'),
|
||||
'button_url' => network_admin_url('update-core.php?page=acf-upgrade'),
|
||||
'confirm' => false
|
||||
);
|
||||
|
||||
|
||||
// load view
|
||||
acf_get_view('update-notice', $view);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* network_html
|
||||
*
|
||||
* This function will render the HTML for the network upgrade page
|
||||
*
|
||||
* @type function
|
||||
* @date 19/02/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function network_html() {
|
||||
|
||||
// vars
|
||||
$plugin_version = acf_get_setting('version');
|
||||
|
||||
|
||||
// loop through sites and find updates
|
||||
$sites = wp_get_sites();
|
||||
|
||||
if( $sites ) {
|
||||
|
||||
foreach( $sites as $i => $site ) {
|
||||
|
||||
// switch blog
|
||||
switch_to_blog( $site['blog_id'] );
|
||||
|
||||
|
||||
// extra info
|
||||
$site['name'] = get_bloginfo('name');
|
||||
$site['url'] = home_url();
|
||||
|
||||
|
||||
// get site updates
|
||||
$site['updates'] = acf_get_updates();
|
||||
|
||||
|
||||
// get site version
|
||||
$site['acf_version'] = get_option('acf_version');
|
||||
|
||||
|
||||
// no value equals new instal
|
||||
if( !$site['acf_version'] ) {
|
||||
|
||||
$site['acf_version'] = $plugin_version;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// update
|
||||
$sites[ $i ] = $site;
|
||||
|
||||
|
||||
// restore
|
||||
restore_current_blog();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// view
|
||||
$view = array(
|
||||
'sites' => $sites,
|
||||
'plugin_version' => $plugin_version
|
||||
);
|
||||
|
||||
|
||||
// enqueue
|
||||
acf_enqueue_scripts();
|
||||
|
||||
|
||||
// load view
|
||||
acf_get_view('update-network', $view);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* admin_menu
|
||||
*
|
||||
* This function will chck for available updates and add actions if needed
|
||||
*
|
||||
* @type function
|
||||
* @date 19/02/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function admin_menu() {
|
||||
|
||||
// vars
|
||||
$plugin_version = acf_get_setting('version');
|
||||
$acf_version = get_option('acf_version');
|
||||
|
||||
|
||||
// bail early if a new install
|
||||
if( !$acf_version ) {
|
||||
|
||||
update_option('acf_version', $plugin_version );
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// bail early if $acf_version is >= $plugin_version
|
||||
if( version_compare( $acf_version, $plugin_version, '>=') ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// vars
|
||||
$updates = acf_get_updates();
|
||||
|
||||
|
||||
// bail early if no updates available
|
||||
if( empty($updates) ) {
|
||||
|
||||
update_option('acf_version', $plugin_version );
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// bail early if no show_admin
|
||||
if( !acf_get_setting('show_admin') ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// actions
|
||||
add_action('admin_notices', array($this, 'admin_notices'), 1);
|
||||
|
||||
|
||||
// add page
|
||||
add_submenu_page('edit.php?post_type=acf-field-group', __('Upgrade','acf'), __('Upgrade','acf'), acf_get_setting('capability'),'acf-upgrade', array($this,'html') );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* admin_notices
|
||||
*
|
||||
* This function will render any admin notices
|
||||
*
|
||||
* @type function
|
||||
* @date 17/10/13
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function admin_notices() {
|
||||
|
||||
// bail ealry if already on update page
|
||||
if( acf_is_screen('custom-fields_page_acf-upgrade') ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// view
|
||||
$view = array(
|
||||
'button_text' => __("Upgrade Database", 'acf'),
|
||||
'button_url' => admin_url('edit.php?post_type=acf-field-group&page=acf-upgrade')
|
||||
);
|
||||
|
||||
|
||||
// load view
|
||||
acf_get_view('update-notice', $view);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* html
|
||||
*
|
||||
* description
|
||||
*
|
||||
* @type function
|
||||
* @date 19/02/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $post_id (int)
|
||||
* @return $post_id (int)
|
||||
*/
|
||||
|
||||
function html() {
|
||||
|
||||
// view
|
||||
$view = array(
|
||||
'updates' => acf_get_updates(),
|
||||
'plugin_version' => acf_get_setting('version')
|
||||
);
|
||||
|
||||
|
||||
// enqueue
|
||||
acf_enqueue_scripts();
|
||||
|
||||
|
||||
// load view
|
||||
acf_get_view('update', $view);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ajax_upgrade
|
||||
*
|
||||
* description
|
||||
*
|
||||
* @type function
|
||||
* @date 24/10/13
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $post_id (int)
|
||||
* @return $post_id (int)
|
||||
*/
|
||||
|
||||
function ajax_upgrade() {
|
||||
|
||||
// options
|
||||
$options = wp_parse_args( $_POST, array(
|
||||
'nonce' => '',
|
||||
'blog_id' => '',
|
||||
));
|
||||
|
||||
|
||||
// validate
|
||||
if( !wp_verify_nonce($options['nonce'], 'acf_upgrade') ) {
|
||||
|
||||
wp_send_json_error();
|
||||
|
||||
}
|
||||
|
||||
|
||||
// switch blog
|
||||
if( $options['blog_id'] ) {
|
||||
|
||||
switch_to_blog( $options['blog_id'] );
|
||||
|
||||
}
|
||||
|
||||
|
||||
// vars
|
||||
$updates = acf_get_updates();
|
||||
$message = '';
|
||||
|
||||
|
||||
// bail early if no updates
|
||||
if( empty($updates) ) {
|
||||
|
||||
wp_send_json_error(array(
|
||||
'message' => 'No updates available'
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
|
||||
// install updates
|
||||
foreach( $updates as $version ) {
|
||||
|
||||
// get path
|
||||
$path = acf_get_path("admin/updates/{$version}.php");
|
||||
|
||||
|
||||
// load version
|
||||
if( !file_exists($path) ) {
|
||||
|
||||
wp_send_json_error(array(
|
||||
'message' => 'Error loading update'
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
|
||||
// load any errors / feedback from update
|
||||
ob_start();
|
||||
|
||||
|
||||
// action for 3rd party
|
||||
do_action('acf/upgrade_start/' . $version );
|
||||
|
||||
|
||||
// include
|
||||
include( $path );
|
||||
|
||||
|
||||
// action for 3rd party
|
||||
do_action('acf/upgrade_finish/' . $version );
|
||||
|
||||
|
||||
// get feedback
|
||||
$message .= ob_get_clean();
|
||||
|
||||
|
||||
// update successful
|
||||
update_option('acf_version', $version );
|
||||
|
||||
}
|
||||
|
||||
|
||||
// updates complete
|
||||
update_option('acf_version', acf_get_setting('version'));
|
||||
|
||||
|
||||
// return
|
||||
wp_send_json_success(array(
|
||||
'message' => $message
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* inject_downgrade
|
||||
*
|
||||
* description
|
||||
*
|
||||
* @type function
|
||||
* @date 16/01/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $post_id (int)
|
||||
* @return $post_id (int)
|
||||
*/
|
||||
|
||||
/*
|
||||
function inject_downgrade( $transient ) {
|
||||
|
||||
// bail early if no plugins are being checked
|
||||
if( empty($transient->checked) ) {
|
||||
|
||||
return $transient;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// bail early if no nonce
|
||||
if( empty($_GET['_acfrollback']) ) {
|
||||
|
||||
return $transient;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// vars
|
||||
$rollback = get_option('acf_version');
|
||||
|
||||
|
||||
// bail early if nonce is not correct
|
||||
if( !wp_verify_nonce( $_GET['_acfrollback'], 'rollback-acf_' . $rollback ) ) {
|
||||
|
||||
return $transient;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// create new object for update
|
||||
$obj = new stdClass();
|
||||
$obj->slug = $_GET['plugin'];
|
||||
$obj->new_version = $rollback;
|
||||
$obj->url = 'https://wordpress.org/plugins/advanced-custom-fields';
|
||||
$obj->package = 'http://downloads.wordpress.org/plugin/advanced-custom-fields.' . $rollback . '.zip';;
|
||||
|
||||
|
||||
// add to transient
|
||||
$transient->response[ $_GET['plugin'] ] = $obj;
|
||||
|
||||
|
||||
// return
|
||||
return $transient;
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
// initialize
|
||||
new acf_admin_update();
|
||||
|
||||
endif;
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,325 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Upgrade to version 5.0.0
|
||||
*
|
||||
* @type upgrade
|
||||
* @date 20/02/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
// Exit if accessed directly
|
||||
if( !defined('ABSPATH') ) exit;
|
||||
|
||||
|
||||
// global
|
||||
global $wpdb;
|
||||
|
||||
|
||||
// migrate field groups
|
||||
$ofgs = get_posts(array(
|
||||
'numberposts' => -1,
|
||||
'post_type' => 'acf',
|
||||
'orderby' => 'menu_order title',
|
||||
'order' => 'asc',
|
||||
'suppress_filters' => true,
|
||||
));
|
||||
|
||||
|
||||
// populate acfs
|
||||
if( $ofgs ){ foreach( $ofgs as $ofg ){
|
||||
|
||||
// migrate field group
|
||||
$nfg = _migrate_field_group_500( $ofg );
|
||||
|
||||
|
||||
// get field from postmeta
|
||||
$rows = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->postmeta WHERE post_id = %d AND meta_key LIKE %s", $ofg->ID, 'field_%'), ARRAY_A);
|
||||
|
||||
|
||||
if( $rows )
|
||||
{
|
||||
$nfg['fields'] = array();
|
||||
|
||||
foreach( $rows as $row )
|
||||
{
|
||||
$field = $row['meta_value'];
|
||||
$field = maybe_unserialize( $field );
|
||||
$field = maybe_unserialize( $field ); // run again for WPML
|
||||
|
||||
|
||||
// add parent
|
||||
$field['parent'] = $nfg['ID'];
|
||||
|
||||
|
||||
// migrate field
|
||||
$field = _migrate_field_500( $field );
|
||||
}
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
|
||||
/*
|
||||
* _migrate_field_group_500
|
||||
*
|
||||
* description
|
||||
*
|
||||
* @type function
|
||||
* @date 20/02/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $post_id (int)
|
||||
* @return $post_id (int)
|
||||
*/
|
||||
|
||||
function _migrate_field_group_500( $ofg ) {
|
||||
|
||||
// global
|
||||
global $wpdb;
|
||||
|
||||
|
||||
// get post status
|
||||
$post_status = $ofg->post_status;
|
||||
|
||||
|
||||
// create new field group
|
||||
$nfg = array(
|
||||
'ID' => 0,
|
||||
'title' => $ofg->post_title,
|
||||
'menu_order' => $ofg->menu_order,
|
||||
);
|
||||
|
||||
|
||||
// location rules
|
||||
$groups = array();
|
||||
|
||||
|
||||
// get all rules
|
||||
$rules = get_post_meta($ofg->ID, 'rule', false);
|
||||
|
||||
if( is_array($rules) ) {
|
||||
|
||||
$group_no = 0;
|
||||
|
||||
foreach( $rules as $rule ) {
|
||||
|
||||
// if field group was duplicated, it may now be a serialized string!
|
||||
$rule = maybe_unserialize($rule);
|
||||
|
||||
|
||||
// does this rule have a group?
|
||||
// + groups were added in 4.0.4
|
||||
if( !isset($rule['group_no']) ) {
|
||||
|
||||
$rule['group_no'] = $group_no;
|
||||
|
||||
// sperate groups?
|
||||
if( get_post_meta($ofg->ID, 'allorany', true) == 'any' ) {
|
||||
|
||||
$group_no++;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// extract vars
|
||||
$group = acf_extract_var( $rule, 'group_no' );
|
||||
$order = acf_extract_var( $rule, 'order_no' );
|
||||
|
||||
|
||||
// add to group
|
||||
$groups[ $group ][ $order ] = $rule;
|
||||
|
||||
|
||||
// sort rules
|
||||
ksort( $groups[ $group ] );
|
||||
|
||||
}
|
||||
|
||||
// sort groups
|
||||
ksort( $groups );
|
||||
}
|
||||
|
||||
$nfg['location'] = $groups;
|
||||
|
||||
|
||||
// settings
|
||||
if( $position = get_post_meta($ofg->ID, 'position', true) ) {
|
||||
|
||||
$nfg['position'] = $position;
|
||||
|
||||
}
|
||||
|
||||
if( $layout = get_post_meta($ofg->ID, 'layout', true) ) {
|
||||
|
||||
$nfg['layout'] = $layout;
|
||||
|
||||
}
|
||||
|
||||
if( $hide_on_screen = get_post_meta($ofg->ID, 'hide_on_screen', true) ) {
|
||||
|
||||
$nfg['hide_on_screen'] = maybe_unserialize($hide_on_screen);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Note: acf_update_field_group will call the acf_get_valid_field_group function and apply 'compatibility' changes
|
||||
|
||||
|
||||
// add old ID reference
|
||||
$nfg['old_ID'] = $ofg->ID;
|
||||
|
||||
|
||||
// save field group
|
||||
$nfg = acf_update_field_group( $nfg );
|
||||
|
||||
|
||||
// trash?
|
||||
if( $post_status == 'trash' ) {
|
||||
|
||||
acf_trash_field_group( $nfg['ID'] );
|
||||
|
||||
}
|
||||
|
||||
|
||||
// return
|
||||
return $nfg;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* _migrate_field_500
|
||||
*
|
||||
* description
|
||||
*
|
||||
* @type function
|
||||
* @date 20/02/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $post_id (int)
|
||||
* @return $post_id (int)
|
||||
*/
|
||||
|
||||
function _migrate_field_500( $field ) {
|
||||
|
||||
// orig
|
||||
$orig = $field;
|
||||
|
||||
|
||||
// order_no is now menu_order
|
||||
$field['menu_order'] = acf_extract_var( $field, 'order_no' );
|
||||
|
||||
|
||||
// correct very old field keys
|
||||
if( substr($field['key'], 0, 6) !== 'field_' ) {
|
||||
|
||||
$field['key'] = 'field_' . str_replace('field', '', $field['key']);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// get valid field
|
||||
$field = acf_get_valid_field( $field );
|
||||
|
||||
|
||||
// save field
|
||||
$field = acf_update_field( $field );
|
||||
|
||||
|
||||
// sub fields
|
||||
if( $field['type'] == 'repeater' ) {
|
||||
|
||||
// get sub fields
|
||||
$sub_fields = acf_extract_var( $orig, 'sub_fields' );
|
||||
|
||||
|
||||
// save sub fields
|
||||
if( !empty($sub_fields) ) {
|
||||
|
||||
$keys = array_keys($sub_fields);
|
||||
|
||||
foreach( $keys as $key ) {
|
||||
|
||||
$sub_field = acf_extract_var($sub_fields, $key);
|
||||
$sub_field['parent'] = $field['ID'];
|
||||
|
||||
_migrate_field_500( $sub_field );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
} elseif( $field['type'] == 'flexible_content' ) {
|
||||
|
||||
// get layouts
|
||||
$layouts = acf_extract_var( $orig, 'layouts' );
|
||||
|
||||
|
||||
// update layouts
|
||||
$field['layouts'] = array();
|
||||
|
||||
|
||||
// save sub fields
|
||||
if( !empty($layouts) ) {
|
||||
|
||||
foreach( $layouts as $layout ) {
|
||||
|
||||
// vars
|
||||
$layout_key = uniqid();
|
||||
|
||||
|
||||
// append layotu key
|
||||
$layout['key'] = $layout_key;
|
||||
|
||||
|
||||
// extract sub fields
|
||||
$sub_fields = acf_extract_var($layout, 'sub_fields');
|
||||
|
||||
|
||||
// save sub fields
|
||||
if( !empty($sub_fields) ) {
|
||||
|
||||
$keys = array_keys($sub_fields);
|
||||
|
||||
foreach( $keys as $key ) {
|
||||
|
||||
$sub_field = acf_extract_var($sub_fields, $key);
|
||||
$sub_field['parent'] = $field['ID'];
|
||||
$sub_field['parent_layout'] = $layout_key;
|
||||
|
||||
_migrate_field_500( $sub_field );
|
||||
|
||||
}
|
||||
// foreach
|
||||
|
||||
}
|
||||
// if
|
||||
|
||||
|
||||
// append layout
|
||||
$field['layouts'][] = $layout;
|
||||
|
||||
}
|
||||
// foreach
|
||||
|
||||
}
|
||||
// if
|
||||
|
||||
|
||||
// save field again with less sub field data
|
||||
$field = acf_update_field( $field );
|
||||
|
||||
}
|
||||
|
||||
|
||||
// return
|
||||
return $field;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,169 @@
|
|||
<?php
|
||||
|
||||
// vars
|
||||
$field = acf_extract_var( $args, 'field');
|
||||
$groups = acf_extract_var( $field, 'conditional_logic');
|
||||
$disabled = empty($groups) ? 1 : 0;
|
||||
|
||||
|
||||
// UI needs at least 1 conditional logic rule
|
||||
if( empty($groups) ) {
|
||||
|
||||
$groups = array(
|
||||
|
||||
// group 0
|
||||
array(
|
||||
|
||||
// rule 0
|
||||
array()
|
||||
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<tr data-name="conditional_logic" class="acf-field">
|
||||
<td class="acf-label">
|
||||
<label><?php _e("Conditional Logic",'acf'); ?></label>
|
||||
</td>
|
||||
<td class="acf-input">
|
||||
<?php
|
||||
|
||||
acf_render_field(array(
|
||||
'type' => 'radio',
|
||||
'name' => 'conditional_logic',
|
||||
'prefix' => $field['prefix'],
|
||||
'value' => $disabled ? 0 : 1,
|
||||
'choices' => array(
|
||||
1 => __("Yes",'acf'),
|
||||
0 => __("No",'acf'),
|
||||
),
|
||||
'layout' => 'horizontal',
|
||||
'class' => 'conditional-toggle'
|
||||
));
|
||||
|
||||
?>
|
||||
<div class="rule-groups" <?php if($disabled): ?>style="display:none;"<?php endif; ?>>
|
||||
|
||||
<?php foreach( $groups as $group_id => $group ):
|
||||
|
||||
// validate
|
||||
if( empty($group) ) {
|
||||
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
// vars
|
||||
// $group_id must be completely different to $rule_id to avoid JS issues
|
||||
$group_id = "group_{$group_id}";
|
||||
$h4 = ($group_id == "group_0") ? __("Show this field if",'acf') : __("or",'acf');
|
||||
|
||||
?>
|
||||
<div class="rule-group" data-id="<?php echo $group_id; ?>">
|
||||
|
||||
<h4><?php echo $h4; ?></h4>
|
||||
|
||||
<table class="acf-table -clear">
|
||||
<tbody>
|
||||
<?php foreach( $group as $rule_id => $rule ):
|
||||
|
||||
// valid rule
|
||||
$rule = wp_parse_args( $rule, array(
|
||||
'field' => '',
|
||||
'operator' => '==',
|
||||
'value' => '',
|
||||
));
|
||||
|
||||
|
||||
// vars
|
||||
// $group_id must be completely different to $rule_id to avoid JS issues
|
||||
$rule_id = "rule_{$rule_id}";
|
||||
$prefix = "{$field['prefix']}[conditional_logic][{$group_id}][{$rule_id}]";
|
||||
|
||||
?>
|
||||
<tr class="rule" data-id="<?php echo $rule_id; ?>">
|
||||
<td class="param">
|
||||
<?php
|
||||
|
||||
$choices = array();
|
||||
$choices[ $rule['field'] ] = $rule['field'];
|
||||
|
||||
// create field
|
||||
acf_render_field(array(
|
||||
'type' => 'select',
|
||||
'prefix' => $prefix,
|
||||
'name' => 'field',
|
||||
'value' => $rule['field'],
|
||||
'choices' => $choices,
|
||||
'class' => 'conditional-rule-param',
|
||||
'disabled' => $disabled,
|
||||
));
|
||||
|
||||
?>
|
||||
</td>
|
||||
<td class="operator">
|
||||
<?php
|
||||
|
||||
$choices = array(
|
||||
'==' => __("is equal to",'acf'),
|
||||
'!=' => __("is not equal to",'acf'),
|
||||
);
|
||||
|
||||
|
||||
// create field
|
||||
acf_render_field(array(
|
||||
'type' => 'select',
|
||||
'prefix' => $prefix,
|
||||
'name' => 'operator',
|
||||
'value' => $rule['operator'],
|
||||
'choices' => $choices,
|
||||
'class' => 'conditional-rule-operator',
|
||||
'disabled' => $disabled,
|
||||
));
|
||||
|
||||
?>
|
||||
</td>
|
||||
<td class="value">
|
||||
<?php
|
||||
|
||||
$choices = array();
|
||||
$choices[ $rule['value'] ] = $rule['value'];
|
||||
|
||||
// create field
|
||||
acf_render_field(array(
|
||||
'type' => 'select',
|
||||
'prefix' => $prefix,
|
||||
'name' => 'value',
|
||||
'value' => $rule['value'],
|
||||
'choices' => $choices,
|
||||
'class' => 'conditional-rule-value',
|
||||
'disabled' => $disabled,
|
||||
));
|
||||
|
||||
?>
|
||||
</td>
|
||||
<td class="add">
|
||||
<a href="#" class="button add-conditional-rule"><?php _e("and",'acf'); ?></a>
|
||||
</td>
|
||||
<td class="remove">
|
||||
<a href="#" class="acf-icon -minus remove-conditional-rule"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<h4><?php _e("or",'acf'); ?></h4>
|
||||
|
||||
<a href="#" class="button add-conditional-group"><?php _e("Add rule group",'acf'); ?></a>
|
||||
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -0,0 +1,216 @@
|
|||
<?php
|
||||
|
||||
// global
|
||||
global $post;
|
||||
|
||||
|
||||
// extract args
|
||||
extract( $args );
|
||||
|
||||
|
||||
// add prefix
|
||||
$field['prefix'] = "acf_fields[{$field['ID']}]";
|
||||
|
||||
|
||||
// vars
|
||||
$atts = array(
|
||||
'class' => "acf-field-object acf-field-object-{$field['type']}",
|
||||
'data-id' => $field['ID'],
|
||||
'data-key' => $field['key'],
|
||||
'data-type' => $field['type'],
|
||||
);
|
||||
|
||||
$meta = array(
|
||||
'ID' => $field['ID'],
|
||||
'key' => $field['key'],
|
||||
'parent' => $field['parent'],
|
||||
'menu_order' => $field['menu_order'],
|
||||
'save' => '',
|
||||
);
|
||||
|
||||
|
||||
// replace
|
||||
$atts['class'] = str_replace('_', '-', $atts['class']);
|
||||
|
||||
?>
|
||||
<div <?php echo acf_esc_attr( $atts ); ?>>
|
||||
|
||||
<div class="meta">
|
||||
<?php foreach( $meta as $k => $v ):
|
||||
|
||||
acf_hidden_input(array( 'class' => "input-{$k}", 'name' => "{$field['prefix']}[{$k}]", 'value' => $v ));
|
||||
|
||||
endforeach; ?>
|
||||
</div>
|
||||
|
||||
<div class="handle">
|
||||
<ul class="acf-hl acf-tbody">
|
||||
<li class="li-field-order">
|
||||
<span class="acf-icon acf-sortable-handle"><?php echo ($i + 1); ?></span>
|
||||
<pre class="pre-field-key"><?php echo $field['key']; ?></pre>
|
||||
</li>
|
||||
<li class="li-field-label">
|
||||
<strong>
|
||||
<a class="edit-field" title="<?php _e("Edit field",'acf'); ?>" href="#"><?php echo acf_get_field_label($field); ?></a>
|
||||
</strong>
|
||||
<div class="row-options">
|
||||
<a class="edit-field" title="<?php _e("Edit field",'acf'); ?>" href="#"><?php _e("Edit",'acf'); ?></a>
|
||||
<a class="duplicate-field" title="<?php _e("Duplicate field",'acf'); ?>" href="#"><?php _e("Duplicate",'acf'); ?></a>
|
||||
<a class="move-field" title="<?php _e("Move field to another group",'acf'); ?>" href="#"><?php _e("Move",'acf'); ?></a>
|
||||
<a class="delete-field" title="<?php _e("Delete field",'acf'); ?>" href="#"><?php _e("Delete",'acf'); ?></a>
|
||||
</div>
|
||||
</li>
|
||||
<li class="li-field-name"><?php echo $field['name']; ?></li>
|
||||
<li class="li-field-type">
|
||||
<?php if( acf_field_type_exists($field['type']) ): ?>
|
||||
<?php echo acf_get_field_type_label($field['type']); ?>
|
||||
<?php else: ?>
|
||||
<b><?php _e('Error', 'acf'); ?></b> <?php _e('Field type does not exist', 'acf'); ?>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="settings">
|
||||
<table class="acf-table">
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
// label
|
||||
acf_render_field_wrap(array(
|
||||
'label' => __('Field Label','acf'),
|
||||
'instructions' => __('This is the name which will appear on the EDIT page','acf'),
|
||||
'required' => 1,
|
||||
'type' => 'text',
|
||||
'name' => 'label',
|
||||
'prefix' => $field['prefix'],
|
||||
'value' => $field['label'],
|
||||
'class' => 'field-label'
|
||||
), 'tr');
|
||||
|
||||
|
||||
// name
|
||||
acf_render_field_wrap(array(
|
||||
'label' => __('Field Name','acf'),
|
||||
'instructions' => __('Single word, no spaces. Underscores and dashes allowed','acf'),
|
||||
'required' => 1,
|
||||
'type' => 'text',
|
||||
'name' => 'name',
|
||||
'prefix' => $field['prefix'],
|
||||
'value' => $field['name'],
|
||||
'class' => 'field-name'
|
||||
), 'tr');
|
||||
|
||||
|
||||
// type
|
||||
acf_render_field_wrap(array(
|
||||
'label' => __('Field Type','acf'),
|
||||
'instructions' => '',
|
||||
'required' => 1,
|
||||
'type' => 'select',
|
||||
'name' => 'type',
|
||||
'prefix' => $field['prefix'],
|
||||
'value' => $field['type'],
|
||||
'choices' => acf_get_field_types(),
|
||||
'class' => 'field-type'
|
||||
), 'tr');
|
||||
|
||||
|
||||
// instructions
|
||||
acf_render_field_wrap(array(
|
||||
'label' => __('Instructions','acf'),
|
||||
'instructions' => __('Instructions for authors. Shown when submitting data','acf'),
|
||||
'type' => 'textarea',
|
||||
'name' => 'instructions',
|
||||
'prefix' => $field['prefix'],
|
||||
'value' => $field['instructions'],
|
||||
'rows' => 5
|
||||
), 'tr');
|
||||
|
||||
|
||||
// required
|
||||
acf_render_field_wrap(array(
|
||||
'label' => __('Required?','acf'),
|
||||
'instructions' => '',
|
||||
'type' => 'radio',
|
||||
'name' => 'required',
|
||||
'prefix' => $field['prefix'],
|
||||
'value' => $field['required'],
|
||||
'choices' => array(
|
||||
1 => __("Yes",'acf'),
|
||||
0 => __("No",'acf'),
|
||||
),
|
||||
'layout' => 'horizontal',
|
||||
'class' => 'field-required'
|
||||
), 'tr');
|
||||
|
||||
|
||||
// type specific settings
|
||||
do_action("acf/render_field_settings/type={$field['type']}", $field);
|
||||
|
||||
|
||||
// 3rd party settings
|
||||
do_action('acf/render_field_settings', $field);
|
||||
|
||||
|
||||
// conditional logic
|
||||
acf_get_view('field-group-field-conditional-logic', array( 'field' => $field ));
|
||||
|
||||
|
||||
// wrapper
|
||||
acf_render_field_wrap(array(
|
||||
'label' => __('Wrapper Attributes','acf'),
|
||||
'instructions' => '',
|
||||
'type' => 'text',
|
||||
'name' => 'width',
|
||||
'prefix' => $field['prefix'] . '[wrapper]',
|
||||
'value' => $field['wrapper']['width'],
|
||||
'prepend' => __('width', 'acf'),
|
||||
'append' => '%',
|
||||
'wrapper' => array(
|
||||
'data-name' => 'wrapper'
|
||||
)
|
||||
), 'tr');
|
||||
|
||||
acf_render_field_wrap(array(
|
||||
'label' => '',
|
||||
'instructions' => '',
|
||||
'type' => 'text',
|
||||
'name' => 'class',
|
||||
'prefix' => $field['prefix'] . '[wrapper]',
|
||||
'value' => $field['wrapper']['class'],
|
||||
'prepend' => __('class', 'acf'),
|
||||
'wrapper' => array(
|
||||
'data-append' => 'wrapper'
|
||||
)
|
||||
), 'tr');
|
||||
|
||||
acf_render_field_wrap(array(
|
||||
'label' => '',
|
||||
'instructions' => '',
|
||||
'type' => 'text',
|
||||
'name' => 'id',
|
||||
'prefix' => $field['prefix'] . '[wrapper]',
|
||||
'value' => $field['wrapper']['id'],
|
||||
'prepend' => __('id', 'acf'),
|
||||
'wrapper' => array(
|
||||
'data-append' => 'wrapper'
|
||||
)
|
||||
), 'tr');
|
||||
|
||||
?>
|
||||
<tr class="acf-field acf-field-save">
|
||||
<td class="acf-label"></td>
|
||||
<td class="acf-input">
|
||||
<ul class="acf-hl">
|
||||
<li>
|
||||
<a class="button edit-field" title="<?php _e("Close Field",'acf'); ?>" href="#"><?php _e("Close Field",'acf'); ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
// vars
|
||||
// Note: $args is always passed to this view from above
|
||||
$fields = array();
|
||||
$layout = false;
|
||||
$parent = 0;
|
||||
|
||||
|
||||
// use fields if passed in
|
||||
extract( $args );
|
||||
|
||||
|
||||
// add clone
|
||||
$fields[] = acf_get_valid_field(array(
|
||||
'ID' => 'acfcloneindex',
|
||||
'key' => 'acfcloneindex',
|
||||
'label' => __('New Field','acf'),
|
||||
'name' => 'new_field',
|
||||
'type' => 'text',
|
||||
'parent' => $parent
|
||||
));
|
||||
|
||||
|
||||
?>
|
||||
<div class="acf-field-list-wrap">
|
||||
|
||||
<ul class="acf-hl acf-thead">
|
||||
<li class="li-field-order"><?php _e('Order','acf'); ?></li>
|
||||
<li class="li-field-label"><?php _e('Label','acf'); ?></li>
|
||||
<li class="li-field-name"><?php _e('Name','acf'); ?></li>
|
||||
<li class="li-field-type"><?php _e('Type','acf'); ?></li>
|
||||
</ul>
|
||||
|
||||
<div class="acf-field-list<?php if( $layout ){ echo " layout-{$layout}"; } ?>">
|
||||
|
||||
<?php foreach( $fields as $i => $field ): ?>
|
||||
|
||||
<?php acf_get_view('field-group-field', array( 'field' => $field, 'i' => $i )); ?>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
<div class="no-fields-message" <?php if(count($fields) > 1){ echo 'style="display:none;"'; } ?>>
|
||||
<?php _e("No fields. Click the <strong>+ Add Field</strong> button to create your first field.",'acf'); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<ul class="acf-hl acf-tfoot">
|
||||
<li class="acf-fr">
|
||||
<a href="#" class="button button-primary button-large add-field"><?php _e('+ Add Field','acf'); ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,151 @@
|
|||
<?php
|
||||
|
||||
// vars
|
||||
$rule_types = apply_filters('acf/location/rule_types', array(
|
||||
__("Post",'acf') => array(
|
||||
'post_type' => __("Post Type",'acf'),
|
||||
'post_status' => __("Post Status",'acf'),
|
||||
'post_format' => __("Post Format",'acf'),
|
||||
'post_category' => __("Post Category",'acf'),
|
||||
'post_taxonomy' => __("Post Taxonomy",'acf'),
|
||||
'post' => __("Post",'acf')
|
||||
),
|
||||
__("Page",'acf') => array(
|
||||
'page_template' => __("Page Template",'acf'),
|
||||
'page_type' => __("Page Type",'acf'),
|
||||
'page_parent' => __("Page Parent",'acf'),
|
||||
'page' => __("Page",'acf')
|
||||
),
|
||||
__("User",'acf') => array(
|
||||
'current_user' => __("Current User",'acf'),
|
||||
'current_user_role' => __("Current User Role",'acf'),
|
||||
'user_form' => __("User Form",'acf'),
|
||||
'user_role' => __("User Role",'acf')
|
||||
),
|
||||
__("Forms",'acf') => array(
|
||||
'attachment' => __("Attachment",'acf'),
|
||||
'taxonomy' => __("Taxonomy Term",'acf'),
|
||||
'comment' => __("Comment",'acf'),
|
||||
'widget' => __("Widget",'acf')
|
||||
)
|
||||
));
|
||||
|
||||
$rule_operators = apply_filters( 'acf/location/rule_operators', array(
|
||||
'==' => __("is equal to",'acf'),
|
||||
'!=' => __("is not equal to",'acf'),
|
||||
));
|
||||
|
||||
?>
|
||||
<div class="acf-field">
|
||||
<div class="acf-label">
|
||||
<label><?php _e("Rules",'acf'); ?></label>
|
||||
<p><?php _e("Create a set of rules to determine which edit screens will use these advanced custom fields",'acf'); ?></p>
|
||||
</div>
|
||||
<div class="acf-input">
|
||||
<div class="rule-groups">
|
||||
|
||||
<?php foreach( $field_group['location'] as $group_id => $group ):
|
||||
|
||||
// validate
|
||||
if( empty($group) ) {
|
||||
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// $group_id must be completely different to $rule_id to avoid JS issues
|
||||
$group_id = "group_{$group_id}";
|
||||
$h4 = ($group_id == "group_0") ? __("Show this field group if",'acf') : __("or",'acf');
|
||||
|
||||
?>
|
||||
|
||||
<div class="rule-group" data-id="<?php echo $group_id; ?>">
|
||||
|
||||
<h4><?php echo $h4; ?></h4>
|
||||
|
||||
<table class="acf-table -clear">
|
||||
<tbody>
|
||||
<?php foreach( $group as $rule_id => $rule ):
|
||||
|
||||
// valid rule
|
||||
$rule = wp_parse_args( $rule, array(
|
||||
'field' => '',
|
||||
'operator' => '==',
|
||||
'value' => '',
|
||||
));
|
||||
|
||||
|
||||
// $group_id must be completely different to $rule_id to avoid JS issues
|
||||
$rule_id = "rule_{$rule_id}";
|
||||
|
||||
?>
|
||||
<tr data-id="<?php echo $rule_id; ?>">
|
||||
<td class="param"><?php
|
||||
|
||||
// create field
|
||||
acf_render_field(array(
|
||||
'type' => 'select',
|
||||
'prefix' => "acf_field_group[location][{$group_id}][{$rule_id}]",
|
||||
'name' => 'param',
|
||||
'value' => $rule['param'],
|
||||
'choices' => $rule_types,
|
||||
'class' => 'location-rule-param'
|
||||
));
|
||||
|
||||
?></td>
|
||||
<td class="operator"><?php
|
||||
|
||||
// create field
|
||||
acf_render_field(array(
|
||||
'type' => 'select',
|
||||
'prefix' => "acf_field_group[location][{$group_id}][{$rule_id}]",
|
||||
'name' => 'operator',
|
||||
'value' => $rule['operator'],
|
||||
'choices' => $rule_operators,
|
||||
'class' => 'location-rule-operator'
|
||||
));
|
||||
|
||||
?></td>
|
||||
<td class="value"><?php
|
||||
|
||||
$this->render_location_value(array(
|
||||
'group_id' => $group_id,
|
||||
'rule_id' => $rule_id,
|
||||
'value' => $rule['value'],
|
||||
'param' => $rule['param'],
|
||||
'class' => 'location-rule-value'
|
||||
));
|
||||
|
||||
?></td>
|
||||
<td class="add">
|
||||
<a href="#" class="button add-location-rule"><?php _e("and",'acf'); ?></a>
|
||||
</td>
|
||||
<td class="remove">
|
||||
<a href="#" class="acf-icon -minus remove-location-rule"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<h4><?php _e("or",'acf'); ?></h4>
|
||||
|
||||
<a href="#" class="button add-location-group"><?php _e("Add rule group",'acf'); ?></a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
if( typeof acf !== 'undefined' ) {
|
||||
|
||||
acf.postbox.render({
|
||||
'id': 'acf-field-group-locations',
|
||||
'label': 'left'
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
<?php
|
||||
|
||||
// active
|
||||
acf_render_field_wrap(array(
|
||||
'label' => __('Status','acf'),
|
||||
'instructions' => '',
|
||||
'type' => 'select',
|
||||
'name' => 'active',
|
||||
'prefix' => 'acf_field_group',
|
||||
'value' => $field_group['active'],
|
||||
'choices' => array(
|
||||
1 => __("Active",'acf'),
|
||||
0 => __("Disabled",'acf'),
|
||||
)
|
||||
));
|
||||
|
||||
|
||||
// style
|
||||
acf_render_field_wrap(array(
|
||||
'label' => __('Style','acf'),
|
||||
'instructions' => '',
|
||||
'type' => 'select',
|
||||
'name' => 'style',
|
||||
'prefix' => 'acf_field_group',
|
||||
'value' => $field_group['style'],
|
||||
'choices' => array(
|
||||
'default' => __("Standard (WP metabox)",'acf'),
|
||||
'seamless' => __("Seamless (no metabox)",'acf'),
|
||||
)
|
||||
));
|
||||
|
||||
|
||||
// position
|
||||
acf_render_field_wrap(array(
|
||||
'label' => __('Position','acf'),
|
||||
'instructions' => '',
|
||||
'type' => 'select',
|
||||
'name' => 'position',
|
||||
'prefix' => 'acf_field_group',
|
||||
'value' => $field_group['position'],
|
||||
'choices' => array(
|
||||
'acf_after_title' => __("High (after title)",'acf'),
|
||||
'normal' => __("Normal (after content)",'acf'),
|
||||
'side' => __("Side",'acf'),
|
||||
),
|
||||
'default_value' => 'normal'
|
||||
));
|
||||
|
||||
|
||||
// label_placement
|
||||
acf_render_field_wrap(array(
|
||||
'label' => __('Label placement','acf'),
|
||||
'instructions' => '',
|
||||
'type' => 'select',
|
||||
'name' => 'label_placement',
|
||||
'prefix' => 'acf_field_group',
|
||||
'value' => $field_group['label_placement'],
|
||||
'choices' => array(
|
||||
'top' => __("Top aligned",'acf'),
|
||||
'left' => __("Left Aligned",'acf'),
|
||||
)
|
||||
));
|
||||
|
||||
|
||||
// instruction_placement
|
||||
acf_render_field_wrap(array(
|
||||
'label' => __('Instruction placement','acf'),
|
||||
'instructions' => '',
|
||||
'type' => 'select',
|
||||
'name' => 'instruction_placement',
|
||||
'prefix' => 'acf_field_group',
|
||||
'value' => $field_group['instruction_placement'],
|
||||
'choices' => array(
|
||||
'label' => __("Below labels",'acf'),
|
||||
'field' => __("Below fields",'acf'),
|
||||
)
|
||||
));
|
||||
|
||||
|
||||
// menu_order
|
||||
acf_render_field_wrap(array(
|
||||
'label' => __('Order No.','acf'),
|
||||
'instructions' => __('Field groups with a lower order will appear first','acf'),
|
||||
'type' => 'number',
|
||||
'name' => 'menu_order',
|
||||
'prefix' => 'acf_field_group',
|
||||
'value' => $field_group['menu_order'],
|
||||
));
|
||||
|
||||
|
||||
// description
|
||||
acf_render_field_wrap(array(
|
||||
'label' => __('Description','acf'),
|
||||
'instructions' => __('Shown in field group list','acf'),
|
||||
'type' => 'text',
|
||||
'name' => 'description',
|
||||
'prefix' => 'acf_field_group',
|
||||
'value' => $field_group['description'],
|
||||
));
|
||||
|
||||
|
||||
// hide on screen
|
||||
acf_render_field_wrap(array(
|
||||
'label' => __('Hide on screen','acf'),
|
||||
'instructions' => __('<b>Select</b> items to <b>hide</b> them from the edit screen.','acf') . '<br /><br />' . __("If multiple field groups appear on an edit screen, the first field group's options will be used (the one with the lowest order number)",'acf'),
|
||||
'type' => 'checkbox',
|
||||
'name' => 'hide_on_screen',
|
||||
'prefix' => 'acf_field_group',
|
||||
'value' => $field_group['hide_on_screen'],
|
||||
'toggle' => true,
|
||||
'choices' => array(
|
||||
'permalink' => __("Permalink", 'acf'),
|
||||
'the_content' => __("Content Editor",'acf'),
|
||||
'excerpt' => __("Excerpt", 'acf'),
|
||||
'custom_fields' => __("Custom Fields", 'acf'),
|
||||
'discussion' => __("Discussion", 'acf'),
|
||||
'comments' => __("Comments", 'acf'),
|
||||
'revisions' => __("Revisions", 'acf'),
|
||||
'slug' => __("Slug", 'acf'),
|
||||
'author' => __("Author", 'acf'),
|
||||
'format' => __("Format", 'acf'),
|
||||
'page_attributes' => __("Page Attributes", 'acf'),
|
||||
'featured_image' => __("Featured Image", 'acf'),
|
||||
'categories' => __("Categories", 'acf'),
|
||||
'tags' => __("Tags", 'acf'),
|
||||
'send-trackbacks' => __("Send Trackbacks", 'acf'),
|
||||
)
|
||||
));
|
||||
|
||||
|
||||
// 3rd party settings
|
||||
do_action('acf/render_field_group_settings', $field_group);
|
||||
|
||||
?>
|
||||
<div class="acf-hidden">
|
||||
<input type="hidden" name="acf_field_group[key]" value="<?php echo $field_group['key']; ?>" />
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
if( typeof acf !== 'undefined' ) {
|
||||
|
||||
acf.postbox.render({
|
||||
'id': 'acf-field-group-options',
|
||||
'label': 'left'
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
|
||||
// vars
|
||||
$json = acf_extract_var( $args, 'json');
|
||||
|
||||
?>
|
||||
<div class="wrap acf-settings-wrap">
|
||||
|
||||
<h1><?php _e("Add-ons",'acf'); ?></h1>
|
||||
|
||||
<div class="add-ons-list acf-cf">
|
||||
|
||||
<?php if( !empty($json) ): ?>
|
||||
|
||||
<?php foreach( $json as $addon ):
|
||||
|
||||
$addon = acf_parse_args($addon, array(
|
||||
"title" => "",
|
||||
"slug" => "",
|
||||
"description" => "",
|
||||
"thumbnail" => "",
|
||||
"url" => "",
|
||||
"btn" => __("Download & Install",'acf'),
|
||||
"btn_color" => ""
|
||||
));
|
||||
|
||||
?>
|
||||
|
||||
<div class="acf-box add-on add-on-<?php echo $addon['slug']; ?>">
|
||||
|
||||
<div class="thumbnail">
|
||||
<a target="_blank" href="<?php echo $addon['url']; ?>">
|
||||
<img src="<?php echo $addon['thumbnail']; ?>" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="inner">
|
||||
<h3><a target="_blank" href="<?php echo $addon['url']; ?>"><?php echo $addon['title']; ?></a></h3>
|
||||
<p><?php echo $addon['description']; ?></p>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<?php if( apply_filters("acf/is_add_on_active/slug={$addon['slug']}", false ) ): ?>
|
||||
<a class="button" disabled="disabled"><?php _e("Installed",'acf'); ?></a>
|
||||
<?php else: ?>
|
||||
<a class="button <?php echo $addon['btn_color']; ?>" target="_blank" href="<?php echo $addon['url']; ?>" ><?php _e($addon['btn']); ?></a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if( !empty($addon['footer']) ): ?>
|
||||
<p><?php echo $addon['footer']; ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,189 @@
|
|||
<?php
|
||||
|
||||
// extract args
|
||||
extract( $args );
|
||||
|
||||
?>
|
||||
<div class="wrap about-wrap acf-wrap">
|
||||
|
||||
<h1><?php _e("Welcome to Advanced Custom Fields",'acf'); ?> <?php echo $version; ?></h1>
|
||||
<div class="about-text"><?php printf(__("Thank you for updating! ACF %s is bigger and better than ever before. We hope you like it.", 'acf'), $version); ?></div>
|
||||
<div class="acf-icon logo">
|
||||
<i class="acf-sprite-logo"></i>
|
||||
</div>
|
||||
|
||||
<h2 class="nav-tab-wrapper">
|
||||
<?php foreach( $tabs as $tab_slug => $tab_title ): ?>
|
||||
<a class="nav-tab<?php if( $active == $tab_slug ): ?> nav-tab-active<?php endif; ?>" href="<?php echo admin_url("edit.php?post_type=acf-field-group&page=acf-settings-info&tab={$tab_slug}"); ?>"><?php echo $tab_title; ?></a>
|
||||
<?php endforeach; ?>
|
||||
</h2>
|
||||
|
||||
<?php if( $active == 'new' ): ?>
|
||||
|
||||
<h2 class="about-headline-callout"><?php _e("A smoother custom field experience", 'acf'); ?></h2>
|
||||
|
||||
<div class="feature-section acf-three-col">
|
||||
<div>
|
||||
<img src="http://assets.advancedcustomfields.com/info/5.0.0/select2.png">
|
||||
<h3><?php _e("Improved Usability", 'acf'); ?></h3>
|
||||
<p><?php _e("Including the popular Select2 library has improved both usability and speed across a number of field types including post object, page link, taxonomy and select.", 'acf'); ?></p>
|
||||
</div>
|
||||
<div>
|
||||
<img src="http://assets.advancedcustomfields.com/info/5.0.0/design.png">
|
||||
<h3><?php _e("Improved Design", 'acf'); ?></h3>
|
||||
<p><?php _e("Many fields have undergone a visual refresh to make ACF look better than ever! Noticeable changes are seen on the gallery, relationship and oEmbed (new) fields!", 'acf'); ?></p>
|
||||
</div>
|
||||
<div>
|
||||
<img src="http://assets.advancedcustomfields.com/info/5.0.0/sub-fields.png">
|
||||
<h3><?php _e("Improved Data", 'acf'); ?></h3>
|
||||
<p><?php _e("Redesigning the data architecture has allowed sub fields to live independently from their parents. This allows you to drag and drop fields in and out of parent fields!", 'acf'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<h2 class="about-headline-callout"><?php _e("Goodbye Add-ons. Hello PRO", 'acf'); ?></h2>
|
||||
|
||||
<div class="feature-section acf-three-col">
|
||||
|
||||
<div>
|
||||
<h3><?php _e("Introducing ACF PRO", 'acf'); ?></h3>
|
||||
<p><?php _e("We're changing the way premium functionality is delivered in an exciting way!", 'acf'); ?></p>
|
||||
<p><?php printf(__('All 4 premium add-ons have been combined into a new <a href="%s">Pro version of ACF</a>. With both personal and developer licenses available, premium functionality is more affordable and accessible than ever before!', 'acf'), esc_url('http://www.advancedcustomfields.com/pro')); ?></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3><?php _e("Powerful Features", 'acf'); ?></h3>
|
||||
<p><?php _e("ACF PRO contains powerful features such as repeatable data, flexible content layouts, a beautiful gallery field and the ability to create extra admin options pages!", 'acf'); ?></p>
|
||||
<p><?php printf(__('Read more about <a href="%s">ACF PRO features</a>.', 'acf'), esc_url('http://www.advancedcustomfields.com/pro')); ?></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3><?php _e("Easy Upgrading", 'acf'); ?></h3>
|
||||
<p><?php printf(__('To help make upgrading easy, <a href="%s">login to your store account</a> and claim a free copy of ACF PRO!', 'acf'), esc_url('http://www.advancedcustomfields.com/my-account/')); ?></p>
|
||||
<p><?php printf(__('We also wrote an <a href="%s">upgrade guide</a> to answer any questions, but if you do have one, please contact our support team via the <a href="%s">help desk</a>', 'acf'), esc_url('http://www.advancedcustomfields.com/resources/updates/upgrading-v4-v5/'), esc_url('http://support.advancedcustomfields.com')); ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<h2 class="about-headline-callout"><?php _e("Under the Hood", 'acf'); ?></h2>
|
||||
|
||||
<div class="feature-section acf-three-col">
|
||||
|
||||
<div>
|
||||
<h4><?php _e("Smarter field settings", 'acf'); ?></h4>
|
||||
<p><?php _e("ACF now saves its field settings as individual post objects", 'acf'); ?></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4><?php _e("More AJAX", 'acf'); ?></h4>
|
||||
<p><?php _e("More fields use AJAX powered search to speed up page loading", 'acf'); ?></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4><?php _e("Local JSON", 'acf'); ?></h4>
|
||||
<p><?php _e("New auto export to JSON feature improves speed", 'acf'); ?></p>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<div>
|
||||
<h4><?php _e("Better version control", 'acf'); ?></h4>
|
||||
<p><?php _e("New auto export to JSON feature allows field settings to be version controlled", 'acf'); ?></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4><?php _e("Swapped XML for JSON", 'acf'); ?></h4>
|
||||
<p><?php _e("Import / Export now uses JSON in favour of XML", 'acf'); ?></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4><?php _e("New Forms", 'acf'); ?></h4>
|
||||
<p><?php _e("Fields can now be mapped to comments, widgets and all user forms!", 'acf'); ?></p>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<div>
|
||||
<h4><?php _e("New Field", 'acf'); ?></h4>
|
||||
<p><?php _e("A new field for embedding content has been added", 'acf'); ?></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4><?php _e("New Gallery", 'acf'); ?></h4>
|
||||
<p><?php _e("The gallery field has undergone a much needed facelift", 'acf'); ?></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4><?php _e("New Settings", 'acf'); ?></h4>
|
||||
<p><?php _e("Field group settings have been added for label placement and instruction placement", 'acf'); ?></p>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<div>
|
||||
<h4><?php _e("Better Front End Forms", 'acf'); ?></h4>
|
||||
<p><?php _e("acf_form() can now create a new post on submission", 'acf'); ?></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4><?php _e("Better Validation", 'acf'); ?></h4>
|
||||
<p><?php _e("Form validation is now done via PHP + AJAX in favour of only JS", 'acf'); ?></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4><?php _e("Relationship Field", 'acf'); ?></h4>
|
||||
<p><?php _e("New Relationship field setting for 'Filters' (Search, Post Type, Taxonomy)", 'acf'); ?></p>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<div>
|
||||
<h4><?php _e("Moving Fields", 'acf'); ?></h4>
|
||||
<p><?php _e("New field group functionality allows you to move a field between groups & parents", 'acf'); ?></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4><?php _e("Page Link", 'acf'); ?></h4>
|
||||
<p><?php _e("New archives group in page_link field selection", 'acf'); ?></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4><?php _e("Better Options Pages", 'acf'); ?></h4>
|
||||
<p><?php _e("New functions for options page allow creation of both parent and child menu pages", 'acf'); ?></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php elseif( $active == 'changelog' ): ?>
|
||||
|
||||
<p class="about-description"><?php printf(__("We think you'll love the changes in %s.", 'acf'), $version); ?></p>
|
||||
|
||||
<?php
|
||||
|
||||
$items = file_get_contents( acf_get_path('readme.txt') );
|
||||
$items = explode('= ' . $version . ' =', $items);
|
||||
|
||||
$items = end( $items );
|
||||
$items = current( explode("\n\n", $items) );
|
||||
$items = array_filter( array_map('trim', explode("*", $items)) );
|
||||
|
||||
?>
|
||||
<ul class="changelog">
|
||||
<?php foreach( $items as $item ):
|
||||
|
||||
$item = explode('http', $item);
|
||||
|
||||
?>
|
||||
<li><?php echo $item[0]; ?><?php if( isset($item[1]) ): ?><a href="http<?php echo $item[1]; ?>" target="_blank">[...]</a><?php endif; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
<?php
|
||||
|
||||
// vars
|
||||
$field_groups = acf_extract_var( $args, 'field_groups');
|
||||
|
||||
|
||||
// replace
|
||||
$str_replace = array(
|
||||
" " => "\t",
|
||||
"!!\'" => "'",
|
||||
"'!!" => "",
|
||||
"!!'" => ""
|
||||
);
|
||||
|
||||
$preg_replace = array(
|
||||
'/([\t\r\n]+?)array/' => 'array',
|
||||
'/[0-9]+ => array/' => 'array'
|
||||
);
|
||||
|
||||
?>
|
||||
<div class="wrap acf-settings-wrap">
|
||||
|
||||
<h1><?php _e('Tools', 'acf'); ?></h1>
|
||||
|
||||
<div class="acf-box">
|
||||
<div class="title">
|
||||
<h3><?php _e('Export Field Groups to PHP', 'acf'); ?></h3>
|
||||
</div>
|
||||
|
||||
<div class="inner">
|
||||
<p><?php _e("The following code can be used to register a local version of the selected field group(s). A local field group can provide many benefits such as faster load times, version control & dynamic fields/settings. Simply copy and paste the following code to your theme's functions.php file or include it within an external file.", 'acf'); ?></p>
|
||||
|
||||
<textarea class="pre" readonly="true"><?php
|
||||
|
||||
echo "if( function_exists('acf_add_local_field_group') ):" . "\r\n" . "\r\n";
|
||||
|
||||
foreach( $field_groups as $field_group ) {
|
||||
|
||||
// code
|
||||
$code = var_export($field_group, true);
|
||||
|
||||
|
||||
// change double spaces to tabs
|
||||
$code = str_replace( array_keys($str_replace), array_values($str_replace), $code );
|
||||
|
||||
|
||||
// correctly formats "=> array("
|
||||
$code = preg_replace( array_keys($preg_replace), array_values($preg_replace), $code );
|
||||
|
||||
|
||||
// esc_textarea
|
||||
$code = esc_textarea( $code );
|
||||
|
||||
|
||||
// echo
|
||||
echo "acf_add_local_field_group({$code});" . "\r\n" . "\r\n";
|
||||
|
||||
}
|
||||
|
||||
echo "endif;";
|
||||
|
||||
?></textarea>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="acf-hidden">
|
||||
<style type="text/css">
|
||||
textarea.pre {
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
font-size: 14px;
|
||||
line-height: 1.5em;
|
||||
resize: none;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
(function($){
|
||||
|
||||
var i = 0;
|
||||
|
||||
$(document).on('click', 'textarea.pre', function(){
|
||||
|
||||
if( i == 0 )
|
||||
{
|
||||
i++;
|
||||
|
||||
$(this).focus().select();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$(document).on('keyup', 'textarea.pre', function(){
|
||||
|
||||
$(this).height( 0 );
|
||||
$(this).height( this.scrollHeight );
|
||||
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
$('textarea.pre').trigger('keyup');
|
||||
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
</script>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
<?php
|
||||
|
||||
// vars
|
||||
$field = array(
|
||||
'label' => __('Select Field Groups', 'acf'),
|
||||
'type' => 'checkbox',
|
||||
'name' => 'acf_export_keys',
|
||||
'prefix' => false,
|
||||
'value' => false,
|
||||
'toggle' => true,
|
||||
'choices' => array(),
|
||||
);
|
||||
|
||||
$field_groups = acf_get_field_groups();
|
||||
|
||||
|
||||
// populate choices
|
||||
if( $field_groups ) {
|
||||
|
||||
foreach( $field_groups as $field_group ) {
|
||||
|
||||
$field['choices'][ $field_group['key'] ] = $field_group['title'];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="wrap acf-settings-wrap">
|
||||
|
||||
<h1><?php _e('Tools', 'acf'); ?></h1>
|
||||
|
||||
<div class="acf-box" id="acf-export-field-groups">
|
||||
<div class="title">
|
||||
<h3><?php _e('Export Field Groups', 'acf'); ?></h3>
|
||||
</div>
|
||||
<div class="inner">
|
||||
<p><?php _e('Select the field groups you would like to export and then select your export method. Use the download button to export to a .json file which you can then import to another ACF installation. Use the generate button to export to PHP code which you can place in your theme.', 'acf'); ?></p>
|
||||
|
||||
<form method="post" action="">
|
||||
<div class="acf-hidden">
|
||||
<input type="hidden" name="_acfnonce" value="<?php echo wp_create_nonce( 'export' ); ?>" />
|
||||
</div>
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<?php acf_render_field_wrap( $field, 'tr' ); ?>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td>
|
||||
<input type="submit" name="download" class="button button-primary" value="<?php _e('Download export file', 'acf'); ?>" />
|
||||
<input type="submit" name="generate" class="button button-primary" value="<?php _e('Generate export code', 'acf'); ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="acf-box">
|
||||
<div class="title">
|
||||
<h3><?php _e('Import Field Groups', 'acf'); ?></h3>
|
||||
</div>
|
||||
<div class="inner">
|
||||
<p><?php _e('Select the Advanced Custom Fields JSON file you would like to import. When you click the import button below, ACF will import the field groups.', 'acf'); ?></p>
|
||||
|
||||
<form method="post" action="" enctype="multipart/form-data">
|
||||
<div class="acf-hidden">
|
||||
<input type="hidden" name="_acfnonce" value="<?php echo wp_create_nonce( 'import' ); ?>" />
|
||||
</div>
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<label><?php _e('Select File', 'acf'); ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<input type="file" name="acf_import_file">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td>
|
||||
<input type="submit" class="button button-primary" value="<?php _e('Import', 'acf'); ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,234 @@
|
|||
<?php
|
||||
|
||||
extract($args);
|
||||
|
||||
?>
|
||||
<div id="acf-upgrade-wrap" class="wrap">
|
||||
|
||||
<h1><?php _e("Advanced Custom Fields Database Upgrade",'acf'); ?></h1>
|
||||
|
||||
<p><?php _e("The following sites require a DB upgrade. Check the ones you want to update and then click “Upgrade Database”.",'acf'); ?></p>
|
||||
|
||||
<p><input type="submit" name="upgrade" value="Update Sites" class="button" id="upgrade-sites"></p>
|
||||
|
||||
<table class="wp-list-table widefat">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="manage-column check-column" scope="col"><input type="checkbox" id="sites-select-all"></th>
|
||||
<th class="manage-column" scope="col" style="width:33%;"><label for="sites-select-all"><?php _e("Site", 'acf'); ?></label></th>
|
||||
<th><?php _e("Description", 'acf'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th class="manage-column check-column" scope="col"><input type="checkbox" id="sites-select-all-2"></th>
|
||||
<th class="manage-column" scope="col"><label for="sites-select-all-2"><?php _e("Site", 'acf'); ?></label></th>
|
||||
<th><?php _e("Description", 'acf'); ?></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody id="the-list">
|
||||
|
||||
<?php foreach( $sites as $i => $site ): ?>
|
||||
|
||||
<tr<?php if( $i % 2 == 0 ): ?> class="alternate"<?php endif; ?>>
|
||||
<th class="check-column" scope="row">
|
||||
<?php if( $site['updates'] ): ?>
|
||||
<input type="checkbox" value="<?php echo $site['blog_id']; ?>" name="checked[]">
|
||||
<?php endif; ?>
|
||||
</th>
|
||||
<td>
|
||||
<strong><?php echo $site['name']; ?></strong><br /><?php echo $site['url']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if( $site['updates'] ): ?>
|
||||
<span class="response"><?php printf(__('Site requires database upgrade from %s to %s', 'acf'), $site['acf_version'], $plugin_version); ?></span>
|
||||
<?php else: ?>
|
||||
<?php _e("Site is up to date", 'acf'); ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
<p><input type="submit" name="upgrade" value="Update Sites" class="button" id="upgrade-sites-2"></p>
|
||||
|
||||
<p class="show-on-complete"><?php _e('Database Upgrade complete', 'acf'); ?>. <a href="<?php echo network_admin_url(); ?>"><?php _e("Return to network dashboard",'acf'); ?></a>.</p>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
/* hide show */
|
||||
.show-on-complete {
|
||||
display: none;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function($) {
|
||||
|
||||
var upgrader = {
|
||||
|
||||
$buttons: null,
|
||||
|
||||
$inputs: null,
|
||||
i: 0,
|
||||
|
||||
init : function(){
|
||||
|
||||
// reference
|
||||
var self = this;
|
||||
|
||||
|
||||
// vars
|
||||
this.$buttons = $('#upgrade-sites, #upgrade-sites-2');
|
||||
|
||||
|
||||
// events
|
||||
this.$buttons.on('click', function( e ){
|
||||
|
||||
// prevent default
|
||||
e.preventDefault();
|
||||
|
||||
|
||||
// confirm
|
||||
var answer = confirm("<?php _e('It is strongly recommended that you backup your database before proceeding. Are you sure you wish to run the updater now?', 'acf'); ?>");
|
||||
|
||||
|
||||
// bail early if no confirm
|
||||
if( !answer ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// populate inputs
|
||||
self.$inputs = $('#the-list input:checked');
|
||||
|
||||
|
||||
// upgrade
|
||||
self.upgrade();
|
||||
|
||||
});
|
||||
|
||||
|
||||
// return
|
||||
return this;
|
||||
|
||||
},
|
||||
|
||||
upgrade: function(){
|
||||
|
||||
// reference
|
||||
var self = this;
|
||||
|
||||
|
||||
// bail early if no sites
|
||||
if( !this.$inputs.length ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// complete
|
||||
if( this.i >= this.$inputs.length ) {
|
||||
|
||||
this.complete();
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// disable buttons
|
||||
this.$buttons.attr('disabled', 'disabled');
|
||||
|
||||
|
||||
// vars
|
||||
var $input = this.$inputs.eq( this.i ),
|
||||
$tr = $input.closest('tr'),
|
||||
text = '<?php _e('Upgrade complete', 'acf'); ?>';
|
||||
|
||||
|
||||
// add loading
|
||||
$tr.find('.response').html('<i class="acf-loading"></i></span> <?php _e('Upgrading data to', 'acf'); ?> <?php echo $plugin_version; ?>');
|
||||
|
||||
|
||||
// get results
|
||||
var xhr = $.ajax({
|
||||
url: '<?php echo admin_url('admin-ajax.php'); ?>',
|
||||
dataType: 'json',
|
||||
type: 'post',
|
||||
data: {
|
||||
action: 'acf/admin/data_upgrade',
|
||||
nonce: '<?php echo wp_create_nonce('acf_upgrade'); ?>',
|
||||
blog_id: $input.val(),
|
||||
},
|
||||
success: function( json ){
|
||||
|
||||
// remove input
|
||||
$input.prop('checked', false);
|
||||
$input.remove();
|
||||
|
||||
|
||||
// vars
|
||||
var message = acf.get_ajax_message(json);
|
||||
|
||||
|
||||
// bail early if no message text
|
||||
if( !message.text ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// update text
|
||||
text = '<pre>' + message.text + '</pre>';
|
||||
|
||||
},
|
||||
complete: function(){
|
||||
|
||||
$tr.find('.response').html( text );
|
||||
|
||||
|
||||
// upgrade next site
|
||||
self.next();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
next: function(){
|
||||
|
||||
this.i++;
|
||||
|
||||
this.upgrade();
|
||||
|
||||
},
|
||||
|
||||
complete: function(){
|
||||
|
||||
// enable buttons
|
||||
this.$buttons.removeAttr('disabled');
|
||||
|
||||
|
||||
// show message
|
||||
$('.show-on-complete').show();
|
||||
|
||||
}
|
||||
|
||||
}.init();
|
||||
|
||||
})(jQuery);
|
||||
</script>
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
// defaults
|
||||
$args = wp_parse_args($args, array(
|
||||
'button_url' => '',
|
||||
'button_text' => '',
|
||||
'confirm' => true
|
||||
));
|
||||
|
||||
extract($args);
|
||||
|
||||
?>
|
||||
<div id="acf-upgrade-notice" class="acf-cf">
|
||||
|
||||
<div class="inner">
|
||||
|
||||
<div class="acf-icon logo">
|
||||
<i class="acf-sprite-logo"></i>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
|
||||
<h2><?php _e("Database Upgrade Required",'acf'); ?></h2>
|
||||
|
||||
<p><?php printf(__("Thank you for updating to %s v%s!", 'acf'), acf_get_setting('name'), acf_get_setting('version') ); ?><br /><?php _e("Before you start using the new awesome features, please update your database to the newest version.", 'acf'); ?></p>
|
||||
|
||||
<p><a id="acf-notice-action" href="<?php echo $button_url; ?>" class="button button-primary"><?php echo $button_text; ?></a></p>
|
||||
|
||||
<?php if( $confirm ): ?>
|
||||
<script type="text/javascript">
|
||||
(function($) {
|
||||
|
||||
$("#acf-notice-action").on("click", function(){
|
||||
|
||||
var answer = confirm("<?php _e( 'It is strongly recommended that you backup your database before proceeding. Are you sure you wish to run the updater now?', 'acf' ); ?>");
|
||||
return answer;
|
||||
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
<?php
|
||||
|
||||
extract($args);
|
||||
|
||||
?>
|
||||
<div id="acf-upgrade-wrap" class="wrap">
|
||||
|
||||
<h1><?php _e("Advanced Custom Fields Database Upgrade",'acf'); ?></h1>
|
||||
|
||||
<?php if( !empty($updates) ): ?>
|
||||
|
||||
<p><?php _e('Reading upgrade tasks...', 'acf'); ?></p>
|
||||
|
||||
<p class="show-on-ajax"><i class="acf-loading"></i> <?php printf(__('Upgrading data to version %s', 'acf'), $plugin_version); ?></p>
|
||||
|
||||
<p class="show-on-complete"><?php _e('Database Upgrade complete', 'acf'); ?>. <a href="<?php echo admin_url('edit.php?post_type=acf-field-group&page=acf-settings-info'); ?>"><?php _e("See what's new",'acf'); ?></a>.</p>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
/* hide show */
|
||||
.show-on-ajax,
|
||||
.show-on-complete {
|
||||
display: none;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function($) {
|
||||
|
||||
var upgrader = {
|
||||
|
||||
init: function(){
|
||||
|
||||
// reference
|
||||
var self = this;
|
||||
|
||||
|
||||
// allow user to read message for 1 second
|
||||
setTimeout(function(){
|
||||
|
||||
self.upgrade();
|
||||
|
||||
}, 1000);
|
||||
|
||||
|
||||
// return
|
||||
return this;
|
||||
},
|
||||
|
||||
upgrade: function(){
|
||||
|
||||
// reference
|
||||
var self = this;
|
||||
|
||||
|
||||
// show message
|
||||
$('.show-on-ajax').show();
|
||||
|
||||
|
||||
// get results
|
||||
var xhr = $.ajax({
|
||||
url: '<?php echo admin_url('admin-ajax.php'); ?>',
|
||||
dataType: 'json',
|
||||
type: 'post',
|
||||
data: {
|
||||
action: 'acf/admin/data_upgrade',
|
||||
nonce: '<?php echo wp_create_nonce('acf_upgrade'); ?>'
|
||||
},
|
||||
success: function( json ){
|
||||
|
||||
// vars
|
||||
var message = acf.get_ajax_message(json);
|
||||
|
||||
|
||||
// bail early if no message text
|
||||
if( !message.text ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// show message
|
||||
$('.show-on-ajax').html( message.text );
|
||||
|
||||
},
|
||||
complete: function( json ){
|
||||
|
||||
// remove spinner
|
||||
$('.acf-loading').hide();
|
||||
|
||||
|
||||
// show complete
|
||||
$('.show-on-complete').show();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
}.init();
|
||||
|
||||
})(jQuery);
|
||||
</script>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<p><?php _e('No updates available', 'acf'); ?>.</p>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,468 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* acf_get_metadata
|
||||
*
|
||||
* This function will get a value from the DB
|
||||
*
|
||||
* @type function
|
||||
* @date 16/10/2015
|
||||
* @since 5.2.3
|
||||
*
|
||||
* @param $post_id (mixed)
|
||||
* @param $name (string)
|
||||
* @param $hidden (boolean)
|
||||
* @return $return (mixed)
|
||||
*/
|
||||
|
||||
function acf_get_metadata( $post_id = 0, $name = '', $hidden = false ) {
|
||||
|
||||
// vars
|
||||
$value = null;
|
||||
|
||||
|
||||
// bail early if no $post_id (acf_form - new_post)
|
||||
if( !$post_id ) return $value;
|
||||
|
||||
|
||||
// add prefix for hidden meta
|
||||
if( $hidden ) {
|
||||
|
||||
$name = '_' . $name;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// post
|
||||
if( is_numeric($post_id) ) {
|
||||
|
||||
$meta = get_metadata( 'post', $post_id, $name, false );
|
||||
|
||||
if( isset($meta[0]) ) {
|
||||
|
||||
$value = $meta[0];
|
||||
|
||||
}
|
||||
|
||||
// user
|
||||
} elseif( substr($post_id, 0, 5) == 'user_' ) {
|
||||
|
||||
$user_id = (int) substr($post_id, 5);
|
||||
|
||||
$meta = get_metadata( 'user', $user_id, $name, false );
|
||||
|
||||
if( isset($meta[0]) ) {
|
||||
|
||||
$value = $meta[0];
|
||||
|
||||
}
|
||||
|
||||
// comment
|
||||
} elseif( substr($post_id, 0, 8) == 'comment_' ) {
|
||||
|
||||
$comment_id = (int) substr($post_id, 8);
|
||||
|
||||
$meta = get_metadata( 'comment', $comment_id, $name, false );
|
||||
|
||||
if( isset($meta[0]) ) {
|
||||
|
||||
$value = $meta[0];
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// modify prefix for hidden meta
|
||||
if( $hidden ) {
|
||||
|
||||
$post_id = '_' . $post_id;
|
||||
$name = substr($name, 1);
|
||||
|
||||
}
|
||||
|
||||
$value = get_option( $post_id . '_' . $name, null );
|
||||
|
||||
}
|
||||
|
||||
|
||||
// return
|
||||
return $value;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* acf_update_metadata
|
||||
*
|
||||
* This function will update a value from the DB
|
||||
*
|
||||
* @type function
|
||||
* @date 16/10/2015
|
||||
* @since 5.2.3
|
||||
*
|
||||
* @param $post_id (mixed)
|
||||
* @param $name (string)
|
||||
* @param $value (mixed)
|
||||
* @param $hidden (boolean)
|
||||
* @return $return (boolean)
|
||||
*/
|
||||
|
||||
function acf_update_metadata( $post_id = 0, $name = '', $value = '', $hidden = false ) {
|
||||
|
||||
// vars
|
||||
$return = false;
|
||||
|
||||
|
||||
// add prefix for hidden meta
|
||||
if( $hidden ) {
|
||||
|
||||
$name = '_' . $name;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// postmeta
|
||||
if( is_numeric($post_id) ) {
|
||||
|
||||
$return = update_metadata('post', $post_id, $name, $value );
|
||||
|
||||
// usermeta
|
||||
} elseif( substr($post_id, 0, 5) == 'user_' ) {
|
||||
|
||||
$user_id = (int) substr($post_id, 5);
|
||||
|
||||
$return = update_metadata('user', $user_id, $name, $value);
|
||||
|
||||
// commentmeta
|
||||
} elseif( substr($post_id, 0, 8) == 'comment_' ) {
|
||||
|
||||
$comment_id = (int) substr($post_id, 8);
|
||||
|
||||
$return = update_metadata('comment', $comment_id, $name, $value);
|
||||
|
||||
// options
|
||||
} else {
|
||||
|
||||
// modify prefix for hidden meta
|
||||
if( $hidden ) {
|
||||
|
||||
$post_id = '_' . $post_id;
|
||||
$name = substr($name, 1);
|
||||
|
||||
}
|
||||
|
||||
$return = acf_update_option( $post_id . '_' . $name, $value );
|
||||
|
||||
}
|
||||
|
||||
|
||||
// return
|
||||
return (boolean) $return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* acf_delete_metadata
|
||||
*
|
||||
* This function will delete a value from the DB
|
||||
*
|
||||
* @type function
|
||||
* @date 16/10/2015
|
||||
* @since 5.2.3
|
||||
*
|
||||
* @param $post_id (mixed)
|
||||
* @param $name (string)
|
||||
* @param $hidden (boolean)
|
||||
* @return $return (boolean)
|
||||
*/
|
||||
|
||||
function acf_delete_metadata( $post_id = 0, $name = '', $hidden = false ) {
|
||||
|
||||
// vars
|
||||
$return = false;
|
||||
|
||||
|
||||
// add prefix for hidden meta
|
||||
if( $hidden ) {
|
||||
|
||||
$name = '_' . $name;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// postmeta
|
||||
if( is_numeric($post_id) ) {
|
||||
|
||||
$return = delete_metadata('post', $post_id, $name );
|
||||
|
||||
// usermeta
|
||||
} elseif( substr($post_id, 0, 5) == 'user_' ) {
|
||||
|
||||
$user_id = (int) substr($post_id, 5);
|
||||
|
||||
$return = delete_metadata('user', $user_id, $name);
|
||||
|
||||
// commentmeta
|
||||
} elseif( substr($post_id, 0, 8) == 'comment_' ) {
|
||||
|
||||
$comment_id = (int) substr($post_id, 8);
|
||||
|
||||
$return = delete_metadata('comment', $comment_id, $name);
|
||||
|
||||
// options
|
||||
} else {
|
||||
|
||||
// modify prefix for hidden meta
|
||||
if( $hidden ) {
|
||||
|
||||
$post_id = '_' . $post_id;
|
||||
$name = substr($name, 1);
|
||||
|
||||
}
|
||||
|
||||
$return = delete_option( $post_id . '_' . $name );
|
||||
|
||||
}
|
||||
|
||||
|
||||
// return
|
||||
return $return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* acf_update_option
|
||||
*
|
||||
* This function is a wrapper for the WP update_option but provides logic for a 'no' autoload
|
||||
*
|
||||
* @type function
|
||||
* @date 4/01/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $option (string)
|
||||
* @param $value (mixed)
|
||||
* @param autoload (mixed)
|
||||
* @return (boolean)
|
||||
*/
|
||||
|
||||
function acf_update_option( $option = '', $value = '', $autoload = null ) {
|
||||
|
||||
// vars
|
||||
$deprecated = '';
|
||||
$return = false;
|
||||
|
||||
|
||||
// autoload
|
||||
if( $autoload === null ){
|
||||
|
||||
$autoload = acf_get_setting('autoload') ? 'yes' : 'no';
|
||||
|
||||
}
|
||||
|
||||
|
||||
// for some reason, update_option does not use stripslashes_deep.
|
||||
// update_metadata -> http://core.trac.wordpress.org/browser/tags/3.4.2/wp-includes/meta.php#L82: line 101 (does use stripslashes_deep)
|
||||
// update_option -> http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/option.php#L0: line 215 (does not use stripslashes_deep)
|
||||
$value = stripslashes_deep($value);
|
||||
|
||||
|
||||
// add or update
|
||||
if( get_option($option) !== false ) {
|
||||
|
||||
$return = update_option( $option, $value );
|
||||
|
||||
} else {
|
||||
|
||||
$return = add_option( $option, $value, $deprecated, $autoload );
|
||||
|
||||
}
|
||||
|
||||
|
||||
// return
|
||||
return $return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* acf_get_value
|
||||
*
|
||||
* This function will load in a field's value
|
||||
*
|
||||
* @type function
|
||||
* @date 28/09/13
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $post_id (int)
|
||||
* @param $field (array)
|
||||
* @return (mixed)
|
||||
*/
|
||||
|
||||
function acf_get_value( $post_id = 0, $field ) {
|
||||
|
||||
// try cache
|
||||
$found = false;
|
||||
$cache = wp_cache_get( "load_value/post_id={$post_id}/name={$field['name']}", 'acf', false, $found );
|
||||
|
||||
if( $found ) {
|
||||
|
||||
return $cache;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// load value
|
||||
$value = acf_get_metadata( $post_id, $field['name'] );
|
||||
|
||||
|
||||
// if value was duplicated, it may now be a serialized string!
|
||||
$value = maybe_unserialize( $value );
|
||||
|
||||
|
||||
// no value? try default_value
|
||||
if( $value === null && isset($field['default_value']) ) {
|
||||
|
||||
$value = $field['default_value'];
|
||||
|
||||
}
|
||||
|
||||
|
||||
// filter for 3rd party customization
|
||||
$value = apply_filters( "acf/load_value", $value, $post_id, $field );
|
||||
$value = apply_filters( "acf/load_value/type={$field['type']}", $value, $post_id, $field );
|
||||
$value = apply_filters( "acf/load_value/name={$field['name']}", $value, $post_id, $field );
|
||||
$value = apply_filters( "acf/load_value/key={$field['key']}", $value, $post_id, $field );
|
||||
|
||||
|
||||
// update cache
|
||||
wp_cache_set( "load_value/post_id={$post_id}/name={$field['name']}", $value, 'acf' );
|
||||
|
||||
|
||||
// return
|
||||
return $value;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* acf_format_value
|
||||
*
|
||||
* This function will format the value for front end use
|
||||
*
|
||||
* @type function
|
||||
* @date 3/07/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $value (mixed)
|
||||
* @param $post_id (mixed)
|
||||
* @param $field (array)
|
||||
* @return $value
|
||||
*/
|
||||
|
||||
function acf_format_value( $value, $post_id, $field ) {
|
||||
|
||||
// apply filters
|
||||
$value = apply_filters( "acf/format_value", $value, $post_id, $field );
|
||||
$value = apply_filters( "acf/format_value/type={$field['type']}", $value, $post_id, $field );
|
||||
$value = apply_filters( "acf/format_value/name={$field['name']}", $value, $post_id, $field );
|
||||
$value = apply_filters( "acf/format_value/key={$field['key']}", $value, $post_id, $field );
|
||||
|
||||
|
||||
// return
|
||||
return $value;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* acf_update_value
|
||||
*
|
||||
* updates a value into the db
|
||||
*
|
||||
* @type action
|
||||
* @date 23/01/13
|
||||
*
|
||||
* @param $value (mixed)
|
||||
* @param $post_id (mixed)
|
||||
* @param $field (array)
|
||||
* @return (boolean)
|
||||
*/
|
||||
|
||||
function acf_update_value( $value = null, $post_id = 0, $field ) {
|
||||
|
||||
// strip slashes
|
||||
if( acf_get_setting('stripslashes') ) {
|
||||
|
||||
$value = stripslashes_deep($value);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// filter for 3rd party customization
|
||||
$value = apply_filters( "acf/update_value", $value, $post_id, $field );
|
||||
$value = apply_filters( "acf/update_value/type={$field['type']}", $value, $post_id, $field );
|
||||
$value = apply_filters( "acf/update_value/name={$field['name']}", $value, $post_id, $field );
|
||||
$value = apply_filters( "acf/update_value/key={$field['key']}", $value, $post_id, $field );
|
||||
|
||||
|
||||
// update value
|
||||
$return = acf_update_metadata( $post_id, $field['name'], $value );
|
||||
|
||||
|
||||
// update reference
|
||||
acf_update_metadata( $post_id, $field['name'], $field['key'], true );
|
||||
|
||||
|
||||
// clear cache
|
||||
wp_cache_delete( "load_value/post_id={$post_id}/name={$field['name']}", 'acf' );
|
||||
|
||||
|
||||
// return
|
||||
return $return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* acf_delete_value
|
||||
*
|
||||
* This function will delete a value from the database
|
||||
*
|
||||
* @type function
|
||||
* @date 28/09/13
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $post_id (mixed)
|
||||
* @param $field (array)
|
||||
* @return (boolean)
|
||||
*/
|
||||
|
||||
function acf_delete_value( $post_id = 0, $field ) {
|
||||
|
||||
// action for 3rd party customization
|
||||
do_action("acf/delete_value", $post_id, $field['name'], $field);
|
||||
do_action("acf/delete_value/type={$field['type']}", $post_id, $field['name'], $field);
|
||||
do_action("acf/delete_value/name={$field['_name']}", $post_id, $field['name'], $field);
|
||||
do_action("acf/delete_value/key={$field['key']}", $post_id, $field['name'], $field);
|
||||
|
||||
|
||||
// delete value
|
||||
$return = acf_delete_metadata( $post_id, $field['name'] );
|
||||
|
||||
|
||||
// delete reference
|
||||
acf_delete_metadata( $post_id, $field['name'], true );
|
||||
|
||||
|
||||
// clear cache
|
||||
wp_cache_delete( "load_value/post_id={$post_id}/name={$field['name']}", 'acf' );
|
||||
|
||||
|
||||
// return
|
||||
return $return;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,376 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
*
|
||||
* Global
|
||||
*
|
||||
*---------------------------------------------------------------------------------------------*/
|
||||
#adv-settings .show-field-keys label {
|
||||
padding: 0 5px;
|
||||
}
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
*
|
||||
* Postbox: Publish
|
||||
*
|
||||
*---------------------------------------------------------------------------------------------*/
|
||||
#minor-publishing-actions,
|
||||
#misc-publishing-actions #visibility {
|
||||
display: none;
|
||||
}
|
||||
#minor-publishing {
|
||||
border-bottom: 0 none;
|
||||
}
|
||||
#misc-pub-section {
|
||||
border-bottom: 0 none;
|
||||
}
|
||||
#misc-publishing-actions .misc-pub-section {
|
||||
border-bottom-color: #F5F5F5;
|
||||
}
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
*
|
||||
* Postbox: Fields
|
||||
*
|
||||
*---------------------------------------------------------------------------------------------*/
|
||||
#acf-field-group-fields > .inside,
|
||||
#acf-field-group-locations > .inside,
|
||||
#acf-field-group-options > .inside {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
#acf-field-group-fields {
|
||||
border: 0 none;
|
||||
box-shadow: none;
|
||||
}
|
||||
#acf-field-group-fields > .handlediv,
|
||||
#acf-field-group-fields > .hndle {
|
||||
display: none;
|
||||
}
|
||||
.no-fields-message {
|
||||
padding: 15px 15px;
|
||||
}
|
||||
.acf-field-list-wrap {
|
||||
border: #DFDFDF solid 1px;
|
||||
}
|
||||
/* table header */
|
||||
.li-field-order {
|
||||
width: 22%;
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
.li-field-label {
|
||||
width: 28%;
|
||||
}
|
||||
.li-field-name {
|
||||
width: 25%;
|
||||
}
|
||||
.li-field-type {
|
||||
width: 25%;
|
||||
}
|
||||
/* field list */
|
||||
.acf-field-list {
|
||||
background: #F9F9F9;
|
||||
border-top: #E1E1E1 solid 1px;
|
||||
margin-top: -1px;
|
||||
}
|
||||
.acf-field-list a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.acf-field-list a:active,
|
||||
.acf-field-list a:focus {
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
/* field object */
|
||||
.acf-field-object {
|
||||
border-top: #F0F0F0 solid 1px;
|
||||
background: #fff;
|
||||
}
|
||||
.acf-field-object:first-child {
|
||||
border-top: 0 none;
|
||||
}
|
||||
.acf-field-object.ui-sortable-helper {
|
||||
border-top-color: #fff;
|
||||
box-shadow: 0 0 0 1px #DFDFDF, 0 1px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.acf-field-object.ui-sortable-placeholder {
|
||||
box-shadow: 0 -1px 0 0 #DFDFDF;
|
||||
visibility: visible !important;
|
||||
background: #F9F9F9;
|
||||
border-top-color: transparent;
|
||||
}
|
||||
.acf-field-object[data-key="acfcloneindex"] {
|
||||
display: none !important;
|
||||
}
|
||||
/* field object (open) */
|
||||
.acf-field-object.open + .acf-field-object {
|
||||
border-top-color: #E1E1E1;
|
||||
}
|
||||
/* field object meta */
|
||||
.acf-field-object .meta {
|
||||
display: none;
|
||||
}
|
||||
/* field object handle */
|
||||
.acf-field-object .handle li {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
.acf-field-object .handle .acf-icon {
|
||||
margin: 1px 0 0;
|
||||
cursor: move;
|
||||
background: transparent;
|
||||
float: left;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
width: 28px;
|
||||
font-size: 13px;
|
||||
color: #444;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
.acf-field-object .handle strong {
|
||||
display: block;
|
||||
padding-bottom: 6px;
|
||||
font-size: 14px;
|
||||
line-height: 14px;
|
||||
min-height: 14px;
|
||||
}
|
||||
.acf-field-object.open > .handle .acf-required {
|
||||
color: #fff;
|
||||
}
|
||||
.acf-field-object .handle .row-options {
|
||||
visibility: hidden;
|
||||
}
|
||||
.acf-field-object:hover > .handle .row-options {
|
||||
visibility: visible;
|
||||
}
|
||||
.acf-field-object .handle .row-options a {
|
||||
margin-right: 4px;
|
||||
}
|
||||
.acf-field-object .handle .delete-field:hover {
|
||||
color: #f00;
|
||||
}
|
||||
/* field object handle (open) */
|
||||
.acf-field-object.open > .handle {
|
||||
background: #00a0d2;
|
||||
border: #0092bf solid 1px;
|
||||
text-shadow: #268FBB 0 1px 0;
|
||||
color: #fff;
|
||||
position: relative;
|
||||
margin: -1px -1px 0 -1px;
|
||||
}
|
||||
.acf-field-object.open > .handle a {
|
||||
color: #fff !important;
|
||||
-webkit-transition: none;
|
||||
-moz-transition: none;
|
||||
-o-transition: none;
|
||||
transition: none;
|
||||
}
|
||||
.acf-field-object.open > .handle .row-options a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.acf-field-object.open > .handle .acf-icon {
|
||||
border-color: #fff;
|
||||
color: #fff;
|
||||
}
|
||||
/* field object settings */
|
||||
.acf-field-object > .settings {
|
||||
display: none;
|
||||
width: 100%;
|
||||
}
|
||||
.acf-field-object > .settings > .acf-table {
|
||||
border: none;
|
||||
}
|
||||
/* conditional logic */
|
||||
.acf-field-object .rule-groups {
|
||||
margin-top: 10px;
|
||||
}
|
||||
/* field object keys */
|
||||
.acf-field-object .handle .pre-field-key {
|
||||
border: #E1E1E1 solid 1px;
|
||||
margin: 4px 0 0 -6px;
|
||||
padding: 5px 5px 5px 11px;
|
||||
font: inherit;
|
||||
float: left;
|
||||
border-radius: 0 3px 3px 0;
|
||||
display: none;
|
||||
border-left: none;
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
}
|
||||
.acf-field-object.open > .handle .pre-field-key {
|
||||
border-color: #FAFCFD;
|
||||
}
|
||||
.show-field-keys .acf-field-object .handle .pre-field-key {
|
||||
display: block;
|
||||
}
|
||||
.show-field-keys .li-field-order {
|
||||
width: 24%;
|
||||
}
|
||||
.show-field-keys .li-field-label {
|
||||
width: 26%;
|
||||
}
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
*
|
||||
* Postbox: Locations
|
||||
*
|
||||
*---------------------------------------------------------------------------------------------*/
|
||||
.rule-groups h4 {
|
||||
margin: 15px 0 5px;
|
||||
}
|
||||
.rule-groups .rule-group {
|
||||
margin: 0 0 5px;
|
||||
}
|
||||
.rule-groups .rule-group h4 {
|
||||
margin: 0 0 3px;
|
||||
}
|
||||
.rule-groups .rule-group td.param {
|
||||
width: 35%;
|
||||
}
|
||||
.rule-groups .rule-group td.operator {
|
||||
width: 20%;
|
||||
}
|
||||
.rule-groups .rule-group td.add {
|
||||
width: 40px;
|
||||
}
|
||||
.rule-groups .rule-group td.remove {
|
||||
width: 28px;
|
||||
vertical-align: middle;
|
||||
visibility: hidden;
|
||||
}
|
||||
.rule-groups .rule-group tr:hover td.remove {
|
||||
visibility: visible;
|
||||
}
|
||||
/* Don't allow user to delete the first field group */
|
||||
.rule-groups .rule-group:first-child tr:first-child td.remove {
|
||||
visibility: hidden !important;
|
||||
}
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
*
|
||||
* Options
|
||||
*
|
||||
*---------------------------------------------------------------------------------------------*/
|
||||
#acf-field-group-options tr[data-name="hide_on_screen"] li {
|
||||
float: left;
|
||||
width: 33%;
|
||||
}
|
||||
@media (max-width: 1100px) {
|
||||
#acf-field-group-options tr[data-name="hide_on_screen"] li {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
*
|
||||
* Conditional Logic
|
||||
*
|
||||
*---------------------------------------------------------------------------------------------*/
|
||||
table.conditional-logic-rules {
|
||||
background: transparent;
|
||||
border: 0 none;
|
||||
border-radius: 0;
|
||||
}
|
||||
table.conditional-logic-rules tbody td {
|
||||
background: transparent;
|
||||
border: 0 none !important;
|
||||
padding: 5px 2px !important;
|
||||
}
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
*
|
||||
* Field: Tab
|
||||
*
|
||||
*---------------------------------------------------------------------------------------------*/
|
||||
.acf-field-object-tab tr[data-name="name"],
|
||||
.acf-field-object-tab tr[data-name="instructions"],
|
||||
.acf-field-object-tab tr[data-name="required"],
|
||||
.acf-field-object-tab tr[data-name="warning"],
|
||||
.acf-field-object-tab tr[data-name="wrapper"] {
|
||||
display: none !important;
|
||||
}
|
||||
.acf-field-object-tab .li-field-name {
|
||||
visibility: hidden;
|
||||
}
|
||||
.acf-field-object-tab .acf-error-message {
|
||||
display: none;
|
||||
}
|
||||
.acf-field-list[data-layout="table"] .acf-field-object-tab .acf-error-message {
|
||||
display: block;
|
||||
}
|
||||
.acf-field-object + .acf-field-object-tab {
|
||||
margin-top: 6px;
|
||||
}
|
||||
.acf-field-object + .acf-field-object-tab:before {
|
||||
display: block;
|
||||
content: "";
|
||||
height: 1px;
|
||||
background: #F0F0F0;
|
||||
margin-top: -7px;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
}
|
||||
.acf-field-object + .acf-field-object-tab.ui-sortable-placeholder {
|
||||
margin-top: 0;
|
||||
padding-top: 6px;
|
||||
}
|
||||
.acf-field-object-tab.ui-sortable-helper:before,
|
||||
.ui-sortable-placeholder + .acf-field-object-tab:before {
|
||||
display: none;
|
||||
}
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
*
|
||||
* Field: Message
|
||||
*
|
||||
*---------------------------------------------------------------------------------------------*/
|
||||
.acf-field-object-message tr[data-name="name"],
|
||||
.acf-field-object-message tr[data-name="instructions"],
|
||||
.acf-field-object-message tr[data-name="required"] {
|
||||
display: none !important;
|
||||
}
|
||||
.acf-field-object-message .li-field-name {
|
||||
visibility: hidden;
|
||||
}
|
||||
.acf-field-object-message textarea {
|
||||
height: 175px !important;
|
||||
}
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
*
|
||||
* Field: Date Picker
|
||||
*
|
||||
*---------------------------------------------------------------------------------------------*/
|
||||
.acf-field-object-date_picker .acf-radio-list span {
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
}
|
||||
/*--------------------------------------------------------------------------------------------
|
||||
*
|
||||
* RTL
|
||||
*
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
html[dir="rtl"] .acf-field-object.open > .handle {
|
||||
margin: -1px -1px 0;
|
||||
}
|
||||
html[dir="rtl"] .acf-field-object.open > .handle .acf-icon {
|
||||
float: right;
|
||||
}
|
||||
html[dir="rtl"] .acf-field-object.open > .handle .li-field-order {
|
||||
padding-left: 0 !important;
|
||||
padding-right: 15px !important;
|
||||
}
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
*
|
||||
* Device
|
||||
*
|
||||
*---------------------------------------------------------------------------------------------*/
|
||||
@media only screen and (max-width: 850px) {
|
||||
tr.acf-field,
|
||||
td.acf-label,
|
||||
td.acf-input {
|
||||
display: block !important;
|
||||
width: auto !important;
|
||||
border: 0 none !important;
|
||||
}
|
||||
tr.acf-field {
|
||||
border-top: #ededed solid 1px !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
td.acf-label {
|
||||
background: transparent !important;
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
Font license info
|
||||
|
||||
|
||||
## Entypo
|
||||
|
||||
Copyright (C) 2012 by Daniel Bruce
|
||||
|
||||
Author: Daniel Bruce
|
||||
License: SIL (http://scripts.sil.org/OFL)
|
||||
Homepage: http://www.entypo.com
|
||||
|
||||
|
||||
## Typicons
|
||||
|
||||
(c) Stephen Hutchings 2012
|
||||
|
||||
Author: Stephen Hutchings
|
||||
License: SIL (http://scripts.sil.org/OFL)
|
||||
Homepage: http://typicons.com/
|
||||
|
||||
|
||||
## Font Awesome
|
||||
|
||||
Copyright (C) 2012 by Dave Gandy
|
||||
|
||||
Author: Dave Gandy
|
||||
License: SIL ()
|
||||
Homepage: http://fortawesome.github.com/Font-Awesome/
|
||||
|
||||
|
||||
## Elusive
|
||||
|
||||
Copyright (C) 2013 by Aristeides Stathopoulos
|
||||
|
||||
Author: Aristeides Stathopoulos
|
||||
License: SIL (http://scripts.sil.org/OFL)
|
||||
Homepage: http://aristeides.com/
|
||||
|
||||
|
||||
## Modern Pictograms
|
||||
|
||||
Copyright (c) 2012 by John Caserta. All rights reserved.
|
||||
|
||||
Author: John Caserta
|
||||
License: SIL (http://scripts.sil.org/OFL)
|
||||
Homepage: http://thedesignoffice.org/project/modern-pictograms/
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
This webfont is generated by http://fontello.com open source project.
|
||||
|
||||
|
||||
================================================================================
|
||||
Please, note, that you should obey original font licences, used to make this
|
||||
webfont pack. Details available in LICENSE.txt file.
|
||||
|
||||
- Usually, it's enough to publish content of LICENSE.txt file somewhere on your
|
||||
site in "About" section.
|
||||
|
||||
- If your project is open-source, usually, it will be ok to make LICENSE.txt
|
||||
file publically available in your repository.
|
||||
|
||||
- Fonts, used in Fontello, don't require a clickable link on your site.
|
||||
But any kind of additional authors crediting is welcome.
|
||||
================================================================================
|
||||
|
||||
|
||||
Comments on archive content
|
||||
---------------------------
|
||||
|
||||
- /font/* - fonts in different formats
|
||||
|
||||
- /css/* - different kinds of css, for all situations. Should be ok with
|
||||
twitter bootstrap. Also, you can skip <i> style and assign icon classes
|
||||
directly to text elements, if you don't mind about IE7.
|
||||
|
||||
- demo.html - demo file, to show your webfont content
|
||||
|
||||
- LICENSE.txt - license info about source fonts, used to build your one.
|
||||
|
||||
- config.json - keeps your settings. You can import it back into fontello
|
||||
anytime, to continue your work
|
||||
|
||||
|
||||
Why so many CSS files ?
|
||||
-----------------------
|
||||
|
||||
Because we like to fit all your needs :)
|
||||
|
||||
- basic file, <your_font_name>.css - is usually enough, it contains @font-face
|
||||
and character code definitions
|
||||
|
||||
- *-ie7.css - if you need IE7 support, but still don't wish to put char codes
|
||||
directly into html
|
||||
|
||||
- *-codes.css and *-ie7-codes.css - if you like to use your own @font-face
|
||||
rules, but still wish to benefit from css generation. That can be very
|
||||
convenient for automated asset build systems. When you need to update font -
|
||||
no need to manually edit files, just override old version with archive
|
||||
content. See fontello source code for examples.
|
||||
|
||||
- *-embedded.css - basic css file, but with embedded WOFF font, to avoid
|
||||
CORS issues in Firefox and IE9+, when fonts are hosted on the separate domain.
|
||||
We strongly recommend to resolve this issue by `Access-Control-Allow-Origin`
|
||||
server headers. But if you ok with dirty hack - this file is for you. Note,
|
||||
that data url moved to separate @font-face to avoid problems with <IE9, when
|
||||
string is too long.
|
||||
|
||||
- animate.css - use it to get ideas about spinner rotation animation.
|
||||
|
||||
|
||||
Attention for server setup
|
||||
--------------------------
|
||||
|
||||
You MUST setup server to reply with proper `mime-types` for font files -
|
||||
otherwise some browsers will fail to show fonts.
|
||||
|
||||
Usually, `apache` already has necessary settings, but `nginx` and other
|
||||
webservers should be tuned. Here is list of mime types for our file extensions:
|
||||
|
||||
- `application/vnd.ms-fontobject` - eot
|
||||
- `application/x-font-woff` - woff
|
||||
- `application/x-font-ttf` - ttf
|
||||
- `image/svg+xml` - svg
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Copyright (C) 2015 by original authors @ fontello.com</metadata>
|
||||
<defs>
|
||||
<font id="acf" horiz-adv-x="1000" >
|
||||
<font-face font-family="acf" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
|
||||
<missing-glyph horiz-adv-x="1000" />
|
||||
<glyph glyph-name="plus" unicode="" d="m550 400q30 0 30-50t-30-50l-210 0 0-210q0-30-50-30t-50 30l0 210-210 0q-30 0-30 50t30 50l210 0 0 210q0 30 50 30t50-30l0-210 210 0z" horiz-adv-x="580" />
|
||||
<glyph glyph-name="minus" unicode="" d="m550 400q30 0 30-50t-30-50l-520 0q-30 0-30 50t30 50l520 0z" horiz-adv-x="580" />
|
||||
<glyph glyph-name="cancel" unicode="" d="m452 194q18-18 18-43t-18-43q-18-16-43-16t-43 16l-132 152-132-152q-18-16-43-16t-43 16q-16 18-16 43t16 43l138 156-138 158q-16 18-16 43t16 43q18 16 43 16t43-16l132-152 132 152q18 16 43 16t43-16q18-18 18-43t-18-43l-138-158z" horiz-adv-x="470" />
|
||||
<glyph glyph-name="pencil" unicode="" d="m938 605q22-22 22-55t-22-55l-570-570q-22-21-60-38t-73-17l-235 0 0 234q0 35 17 74t38 60l570 570q23 22 55 22t55-22z m-794-426l65-64 431 433-64 63z m91-205q14 0 33 8-10 10-27 26t-50 50-56 56l-22 22q-9-21-9-32l0-78 52-52 79 0z m74 40l432 432-63 64-433-431z m469 469l67 67-165 165-67-66z" horiz-adv-x="960" />
|
||||
<glyph glyph-name="location" unicode="" d="m250 750q104 0 177-73t73-177q0-106-62-243t-126-223l-62-84q-10 12-27 35t-60 89-76 130-60 147-27 149q0 104 73 177t177 73z m0-388q56 0 96 40t40 96-40 95-96 39-95-39-39-95 39-96 95-40z" horiz-adv-x="500" />
|
||||
<glyph glyph-name="down" unicode="" d="m564 422l-234-224q-18-18-40-18t-40 18l-234 224q-16 16-16 41t16 41q38 38 78 0l196-188 196 188q40 38 78 0 16-16 16-41t-16-41z" horiz-adv-x="580" />
|
||||
<glyph glyph-name="left" unicode="" d="m242 626q14 16 39 16t41-16q38-36 0-80l-186-196 186-194q38-44 0-80-16-16-40-16t-40 16l-226 236q-16 16-16 38 0 24 16 40 206 214 226 236z" horiz-adv-x="341" />
|
||||
<glyph glyph-name="right" unicode="" d="m98 626l226-236q16-16 16-40 0-22-16-38l-226-236q-16-16-40-16t-40 16q-36 36 0 80l186 194-186 196q-36 44 0 80 16 16 41 16t39-16z" horiz-adv-x="340" />
|
||||
<glyph glyph-name="up" unicode="" d="m564 280q16-16 16-41t-16-41q-38-38-78 0l-196 188-196-188q-40-38-78 0-16 16-16 41t16 41l234 224q16 16 40 16t40-16z" horiz-adv-x="580" />
|
||||
<glyph glyph-name="sync" unicode="" d="m843 261q0-3 0-4-36-150-150-243t-267-93q-81 0-157 31t-136 88l-72-72q-11-11-25-11t-25 11-11 25v250q0 14 11 25t25 11h250q14 0 25-11t10-25-10-25l-77-77q40-37 90-57t105-20q74 0 139 37t104 99q6 10 29 66 5 13 17 13h107q8 0 13-6t5-12z m14 446v-250q0-14-10-25t-26-11h-250q-14 0-25 11t-10 25 10 25l77 77q-82 77-194 77-75 0-140-37t-104-99q-6-10-29-66-5-13-17-13h-111q-7 0-13 6t-5 12v4q36 150 151 243t268 93q81 0 158-31t137-88l72 72q11 11 25 11t26-11 10-25z" horiz-adv-x="857.1" />
|
||||
<glyph glyph-name="globe" unicode="" d="m480 830q200 0 340-141t140-339q0-200-140-340t-340-140q-198 0-339 140t-141 340q0 198 141 339t339 141z m410-480q0 132-78 239t-202 149q-18-24-16-32 4-38 18-51t30-7l32 12t20 2q22-24 0-47t-45-56-1-77q34-64 96-64 28-2 43-36t17-66q10-80-14-140-22-44 14-76 86 112 86 250z m-466 404q-112-14-199-84t-127-174q6 0 22-2t28-3 26-4 24-8 12-13q4-12-14-45t-18-61q0-30 38-56t38-46q0-28 8-68t8-44q0-12 36-54t52-42q10 0 11 22t-2 54-3 40q0 32 14 74 12 42 59 70t55 46q16 34 9 61t-17 43-34 28-41 17-37 9-22 4q-16 6-42 7t-36-3-27 11-17 29q0 10 15 27t35 37 28 30q8 14 17 21t22 16 27 21q4 4 25 17t27 23z m-72-794q66-20 128-20 128 0 226 68-26 44-118 34-24-2-65-17t-47-17q-74-16-76-16-12-2-26-14t-22-18z" horiz-adv-x="960" />
|
||||
<glyph glyph-name="picture" unicode="" d="m0-68l0 836 1000 0 0-836-1000 0z m76 78l848 0 0 680-848 0 0-680z m90 80l0 59 150 195 102-86 193 291 223-228 0-231-668 0z m0 416q0 37 24 62t62 24q33 0 58-24t24-62q0-33-24-57t-58-25q-37 0-62 25t-24 57z" horiz-adv-x="1000" />
|
||||
<glyph glyph-name="check" unicode="" d="m249 0q-34 0-56 28l-180 236q-16 24-12 52t26 46 51 14 47-28l118-154 296 474q16 24 43 30t53-8q24-16 30-43t-8-53l-350-560q-20-32-56-32z" horiz-adv-x="667" />
|
||||
<glyph glyph-name="dot-3" unicode="" d="m110 460q46 0 78-32t32-78q0-44-32-77t-78-33-78 33-32 77q0 46 32 78t78 32z m350 0q46 0 78-32t32-78q0-44-33-77t-77-33-77 33-33 77q0 46 32 78t78 32z m350 0q46 0 78-32t32-78q0-44-32-77t-78-33-78 33-32 77q0 46 32 78t78 32z" horiz-adv-x="920" />
|
||||
<glyph glyph-name="arrow-combo" unicode="" d="m230 850l230-364-460 0z m0-1000l-230 366 460 0z" horiz-adv-x="460" />
|
||||
<glyph glyph-name="arrow-down" unicode="" d="m540 587l-269-473-271 473 540 0z" horiz-adv-x="540" />
|
||||
<glyph glyph-name="arrow-up" unicode="" d="m0 114l269 473 271-473-540 0z" horiz-adv-x="540" />
|
||||
<glyph glyph-name="search" unicode="" d="m772 78q30-34 6-62l-46-46q-36-32-68 0l-190 190q-74-42-156-42-128 0-223 95t-95 223 90 219 218 91 224-95 96-223q0-88-46-162z m-678 358q0-88 68-156t156-68 151 63 63 153q0 88-68 155t-156 67-151-63-63-151z" horiz-adv-x="789" />
|
||||
</font>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.0 KiB |
|
|
@ -0,0 +1,118 @@
|
|||
{
|
||||
"name": "acf",
|
||||
"css_prefix_text": "acf-icon-",
|
||||
"css_use_suffix": false,
|
||||
"hinting": true,
|
||||
"units_per_em": 1000,
|
||||
"ascent": 850,
|
||||
"glyphs": [
|
||||
{
|
||||
"uid": "a73c5deb486c8d66249811642e5d719a",
|
||||
"css": "sync",
|
||||
"code": 59401,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "7222571caa5c15f83dcfd447c58d68d9",
|
||||
"css": "search",
|
||||
"code": 59409,
|
||||
"src": "entypo"
|
||||
},
|
||||
{
|
||||
"uid": "14017aae737730faeda4a6fd8fb3a5f0",
|
||||
"css": "check",
|
||||
"code": 59404,
|
||||
"src": "entypo"
|
||||
},
|
||||
{
|
||||
"uid": "c709da589c923ba3c2ad48d9fc563e93",
|
||||
"css": "cancel",
|
||||
"code": 59394,
|
||||
"src": "entypo"
|
||||
},
|
||||
{
|
||||
"uid": "70370693ada58ef0a60fa0984fe8d52a",
|
||||
"css": "plus",
|
||||
"code": 59392,
|
||||
"src": "entypo"
|
||||
},
|
||||
{
|
||||
"uid": "1256e3054823e304d7e452a589cf8bb8",
|
||||
"css": "minus",
|
||||
"code": 59393,
|
||||
"src": "entypo"
|
||||
},
|
||||
{
|
||||
"uid": "a42b598e4298f3319b25a2702a02e7ff",
|
||||
"css": "location",
|
||||
"code": 59396,
|
||||
"src": "entypo"
|
||||
},
|
||||
{
|
||||
"uid": "0a3192de65a73ca1501b073ad601f87d",
|
||||
"css": "arrow-combo",
|
||||
"code": 59406,
|
||||
"src": "entypo"
|
||||
},
|
||||
{
|
||||
"uid": "8704cd847a47b64265b8bb110c8b4d62",
|
||||
"css": "down",
|
||||
"code": 59397,
|
||||
"src": "entypo"
|
||||
},
|
||||
{
|
||||
"uid": "c311c48d79488965b0fab7f9cd12b6b5",
|
||||
"css": "left",
|
||||
"code": 59398,
|
||||
"src": "entypo"
|
||||
},
|
||||
{
|
||||
"uid": "749e7d90a9182938180f1d2d8c33584e",
|
||||
"css": "right",
|
||||
"code": 59399,
|
||||
"src": "entypo"
|
||||
},
|
||||
{
|
||||
"uid": "9c7ff134960bb5a82404e4aeaab366d9",
|
||||
"css": "up",
|
||||
"code": 59400,
|
||||
"src": "entypo"
|
||||
},
|
||||
{
|
||||
"uid": "6a12c2b74456ea21cc984e11dec227a1",
|
||||
"css": "globe",
|
||||
"code": 59402,
|
||||
"src": "entypo"
|
||||
},
|
||||
{
|
||||
"uid": "d10920db2e79c997c5e783279291970c",
|
||||
"css": "dot-3",
|
||||
"code": 59405,
|
||||
"src": "entypo"
|
||||
},
|
||||
{
|
||||
"uid": "1e77a2yvsq3owssduo2lcgsiven57iv5",
|
||||
"css": "pencil",
|
||||
"code": 59395,
|
||||
"src": "typicons"
|
||||
},
|
||||
{
|
||||
"uid": "8ax1xqcbzz1hobyd4i7f0unwib1bztip",
|
||||
"css": "arrow-down",
|
||||
"code": 59407,
|
||||
"src": "modernpics"
|
||||
},
|
||||
{
|
||||
"uid": "6ipws8y9gej6vbloufvhi5qux7rluf64",
|
||||
"css": "arrow-up",
|
||||
"code": 59408,
|
||||
"src": "modernpics"
|
||||
},
|
||||
{
|
||||
"uid": "a1be363d4de9be39857893d4134f6215",
|
||||
"css": "picture",
|
||||
"code": 59403,
|
||||
"src": "elusive"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 9.4 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 206 B |
|
After Width: | Height: | Size: 206 B |
|
After Width: | Height: | Size: 230 B |
|
After Width: | Height: | Size: 230 B |
|
After Width: | Height: | Size: 212 B |
|
After Width: | Height: | Size: 208 B |
|
After Width: | Height: | Size: 208 B |
|
After Width: | Height: | Size: 203 B |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
|
@ -0,0 +1,650 @@
|
|||
/*! jQuery UI - v1.10.4 - 2014-02-04
|
||||
* http://jqueryui.com
|
||||
* Includes: jquery.ui.core.css, jquery.ui.datepicker.css, jquery.ui.theme.css
|
||||
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=%22Open%20Sans%22%2C%E2%80%8B%20sans-serif&fwDefault=normal&fsDefault=13px&cornerRadius=0&bgColorHeader=%23ffffff&bgTextureHeader=highlight_soft&bgImgOpacityHeader=0&borderColorHeader=%23ffffff&fcHeader=%23222222&iconColorHeader=%23DDDDDD&bgColorContent=%23ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=%23E1E1E1&fcContent=%23222222&iconColorContent=%23222222&bgColorDefault=%23F9F9F9&bgTextureDefault=flat&bgImgOpacityDefault=0&borderColorDefault=%23F0F0F0&fcDefault=%23444444&iconColorDefault=%23444444&bgColorHover=%23F0F0F0&bgTextureHover=flat&bgImgOpacityHover=0&borderColorHover=%23E1E1E1&fcHover=%23444444&iconColorHover=%232EA2CC&bgColorActive=%232EA2CC&bgTextureActive=flat&bgImgOpacityActive=0&borderColorActive=%230074A2&fcActive=%23ffffff&iconColorActive=%23ffffff&bgColorHighlight=%23ffffff&bgTextureHighlight=flat&bgImgOpacityHighlight=0&borderColorHighlight=%23aaaaaa&fcHighlight=%23444444&iconColorHighlight=%23444444&bgColorError=%23E14D43&bgTextureError=flat&bgImgOpacityError=0&borderColorError=%23D02A21&fcError=%23ffffff&iconColorError=%23ffffff&bgColorOverlay=%23aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=%23aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
|
||||
* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
|
||||
|
||||
/* Layout helpers
|
||||
----------------------------------*/
|
||||
.ui-helper-hidden {
|
||||
display: none;
|
||||
}
|
||||
.ui-helper-hidden-accessible {
|
||||
border: 0;
|
||||
clip: rect(0 0 0 0);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
}
|
||||
.ui-helper-reset {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
line-height: 1.3;
|
||||
text-decoration: none;
|
||||
font-size: 100%;
|
||||
list-style: none;
|
||||
}
|
||||
.ui-helper-clearfix:before,
|
||||
.ui-helper-clearfix:after {
|
||||
content: "";
|
||||
display: table;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.ui-helper-clearfix:after {
|
||||
clear: both;
|
||||
}
|
||||
.ui-helper-clearfix {
|
||||
min-height: 0; /* support: IE7 */
|
||||
}
|
||||
.ui-helper-zfix {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
filter:Alpha(Opacity=0);
|
||||
}
|
||||
|
||||
.ui-front {
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-disabled {
|
||||
cursor: default !important;
|
||||
}
|
||||
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.ui-icon {
|
||||
display: block;
|
||||
text-indent: -99999px;
|
||||
overflow: hidden;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.ui-datepicker {
|
||||
width: 17em;
|
||||
padding: .2em .2em 0;
|
||||
display: none;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-header {
|
||||
position: relative;
|
||||
padding: .2em 0;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev,
|
||||
.ui-datepicker .ui-datepicker-next {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
width: 1.8em;
|
||||
height: 1.8em;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev-hover,
|
||||
.ui-datepicker .ui-datepicker-next-hover {
|
||||
top: 1px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev {
|
||||
left: 2px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-next {
|
||||
right: 2px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev-hover {
|
||||
left: 1px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-next-hover {
|
||||
right: 1px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev span,
|
||||
.ui-datepicker .ui-datepicker-next span {
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
margin-left: -8px;
|
||||
top: 50%;
|
||||
margin-top: -8px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-title {
|
||||
margin: 0 2.3em;
|
||||
line-height: 1.8em;
|
||||
text-align: center;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-title select {
|
||||
font-size: 1em;
|
||||
margin: 1px 0;
|
||||
}
|
||||
.ui-datepicker select.ui-datepicker-month,
|
||||
.ui-datepicker select.ui-datepicker-year {
|
||||
width: 49%;
|
||||
}
|
||||
.ui-datepicker table {
|
||||
width: 100%;
|
||||
font-size: .9em;
|
||||
border-collapse: collapse;
|
||||
margin: 0 0 .4em;
|
||||
}
|
||||
.ui-datepicker th {
|
||||
padding: .7em .3em;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
border: 0;
|
||||
}
|
||||
.ui-datepicker td {
|
||||
border: 0;
|
||||
padding: 1px;
|
||||
}
|
||||
.ui-datepicker td span,
|
||||
.ui-datepicker td a {
|
||||
display: block;
|
||||
padding: .2em;
|
||||
text-align: right;
|
||||
text-decoration: none;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-buttonpane {
|
||||
background-image: none;
|
||||
margin: .7em 0 0 0;
|
||||
padding: 0 .2em;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
border-bottom: 0;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-buttonpane button {
|
||||
float: right;
|
||||
margin: .5em .2em .4em;
|
||||
cursor: pointer;
|
||||
padding: .2em .6em .3em .6em;
|
||||
width: auto;
|
||||
overflow: visible;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
|
||||
float: left;
|
||||
}
|
||||
|
||||
/* with multiple calendars */
|
||||
.ui-datepicker.ui-datepicker-multi {
|
||||
width: auto;
|
||||
}
|
||||
.ui-datepicker-multi .ui-datepicker-group {
|
||||
float: left;
|
||||
}
|
||||
.ui-datepicker-multi .ui-datepicker-group table {
|
||||
width: 95%;
|
||||
margin: 0 auto .4em;
|
||||
}
|
||||
.ui-datepicker-multi-2 .ui-datepicker-group {
|
||||
width: 50%;
|
||||
}
|
||||
.ui-datepicker-multi-3 .ui-datepicker-group {
|
||||
width: 33.3%;
|
||||
}
|
||||
.ui-datepicker-multi-4 .ui-datepicker-group {
|
||||
width: 25%;
|
||||
}
|
||||
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
|
||||
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
|
||||
border-left-width: 0;
|
||||
}
|
||||
.ui-datepicker-multi .ui-datepicker-buttonpane {
|
||||
clear: left;
|
||||
}
|
||||
.ui-datepicker-row-break {
|
||||
clear: both;
|
||||
width: 100%;
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
/* RTL support */
|
||||
.ui-datepicker-rtl {
|
||||
direction: rtl;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-prev {
|
||||
right: 2px;
|
||||
left: auto;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-next {
|
||||
left: 2px;
|
||||
right: auto;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-prev:hover {
|
||||
right: 1px;
|
||||
left: auto;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-next:hover {
|
||||
left: 1px;
|
||||
right: auto;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane {
|
||||
clear: right;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
|
||||
float: left;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
|
||||
.ui-datepicker-rtl .ui-datepicker-group {
|
||||
float: right;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
|
||||
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
|
||||
border-right-width: 0;
|
||||
border-left-width: 1px;
|
||||
}
|
||||
|
||||
/* Component containers
|
||||
----------------------------------*/
|
||||
.acf-ui-datepicker .ui-widget {
|
||||
font-family: "Open Sans", sans-serif;
|
||||
font-size: 13px;
|
||||
}
|
||||
.acf-ui-datepicker .ui-widget .ui-widget {
|
||||
font-size: 1em;
|
||||
}
|
||||
.acf-ui-datepicker .ui-widget input,
|
||||
.acf-ui-datepicker .ui-widget select,
|
||||
.acf-ui-datepicker .ui-widget textarea,
|
||||
.acf-ui-datepicker .ui-widget button {
|
||||
font-family: "Open Sans", sans-serif;
|
||||
font-size: 1em;
|
||||
}
|
||||
.acf-ui-datepicker .ui-widget-content {
|
||||
border: 1px solid #E1E1E1;
|
||||
background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;
|
||||
color: #222222;
|
||||
}
|
||||
.acf-ui-datepicker .ui-widget-content a {
|
||||
color: #222222;
|
||||
}
|
||||
.acf-ui-datepicker .ui-widget-header {
|
||||
border: 1px solid #ffffff;
|
||||
background: #ffffff url(images/ui-bg_highlight-soft_0_ffffff_1x100.png) 50% 50% repeat-x;
|
||||
color: #222222;
|
||||
font-weight: bold;
|
||||
}
|
||||
.acf-ui-datepicker .ui-widget-header a {
|
||||
color: #222222;
|
||||
}
|
||||
|
||||
/* Interaction states
|
||||
----------------------------------*/
|
||||
.acf-ui-datepicker .ui-state-default,
|
||||
.acf-ui-datepicker .ui-widget-content .ui-state-default,
|
||||
.acf-ui-datepicker .ui-widget-header .ui-state-default {
|
||||
border: 1px solid #F0F0F0;
|
||||
background: #F9F9F9 url(images/ui-bg_flat_0_F9F9F9_40x100.png) 50% 50% repeat-x;
|
||||
font-weight: normal;
|
||||
color: #444444;
|
||||
}
|
||||
.acf-ui-datepicker .ui-state-default a,
|
||||
.acf-ui-datepicker .ui-state-default a:link,
|
||||
.acf-ui-datepicker .ui-state-default a:visited {
|
||||
color: #444444;
|
||||
text-decoration: none;
|
||||
}
|
||||
.acf-ui-datepicker .ui-state-hover,
|
||||
.acf-ui-datepicker .ui-widget-content .ui-state-hover,
|
||||
.acf-ui-datepicker .ui-widget-header .ui-state-hover,
|
||||
.acf-ui-datepicker .ui-state-focus,
|
||||
.acf-ui-datepicker .ui-widget-content .ui-state-focus,
|
||||
.acf-ui-datepicker .ui-widget-header .ui-state-focus {
|
||||
border: 1px solid #E1E1E1;
|
||||
background: #F0F0F0 url(images/ui-bg_flat_0_F0F0F0_40x100.png) 50% 50% repeat-x;
|
||||
font-weight: normal;
|
||||
color: #444444;
|
||||
}
|
||||
.acf-ui-datepicker .ui-state-hover a,
|
||||
.acf-ui-datepicker .ui-state-hover a:hover,
|
||||
.acf-ui-datepicker .ui-state-hover a:link,
|
||||
.acf-ui-datepicker .ui-state-hover a:visited,
|
||||
.acf-ui-datepicker .ui-state-focus a,
|
||||
.acf-ui-datepicker .ui-state-focus a:hover,
|
||||
.acf-ui-datepicker .ui-state-focus a:link,
|
||||
.acf-ui-datepicker .ui-state-focus a:visited {
|
||||
color: #444444;
|
||||
text-decoration: none;
|
||||
}
|
||||
.acf-ui-datepicker .ui-state-active,
|
||||
.acf-ui-datepicker .ui-widget-content .ui-state-active,
|
||||
.acf-ui-datepicker .ui-widget-header .ui-state-active {
|
||||
border: 1px solid #0074A2;
|
||||
background: #2EA2CC url(images/ui-bg_flat_0_2EA2CC_40x100.png) 50% 50% repeat-x;
|
||||
font-weight: normal;
|
||||
color: #ffffff;
|
||||
}
|
||||
.acf-ui-datepicker .ui-state-active a,
|
||||
.acf-ui-datepicker .ui-state-active a:link,
|
||||
.acf-ui-datepicker .ui-state-active a:visited {
|
||||
color: #ffffff;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.acf-ui-datepicker .ui-state-highlight,
|
||||
.acf-ui-datepicker .ui-widget-content .ui-state-highlight,
|
||||
.acf-ui-datepicker .ui-widget-header .ui-state-highlight {
|
||||
border: 1px solid #aaaaaa;
|
||||
background: #ffffff url(images/ui-bg_flat_0_ffffff_40x100.png) 50% 50% repeat-x;
|
||||
color: #444444;
|
||||
}
|
||||
.acf-ui-datepicker .ui-state-highlight a,
|
||||
.acf-ui-datepicker .ui-widget-content .ui-state-highlight a,
|
||||
.acf-ui-datepicker .ui-widget-header .ui-state-highlight a {
|
||||
color: #444444;
|
||||
}
|
||||
.acf-ui-datepicker .ui-state-error,
|
||||
.acf-ui-datepicker .ui-widget-content .ui-state-error,
|
||||
.acf-ui-datepicker .ui-widget-header .ui-state-error {
|
||||
border: 1px solid #D02A21;
|
||||
background: #E14D43 url(images/ui-bg_flat_0_E14D43_40x100.png) 50% 50% repeat-x;
|
||||
color: #ffffff;
|
||||
}
|
||||
.acf-ui-datepicker .ui-state-error a,
|
||||
.acf-ui-datepicker .ui-widget-content .ui-state-error a,
|
||||
.acf-ui-datepicker .ui-widget-header .ui-state-error a {
|
||||
color: #ffffff;
|
||||
}
|
||||
.acf-ui-datepicker .ui-state-error-text,
|
||||
.acf-ui-datepicker .ui-widget-content .ui-state-error-text,
|
||||
.acf-ui-datepicker .ui-widget-header .ui-state-error-text {
|
||||
color: #ffffff;
|
||||
}
|
||||
.acf-ui-datepicker .ui-priority-primary,
|
||||
.acf-ui-datepicker .ui-widget-content .ui-priority-primary,
|
||||
.acf-ui-datepicker .ui-widget-header .ui-priority-primary {
|
||||
font-weight: bold;
|
||||
}
|
||||
.acf-ui-datepicker .ui-priority-secondary,
|
||||
.acf-ui-datepicker .ui-widget-content .ui-priority-secondary,
|
||||
.acf-ui-datepicker .ui-widget-header .ui-priority-secondary {
|
||||
opacity: .7;
|
||||
filter:Alpha(Opacity=70);
|
||||
font-weight: normal;
|
||||
}
|
||||
.acf-ui-datepicker .ui-state-disabled,
|
||||
.acf-ui-datepicker .ui-widget-content .ui-state-disabled,
|
||||
.acf-ui-datepicker .ui-widget-header .ui-state-disabled {
|
||||
opacity: .35;
|
||||
filter:Alpha(Opacity=35);
|
||||
background-image: none;
|
||||
}
|
||||
.acf-ui-datepicker .ui-state-disabled .ui-icon {
|
||||
filter:Alpha(Opacity=35); /* For IE8 - See #6059 */
|
||||
}
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.acf-ui-datepicker .ui-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
.acf-ui-datepicker .ui-icon,
|
||||
.acf-ui-datepicker .ui-widget-content .ui-icon {
|
||||
background-image: url(images/ui-icons_222222_256x240.png);
|
||||
}
|
||||
.acf-ui-datepicker .ui-widget-header .ui-icon {
|
||||
background-image: url(images/ui-icons_DDDDDD_256x240.png);
|
||||
}
|
||||
.acf-ui-datepicker .ui-state-default .ui-icon {
|
||||
background-image: url(images/ui-icons_444444_256x240.png);
|
||||
}
|
||||
.acf-ui-datepicker .ui-state-hover .ui-icon,
|
||||
.acf-ui-datepicker .ui-state-focus .ui-icon {
|
||||
background-image: url(images/ui-icons_2EA2CC_256x240.png);
|
||||
}
|
||||
.acf-ui-datepicker .ui-state-active .ui-icon {
|
||||
background-image: url(images/ui-icons_ffffff_256x240.png);
|
||||
}
|
||||
.acf-ui-datepicker .ui-state-highlight .ui-icon {
|
||||
background-image: url(images/ui-icons_444444_256x240.png);
|
||||
}
|
||||
.acf-ui-datepicker .ui-state-error .ui-icon,
|
||||
.acf-ui-datepicker .ui-state-error-text .ui-icon {
|
||||
background-image: url(images/ui-icons_ffffff_256x240.png);
|
||||
}
|
||||
|
||||
/* positioning */
|
||||
.acf-ui-datepicker .ui-icon-blank { background-position: 16px 16px; }
|
||||
.acf-ui-datepicker .ui-icon-carat-1-n { background-position: 0 0; }
|
||||
.acf-ui-datepicker .ui-icon-carat-1-ne { background-position: -16px 0; }
|
||||
.acf-ui-datepicker .ui-icon-carat-1-e { background-position: -32px 0; }
|
||||
.acf-ui-datepicker .ui-icon-carat-1-se { background-position: -48px 0; }
|
||||
.acf-ui-datepicker .ui-icon-carat-1-s { background-position: -64px 0; }
|
||||
.acf-ui-datepicker .ui-icon-carat-1-sw { background-position: -80px 0; }
|
||||
.acf-ui-datepicker .ui-icon-carat-1-w { background-position: -96px 0; }
|
||||
.acf-ui-datepicker .ui-icon-carat-1-nw { background-position: -112px 0; }
|
||||
.acf-ui-datepicker .ui-icon-carat-2-n-s { background-position: -128px 0; }
|
||||
.acf-ui-datepicker .ui-icon-carat-2-e-w { background-position: -144px 0; }
|
||||
.acf-ui-datepicker .ui-icon-triangle-1-n { background-position: 0 -16px; }
|
||||
.acf-ui-datepicker .ui-icon-triangle-1-ne { background-position: -16px -16px; }
|
||||
.acf-ui-datepicker .ui-icon-triangle-1-e { background-position: -32px -16px; }
|
||||
.acf-ui-datepicker .ui-icon-triangle-1-se { background-position: -48px -16px; }
|
||||
.acf-ui-datepicker .ui-icon-triangle-1-s { background-position: -64px -16px; }
|
||||
.acf-ui-datepicker .ui-icon-triangle-1-sw { background-position: -80px -16px; }
|
||||
.acf-ui-datepicker .ui-icon-triangle-1-w { background-position: -96px -16px; }
|
||||
.acf-ui-datepicker .ui-icon-triangle-1-nw { background-position: -112px -16px; }
|
||||
.acf-ui-datepicker .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
|
||||
.acf-ui-datepicker .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
|
||||
.acf-ui-datepicker .ui-icon-arrow-1-n { background-position: 0 -32px; }
|
||||
.acf-ui-datepicker .ui-icon-arrow-1-ne { background-position: -16px -32px; }
|
||||
.acf-ui-datepicker .ui-icon-arrow-1-e { background-position: -32px -32px; }
|
||||
.acf-ui-datepicker .ui-icon-arrow-1-se { background-position: -48px -32px; }
|
||||
.acf-ui-datepicker .ui-icon-arrow-1-s { background-position: -64px -32px; }
|
||||
.acf-ui-datepicker .ui-icon-arrow-1-sw { background-position: -80px -32px; }
|
||||
.acf-ui-datepicker .ui-icon-arrow-1-w { background-position: -96px -32px; }
|
||||
.acf-ui-datepicker .ui-icon-arrow-1-nw { background-position: -112px -32px; }
|
||||
.acf-ui-datepicker .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
|
||||
.acf-ui-datepicker .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
|
||||
.acf-ui-datepicker .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
|
||||
.acf-ui-datepicker .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
|
||||
.acf-ui-datepicker .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
|
||||
.acf-ui-datepicker .ui-icon-arrow-4 { background-position: 0 -80px; }
|
||||
.acf-ui-datepicker .ui-icon-arrow-4-diag { background-position: -16px -80px; }
|
||||
.acf-ui-datepicker .ui-icon-extlink { background-position: -32px -80px; }
|
||||
.acf-ui-datepicker .ui-icon-newwin { background-position: -48px -80px; }
|
||||
.acf-ui-datepicker .ui-icon-refresh { background-position: -64px -80px; }
|
||||
.acf-ui-datepicker .ui-icon-shuffle { background-position: -80px -80px; }
|
||||
.acf-ui-datepicker .ui-icon-transfer-e-w { background-position: -96px -80px; }
|
||||
.acf-ui-datepicker .ui-icon-transferthick-e-w { background-position: -112px -80px; }
|
||||
.acf-ui-datepicker .ui-icon-folder-collapsed { background-position: 0 -96px; }
|
||||
.acf-ui-datepicker .ui-icon-folder-open { background-position: -16px -96px; }
|
||||
.acf-ui-datepicker .ui-icon-document { background-position: -32px -96px; }
|
||||
.acf-ui-datepicker .ui-icon-document-b { background-position: -48px -96px; }
|
||||
.acf-ui-datepicker .ui-icon-note { background-position: -64px -96px; }
|
||||
.acf-ui-datepicker .ui-icon-mail-closed { background-position: -80px -96px; }
|
||||
.acf-ui-datepicker .ui-icon-mail-open { background-position: -96px -96px; }
|
||||
.acf-ui-datepicker .ui-icon-suitcase { background-position: -112px -96px; }
|
||||
.acf-ui-datepicker .ui-icon-comment { background-position: -128px -96px; }
|
||||
.acf-ui-datepicker .ui-icon-person { background-position: -144px -96px; }
|
||||
.acf-ui-datepicker .ui-icon-print { background-position: -160px -96px; }
|
||||
.acf-ui-datepicker .ui-icon-trash { background-position: -176px -96px; }
|
||||
.acf-ui-datepicker .ui-icon-locked { background-position: -192px -96px; }
|
||||
.acf-ui-datepicker .ui-icon-unlocked { background-position: -208px -96px; }
|
||||
.acf-ui-datepicker .ui-icon-bookmark { background-position: -224px -96px; }
|
||||
.acf-ui-datepicker .ui-icon-tag { background-position: -240px -96px; }
|
||||
.acf-ui-datepicker .ui-icon-home { background-position: 0 -112px; }
|
||||
.acf-ui-datepicker .ui-icon-flag { background-position: -16px -112px; }
|
||||
.acf-ui-datepicker .ui-icon-calendar { background-position: -32px -112px; }
|
||||
.acf-ui-datepicker .ui-icon-cart { background-position: -48px -112px; }
|
||||
.acf-ui-datepicker .ui-icon-pencil { background-position: -64px -112px; }
|
||||
.acf-ui-datepicker .ui-icon-clock { background-position: -80px -112px; }
|
||||
.acf-ui-datepicker .ui-icon-disk { background-position: -96px -112px; }
|
||||
.acf-ui-datepicker .ui-icon-calculator { background-position: -112px -112px; }
|
||||
.acf-ui-datepicker .ui-icon-zoomin { background-position: -128px -112px; }
|
||||
.acf-ui-datepicker .ui-icon-zoomout { background-position: -144px -112px; }
|
||||
.acf-ui-datepicker .ui-icon-search { background-position: -160px -112px; }
|
||||
.acf-ui-datepicker .ui-icon-wrench { background-position: -176px -112px; }
|
||||
.acf-ui-datepicker .ui-icon-gear { background-position: -192px -112px; }
|
||||
.acf-ui-datepicker .ui-icon-heart { background-position: -208px -112px; }
|
||||
.acf-ui-datepicker .ui-icon-star { background-position: -224px -112px; }
|
||||
.acf-ui-datepicker .ui-icon-link { background-position: -240px -112px; }
|
||||
.acf-ui-datepicker .ui-icon-cancel { background-position: 0 -128px; }
|
||||
.acf-ui-datepicker .ui-icon-plus { background-position: -16px -128px; }
|
||||
.acf-ui-datepicker .ui-icon-plusthick { background-position: -32px -128px; }
|
||||
.acf-ui-datepicker .ui-icon-minus { background-position: -48px -128px; }
|
||||
.acf-ui-datepicker .ui-icon-minusthick { background-position: -64px -128px; }
|
||||
.acf-ui-datepicker .ui-icon-close { background-position: -80px -128px; }
|
||||
.acf-ui-datepicker .ui-icon-closethick { background-position: -96px -128px; }
|
||||
.acf-ui-datepicker .ui-icon-key { background-position: -112px -128px; }
|
||||
.acf-ui-datepicker .ui-icon-lightbulb { background-position: -128px -128px; }
|
||||
.acf-ui-datepicker .ui-icon-scissors { background-position: -144px -128px; }
|
||||
.acf-ui-datepicker .ui-icon-clipboard { background-position: -160px -128px; }
|
||||
.acf-ui-datepicker .ui-icon-copy { background-position: -176px -128px; }
|
||||
.acf-ui-datepicker .ui-icon-contact { background-position: -192px -128px; }
|
||||
.acf-ui-datepicker .ui-icon-image { background-position: -208px -128px; }
|
||||
.acf-ui-datepicker .ui-icon-video { background-position: -224px -128px; }
|
||||
.acf-ui-datepicker .ui-icon-script { background-position: -240px -128px; }
|
||||
.acf-ui-datepicker .ui-icon-alert { background-position: 0 -144px; }
|
||||
.acf-ui-datepicker .ui-icon-info { background-position: -16px -144px; }
|
||||
.acf-ui-datepicker .ui-icon-notice { background-position: -32px -144px; }
|
||||
.acf-ui-datepicker .ui-icon-help { background-position: -48px -144px; }
|
||||
.acf-ui-datepicker .ui-icon-check { background-position: -64px -144px; }
|
||||
.acf-ui-datepicker .ui-icon-bullet { background-position: -80px -144px; }
|
||||
.acf-ui-datepicker .ui-icon-radio-on { background-position: -96px -144px; }
|
||||
.acf-ui-datepicker .ui-icon-radio-off { background-position: -112px -144px; }
|
||||
.acf-ui-datepicker .ui-icon-pin-w { background-position: -128px -144px; }
|
||||
.acf-ui-datepicker .ui-icon-pin-s { background-position: -144px -144px; }
|
||||
.acf-ui-datepicker .ui-icon-play { background-position: 0 -160px; }
|
||||
.acf-ui-datepicker .ui-icon-pause { background-position: -16px -160px; }
|
||||
.acf-ui-datepicker .ui-icon-seek-next { background-position: -32px -160px; }
|
||||
.acf-ui-datepicker .ui-icon-seek-prev { background-position: -48px -160px; }
|
||||
.acf-ui-datepicker .ui-icon-seek-end { background-position: -64px -160px; }
|
||||
.acf-ui-datepicker .ui-icon-seek-start { background-position: -80px -160px; }
|
||||
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
|
||||
.acf-ui-datepicker .ui-icon-seek-first { background-position: -80px -160px; }
|
||||
.acf-ui-datepicker .ui-icon-stop { background-position: -96px -160px; }
|
||||
.acf-ui-datepicker .ui-icon-eject { background-position: -112px -160px; }
|
||||
.acf-ui-datepicker .ui-icon-volume-off { background-position: -128px -160px; }
|
||||
.acf-ui-datepicker .ui-icon-volume-on { background-position: -144px -160px; }
|
||||
.acf-ui-datepicker .ui-icon-power { background-position: 0 -176px; }
|
||||
.acf-ui-datepicker .ui-icon-signal-diag { background-position: -16px -176px; }
|
||||
.acf-ui-datepicker .ui-icon-signal { background-position: -32px -176px; }
|
||||
.acf-ui-datepicker .ui-icon-battery-0 { background-position: -48px -176px; }
|
||||
.acf-ui-datepicker .ui-icon-battery-1 { background-position: -64px -176px; }
|
||||
.acf-ui-datepicker .ui-icon-battery-2 { background-position: -80px -176px; }
|
||||
.acf-ui-datepicker .ui-icon-battery-3 { background-position: -96px -176px; }
|
||||
.acf-ui-datepicker .ui-icon-circle-plus { background-position: 0 -192px; }
|
||||
.acf-ui-datepicker .ui-icon-circle-minus { background-position: -16px -192px; }
|
||||
.acf-ui-datepicker .ui-icon-circle-close { background-position: -32px -192px; }
|
||||
.acf-ui-datepicker .ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
||||
.acf-ui-datepicker .ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
||||
.acf-ui-datepicker .ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
||||
.acf-ui-datepicker .ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
||||
.acf-ui-datepicker .ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
||||
.acf-ui-datepicker .ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
||||
.acf-ui-datepicker .ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
||||
.acf-ui-datepicker .ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
||||
.acf-ui-datepicker .ui-icon-circle-zoomin { background-position: -176px -192px; }
|
||||
.acf-ui-datepicker .ui-icon-circle-zoomout { background-position: -192px -192px; }
|
||||
.acf-ui-datepicker .ui-icon-circle-check { background-position: -208px -192px; }
|
||||
.acf-ui-datepicker .ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
||||
.acf-ui-datepicker .ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
||||
.acf-ui-datepicker .ui-icon-circlesmall-close { background-position: -32px -208px; }
|
||||
.acf-ui-datepicker .ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
||||
.acf-ui-datepicker .ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
||||
.acf-ui-datepicker .ui-icon-squaresmall-close { background-position: -80px -208px; }
|
||||
.acf-ui-datepicker .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
||||
.acf-ui-datepicker .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
||||
.acf-ui-datepicker .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
||||
.acf-ui-datepicker .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
||||
.acf-ui-datepicker .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
||||
.acf-ui-datepicker .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Corner radius */
|
||||
.acf-ui-datepicker .ui-corner-all,
|
||||
.acf-ui-datepicker .ui-corner-top,
|
||||
.acf-ui-datepicker .ui-corner-left,
|
||||
.acf-ui-datepicker .ui-corner-tl {
|
||||
border-top-left-radius: 0;
|
||||
}
|
||||
.acf-ui-datepicker .ui-corner-all,
|
||||
.acf-ui-datepicker .ui-corner-top,
|
||||
.acf-ui-datepicker .ui-corner-right,
|
||||
.acf-ui-datepicker .ui-corner-tr {
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
.acf-ui-datepicker .ui-corner-all,
|
||||
.acf-ui-datepicker .ui-corner-bottom,
|
||||
.acf-ui-datepicker .ui-corner-left,
|
||||
.acf-ui-datepicker .ui-corner-bl {
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.acf-ui-datepicker .ui-corner-all,
|
||||
.acf-ui-datepicker .ui-corner-bottom,
|
||||
.acf-ui-datepicker .ui-corner-right,
|
||||
.acf-ui-datepicker .ui-corner-br {
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
/* Overlays */
|
||||
.acf-ui-datepicker .ui-widget-overlay {
|
||||
background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
|
||||
opacity: .3;
|
||||
filter: Alpha(Opacity=30);
|
||||
}
|
||||
.acf-ui-datepicker .ui-widget-shadow {
|
||||
margin: -8px 0 0 -8px;
|
||||
padding: 8px;
|
||||
background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
|
||||
opacity: .3;
|
||||
filter: Alpha(Opacity=30);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
Contributing to Select2
|
||||
=======================
|
||||
Looking to contribute something to Select2? **Here's how you can help.**
|
||||
|
||||
Please take a moment to review this document in order to make the contribution
|
||||
process easy and effective for everyone involved.
|
||||
|
||||
Following these guidelines helps to communicate that you respect the time of
|
||||
the developers managing and developing this open source project. In return,
|
||||
they should reciprocate that respect in addressing your issue or assessing
|
||||
patches and features.
|
||||
|
||||
Using the issue tracker
|
||||
-----------------------
|
||||
When [reporting bugs][reporting-bugs] or
|
||||
[requesting features][requesting-features], the
|
||||
[issue tracker on GitHub][issue-tracker] is the recommended channel to use.
|
||||
|
||||
The issue tracker **is not** a place for support requests. The
|
||||
[mailing list][mailing-list] or [IRC channel][irc-channel] are better places to
|
||||
get help.
|
||||
|
||||
Reporting bugs with Select2
|
||||
---------------------------
|
||||
We really appreciate clear bug reports that _consistently_ show an issue
|
||||
_within Select2_.
|
||||
|
||||
The ideal bug report follows these guidelines:
|
||||
|
||||
1. **Use the [GitHub issue search][issue-search]** — Check if the issue
|
||||
has already been reported.
|
||||
2. **Check if the issue has been fixed** — Try to reproduce the problem
|
||||
using the code in the `master` branch.
|
||||
3. **Isolate the problem** — Try to create an
|
||||
[isolated test case][isolated-case] that consistently reproduces the problem.
|
||||
|
||||
Please try to be as detailed as possible in your bug report, especially if an
|
||||
isolated test case cannot be made. Some useful questions to include the answer
|
||||
to are:
|
||||
|
||||
- What steps can be used to reproduce the issue?
|
||||
- What is the bug and what is the expected outcome?
|
||||
- What browser(s) and Operating System have you tested with?
|
||||
- Does the bug happen consistently across all tested browsers?
|
||||
- What version of jQuery are you using? And what version of Select2?
|
||||
- Are you using Select2 with other plugins?
|
||||
|
||||
All of these questions will help people fix and identify any potential bugs.
|
||||
|
||||
Requesting features in Select2
|
||||
------------------------------
|
||||
Select2 is a large library that carries with it a lot of functionality. Because
|
||||
of this, many feature requests will not be implemented in the core library.
|
||||
|
||||
Before starting work on a major feature for Select2, **contact the
|
||||
[community][community] first** or you may risk spending a considerable amount of
|
||||
time on something which the project developers are not interested in bringing
|
||||
into the project.
|
||||
|
||||
### Select2 4.0
|
||||
|
||||
Many feature requests will be closed off until 4.0, where Select2 plans to adopt
|
||||
a more flexible API. If you are interested in helping with the development of
|
||||
the next major Select2 release, please send a message to the
|
||||
[mailing list][mailing-list] or [irc channel][irc-channel] for more information.
|
||||
|
||||
Triaging issues and pull requests
|
||||
---------------------------------
|
||||
Anyone can help the project maintainers triage issues and review pull requests.
|
||||
|
||||
### Handling new issues
|
||||
|
||||
Select2 regularly receives new issues which need to be tested and organized.
|
||||
|
||||
When a new issue that comes in that is similar to another existing issue, it
|
||||
should be checked to make sure it is not a duplicate. Duplicates issues should
|
||||
be marked by replying to the issue with "Duplicate of #[issue number]" where
|
||||
`[issue number]` is the url or issue number for the existing issue. This will
|
||||
allow the project maintainers to quickly close off additional issues and keep
|
||||
the discussion focused within a single issue.
|
||||
|
||||
If you can test issues that are reported to Select2 that contain test cases and
|
||||
confirm under what conditions bugs happen, that will allow others to identify
|
||||
what causes a bug quicker.
|
||||
|
||||
### Reviewing pull requests
|
||||
|
||||
It is very common for pull requests to be opened for issues that contain a clear
|
||||
solution to the problem. These pull requests should be rigorously reviewed by
|
||||
the community before being accepted. If you are not sure about a piece of
|
||||
submitted code, or know of a better way to do something, do not hesitate to make
|
||||
a comment on the pull request.
|
||||
|
||||
It should also be made clear that **all code contributed to Select** must be
|
||||
licensable under the [Apache 2 or GPL 2 licenses][licensing]. Code that cannot
|
||||
be released under either of these licenses **cannot be accepted** into the
|
||||
project.
|
||||
|
||||
[community]: https://github.com/ivaynberg/select2#community
|
||||
[reporting-bugs]: #reporting-bugs-with-select2
|
||||
[requesting-features]: #requesting-features-in-select2
|
||||
[issue-tracker]: https://github.com/ivaynberg/select2/issues
|
||||
[mailing-list]: https://github.com/ivaynberg/select2#mailing-list
|
||||
[irc-channel]: https://github.com/ivaynberg/select2#irc-channel
|
||||
[issue-search]: https://github.com/ivaynberg/select2/search?q=&type=Issues
|
||||
[isolated-case]: http://css-tricks.com/6263-reduced-test-cases/
|
||||
[licensing]: https://github.com/ivaynberg/select2#copyright-and-license
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
Copyright 2014 Igor Vaynberg
|
||||
|
||||
Version: @@ver@@ Timestamp: @@timestamp@@
|
||||
|
||||
This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
|
||||
General Public License version 2 (the "GPL License"). You may choose either license to govern your
|
||||
use of this software only upon the condition that you accept all of the terms of either the Apache
|
||||
License or the GPL License.
|
||||
|
||||
You may obtain a copy of the Apache License and the GPL License at:
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software distributed under the Apache License
|
||||
or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
either express or implied. See the Apache License and the GPL License for the specific language governing
|
||||
permissions and limitations under the Apache License and the GPL License.
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
Select2
|
||||
=======
|
||||
|
||||
Select2 is a jQuery-based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.
|
||||
|
||||
To get started, checkout examples and documentation at http://ivaynberg.github.com/select2
|
||||
|
||||
Use cases
|
||||
---------
|
||||
|
||||
* Enhancing native selects with search.
|
||||
* Enhancing native selects with a better multi-select interface.
|
||||
* Loading data from JavaScript: easily load items via ajax and have them searchable.
|
||||
* Nesting optgroups: native selects only support one level of nested. Select2 does not have this restriction.
|
||||
* Tagging: ability to add new items on the fly.
|
||||
* Working with large, remote datasets: ability to partially load a dataset based on the search term.
|
||||
* Paging of large datasets: easy support for loading more pages when the results are scrolled to the end.
|
||||
* Templating: support for custom rendering of results and selections.
|
||||
|
||||
Browser compatibility
|
||||
---------------------
|
||||
* IE 8+
|
||||
* Chrome 8+
|
||||
* Firefox 10+
|
||||
* Safari 3+
|
||||
* Opera 10.6+
|
||||
|
||||
Usage
|
||||
-----
|
||||
You can source Select2 directly from a CDN like [JSDliver](http://www.jsdelivr.com/#!select2) or [CDNJS](http://www.cdnjs.com/libraries/select2), [download it from this GitHub repo](https://github.com/ivaynberg/select2/tags), or use one of the integrations below.
|
||||
|
||||
Integrations
|
||||
------------
|
||||
|
||||
* [Wicket-Select2](https://github.com/ivaynberg/wicket-select2) (Java / [Apache Wicket](http://wicket.apache.org))
|
||||
* [select2-rails](https://github.com/argerim/select2-rails) (Ruby on Rails)
|
||||
* [AngularUI](http://angular-ui.github.io/#ui-select) ([AngularJS](https://angularjs.org/))
|
||||
* [Django](https://github.com/applegrew/django-select2)
|
||||
* [Symfony](https://github.com/19Gerhard85/sfSelect2WidgetsPlugin)
|
||||
* [Symfony2](https://github.com/avocode/FormExtensions)
|
||||
* [Bootstrap 2](https://github.com/t0m/select2-bootstrap-css) and [Bootstrap 3](https://github.com/t0m/select2-bootstrap-css/tree/bootstrap3) (CSS skins)
|
||||
* [Meteor](https://github.com/nate-strauser/meteor-select2) (modern reactive JavaScript framework; + [Bootstrap 3 skin](https://github.com/esperadomedia/meteor-select2-bootstrap3-css/))
|
||||
* [Meteor](https://jquery-select2.meteor.com)
|
||||
* [Yii 2.x](http://demos.krajee.com/widgets#select2)
|
||||
* [Yii 1.x](https://github.com/tonybolzan/yii-select2)
|
||||
* [AtmosphereJS](https://atmospherejs.com/package/jquery-select2)
|
||||
|
||||
### Example Integrations
|
||||
|
||||
* [Knockout.js](https://github.com/ivaynberg/select2/wiki/Knockout.js-Integration)
|
||||
* [Socket.IO](https://github.com/ivaynberg/select2/wiki/Socket.IO-Integration)
|
||||
* [PHP](https://github.com/ivaynberg/select2/wiki/PHP-Example)
|
||||
* [.Net MVC] (https://github.com/ivaynberg/select2/wiki/.Net-MVC-Example)
|
||||
|
||||
Internationalization (i18n)
|
||||
---------------------------
|
||||
|
||||
Select2 supports multiple languages by simply including the right language JS
|
||||
file (`select2_locale_it.js`, `select2_locale_nl.js`, etc.) after `select2.js`.
|
||||
|
||||
Missing a language? Just copy `select2_locale_en.js.template`, translate
|
||||
it, and make a pull request back to Select2 here on GitHub.
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
The documentation for Select2 is available [through GitHub Pages](https://ivaynberg.github.io/select2/) and is located within this repository in the [`gh-pages` branch](https://github.com/ivaynberg/select2/tree/gh-pages).
|
||||
|
||||
Community
|
||||
---------
|
||||
|
||||
### Bug tracker
|
||||
|
||||
Have a bug? Please create an issue here on GitHub!
|
||||
|
||||
https://github.com/ivaynberg/select2/issues
|
||||
|
||||
### Mailing list
|
||||
|
||||
Have a question? Ask on our mailing list!
|
||||
|
||||
select2@googlegroups.com
|
||||
|
||||
https://groups.google.com/d/forum/select2
|
||||
|
||||
### IRC channel
|
||||
|
||||
Need help implementing Select2 in your project? Ask in our IRC channel!
|
||||
|
||||
**Network:** [Freenode](https://freenode.net/) (`chat.freenode.net`)
|
||||
|
||||
**Channel:** `#select2`
|
||||
|
||||
**Web access:** https://webchat.freenode.net/?channels=select2
|
||||
|
||||
Copyright and license
|
||||
---------------------
|
||||
|
||||
Copyright 2012 Igor Vaynberg
|
||||
|
||||
This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
|
||||
General Public License version 2 (the "GPL License"). You may choose either license to govern your
|
||||
use of this software only upon the condition that you accept all of the terms of either the Apache
|
||||
License or the GPL License.
|
||||
|
||||
You may obtain a copy of the Apache License and the GPL License in the LICENSE file, or at:
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software distributed under the Apache License
|
||||
or the GPL License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
either express or implied. See the Apache License and the GPL License for the specific language governing
|
||||
permissions and limitations under the Apache License and the GPL License.
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"name": "select2",
|
||||
"version": "3.5.2",
|
||||
"main": ["select2.js", "select2.css", "select2.png", "select2x2.png", "select2-spinner.gif"],
|
||||
"dependencies": {
|
||||
"jquery": ">= 1.7.1"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
{
|
||||
"name": "select2",
|
||||
"repo": "ivaynberg/select2",
|
||||
"description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
|
||||
"version": "3.5.2",
|
||||
"demo": "http://ivaynberg.github.io/select2/",
|
||||
"keywords": [
|
||||
"jquery"
|
||||
],
|
||||
"main": "select2.js",
|
||||
"styles": [
|
||||
"select2.css",
|
||||
"select2-bootstrap.css"
|
||||
],
|
||||
"scripts": [
|
||||
"select2.js",
|
||||
"select2_locale_ar.js",
|
||||
"select2_locale_bg.js",
|
||||
"select2_locale_ca.js",
|
||||
"select2_locale_cs.js",
|
||||
"select2_locale_da.js",
|
||||
"select2_locale_de.js",
|
||||
"select2_locale_el.js",
|
||||
"select2_locale_es.js",
|
||||
"select2_locale_et.js",
|
||||
"select2_locale_eu.js",
|
||||
"select2_locale_fa.js",
|
||||
"select2_locale_fi.js",
|
||||
"select2_locale_fr.js",
|
||||
"select2_locale_gl.js",
|
||||
"select2_locale_he.js",
|
||||
"select2_locale_hr.js",
|
||||
"select2_locale_hu.js",
|
||||
"select2_locale_id.js",
|
||||
"select2_locale_is.js",
|
||||
"select2_locale_it.js",
|
||||
"select2_locale_ja.js",
|
||||
"select2_locale_ka.js",
|
||||
"select2_locale_ko.js",
|
||||
"select2_locale_lt.js",
|
||||
"select2_locale_lv.js",
|
||||
"select2_locale_mk.js",
|
||||
"select2_locale_ms.js",
|
||||
"select2_locale_nl.js",
|
||||
"select2_locale_no.js",
|
||||
"select2_locale_pl.js",
|
||||
"select2_locale_pt-BR.js",
|
||||
"select2_locale_pt-PT.js",
|
||||
"select2_locale_ro.js",
|
||||
"select2_locale_ru.js",
|
||||
"select2_locale_sk.js",
|
||||
"select2_locale_sv.js",
|
||||
"select2_locale_th.js",
|
||||
"select2_locale_tr.js",
|
||||
"select2_locale_uk.js",
|
||||
"select2_locale_vi.js",
|
||||
"select2_locale_zh-CN.js",
|
||||
"select2_locale_zh-TW.js"
|
||||
],
|
||||
"images": [
|
||||
"select2-spinner.gif",
|
||||
"select2.png",
|
||||
"select2x2.png"
|
||||
],
|
||||
"license": "MIT"
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"name":
|
||||
"ivaynberg/select2",
|
||||
"description": "Select2 is a jQuery based replacement for select boxes.",
|
||||
"version": "3.5.2",
|
||||
"type": "component",
|
||||
"homepage": "http://ivaynberg.github.io/select2/",
|
||||
"license": "Apache-2.0",
|
||||
"require": {
|
||||
"robloach/component-installer": "*",
|
||||
"components/jquery": ">=1.7.1"
|
||||
},
|
||||
"extra": {
|
||||
"component": {
|
||||
"scripts": [
|
||||
"select2.js"
|
||||
],
|
||||
"files": [
|
||||
"select2.js",
|
||||
"select2_locale_*.js",
|
||||
"select2.css",
|
||||
"select2-bootstrap.css",
|
||||
"select2-spinner.gif",
|
||||
"select2.png",
|
||||
"select2x2.png"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"name" : "Select2",
|
||||
"description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
|
||||
"homepage": "http://ivaynberg.github.io/select2",
|
||||
"author": "Igor Vaynberg",
|
||||
"repository": {"type": "git", "url": "git://github.com/ivaynberg/select2.git"},
|
||||
"main": "select2.js",
|
||||
"version": "3.5.2",
|
||||
"jspm": {
|
||||
"main": "select2",
|
||||
"files": ["select2.js", "select2.png", "select2.css", "select2-spinner.gif"],
|
||||
"shim": {
|
||||
"select2": {
|
||||
"imports": ["jquery", "./select2.css!"],
|
||||
"exports": "$"
|
||||
}
|
||||
},
|
||||
"buildConfig": { "uglify": true }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo -n "Enter the version for this release: "
|
||||
|
||||
read ver
|
||||
|
||||
if [ ! $ver ]; then
|
||||
echo "Invalid version."
|
||||
exit
|
||||
fi
|
||||
|
||||
name="select2"
|
||||
js="$name.js"
|
||||
mini="$name.min.js"
|
||||
css="$name.css"
|
||||
release="$name-$ver"
|
||||
tag="$ver"
|
||||
branch="build-$ver"
|
||||
curbranch=`git branch | grep "*" | sed "s/* //"`
|
||||
timestamp=$(date)
|
||||
tokens="s/@@ver@@/$ver/g;s/\@@timestamp@@/$timestamp/g"
|
||||
remote="origin"
|
||||
|
||||
echo "Pulling from origin"
|
||||
|
||||
git pull
|
||||
|
||||
echo "Updating Version Identifiers"
|
||||
|
||||
sed -E -e "s/\"version\": \"([0-9\.]+)\",/\"version\": \"$ver\",/g" -i -- bower.json select2.jquery.json component.json composer.json package.json
|
||||
|
||||
git add bower.json
|
||||
git add select2.jquery.json
|
||||
git add component.json
|
||||
git add composer.json
|
||||
git add package.json
|
||||
|
||||
git commit -m "modified version identifiers in descriptors for release $ver"
|
||||
git push
|
||||
|
||||
git branch "$branch"
|
||||
git checkout "$branch"
|
||||
|
||||
echo "Tokenizing..."
|
||||
|
||||
find . -name "$js" | xargs -I{} sed -e "$tokens" -i -- {}
|
||||
find . -name "$css" | xargs -I{} sed -e "$tokens" -i -- {}
|
||||
|
||||
sed -e "s/latest/$ver/g" -i -- bower.json
|
||||
|
||||
git add "$js"
|
||||
git add "$css"
|
||||
|
||||
echo "Minifying..."
|
||||
|
||||
echo "/*" > "$mini"
|
||||
cat LICENSE | sed "$tokens" >> "$mini"
|
||||
echo "*/" >> "$mini"
|
||||
|
||||
curl -s \
|
||||
--data-urlencode "js_code@$js" \
|
||||
http://marijnhaverbeke.nl/uglifyjs \
|
||||
>> "$mini"
|
||||
|
||||
git add "$mini"
|
||||
|
||||
git commit -m "release $ver"
|
||||
|
||||
echo "Tagging..."
|
||||
git tag -a "$tag" -m "tagged version $ver"
|
||||
git push "$remote" --tags
|
||||
|
||||
echo "Cleaning Up..."
|
||||
|
||||
git checkout "$curbranch"
|
||||
git branch -D "$branch"
|
||||
|
||||
echo "Done"
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
.form-control .select2-choice {
|
||||
border: 0;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.form-control .select2-choice .select2-arrow {
|
||||
border-radius: 0 2px 2px 0;
|
||||
}
|
||||
|
||||
.form-control.select2-container {
|
||||
height: auto !important;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.form-control.select2-container.select2-dropdown-open {
|
||||
border-color: #5897FB;
|
||||
border-radius: 3px 3px 0 0;
|
||||
}
|
||||
|
||||
.form-control .select2-container.select2-dropdown-open .select2-choices {
|
||||
border-radius: 3px 3px 0 0;
|
||||
}
|
||||
|
||||
.form-control.select2-container .select2-choices {
|
||||
border: 0 !important;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.control-group.warning .select2-container .select2-choice,
|
||||
.control-group.warning .select2-container .select2-choices,
|
||||
.control-group.warning .select2-container-active .select2-choice,
|
||||
.control-group.warning .select2-container-active .select2-choices,
|
||||
.control-group.warning .select2-dropdown-open.select2-drop-above .select2-choice,
|
||||
.control-group.warning .select2-dropdown-open.select2-drop-above .select2-choices,
|
||||
.control-group.warning .select2-container-multi.select2-container-active .select2-choices {
|
||||
border: 1px solid #C09853 !important;
|
||||
}
|
||||
|
||||
.control-group.warning .select2-container .select2-choice div {
|
||||
border-left: 1px solid #C09853 !important;
|
||||
background: #FCF8E3 !important;
|
||||
}
|
||||
|
||||
.control-group.error .select2-container .select2-choice,
|
||||
.control-group.error .select2-container .select2-choices,
|
||||
.control-group.error .select2-container-active .select2-choice,
|
||||
.control-group.error .select2-container-active .select2-choices,
|
||||
.control-group.error .select2-dropdown-open.select2-drop-above .select2-choice,
|
||||
.control-group.error .select2-dropdown-open.select2-drop-above .select2-choices,
|
||||
.control-group.error .select2-container-multi.select2-container-active .select2-choices {
|
||||
border: 1px solid #B94A48 !important;
|
||||
}
|
||||
|
||||
.control-group.error .select2-container .select2-choice div {
|
||||
border-left: 1px solid #B94A48 !important;
|
||||
background: #F2DEDE !important;
|
||||
}
|
||||
|
||||
.control-group.info .select2-container .select2-choice,
|
||||
.control-group.info .select2-container .select2-choices,
|
||||
.control-group.info .select2-container-active .select2-choice,
|
||||
.control-group.info .select2-container-active .select2-choices,
|
||||
.control-group.info .select2-dropdown-open.select2-drop-above .select2-choice,
|
||||
.control-group.info .select2-dropdown-open.select2-drop-above .select2-choices,
|
||||
.control-group.info .select2-container-multi.select2-container-active .select2-choices {
|
||||
border: 1px solid #3A87AD !important;
|
||||
}
|
||||
|
||||
.control-group.info .select2-container .select2-choice div {
|
||||
border-left: 1px solid #3A87AD !important;
|
||||
background: #D9EDF7 !important;
|
||||
}
|
||||
|
||||
.control-group.success .select2-container .select2-choice,
|
||||
.control-group.success .select2-container .select2-choices,
|
||||
.control-group.success .select2-container-active .select2-choice,
|
||||
.control-group.success .select2-container-active .select2-choices,
|
||||
.control-group.success .select2-dropdown-open.select2-drop-above .select2-choice,
|
||||
.control-group.success .select2-dropdown-open.select2-drop-above .select2-choices,
|
||||
.control-group.success .select2-container-multi.select2-container-active .select2-choices {
|
||||
border: 1px solid #468847 !important;
|
||||
}
|
||||
|
||||
.control-group.success .select2-container .select2-choice div {
|
||||
border-left: 1px solid #468847 !important;
|
||||
background: #DFF0D8 !important;
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
|
|
@ -0,0 +1,704 @@
|
|||
/*
|
||||
Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014
|
||||
*/
|
||||
.select2-container {
|
||||
margin: 0;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
/* inline-block for ie7 */
|
||||
zoom: 1;
|
||||
*display: inline;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.select2-container,
|
||||
.select2-drop,
|
||||
.select2-search,
|
||||
.select2-search input {
|
||||
/*
|
||||
Force border-box so that % widths fit the parent
|
||||
container without overlap because of margin/padding.
|
||||
More Info : http://www.quirksmode.org/css/box.html
|
||||
*/
|
||||
-webkit-box-sizing: border-box; /* webkit */
|
||||
-moz-box-sizing: border-box; /* firefox */
|
||||
box-sizing: border-box; /* css3 */
|
||||
}
|
||||
|
||||
.select2-container .select2-choice {
|
||||
display: block;
|
||||
height: 26px;
|
||||
padding: 0 0 0 8px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
border: 1px solid #aaa;
|
||||
white-space: nowrap;
|
||||
line-height: 26px;
|
||||
color: #444;
|
||||
text-decoration: none;
|
||||
|
||||
border-radius: 4px;
|
||||
|
||||
background-clip: padding-box;
|
||||
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
|
||||
background-color: #fff;
|
||||
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.5, #fff));
|
||||
background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 50%);
|
||||
background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 50%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0);
|
||||
background-image: linear-gradient(to top, #eee 0%, #fff 50%);
|
||||
}
|
||||
|
||||
html[dir="rtl"] .select2-container .select2-choice {
|
||||
padding: 0 8px 0 0;
|
||||
}
|
||||
|
||||
.select2-container.select2-drop-above .select2-choice {
|
||||
border-bottom-color: #aaa;
|
||||
|
||||
border-radius: 0 0 4px 4px;
|
||||
|
||||
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.9, #fff));
|
||||
background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 90%);
|
||||
background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 90%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0);
|
||||
background-image: linear-gradient(to bottom, #eee 0%, #fff 90%);
|
||||
}
|
||||
|
||||
.select2-container.select2-allowclear .select2-choice .select2-chosen {
|
||||
margin-right: 42px;
|
||||
}
|
||||
|
||||
.select2-container .select2-choice > .select2-chosen {
|
||||
margin-right: 26px;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
|
||||
white-space: nowrap;
|
||||
|
||||
text-overflow: ellipsis;
|
||||
float: none;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
html[dir="rtl"] .select2-container .select2-choice > .select2-chosen {
|
||||
margin-left: 26px;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.select2-container .select2-choice abbr {
|
||||
display: none;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
position: absolute;
|
||||
right: 24px;
|
||||
top: 8px;
|
||||
|
||||
font-size: 1px;
|
||||
text-decoration: none;
|
||||
|
||||
border: 0;
|
||||
background: url('select2.png') right top no-repeat;
|
||||
cursor: pointer;
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
.select2-container.select2-allowclear .select2-choice abbr {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.select2-container .select2-choice abbr:hover {
|
||||
background-position: right -11px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.select2-drop-mask {
|
||||
border: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
min-height: 100%;
|
||||
min-width: 100%;
|
||||
height: auto;
|
||||
width: auto;
|
||||
opacity: 0;
|
||||
z-index: 9998;
|
||||
/* styles required for IE to work */
|
||||
background-color: #fff;
|
||||
filter: alpha(opacity=0);
|
||||
}
|
||||
|
||||
.select2-drop {
|
||||
width: 100%;
|
||||
margin-top: -1px;
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
top: 100%;
|
||||
|
||||
background: #fff;
|
||||
color: #000;
|
||||
border: 1px solid #aaa;
|
||||
border-top: 0;
|
||||
|
||||
border-radius: 0 0 4px 4px;
|
||||
|
||||
-webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
|
||||
box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
|
||||
}
|
||||
|
||||
.select2-drop.select2-drop-above {
|
||||
margin-top: 1px;
|
||||
border-top: 1px solid #aaa;
|
||||
border-bottom: 0;
|
||||
|
||||
border-radius: 4px 4px 0 0;
|
||||
|
||||
-webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
|
||||
box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
|
||||
}
|
||||
|
||||
.select2-drop-active {
|
||||
border: 1px solid #5897fb;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.select2-drop.select2-drop-above.select2-drop-active {
|
||||
border-top: 1px solid #5897fb;
|
||||
}
|
||||
|
||||
.select2-drop-auto-width {
|
||||
border-top: 1px solid #aaa;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.select2-drop-auto-width .select2-search {
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
.select2-container .select2-choice .select2-arrow {
|
||||
display: inline-block;
|
||||
width: 18px;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
|
||||
border-left: 1px solid #aaa;
|
||||
border-radius: 0 4px 4px 0;
|
||||
|
||||
background-clip: padding-box;
|
||||
|
||||
background: #ccc;
|
||||
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
|
||||
background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
|
||||
background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0);
|
||||
background-image: linear-gradient(to top, #ccc 0%, #eee 60%);
|
||||
}
|
||||
|
||||
html[dir="rtl"] .select2-container .select2-choice .select2-arrow {
|
||||
left: 0;
|
||||
right: auto;
|
||||
|
||||
border-left: none;
|
||||
border-right: 1px solid #aaa;
|
||||
border-radius: 4px 0 0 4px;
|
||||
}
|
||||
|
||||
.select2-container .select2-choice .select2-arrow b {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: url('select2.png') no-repeat 0 1px;
|
||||
}
|
||||
|
||||
html[dir="rtl"] .select2-container .select2-choice .select2-arrow b {
|
||||
background-position: 2px 1px;
|
||||
}
|
||||
|
||||
.select2-search {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
min-height: 26px;
|
||||
margin: 0;
|
||||
padding-left: 4px;
|
||||
padding-right: 4px;
|
||||
|
||||
position: relative;
|
||||
z-index: 10000;
|
||||
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.select2-search input {
|
||||
width: 100%;
|
||||
height: auto !important;
|
||||
min-height: 26px;
|
||||
padding: 4px 20px 4px 5px;
|
||||
margin: 0;
|
||||
|
||||
outline: 0;
|
||||
font-family: sans-serif;
|
||||
font-size: 1em;
|
||||
|
||||
border: 1px solid #aaa;
|
||||
border-radius: 0;
|
||||
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
|
||||
background: #fff url('select2.png') no-repeat 100% -22px;
|
||||
background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
|
||||
background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
|
||||
background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
|
||||
background: url('select2.png') no-repeat 100% -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
|
||||
}
|
||||
|
||||
html[dir="rtl"] .select2-search input {
|
||||
padding: 4px 5px 4px 20px;
|
||||
|
||||
background: #fff url('select2.png') no-repeat -37px -22px;
|
||||
background: url('select2.png') no-repeat -37px -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
|
||||
background: url('select2.png') no-repeat -37px -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
|
||||
background: url('select2.png') no-repeat -37px -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
|
||||
background: url('select2.png') no-repeat -37px -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
|
||||
}
|
||||
|
||||
.select2-drop.select2-drop-above .select2-search input {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.select2-search input.select2-active {
|
||||
background: #fff url('select2-spinner.gif') no-repeat 100%;
|
||||
background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
|
||||
background: url('select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
|
||||
background: url('select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
|
||||
background: url('select2-spinner.gif') no-repeat 100%, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
|
||||
}
|
||||
|
||||
.select2-container-active .select2-choice,
|
||||
.select2-container-active .select2-choices {
|
||||
border: 1px solid #5897fb;
|
||||
outline: none;
|
||||
|
||||
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
|
||||
box-shadow: 0 0 5px rgba(0, 0, 0, .3);
|
||||
}
|
||||
|
||||
.select2-dropdown-open .select2-choice {
|
||||
border-bottom-color: transparent;
|
||||
-webkit-box-shadow: 0 1px 0 #fff inset;
|
||||
box-shadow: 0 1px 0 #fff inset;
|
||||
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
|
||||
background-color: #eee;
|
||||
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #fff), color-stop(0.5, #eee));
|
||||
background-image: -webkit-linear-gradient(center bottom, #fff 0%, #eee 50%);
|
||||
background-image: -moz-linear-gradient(center bottom, #fff 0%, #eee 50%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);
|
||||
background-image: linear-gradient(to top, #fff 0%, #eee 50%);
|
||||
}
|
||||
|
||||
.select2-dropdown-open.select2-drop-above .select2-choice,
|
||||
.select2-dropdown-open.select2-drop-above .select2-choices {
|
||||
border: 1px solid #5897fb;
|
||||
border-top-color: transparent;
|
||||
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(0.5, #eee));
|
||||
background-image: -webkit-linear-gradient(center top, #fff 0%, #eee 50%);
|
||||
background-image: -moz-linear-gradient(center top, #fff 0%, #eee 50%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);
|
||||
background-image: linear-gradient(to bottom, #fff 0%, #eee 50%);
|
||||
}
|
||||
|
||||
.select2-dropdown-open .select2-choice .select2-arrow {
|
||||
background: transparent;
|
||||
border-left: none;
|
||||
filter: none;
|
||||
}
|
||||
html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.select2-dropdown-open .select2-choice .select2-arrow b {
|
||||
background-position: -18px 1px;
|
||||
}
|
||||
|
||||
html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow b {
|
||||
background-position: -16px 1px;
|
||||
}
|
||||
|
||||
.select2-hidden-accessible {
|
||||
border: 0;
|
||||
clip: rect(0 0 0 0);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
/* results */
|
||||
.select2-results {
|
||||
max-height: 200px;
|
||||
padding: 0 0 0 4px;
|
||||
margin: 4px 4px 4px 0;
|
||||
position: relative;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
html[dir="rtl"] .select2-results {
|
||||
padding: 0 4px 0 0;
|
||||
margin: 4px 0 4px 4px;
|
||||
}
|
||||
|
||||
.select2-results ul.select2-result-sub {
|
||||
margin: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.select2-results li {
|
||||
list-style: none;
|
||||
display: list-item;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
.select2-results li.select2-result-with-children > .select2-result-label {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.select2-results .select2-result-label {
|
||||
padding: 3px 7px 4px;
|
||||
margin: 0;
|
||||
cursor: pointer;
|
||||
|
||||
min-height: 1em;
|
||||
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.select2-results-dept-1 .select2-result-label { padding-left: 20px }
|
||||
.select2-results-dept-2 .select2-result-label { padding-left: 40px }
|
||||
.select2-results-dept-3 .select2-result-label { padding-left: 60px }
|
||||
.select2-results-dept-4 .select2-result-label { padding-left: 80px }
|
||||
.select2-results-dept-5 .select2-result-label { padding-left: 100px }
|
||||
.select2-results-dept-6 .select2-result-label { padding-left: 110px }
|
||||
.select2-results-dept-7 .select2-result-label { padding-left: 120px }
|
||||
|
||||
.select2-results .select2-highlighted {
|
||||
background: #3875d7;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.select2-results li em {
|
||||
background: #feffde;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.select2-results .select2-highlighted em {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.select2-results .select2-highlighted ul {
|
||||
background: #fff;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.select2-results .select2-no-results,
|
||||
.select2-results .select2-searching,
|
||||
.select2-results .select2-ajax-error,
|
||||
.select2-results .select2-selection-limit {
|
||||
background: #f4f4f4;
|
||||
display: list-item;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
/*
|
||||
disabled look for disabled choices in the results dropdown
|
||||
*/
|
||||
.select2-results .select2-disabled.select2-highlighted {
|
||||
color: #666;
|
||||
background: #f4f4f4;
|
||||
display: list-item;
|
||||
cursor: default;
|
||||
}
|
||||
.select2-results .select2-disabled {
|
||||
background: #f4f4f4;
|
||||
display: list-item;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.select2-results .select2-selected {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select2-more-results.select2-active {
|
||||
background: #f4f4f4 url('select2-spinner.gif') no-repeat 100%;
|
||||
}
|
||||
|
||||
.select2-results .select2-ajax-error {
|
||||
background: rgba(255, 50, 50, .2);
|
||||
}
|
||||
|
||||
.select2-more-results {
|
||||
background: #f4f4f4;
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
/* disabled styles */
|
||||
|
||||
.select2-container.select2-container-disabled .select2-choice {
|
||||
background-color: #f4f4f4;
|
||||
background-image: none;
|
||||
border: 1px solid #ddd;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.select2-container.select2-container-disabled .select2-choice .select2-arrow {
|
||||
background-color: #f4f4f4;
|
||||
background-image: none;
|
||||
border-left: 0;
|
||||
}
|
||||
|
||||
.select2-container.select2-container-disabled .select2-choice abbr {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
/* multiselect */
|
||||
|
||||
.select2-container-multi .select2-choices {
|
||||
height: auto !important;
|
||||
height: 1%;
|
||||
margin: 0;
|
||||
padding: 0 5px 0 0;
|
||||
position: relative;
|
||||
|
||||
border: 1px solid #aaa;
|
||||
cursor: text;
|
||||
overflow: hidden;
|
||||
|
||||
background-color: #fff;
|
||||
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eee), color-stop(15%, #fff));
|
||||
background-image: -webkit-linear-gradient(top, #eee 1%, #fff 15%);
|
||||
background-image: -moz-linear-gradient(top, #eee 1%, #fff 15%);
|
||||
background-image: linear-gradient(to bottom, #eee 1%, #fff 15%);
|
||||
}
|
||||
|
||||
html[dir="rtl"] .select2-container-multi .select2-choices {
|
||||
padding: 0 0 0 5px;
|
||||
}
|
||||
|
||||
.select2-locked {
|
||||
padding: 3px 5px 3px 5px !important;
|
||||
}
|
||||
|
||||
.select2-container-multi .select2-choices {
|
||||
min-height: 26px;
|
||||
}
|
||||
|
||||
.select2-container-multi.select2-container-active .select2-choices {
|
||||
border: 1px solid #5897fb;
|
||||
outline: none;
|
||||
|
||||
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
|
||||
box-shadow: 0 0 5px rgba(0, 0, 0, .3);
|
||||
}
|
||||
.select2-container-multi .select2-choices li {
|
||||
float: left;
|
||||
list-style: none;
|
||||
}
|
||||
html[dir="rtl"] .select2-container-multi .select2-choices li
|
||||
{
|
||||
float: right;
|
||||
}
|
||||
.select2-container-multi .select2-choices .select2-search-field {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.select2-container-multi .select2-choices .select2-search-field input {
|
||||
padding: 5px;
|
||||
margin: 1px 0;
|
||||
|
||||
font-family: sans-serif;
|
||||
font-size: 100%;
|
||||
color: #666;
|
||||
outline: 0;
|
||||
border: 0;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
.select2-container-multi .select2-choices .select2-search-field input.select2-active {
|
||||
background: #fff url('select2-spinner.gif') no-repeat 100% !important;
|
||||
}
|
||||
|
||||
.select2-default {
|
||||
color: #999 !important;
|
||||
}
|
||||
|
||||
.select2-container-multi .select2-choices .select2-search-choice {
|
||||
padding: 3px 5px 3px 18px;
|
||||
margin: 3px 0 3px 5px;
|
||||
position: relative;
|
||||
|
||||
line-height: 13px;
|
||||
color: #333;
|
||||
cursor: default;
|
||||
border: 1px solid #aaaaaa;
|
||||
|
||||
border-radius: 3px;
|
||||
|
||||
-webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
|
||||
box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
|
||||
|
||||
background-clip: padding-box;
|
||||
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
|
||||
background-color: #e4e4e4;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0);
|
||||
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eee));
|
||||
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
|
||||
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
|
||||
background-image: linear-gradient(to bottom, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
|
||||
}
|
||||
html[dir="rtl"] .select2-container-multi .select2-choices .select2-search-choice
|
||||
{
|
||||
margin: 3px 5px 3px 0;
|
||||
padding: 3px 18px 3px 5px;
|
||||
}
|
||||
.select2-container-multi .select2-choices .select2-search-choice .select2-chosen {
|
||||
cursor: default;
|
||||
}
|
||||
.select2-container-multi .select2-choices .select2-search-choice-focus {
|
||||
background: #d4d4d4;
|
||||
}
|
||||
|
||||
.select2-search-choice-close {
|
||||
display: block;
|
||||
width: 12px;
|
||||
height: 13px;
|
||||
position: absolute;
|
||||
right: 3px;
|
||||
top: 4px;
|
||||
|
||||
font-size: 1px;
|
||||
outline: none;
|
||||
background: url('select2.png') right top no-repeat;
|
||||
}
|
||||
html[dir="rtl"] .select2-search-choice-close {
|
||||
right: auto;
|
||||
left: 3px;
|
||||
}
|
||||
|
||||
.select2-container-multi .select2-search-choice-close {
|
||||
left: 3px;
|
||||
}
|
||||
|
||||
html[dir="rtl"] .select2-container-multi .select2-search-choice-close {
|
||||
left: auto;
|
||||
right: 2px;
|
||||
}
|
||||
|
||||
.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
|
||||
background-position: right -11px;
|
||||
}
|
||||
.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
|
||||
background-position: right -11px;
|
||||
}
|
||||
|
||||
/* disabled styles */
|
||||
.select2-container-multi.select2-container-disabled .select2-choices {
|
||||
background-color: #f4f4f4;
|
||||
background-image: none;
|
||||
border: 1px solid #ddd;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
|
||||
padding: 3px 5px 3px 5px;
|
||||
border: 1px solid #ddd;
|
||||
background-image: none;
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
|
||||
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close { display: none;
|
||||
background: none;
|
||||
}
|
||||
/* end multiselect */
|
||||
|
||||
|
||||
.select2-result-selectable .select2-match,
|
||||
.select2-result-unselectable .select2-match {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.select2-offscreen, .select2-offscreen:focus {
|
||||
clip: rect(0 0 0 0) !important;
|
||||
width: 1px !important;
|
||||
height: 1px !important;
|
||||
border: 0 !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
overflow: hidden !important;
|
||||
position: absolute !important;
|
||||
outline: 0 !important;
|
||||
left: 0px !important;
|
||||
top: 0px !important;
|
||||
}
|
||||
|
||||
.select2-display-none {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select2-measure-scrollbar {
|
||||
position: absolute;
|
||||
top: -10000px;
|
||||
left: -10000px;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
/* Retina-ize icons */
|
||||
|
||||
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 2dppx) {
|
||||
.select2-search input,
|
||||
.select2-search-choice-close,
|
||||
.select2-container .select2-choice abbr,
|
||||
.select2-container .select2-choice .select2-arrow b {
|
||||
background-image: url('select2x2.png') !important;
|
||||
background-repeat: no-repeat !important;
|
||||
background-size: 60px 40px !important;
|
||||
}
|
||||
|
||||
.select2-search input {
|
||||
background-position: 100% -21px !important;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"name": "select2",
|
||||
"title": "Select2",
|
||||
"description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
|
||||
"keywords": [
|
||||
"select",
|
||||
"autocomplete",
|
||||
"typeahead",
|
||||
"dropdown",
|
||||
"multiselect",
|
||||
"tag",
|
||||
"tagging"
|
||||
],
|
||||
"version": "3.5.2",
|
||||
"author": {
|
||||
"name": "Igor Vaynberg",
|
||||
"url": "https://github.com/ivaynberg"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"type": "Apache",
|
||||
"url": "http://www.apache.org/licenses/LICENSE-2.0"
|
||||
},
|
||||
{
|
||||
"type": "GPL v2",
|
||||
"url": "http://www.gnu.org/licenses/gpl-2.0.html"
|
||||
}
|
||||
],
|
||||
"bugs": "https://github.com/ivaynberg/select2/issues",
|
||||
"homepage": "http://ivaynberg.github.com/select2",
|
||||
"docs": "http://ivaynberg.github.com/select2/",
|
||||
"download": "https://github.com/ivaynberg/select2/tags",
|
||||
"dependencies": {
|
||||
"jquery": ">=1.7.1"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 613 B |
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Select2 Arabic translation.
|
||||
*
|
||||
* Author: Adel KEDJOUR <adel@kedjour.com>
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['ar'] = {
|
||||
formatNoMatches: function () { return "لم يتم العثور على مطابقات"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; if (n == 1){ return "الرجاء إدخال حرف واحد على الأكثر"; } return n == 2 ? "الرجاء إدخال حرفين على الأكثر" : "الرجاء إدخال " + n + " على الأكثر"; },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; if (n == 1){ return "الرجاء إدخال حرف واحد على الأقل"; } return n == 2 ? "الرجاء إدخال حرفين على الأقل" : "الرجاء إدخال " + n + " على الأقل "; },
|
||||
formatSelectionTooBig: function (limit) { if (limit == 1){ return "يمكنك أن تختار إختيار واحد فقط"; } return limit == 2 ? "يمكنك أن تختار إختيارين فقط" : "يمكنك أن تختار " + limit + " إختيارات فقط"; },
|
||||
formatLoadMore: function (pageNumber) { return "تحميل المزيد من النتائج…"; },
|
||||
formatSearching: function () { return "البحث…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['ar']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
/**
|
||||
* Select2 Azerbaijani translation.
|
||||
*
|
||||
* Author: Farhad Safarov <farhad.safarov@gmail.com>
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['az'] = {
|
||||
formatMatches: function (matches) { return matches + " nəticə mövcuddur, hərəkət etdirmək üçün yuxarı və aşağı düymələrindən istifadə edin."; },
|
||||
formatNoMatches: function () { return "Nəticə tapılmadı"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return n + " simvol daxil edin"; },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return n + " simvol silin"; },
|
||||
formatSelectionTooBig: function (limit) { return "Sadəcə " + limit + " element seçə bilərsiniz"; },
|
||||
formatLoadMore: function (pageNumber) { return "Daha çox nəticə yüklənir…"; },
|
||||
formatSearching: function () { return "Axtarılır…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['az']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
/**
|
||||
* Select2 Bulgarian translation.
|
||||
*
|
||||
* @author Lubomir Vikev <lubomirvikev@gmail.com>
|
||||
* @author Uriy Efremochkin <efremochkin@uriy.me>
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['bg'] = {
|
||||
formatNoMatches: function () { return "Няма намерени съвпадения"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return "Моля въведете още " + n + " символ" + (n > 1 ? "а" : ""); },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return "Моля въведете с " + n + " по-малко символ" + (n > 1 ? "а" : ""); },
|
||||
formatSelectionTooBig: function (limit) { return "Можете да направите до " + limit + (limit > 1 ? " избора" : " избор"); },
|
||||
formatLoadMore: function (pageNumber) { return "Зареждат се още…"; },
|
||||
formatSearching: function () { return "Търсене…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['bg']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Select2 Catalan translation.
|
||||
*
|
||||
* Author: David Planella <david.planella@gmail.com>
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['ca'] = {
|
||||
formatNoMatches: function () { return "No s'ha trobat cap coincidència"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return "Introduïu " + n + " caràcter" + (n == 1 ? "" : "s") + " més"; },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return "Introduïu " + n + " caràcter" + (n == 1? "" : "s") + "menys"; },
|
||||
formatSelectionTooBig: function (limit) { return "Només podeu seleccionar " + limit + " element" + (limit == 1 ? "" : "s"); },
|
||||
formatLoadMore: function (pageNumber) { return "S'estan carregant més resultats…"; },
|
||||
formatSearching: function () { return "S'està cercant…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['ca']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
/**
|
||||
* Select2 Czech translation.
|
||||
*
|
||||
* Author: Michal Marek <ahoj@michal-marek.cz>
|
||||
* Author - sklonovani: David Vallner <david@vallner.net>
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
// use text for the numbers 2 through 4
|
||||
var smallNumbers = {
|
||||
2: function(masc) { return (masc ? "dva" : "dvě"); },
|
||||
3: function() { return "tři"; },
|
||||
4: function() { return "čtyři"; }
|
||||
}
|
||||
$.fn.select2.locales['cs'] = {
|
||||
formatNoMatches: function () { return "Nenalezeny žádné položky"; },
|
||||
formatInputTooShort: function (input, min) {
|
||||
var n = min - input.length;
|
||||
if (n == 1) {
|
||||
return "Prosím zadejte ještě jeden znak";
|
||||
} else if (n <= 4) {
|
||||
return "Prosím zadejte ještě další "+smallNumbers[n](true)+" znaky";
|
||||
} else {
|
||||
return "Prosím zadejte ještě dalších "+n+" znaků";
|
||||
}
|
||||
},
|
||||
formatInputTooLong: function (input, max) {
|
||||
var n = input.length - max;
|
||||
if (n == 1) {
|
||||
return "Prosím zadejte o jeden znak méně";
|
||||
} else if (n <= 4) {
|
||||
return "Prosím zadejte o "+smallNumbers[n](true)+" znaky méně";
|
||||
} else {
|
||||
return "Prosím zadejte o "+n+" znaků méně";
|
||||
}
|
||||
},
|
||||
formatSelectionTooBig: function (limit) {
|
||||
if (limit == 1) {
|
||||
return "Můžete zvolit jen jednu položku";
|
||||
} else if (limit <= 4) {
|
||||
return "Můžete zvolit maximálně "+smallNumbers[limit](false)+" položky";
|
||||
} else {
|
||||
return "Můžete zvolit maximálně "+limit+" položek";
|
||||
}
|
||||
},
|
||||
formatLoadMore: function (pageNumber) { return "Načítají se další výsledky…"; },
|
||||
formatSearching: function () { return "Vyhledávání…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['cs']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Select2 Danish translation.
|
||||
*
|
||||
* Author: Anders Jenbo <anders@jenbo.dk>
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['da'] = {
|
||||
formatNoMatches: function () { return "Ingen resultater fundet"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return "Angiv venligst " + n + " tegn mere"; },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return "Angiv venligst " + n + " tegn mindre"; },
|
||||
formatSelectionTooBig: function (limit) { return "Du kan kun vælge " + limit + " emne" + (limit === 1 ? "" : "r"); },
|
||||
formatLoadMore: function (pageNumber) { return "Indlæser flere resultater…"; },
|
||||
formatSearching: function () { return "Søger…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['da']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
/**
|
||||
* Select2 German translation
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['de'] = {
|
||||
formatNoMatches: function () { return "Keine Übereinstimmungen gefunden"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return "Bitte " + n + " Zeichen mehr eingeben"; },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return "Bitte " + n + " Zeichen weniger eingeben"; },
|
||||
formatSelectionTooBig: function (limit) { return "Sie können nur " + limit + " Eintr" + (limit === 1 ? "ag" : "äge") + " auswählen"; },
|
||||
formatLoadMore: function (pageNumber) { return "Lade mehr Ergebnisse…"; },
|
||||
formatSearching: function () { return "Suche…"; },
|
||||
formatMatches: function (matches) { return matches + " Ergebnis " + (matches > 1 ? "se" : "") + " verfügbar, zum Navigieren die Hoch-/Runter-Pfeiltasten verwenden."; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['de']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Select2 Greek translation.
|
||||
*
|
||||
* @author Uriy Efremochkin <efremochkin@uriy.me>
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['el'] = {
|
||||
formatNoMatches: function () { return "Δεν βρέθηκαν αποτελέσματα"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return "Παρακαλούμε εισάγετε " + n + " περισσότερο" + (n > 1 ? "υς" : "") + " χαρακτήρ" + (n > 1 ? "ες" : "α"); },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return "Παρακαλούμε διαγράψτε " + n + " χαρακτήρ" + (n > 1 ? "ες" : "α"); },
|
||||
formatSelectionTooBig: function (limit) { return "Μπορείτε να επιλέξετε μόνο " + limit + " αντικείμεν" + (limit > 1 ? "α" : "ο"); },
|
||||
formatLoadMore: function (pageNumber) { return "Φόρτωση περισσότερων…"; },
|
||||
formatSearching: function () { return "Αναζήτηση…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['el']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
/**
|
||||
* Select2 <Language> translation.
|
||||
*
|
||||
* Author: Your Name <your@email>
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['en'] = {
|
||||
formatMatches: function (matches) { if (matches === 1) { return "One result is available, press enter to select it."; } return matches + " results are available, use up and down arrow keys to navigate."; },
|
||||
formatNoMatches: function () { return "No matches found"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " or more character" + (n == 1 ? "" : "s"); },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return "Please delete " + n + " character" + (n == 1 ? "" : "s"); },
|
||||
formatSelectionTooBig: function (limit) { return "You can only select " + limit + " item" + (limit == 1 ? "" : "s"); },
|
||||
formatLoadMore: function (pageNumber) { return "Loading more results…"; },
|
||||
formatSearching: function () { return "Searching…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['en']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Select2 Spanish translation
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['es'] = {
|
||||
formatMatches: function (matches) { if (matches === 1) { return "Un resultado disponible, presione enter para seleccionarlo."; } return matches + " resultados disponibles, use las teclas de dirección para navegar."; },
|
||||
formatNoMatches: function () { return "No se encontraron resultados"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return "Por favor, introduzca " + n + " car" + (n == 1? "ácter" : "acteres"); },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return "Por favor, elimine " + n + " car" + (n == 1? "ácter" : "acteres"); },
|
||||
formatSelectionTooBig: function (limit) { return "Sólo puede seleccionar " + limit + " elemento" + (limit == 1 ? "" : "s"); },
|
||||
formatLoadMore: function (pageNumber) { return "Cargando más resultados…"; },
|
||||
formatSearching: function () { return "Buscando…"; },
|
||||
formatAjaxError: function() { return "La carga falló"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['es']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Select2 Estonian translation.
|
||||
*
|
||||
* Author: Kuldar Kalvik <kuldar@kalvik.ee>
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['et'] = {
|
||||
formatNoMatches: function () { return "Tulemused puuduvad"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return "Sisesta " + n + " täht" + (n == 1 ? "" : "e") + " rohkem"; },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return "Sisesta " + n + " täht" + (n == 1? "" : "e") + " vähem"; },
|
||||
formatSelectionTooBig: function (limit) { return "Saad vaid " + limit + " tulemus" + (limit == 1 ? "e" : "t") + " valida"; },
|
||||
formatLoadMore: function (pageNumber) { return "Laen tulemusi.."; },
|
||||
formatSearching: function () { return "Otsin.."; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['et']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
/**
|
||||
* Select2 Basque translation.
|
||||
*
|
||||
* Author: Julen Ruiz Aizpuru <julenx at gmail dot com>
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['eu'] = {
|
||||
formatNoMatches: function () {
|
||||
return "Ez da bat datorrenik aurkitu";
|
||||
},
|
||||
formatInputTooShort: function (input, min) {
|
||||
var n = min - input.length;
|
||||
if (n === 1) {
|
||||
return "Idatzi karaktere bat gehiago";
|
||||
} else {
|
||||
return "Idatzi " + n + " karaktere gehiago";
|
||||
}
|
||||
},
|
||||
formatInputTooLong: function (input, max) {
|
||||
var n = input.length - max;
|
||||
if (n === 1) {
|
||||
return "Idatzi karaktere bat gutxiago";
|
||||
} else {
|
||||
return "Idatzi " + n + " karaktere gutxiago";
|
||||
}
|
||||
},
|
||||
formatSelectionTooBig: function (limit) {
|
||||
if (limit === 1 ) {
|
||||
return "Elementu bakarra hauta dezakezu";
|
||||
} else {
|
||||
return limit + " elementu hauta ditzakezu soilik";
|
||||
}
|
||||
},
|
||||
formatLoadMore: function (pageNumber) {
|
||||
return "Emaitza gehiago kargatzen…";
|
||||
},
|
||||
formatSearching: function () {
|
||||
return "Bilatzen…";
|
||||
}
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['eu']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
/**
|
||||
* Select2 Persian translation.
|
||||
*
|
||||
* Author: Ali Choopan <choopan@arsh.co>
|
||||
* Author: Ebrahim Byagowi <ebrahim@gnu.org>
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['fa'] = {
|
||||
formatMatches: function (matches) { return matches + " نتیجه موجود است، کلیدهای جهت بالا و پایین را برای گشتن استفاده کنید."; },
|
||||
formatNoMatches: function () { return "نتیجهای یافت نشد."; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return "لطفاً " + n + " نویسه بیشتر وارد نمایید"; },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return "لطفاً " + n + " نویسه را حذف کنید."; },
|
||||
formatSelectionTooBig: function (limit) { return "شما فقط میتوانید " + limit + " مورد را انتخاب کنید"; },
|
||||
formatLoadMore: function (pageNumber) { return "در حال بارگیری موارد بیشتر…"; },
|
||||
formatSearching: function () { return "در حال جستجو…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['fa']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
/**
|
||||
* Select2 Finnish translation
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
$.fn.select2.locales['fi'] = {
|
||||
formatNoMatches: function () {
|
||||
return "Ei tuloksia";
|
||||
},
|
||||
formatInputTooShort: function (input, min) {
|
||||
var n = min - input.length;
|
||||
return "Ole hyvä ja anna " + n + " merkkiä lisää";
|
||||
},
|
||||
formatInputTooLong: function (input, max) {
|
||||
var n = input.length - max;
|
||||
return "Ole hyvä ja anna " + n + " merkkiä vähemmän";
|
||||
},
|
||||
formatSelectionTooBig: function (limit) {
|
||||
return "Voit valita ainoastaan " + limit + " kpl";
|
||||
},
|
||||
formatLoadMore: function (pageNumber) {
|
||||
return "Ladataan lisää tuloksia…";
|
||||
},
|
||||
formatSearching: function () {
|
||||
return "Etsitään…";
|
||||
}
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['fi']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
/**
|
||||
* Select2 French translation
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['fr'] = {
|
||||
formatMatches: function (matches) { return matches + " résultats sont disponibles, utilisez les flèches haut et bas pour naviguer."; },
|
||||
formatNoMatches: function () { return "Aucun résultat trouvé"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return "Saisissez " + n + " caractère" + (n == 1? "" : "s") + " supplémentaire" + (n == 1? "" : "s") ; },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return "Supprimez " + n + " caractère" + (n == 1? "" : "s"); },
|
||||
formatSelectionTooBig: function (limit) { return "Vous pouvez seulement sélectionner " + limit + " élément" + (limit == 1 ? "" : "s"); },
|
||||
formatLoadMore: function (pageNumber) { return "Chargement de résultats supplémentaires…"; },
|
||||
formatSearching: function () { return "Recherche en cours…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['fr']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
/**
|
||||
* Select2 Galician translation
|
||||
*
|
||||
* Author: Leandro Regueiro <leandro.regueiro@gmail.com>
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['gl'] = {
|
||||
formatNoMatches: function () {
|
||||
return "Non se atoparon resultados";
|
||||
},
|
||||
formatInputTooShort: function (input, min) {
|
||||
var n = min - input.length;
|
||||
if (n === 1) {
|
||||
return "Engada un carácter";
|
||||
} else {
|
||||
return "Engada " + n + " caracteres";
|
||||
}
|
||||
},
|
||||
formatInputTooLong: function (input, max) {
|
||||
var n = input.length - max;
|
||||
if (n === 1) {
|
||||
return "Elimine un carácter";
|
||||
} else {
|
||||
return "Elimine " + n + " caracteres";
|
||||
}
|
||||
},
|
||||
formatSelectionTooBig: function (limit) {
|
||||
if (limit === 1 ) {
|
||||
return "Só pode seleccionar un elemento";
|
||||
} else {
|
||||
return "Só pode seleccionar " + limit + " elementos";
|
||||
}
|
||||
},
|
||||
formatLoadMore: function (pageNumber) {
|
||||
return "Cargando máis resultados…";
|
||||
},
|
||||
formatSearching: function () {
|
||||
return "Buscando…";
|
||||
}
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['gl']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Select2 Hebrew translation.
|
||||
*
|
||||
* Author: Yakir Sitbon <http://www.yakirs.net/>
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['he'] = {
|
||||
formatNoMatches: function () { return "לא נמצאו התאמות"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return "נא להזין עוד " + n + " תווים נוספים"; },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return "נא להזין פחות " + n + " תווים"; },
|
||||
formatSelectionTooBig: function (limit) { return "ניתן לבחור " + limit + " פריטים"; },
|
||||
formatLoadMore: function (pageNumber) { return "טוען תוצאות נוספות…"; },
|
||||
formatSearching: function () { return "מחפש…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['he']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* Select2 Croatian translation.
|
||||
*
|
||||
* @author Edi Modrić <edi.modric@gmail.com>
|
||||
* @author Uriy Efremochkin <efremochkin@uriy.me>
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['hr'] = {
|
||||
formatNoMatches: function () { return "Nema rezultata"; },
|
||||
formatInputTooShort: function (input, min) { return "Unesite još" + character(min - input.length); },
|
||||
formatInputTooLong: function (input, max) { return "Unesite" + character(input.length - max) + " manje"; },
|
||||
formatSelectionTooBig: function (limit) { return "Maksimalan broj odabranih stavki je " + limit; },
|
||||
formatLoadMore: function (pageNumber) { return "Učitavanje rezultata…"; },
|
||||
formatSearching: function () { return "Pretraga…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['hr']);
|
||||
|
||||
function character (n) {
|
||||
return " " + n + " znak" + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 19) ? n%10 > 1 ? "a" : "" : "ova");
|
||||
}
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* Select2 Hungarian translation
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['hu'] = {
|
||||
formatNoMatches: function () { return "Nincs találat."; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return "Túl rövid. Még " + n + " karakter hiányzik."; },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return "Túl hosszú. " + n + " karakterrel több, mint kellene."; },
|
||||
formatSelectionTooBig: function (limit) { return "Csak " + limit + " elemet lehet kiválasztani."; },
|
||||
formatLoadMore: function (pageNumber) { return "Töltés…"; },
|
||||
formatSearching: function () { return "Keresés…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['hu']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Select2 Indonesian translation.
|
||||
*
|
||||
* Author: Ibrahim Yusuf <ibrahim7usuf@gmail.com>
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['id'] = {
|
||||
formatNoMatches: function () { return "Tidak ada data yang sesuai"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return "Masukkan " + n + " huruf lagi" + (n == 1 ? "" : "s"); },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return "Hapus " + n + " huruf" + (n == 1 ? "" : "s"); },
|
||||
formatSelectionTooBig: function (limit) { return "Anda hanya dapat memilih " + limit + " pilihan" + (limit == 1 ? "" : "s"); },
|
||||
formatLoadMore: function (pageNumber) { return "Mengambil data…"; },
|
||||
formatSearching: function () { return "Mencari…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['id']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* Select2 Icelandic translation.
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['is'] = {
|
||||
formatNoMatches: function () { return "Ekkert fannst"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return "Vinsamlegast skrifið " + n + " staf" + (n > 1 ? "i" : "") + " í viðbót"; },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return "Vinsamlegast styttið texta um " + n + " staf" + (n > 1 ? "i" : ""); },
|
||||
formatSelectionTooBig: function (limit) { return "Þú getur aðeins valið " + limit + " atriði"; },
|
||||
formatLoadMore: function (pageNumber) { return "Sæki fleiri niðurstöður…"; },
|
||||
formatSearching: function () { return "Leita…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['is']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* Select2 Italian translation
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['it'] = {
|
||||
formatNoMatches: function () { return "Nessuna corrispondenza trovata"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return "Inserisci ancora " + n + " caratter" + (n == 1? "e" : "i"); },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return "Inserisci " + n + " caratter" + (n == 1? "e" : "i") + " in meno"; },
|
||||
formatSelectionTooBig: function (limit) { return "Puoi selezionare solo " + limit + " element" + (limit == 1 ? "o" : "i"); },
|
||||
formatLoadMore: function (pageNumber) { return "Caricamento in corso…"; },
|
||||
formatSearching: function () { return "Ricerca…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['it']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* Select2 Japanese translation.
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['ja'] = {
|
||||
formatNoMatches: function () { return "該当なし"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return "後" + n + "文字入れてください"; },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return "検索文字列が" + n + "文字長すぎます"; },
|
||||
formatSelectionTooBig: function (limit) { return "最多で" + limit + "項目までしか選択できません"; },
|
||||
formatLoadMore: function (pageNumber) { return "読込中・・・"; },
|
||||
formatSearching: function () { return "検索中・・・"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['ja']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Select2 Georgian (Kartuli) translation.
|
||||
*
|
||||
* Author: Dimitri Kurashvili dimakura@gmail.com
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['ka'] = {
|
||||
formatNoMatches: function () { return "ვერ მოიძებნა"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return "გთხოვთ შეიყვანოთ კიდევ " + n + " სიმბოლო"; },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return "გთხოვთ წაშალოთ " + n + " სიმბოლო"; },
|
||||
formatSelectionTooBig: function (limit) { return "თქვენ შეგიძლიათ მხოლოდ " + limit + " ჩანაწერის მონიშვნა"; },
|
||||
formatLoadMore: function (pageNumber) { return "შედეგის ჩატვირთვა…"; },
|
||||
formatSearching: function () { return "ძებნა…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['ka']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Select2 Korean translation.
|
||||
*
|
||||
* @author Swen Mun <longfinfunnel@gmail.com>
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['ko'] = {
|
||||
formatNoMatches: function () { return "결과 없음"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return "너무 짧습니다. "+n+"글자 더 입력해주세요."; },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return "너무 깁니다. "+n+"글자 지워주세요."; },
|
||||
formatSelectionTooBig: function (limit) { return "최대 "+limit+"개까지만 선택하실 수 있습니다."; },
|
||||
formatLoadMore: function (pageNumber) { return "불러오는 중…"; },
|
||||
formatSearching: function () { return "검색 중…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['ko']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
/**
|
||||
* Select2 Lithuanian translation.
|
||||
*
|
||||
* @author CRONUS Karmalakas <cronus dot karmalakas at gmail dot com>
|
||||
* @author Uriy Efremochkin <efremochkin@uriy.me>
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['lt'] = {
|
||||
formatNoMatches: function () { return "Atitikmenų nerasta"; },
|
||||
formatInputTooShort: function (input, min) { return "Įrašykite dar" + character(min - input.length); },
|
||||
formatInputTooLong: function (input, max) { return "Pašalinkite" + character(input.length - max); },
|
||||
formatSelectionTooBig: function (limit) {
|
||||
return "Jūs galite pasirinkti tik " + limit + " element" + ((limit%100 > 9 && limit%100 < 21) || limit%10 == 0 ? "ų" : limit%10 > 1 ? "us" : "ą");
|
||||
},
|
||||
formatLoadMore: function (pageNumber) { return "Kraunama daugiau rezultatų…"; },
|
||||
formatSearching: function () { return "Ieškoma…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['lt']);
|
||||
|
||||
function character (n) {
|
||||
return " " + n + " simbol" + ((n%100 > 9 && n%100 < 21) || n%10 == 0 ? "ių" : n%10 > 1 ? "ius" : "į");
|
||||
}
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Select2 Latvian translation.
|
||||
*
|
||||
* @author Uriy Efremochkin <efremochkin@uriy.me>
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['lv'] = {
|
||||
formatNoMatches: function () { return "Sakritību nav"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return "Lūdzu ievadiet vēl " + n + " simbol" + (n == 11 ? "us" : n%10 == 1 ? "u" : "us"); },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return "Lūdzu ievadiet par " + n + " simbol" + (n == 11 ? "iem" : n%10 == 1 ? "u" : "iem") + " mazāk"; },
|
||||
formatSelectionTooBig: function (limit) { return "Jūs varat izvēlēties ne vairāk kā " + limit + " element" + (limit == 11 ? "us" : limit%10 == 1 ? "u" : "us"); },
|
||||
formatLoadMore: function (pageNumber) { return "Datu ielāde…"; },
|
||||
formatSearching: function () { return "Meklēšana…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['lv']);
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Select2 Macedonian translation.
|
||||
*
|
||||
* Author: Marko Aleksic <psybaron@gmail.com>
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['mk'] = {
|
||||
formatNoMatches: function () { return "Нема пронајдено совпаѓања"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length; return "Ве молиме внесете уште " + n + " карактер" + (n == 1 ? "" : "и"); },
|
||||
formatInputTooLong: function (input, max) { var n = input.length - max; return "Ве молиме внесете " + n + " помалку карактер" + (n == 1? "" : "и"); },
|
||||
formatSelectionTooBig: function (limit) { return "Можете да изберете само " + limit + " ставк" + (limit == 1 ? "а" : "и"); },
|
||||
formatLoadMore: function (pageNumber) { return "Вчитување резултати…"; },
|
||||
formatSearching: function () { return "Пребарување…"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['mk']);
|
||||
})(jQuery);
|
||||