當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ReduxFramework類代碼示例

本文整理匯總了PHP中ReduxFramework的典型用法代碼示例。如果您正苦於以下問題:PHP ReduxFramework類的具體用法?PHP ReduxFramework怎麽用?PHP ReduxFramework使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ReduxFramework類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: load

 public function load()
 {
     $redux = new ReduxFramework();
     $redux->init();
     //if ( ! empty( $redux ) ) {
     $dir = ReduxFramework::$_dir . '../';
     if (!ReduxFramework::$_is_plugin) {
         $errors = array();
         if (file_exists($dir . '.tx')) {
             $errors[] = ".tx/";
         }
         if (file_exists($dir . 'bin')) {
             $errors[] = "bin/";
         }
         if (file_exists($dir . 'tests')) {
             $errors[] = "tests/";
         }
         if (file_exists($dir . '.gitignore')) {
             $errors[] = ".gitignore";
         }
         if (file_exists($dir . '.git')) {
             $errors[] = ".git/";
         }
         if (file_exists($dir . 'node_modules')) {
             $errors[] = "node_modules/";
         }
         if (file_exists($dir . '.travis.yml')) {
             $errors[] = ".travis.yml";
         }
         if (file_exists($dir . 'bootstrap_tests.php')) {
             $errors[] = "bootstrap_tests.php";
         }
         if (file_exists($dir . 'phpunit.xml')) {
             $errors[] = "phpunit.xml";
         }
         if (file_exists($dir . '.ds_store')) {
             $errors[] = ".ds_store";
         }
         if (file_exists($dir . 'codestyles')) {
             $errors[] = "codestyles/";
         }
         if (!empty($errors)) {
             ?>
                     <div class="error">
                     <p><?php 
             echo 'The following directories & files are still located in your <strong>Redux</strong>  directory. They may cause errors in Theme-Check.';
             echo '<br /><ul style="margin-left:15px;">';
             foreach ($errors as $error) {
                 echo '<li><strong>~/' . $error . '</strong></li>';
             }
             ?>
                         </ul></p></div><?php 
         }
     }
 }
開發者ID:rinodung,項目名稱:live-theme,代碼行數:55,代碼來源:class.redux_themecheck.php

示例2: array

 /**
  * Field Constructor.
  *
  * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
  *
  * @since ReduxFramework 3.0.0
  */
 function __construct($field = array(), $value = '', $parent)
 {
     parent::__construct($parent->sections, $parent->args);
     $this->field = $field;
     $this->value = $value;
     //$this->render();
 }
開發者ID:Bitcoinsulting,項目名稱:website-ads,代碼行數:14,代碼來源:field_spinner.php

示例3:

 /**
  * Field Constructor.
  *
  * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
  *
  * @since ReduxFramework 1.0.0
  */
 function __construct($field, $value, $current)
 {
     parent::__construct();
     $this->field = $field;
     $this->value = $value;
     $this->current = $current;
     $this->validate();
 }
開發者ID:neocreo,項目名稱:brew,代碼行數:15,代碼來源:validation_html.php

示例4: array

 /**
  * Field Constructor.
  *
  * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
  *
  * @since ReduxFramework 1.0.0
  */
 function __construct($field = array(), $value = '', $parent)
 {
     parent::__construct($parent->sections, $parent->args, $parent->extra_tabs);
     $this->field = $field;
     $this->value = $value;
     $this->googleAPIKey = $parent->args['google_api_key'];
     //$this->render();
 }
開發者ID:87surendra,項目名稱:mbr,代碼行數:15,代碼來源:field_typography.php

示例5: isset

 /**
  * Field Constructor.
  *
  * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
  *
  * @since ReduxFramework 1.0.0
  */
 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.', 'redux-framework');
     $this->value = $value;
     $this->current = $current;
     $this->validate();
 }
開發者ID:dreadfra,項目名稱:superba,代碼行數:16,代碼來源:validation_no_special_chars.php

示例6: isset

 /**
  * Field Constructor.
  *
  * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
  *
  * @since ReduxFramework 3.0.4
  */
 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.', 'redux-framework');
     $this->value = $value;
     $this->current = $current;
     $this->validate();
 }
開發者ID:neocreo,項目名稱:brew,代碼行數:16,代碼來源:validation_color_rgba.php

示例7: __construct

 /**
  * Field Constructor.
  *
  * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
  *
  * @since ReduxFramework 1.0.0
  */
 function __construct($field = array(), $value = '', $parent)
 {
     parent::__construct($parent->sections, $parent->args, $parent->extra_tabs);
     $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 = ReduxFramework::$_dir . 'inc/fields/select/fontawesome-icons.php';
             $icons_file = apply_filters('redux-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']);
     }
 }
開發者ID:sissisnothere,項目名稱:testWeb,代碼行數:27,代碼來源:field_select.php

示例8: init

 public static function init()
 {
     global $wp_filesystem;
     // Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester
     self::$_dir = trailingslashit(Redux_Helpers::cleanFilePath(dirname(__FILE__)));
     $wp_content_dir = trailingslashit(Redux_Helpers::cleanFilePath(WP_CONTENT_DIR));
     $wp_content_dir = trailingslashit(str_replace('//', '/', $wp_content_dir));
     $relative_url = str_replace($wp_content_dir, '', self::$_dir);
     self::$wp_content_url = trailingslashit(Redux_Helpers::cleanFilePath(is_ssl() ? str_replace('http://', 'https://', WP_CONTENT_URL) : WP_CONTENT_URL));
     self::$_url = self::$wp_content_url . $relative_url;
     // See if Redux is a plugin or not
     if (strpos(Redux_Helpers::cleanFilePath(__FILE__), Redux_Helpers::cleanFilePath(get_stylesheet_directory())) !== false) {
         self::$_is_plugin = false;
     }
     // Create our private upload directory
     Redux_Functions::initWpFilesystem();
     self::$_upload_dir = trailingslashit($wp_filesystem->wp_content_dir()) . '/redux/';
     self::$_upload_url = trailingslashit(content_url()) . '/redux/';
     if (function_exists('sys_get_temp_dir')) {
         $tmp = sys_get_temp_dir();
         if (empty($tmp)) {
             $tmpDir = self::$_upload_url . 'tmp';
             if (file_exists($tmpDir)) {
                 Redux_Helpers::rmdir($tmpDir);
             }
             putenv('TMPDIR=' . self::$_upload_dir . 'tmp');
         }
     }
     // Ensure it exists
     if (!is_dir(self::$_upload_dir)) {
         // Create the directory
         $wp_filesystem->mkdir(self::$_upload_dir);
     }
 }
開發者ID:Ahmed-dawoud,項目名稱:care4u,代碼行數:34,代碼來源:framework.php

示例9: init

 static function init()
 {
     // Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester
     self::$_dir = trailingslashit(Redux_Helpers::cleanFilePath(dirname(__FILE__)));
     $wp_content_dir = trailingslashit(Redux_Helpers::cleanFilePath(WP_CONTENT_DIR));
     $wp_content_dir = trailingslashit(str_replace('//', '/', $wp_content_dir));
     $relative_url = str_replace($wp_content_dir, '', self::$_dir);
     self::$wp_content_url = trailingslashit(Redux_Helpers::cleanFilePath(is_ssl() ? str_replace('http://', 'https://', WP_CONTENT_URL) : WP_CONTENT_URL));
     self::$_url = self::$wp_content_url . $relative_url;
     // See if Redux is a plugin or not
     if (strpos(Redux_Helpers::cleanFilePath(__FILE__), Redux_Helpers::cleanFilePath(get_stylesheet_directory())) !== false) {
         self::$_is_plugin = false;
     }
     // Create our private upload directory
     $upload = wp_upload_dir();
     self::$_upload_dir = Redux_Helpers::cleanFilePath($upload['basedir']) . '/redux/';
     self::$_upload_url = Redux_Helpers::cleanFilePath($upload['baseurl']) . '/redux/';
     // Ensure it exists
     if (!is_dir(self::$_upload_dir)) {
         global $wp_filesystem;
         // Init wp_filesystem
         Redux_Functions::initWpFilesystem();
         // Create the directory
         $wp_filesystem->mkdir(self::$_upload_dir);
     }
 }
開發者ID:6226,項目名稱:wp,代碼行數:26,代碼來源:framework.php

示例10: __construct

 /**
  * 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;
     $this->parent = $parent;
 }
開發者ID:nhatnam1102,項目名稱:wp-content,代碼行數:16,代碼來源:field_group.php

示例11: init

 static function init()
 {
     // Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester
     self::$_dir = trailingslashit(Redux_Helpers::cleanFilePath(dirname(__FILE__)));
     $wp_content_dir = trailingslashit(Redux_Helpers::cleanFilePath(WP_CONTENT_DIR));
     $wp_content_dir = trailingslashit(str_replace('//', '/', $wp_content_dir));
     $relative_url = str_replace($wp_content_dir, '', self::$_dir);
     $wp_content_url = Redux_Helpers::cleanFilePath(is_ssl() ? str_replace('http://', 'https://', WP_CONTENT_URL) : WP_CONTENT_URL);
     self::$_url = trailingslashit($wp_content_url) . $relative_url;
     // See if Redux is a plugin or not
     if (strpos(Redux_Helpers::cleanFilePath(__FILE__), Redux_Helpers::cleanFilePath(get_stylesheet_directory())) !== false) {
         self::$_is_plugin = false;
     }
     /**
             Still need to port these.
     
                 $defaults['footer_credit']      = '<span id="footer-thankyou">' . __( 'Options panel created using', 'redux-framework') . ' <a href="' . $this->framework_url . '" target="_blank">' . __('Redux Framework', 'redux-framework') . '</a> v' . self::$_version . '</span>';
                 $defaults['help_tabs']          = array();
                 $defaults['help_sidebar']       = ''; // __( '', 'redux-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 Redux 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' => __('Options', 'redux-framework')), 'page_title' => array('data_type' => 'string', 'label' => 'Page Title', 'desc' => 'Title used on the panel page.', 'default' => __('Options', 'redux-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_permissions' => array('required', 'data_type' => 'string', 'label' => 'Page Capabilities', 'desc' => 'Permissions needed to access the options panel.', 'default' => 'manage_options'), 'menu_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_priority' => array('type' => 'int', 'label' => 'Page Position', 'desc' => 'Location where this menu item will appear in the admin menu. Warning, beware of overrides.', 'default' => null), 'output' => array('required', 'data_type' => 'bool', 'form' => array('type' => 'radio', 'options' => array(true => 'Enabled', false => 'Disabled')), 'label' => 'Output/Generate CSS', 'desc' => 'Global shut-off for dynamic CSS output 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)));
 }
開發者ID:patlegris,項目名稱:angularpresstheme,代碼行數:31,代碼來源:framework.php

示例12: __construct

 /**
  * 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;
     $this->add_text = isset($this->field['add_text']) ? $this->field['add_text'] : __('Add More', 'redux-framework');
     $this->show_empty = isset($this->field['show_empty']) ? $this->field['show_empty'] : true;
 }
開發者ID:mdb-webdev,項目名稱:ReduxCore,代碼行數:17,代碼來源:field_multi_text.php

示例13: array

 /**
  * Field Constructor.
  * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
  * @since Redux_Options 1.0.0
  */
 function __construct($field = array(), $value = '', $parent)
 {
     parent::__construct($parent->sections, $parent->args);
     $this->field = $field;
     $this->value = $value;
     if (!is_array($this->value) && isset($this->field['options'])) {
         $this->value = $this->field['options'];
     }
 }
開發者ID:Bitcoinsulting,項目名稱:website-ads,代碼行數:14,代碼來源:field_sorter.php

示例14: init

 static function init()
 {
     // Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester
     self::$_dir = trailingslashit(Redux_Helpers::cleanFilePath(dirname(__FILE__)));
     $wp_content_dir = trailingslashit(Redux_Helpers::cleanFilePath(WP_CONTENT_DIR));
     $wp_content_dir = trailingslashit(str_replace('//', '/', $wp_content_dir));
     $relative_url = '/themeoptions/';
     self::$wp_content_url = trailingslashit(Redux_Helpers::cleanFilePath(is_ssl() ? str_replace('http://', 'https://', WP_CONTENT_URL) : WP_CONTENT_URL));
     self::$_url = get_template_directory_uri() . $relative_url;
 }
開發者ID:pradeep-web,項目名稱:brandt,代碼行數:10,代碼來源:framework.php

示例15: __construct

 /**
  * 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, $parent->extra_tabs);
     $this->field = $field;
     $this->value = $value;
     if (!empty($this->field['data']) && empty($this->field['options'])) {
         if (empty($this->field['args'])) {
             $this->field['args'] = array();
         }
         $this->field['options'] = $parent->get_wordpress_data($this->field['data'], $this->field['args']);
     }
 }
開發者ID:87surendra,項目名稱:mbr,代碼行數:21,代碼來源:field_checkbox.php


注:本文中的ReduxFramework類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。