public function __construct()
 {
     $options = Meta_Box_Attribute::get_attribute_content('options');
     $this->basic = array('id', 'name', 'desc', 'placeholder', 'size' => 'number', 'options' => array('type' => 'custom', 'content' => $options, 'size' => 'wide'), 'clone' => 'checkbox', 'multiple' => 'checkbox');
     $js_options = Meta_Box_Attribute::get_attribute_content('key_value', 'js_options');
     $this->advanced['js_options'] = array('type' => 'custom', 'content' => $js_options, 'size' => 'wide');
     parent::__construct();
 }
예제 #2
0
    public function __construct()
    {
        $query_args = Meta_Box_Attribute::get_attribute_content('key_value', 'query_args');
        $field_type = '<label for="{{field.id}}_field_type">Field Type <br />
					<select ng-model="field.field_type" class="form-control" id="{{field.id}}_field_type">
						<option value="select">Select</option>
						<option value="select_advanced">Select Advanced</option>
					</select>
				</label>';
        $this->basic = array('id', 'name', 'desc', 'std', 'query_args' => array('type' => 'custom', 'size' => 'wide', 'content' => $query_args), 'field_type' => array('type' => 'custom', 'content' => $field_type));
        parent::__construct();
    }
예제 #3
0
    public function __construct()
    {
        $query_args = Meta_Box_Attribute::get_attribute_content('key_value', 'query_args');
        $field_type = '<p class="description description-thin">
							<label for="{{field.id}}_field_type">Field Type <br />
								<select ng-model="field.field_type" class="form-control" id="{{field.id}}_field_type">
									<option value="select">Select</option>
									<option value="select_advanced">Select Advanced</option>
								</select>
							</label>
						</p>';
        $this->basic = array('id', 'name', 'desc', null, 'query_args' => array('type' => 'custom', 'size' => 'wide', 'content' => $query_args), 'field_type' => array('type' => 'custom', 'content' => $field_type), 'placeholder', 'parent' => 'checkbox');
        $datalist = Meta_Box_Attribute::get_attribute_content('datalist');
        $this->advanced['datalist'] = array('type' => 'custom', 'content' => $datalist, 'size' => 'wide');
        parent::__construct();
    }
예제 #4
0
 public function get_fields($fields)
 {
     $output = '';
     foreach ($fields as $index => $field) {
         // Clearfix
         if (is_null($index) || is_null($field)) {
             $output .= '<div class="clear"></div>';
             continue;
         }
         if (is_numeric($index)) {
             // Normal text field, normal size
             $output .= '<p class="description description-thin">';
             $output .= Meta_Box_Attribute::text($field);
             $output .= '</p>';
             continue;
         }
         if (is_string($field)) {
             $output .= '<p class="description description-thin">';
             $output .= Meta_Box_Attribute::$field($index);
             $output .= '</p>';
         }
         if (is_array($field) && !empty($field)) {
             $size = isset($field['size']) ? $field['size'] : 'thin';
             $label = isset($field['label']) ? $field['label'] : null;
             $attrs = isset($field['attrs']) ? $field['attrs'] : array();
             $type = isset($field['type']) ? $field['type'] : 'text';
             $output .= "<p class='description description-{$size}'>";
             if ($type === 'custom') {
                 $output .= $field['content'];
             } else {
                 $output .= Meta_Box_Attribute::$type($index, $label, $attrs);
             }
             $output .= '</p>';
         }
     }
     return $output;
 }
    public function __construct()
    {
        $query_args = Meta_Box_Attribute::get_attribute_content('key_value', 'query_args');
        $taxonomy = '<p class="description description-thin">
			<label for="{{field.id}}_taxonomy">Taxonomy</label>
			<select ng-model="field.options.taxonomy" class="form-control" id="{{field.id}}_taxonomy">';
        foreach (mbb_get_taxonomies() as $taxonomy) {
            $taxonomy .= '<option value="' . $taxonomy . '">' . $taxonomy . '</option>';
        }
        $taxonomy .= '</select></p>';
        $field_type = '<label for="{{field.id}}_type">Field Type <br />
				<select ng-model="field.options.type" class="form-control" id="{{field.id}}_type">
					<option value="select">Select</option>
					<option value="select_tree">Select Tree</option>
					<option value="select_advanced">Select Advanced</option>
					<option value="checkbox_list">Checkbox List</option>
					<option value="checkbox_tree">Checkbox Tree</option>
				</select>
			</label>';
        $this->basic = array('id', 'name', 'desc', 'taxonomy' => array('type' => 'custom', 'content' => $taxonomy), 'field_type' => array('type' => 'custom', 'content' => $field_type), 'clone' => 'checkbox', 'parent' => 'checkbox');
        $args = Meta_Box_Attribute::get_attribute_content('key_value', 'options.args');
        $this->advanced['args'] = array('type' => 'custom', 'content' => $args, 'size' => 'wide');
        parent::__construct();
    }
예제 #6
0
 public function __construct()
 {
     $js_options = Meta_Box_Attribute::get_attribute_content('key_value', 'js_options');
     $this->advanced['js_options'] = array('type' => 'custom', 'content' => $js_options, 'size' => 'wide');
     parent::__construct();
 }
예제 #7
0
 public function __construct()
 {
     $options = Meta_Box_Attribute::get_attribute_content('options');
     $this->basic = array('id', 'name', 'desc', null, 'options' => array('type' => 'custom', 'content' => $options, 'size' => 'wide'), 'clone' => array('type' => 'checkbox', 'size' => 'wide'));
     parent::__construct();
 }
예제 #8
0
 public function __construct()
 {
     $options = Meta_Box_Attribute::get_attribute_content('options');
     $this->basic = array('id', 'name', 'desc', 'options' => array('type' => 'custom', 'content' => $options, 'size' => 'wide'), 'clone' => 'checkbox', 'multiple' => array('type' => 'checkbox', 'label' => 'Multiple?', 'attrs' => array('ng-change', 'toggleMultiple()')));
     parent::__construct();
 }
예제 #9
0
 public function __construct()
 {
     $datalist = Meta_Box_Attribute::get_attribute_content('datalist');
     $this->advanced['datalist'] = array('type' => 'custom', 'content' => $datalist, 'size' => 'wide');
     parent::__construct();
 }
예제 #10
0
 public function __construct()
 {
     $key_value_default = Meta_Box_Attribute::get_attribute_content('key-value-default');
     $this->basic = array('id', 'name', 'desc', 'key_value_default' => array('type' => 'custom', 'content' => $key_value_default, 'size' => 'wide'));
     parent::__construct();
 }
예제 #11
0
 public function __construct()
 {
     $options = Meta_Box_Attribute::get_attribute_content('key_value', 'options');
     $this->basic = array('id', 'name', 'desc', 'rows' => 'number', 'options' => array('type' => 'custom', 'content' => $options, 'size' => 'wide'));
     parent::__construct();
 }