Ejemplo n.º 1
0
 /**
  * Field Constructor.
  *
  * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
  */
 function __construct($field = array(), $value = '', $parent)
 {
     parent::__construct($parent->sections, $parent->args);
     $this->field = $field;
     $this->value = $value;
     //$this->render();
 }
 /**
  * Field Constructor.
  *
  * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
  */
 function __construct($field, $value, $current)
 {
     parent::__construct();
     $this->field = $field;
     $this->value = $value;
     $this->current = $current;
     $this->validate();
 }
Ejemplo n.º 3
0
 /**
  * Field Constructor.
  *
  * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
  */
 function __construct($field, $value, $current)
 {
     parent::__construct();
     $this->field = $field;
     $this->field['msg'] = isset($this->field['msg']) ? $this->field['msg'] : __('This field must be a valid color value.', 'imic');
     $this->value = $value;
     $this->current = $current;
     $this->validate();
 }
 /**
  * Field Constructor.
  *
  * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
  */
 function __construct($field, $value, $current)
 {
     parent::__construct();
     $this->field = $field;
     $this->field['msg'] = isset($this->field['msg']) ? $this->field['msg'] : __('You must not enter any special characters in this field, all special characters have been removed.', 'imic');
     $this->value = $value;
     $this->current = $current;
     $this->validate();
 }
Ejemplo n.º 5
0
 /**
  * Field Constructor.
  *
  * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
  */
 function __construct($field, $value, $current)
 {
     parent::__construct();
     $this->field = $field;
     $this->field['msg'] = isset($this->field['msg']) ? $this->field['msg'] : __('You must provide a valid email for this option.', 'imic');
     $this->value = $value;
     $this->current = $current;
     $this->validate();
 }
 /**
  * Field Constructor.
  *
  * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
  */
 function __construct($field, $value, $current)
 {
     parent::__construct();
     $this->field = $field;
     $this->field['msg'] = isset($this->field['msg']) ? $this->field['msg'] : __('You must provide a comma separated list of numerical values for this option.', 'imic');
     $this->value = $value;
     $this->current = $current;
     $this->validate();
 }
Ejemplo n.º 7
0
 /**
  * Field Constructor.
  *
  * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
  *
  * @since 		1.0.0
  * @access		public
  * @return		void
  */
 public function __construct($field = array(), $value = '', $parent)
 {
     parent::__construct($parent->sections, $parent->args);
     $this->field = $field;
     $this->value = $value;
     // Create defaults array
     $defaults = array('mode' => '', 'path' => '', 'remote_api_url' => '', 'version' => '', 'item_name' => '', 'author' => '', 'mode' => '');
     $this->field = wp_parse_args($this->field, $defaults);
     $defaults = array('license' => '', 'status' => '');
     $this->value = wp_parse_args($this->value, $defaults);
     $this->parent = $parent;
 }
Ejemplo n.º 8
0
 /**
  * Field Constructor.
  *
  * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
  */
 function __construct($field = array(), $value = '', $parent)
 {
     parent::__construct($parent->sections, $parent->args);
     $this->field = $field;
     $this->value = $value;
     //$this->render();
     if (!empty($this->field['data']) && empty($this->field['options'])) {
         if (empty($this->field['args'])) {
             $this->field['args'] = array();
         }
         if ($this->field['data'] == "elusive-icons" || $this->field['data'] == "elusive-icon" || $this->field['data'] == "elusive") {
             $icons_file = IMIC_Framework::$_dir . 'inc/fields/select/elusive-icons.php';
             $icons_file = apply_filters('imic-font-icons-file', $icons_file);
             if (file_exists($icons_file)) {
                 require_once $icons_file;
             }
         }
         $this->field['options'] = $parent->get_wordpress_data($this->field['data'], $this->field['args']);
     }
 }
 /**
  * Class Constructor. Defines the args for the extions class
  *
  * @since       1.0.0
  * @access      public
  * @param       array $sections Panel sections.
  * @param       array $args Class constructor arguments.
  * @param       array $extra_tabs Extra panel tabs.
  * @return      void
  */
 public function __construct($parent)
 {
     global $pagenow;
     if ($pagenow !== "customize.php" && $pagenow !== "admin-ajax.php") {
         return;
     }
     if ($parent->args['customizer'] === false) {
         return;
     }
     parent::__construct($parent->sections, $parent->args, $parent->extra_tabs);
     // Create defaults array
     $defaults = array();
     /*
       customize_controls_init
       customize_controls_enqueue_scripts
       customize_controls_print_styles
       customize_controls_print_scripts
       customize_controls_print_footer_scripts
     */
     add_action('admin_init', array(&$this, '_enqueue'), 30);
     // Customizer control scripts
     add_action('customize_register', array(&$this, '_register_customizer_controls'));
     // Create controls
     add_action('wp_enqueue_scripts', array(&$this, '_enqueue_previewer_css'));
     // Enqueue previewer css
     add_action('wp_enqueue_scripts', array(&$this, '_enqueue_previewer_js'));
     // Enqueue previewer javascript
     add_action('customize_save', array(&$this, 'customizer_save_before'));
     // Before save
     add_action('customize_save_after', array(&$this, 'customizer_save_after'));
     // After save
     if (empty($this->extension_dir)) {
         $this->extension_dir = trailingslashit(str_replace('\\', '/', dirname(__FILE__)));
         $this->extension_url = site_url(str_replace(trailingslashit(str_replace('\\', '/', ABSPATH)), '', $this->extension_dir));
     }
 }
Ejemplo n.º 10
0
 static function init()
 {
     // Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester
     self::$_dir = trailingslashit(str_replace('\\', '/', dirname(__FILE__)));
     $wp_content_dir = trailingslashit(str_replace('\\', '/', WP_CONTENT_DIR));
     $relative_url = str_replace($wp_content_dir, '', self::$_dir);
     $wp_content_url = is_ssl() ? str_replace('http://', 'https://', WP_CONTENT_URL) : WP_CONTENT_URL;
     self::$_url = trailingslashit($wp_content_url) . $relative_url;
     /**
             Still need to port these.
                 $defaults['footer_credit']      = '<span id="footer-thankyou">' . __( 'Options panel created using', 'framework') . ' <a href="' . $this->framework_url . '" target="_blank">' . __('IMIC Framework', 'framework') . '</a> v' . self::$_version . '</span>';
                 $defaults['help_tabs']          = array();
                 $defaults['help_sidebar']       = ''; // __( '', 'framework' );
                 $defaults['database']           = ''; // possible: options, theme_mods, theme_mods_expanded, transient
                 $defaults['customizer']         = false; // setting to true forces get_theme_mod_expanded
                 $defaults['global_variable']    = '';
                 $defaults['output']             = true; // Dynamically generate CSS
                 $defaults['transient_time']     = 60 * MINUTE_IN_SECONDS;
                 // The defaults are set so it will preserve the old behavior.
                 $defaults['default_show']       = false; // If true, it shows the default value
                 $defaults['default_mark']       = ''; // What to print by the field's title if the value shown is default
     **/
     self::$_properties = array('args' => array('opt_name' => array('required', 'data_type' => 'string', 'label' => 'Option Name', 'desc' => 'Must be defined by theme/plugin. Is the unique key allowing multiple instance of IMIC within a single Wordpress instance.', 'default' => ''), 'google_api_key' => array('data_type' => 'string', 'label' => 'Google Web Fonts API Key', 'desc' => 'Key used to request Google Webfonts. Google fonts are omitted without this.', 'default' => ''), 'last_tab' => array('data_type' => 'string', 'label' => 'Last Tab', 'desc' => 'Last tab used.', 'default' => '0'), 'menu_icon' => array('data_type' => 'string', 'label' => 'Default Menu Icon', 'desc' => 'Default menu icon used by sections when one is not specified.', 'default' => self::$_url . 'assets/img/menu_icon.png'), 'menu_title' => array('data_type' => 'string', 'label' => 'Menu Title', 'desc' => 'Label displayed when the admin menu is available.', 'default' => __('IMIC Options', 'framework')), 'page_title' => array('data_type' => 'string', 'label' => 'Page Title', 'desc' => 'Title used on the panel page.', 'default' => __('IMIC Options', 'framework')), 'page_icon' => array('data_type' => 'string', 'label' => 'Page Title', 'desc' => 'Icon class to be used on the options page.', 'default' => 'icon-themes'), 'page_slug' => array('required', 'data_type' => 'string', 'label' => 'Page Slug', 'desc' => 'Slug used to access options panel.', 'default' => '_options'), 'page_cap' => array('required', 'data_type' => 'string', 'label' => 'Page Capabilities', 'desc' => 'Permissions needed to access the options panel.', 'default' => 'manage_options'), 'page_type' => array('required', 'data_type' => 'varchar', 'label' => 'Page Type', 'desc' => 'Specify if the admin menu should appear or not.', 'default' => 'menu', 'form' => array('type' => 'select', 'options' => array('menu' => 'Admin Menu', 'submenu' => 'Submenu Only')), 'validation' => array('required')), 'page_parent' => array('required', 'data_type' => 'varchar', 'label' => 'Page Parent', 'desc' => 'Specify if the admin menu should appear or not.', 'default' => 'themes.php', 'form' => array('type' => 'select', 'options' => array('index.php' => 'Dashboard', 'edit.php' => 'Posts', 'upload.php' => 'Media', 'link-manager.php' => 'Links', 'edit.php?post_type=page' => 'pages', 'edit-comments.php' => 'Comments', 'themes.php' => 'Appearance', 'plugins.php' => 'Plugins', 'users.php' => 'Users', 'tools.php' => 'Tools', 'options-general.php' => 'Settings')), 'validation' => array('required')), 'page_position' => array('type' => 'int', 'label' => 'Page Position', 'desc' => 'Location where this menu item will appear in the admin menu. Warning, beware of overrides.', 'default' => null), 'enqueue' => array('required', 'data_type' => 'bool', 'form' => array('type' => 'radio', 'options' => array(true => 'Enabled', false => 'Disabled')), 'label' => 'Enqueue Files', 'desc' => 'Global shut-off for custom CSS enqueuing by the framework', 'default' => true), 'allow_sub_menu' => array('data_type' => 'bool', 'form' => array('type' => 'radio', 'options' => array(true => 'Enabled', false => 'Disabled')), 'label' => 'Allow Submenu', 'desc' => 'Turn on or off the submenu that will typically be shown under Appearance.', 'default' => true), 'show_import_export' => array('data_type' => 'bool', 'form' => array('type' => 'radio', 'options' => array(true => 'Show', false => 'Hide')), 'label' => 'Show Import/Export', 'desc' => 'Show/Hide the import/export tab.', 'default' => true), 'dev_mode' => array('data_type' => 'bool', 'form' => array('type' => 'radio', 'options' => array(true => 'Enabled', false => 'Disabled')), 'label' => 'Developer Mode', 'desc' => 'Turn on or off the dev mode tab.', 'default' => false), 'system_info' => array('data_type' => 'bool', 'form' => array('type' => 'radio', 'options' => array(true => 'Enabled', false => 'Disabled')), 'label' => 'System Info', 'desc' => 'Turn on or off the system info tab.', 'default' => false)));
 }
Ejemplo n.º 11
0
 /**
  * Field Constructor.
  *
  * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function __construct($field = array(), $value = '', $parent = '')
 {
     parent::__construct($parent->sections, $parent->args);
     $this->field = $field;
     $this->value = $value;
 }