示例#1
0
 public function render_content()
 {
     $field = search_multi($this->ReduxFramework->sections, 'id', $this->option_key);
     // the key is always unique so there will be only one
     $field = $field[0];
     if (!isset($field['name_suffix'])) {
         $field['name_suffix'] = "";
     }
     if (!isset($field['default'])) {
         $field['default'] = array();
     }
     $field['custom_data'] = $this->get_link();
     $field_class = 'ReduxFramework_customizer_checkbox';
     if (!class_exists($field_class)) {
         $class_file = apply_filters('redux-typeclass-load', '/inc/fields/checkbox/field_checkbox.php', $field_class);
         if ($class_file === 'inc/fields/checkbox/field_checkbox.php') {
             /*  for PRO users! - * @noinspection PhpIncludeInspection */
             require_once wpgrade::corepath() . 'vendor/redux3/' . $class_file;
         }
     }
     $value = wpgrade::option($field['id'], 0);
     if (class_exists($field_class) && method_exists($field_class, 'render')) {
         $enqueue = new $field_class($field, $value, $this->ReduxFramework);
         //				$enqueue->enqueue();
         echo "<label>" . "<span class=\"customize-control-title\">" . $field['title'] . "</span>" . "</label>";
         echo '<div class="redux-container-' . $this->type . '">';
         echo $enqueue->render();
         echo '<div>';
     }
 }
示例#2
0
 /**
  * A custom render for sliders in customizer panel
  */
 public function render_content()
 {
     $field = search_multi($this->ReduxFramework->sections, 'id', $this->option_key);
     // the key is always unique so there will be only one
     $field = $field[0];
     if (!isset($field['name_suffix'])) {
         $field['name_suffix'] = "";
     }
     if (!isset($field['default'])) {
         $field['default'] = array();
     }
     $field['custom_data'] = $this->get_link();
     $field_class = 'ReduxFramework_customizer_background';
     if (!class_exists($field_class)) {
         $class_file = apply_filters('redux-typeclass-load', '/inc/fields/background/field_background.php', $field_class);
         if ($class_file === '/inc/fields/background/field_background.php') {
             /** @noinspection PhpIncludeInspection */
             require_once wpgrade::corepath() . 'vendor/redux3/' . $class_file;
         }
     }
     $value = wpgrade::option($field['id'], $field['default']);
     // get wordpress default labels
     $this->json['button_labels'] = array('select' => __('Select Image'), 'change' => __('Change Image'), 'remove' => __('Remove'), 'default' => __('Default'), 'placeholder' => __('No image selected'), 'frame_title' => __('Select Image'), 'frame_button' => __('Choose Image'));
     if (class_exists($field_class) && method_exists($field_class, 'render')) {
         $field_object = new $field_class($field, $value, $this->ReduxFramework);
         //				$enqueue->enqueue();
         echo "<label>" . "<span class=\"customize-control-title\">" . $field['title'] . "</span>" . "</label>";
         //				echo '<div class="redux-container-'. $this->type . '" >';
         echo $field_object->render();
         //				echo '<div>';
     }
 }
示例#3
0
文件: info.php 项目: qhuit/Tournesol
 public function render_content()
 {
     $field = search_multi($this->ReduxFramework->sections, 'id', $this->option_key);
     // the key is always unique so there will be only one
     $field = $field[0];
     if (!isset($field['name_suffix'])) {
         $field['name_suffix'] = "";
     }
     if (!isset($field['default'])) {
         $field['default'] = array();
     }
     $field['custom_data'] = $this->get_link();
     echo '</fieldset></li></ul>';
     echo '<ul class="accordion-section-content bottom" ><li><fieldset>';
     if (isset($field['title'])) {
         echo $field['title'];
     }
 }
function search_multi($array, $key, $value)
{
    $results = array();
    if (is_array($array)) {
        if (isset($array[$key]) && $array[$key] == $value) {
            $results[] = $array;
        }
        foreach ($array as $subarray) {
            $results = array_merge($results, search_multi($subarray, $key, $value));
        }
    }
    return $results;
}