예제 #1
0
$options_panel->Title(__("Advanced Options", "apc"));
//sortable field
$options_panel->addSortable('sortable_field_id', array('1' => 'One', '2' => 'Two', '3' => 'three', '4' => 'four'), array('name' => __('My Sortable Field', 'apc'), 'desc' => __('Sortable field description', 'apc')));
/*
 * To Create a reapeater Block first create an array of fields
 * use the same functions as above but add true as a last param
 */
$repeater_fields[] = $options_panel->addText('re_text_field_id', array('name' => __('My Text ', 'apc')), true);
$repeater_fields[] = $options_panel->addTextarea('re_textarea_field_id', array('name' => __('My Textarea ', 'apc')), true);
$repeater_fields[] = $options_panel->addImage('image_field_id', array('name' => __('My Image ', 'apc')), true);
$repeater_fields[] = $options_panel->addCheckbox('checkbox_field_id', array('name' => __('My Checkbox  ', 'apc')), true);
/*
 * Then just add the fields to the repeater block
 */
//repeater block
$options_panel->addRepeaterBlock('re_', array('sortable' => true, 'inline' => true, 'name' => __('This is a Repeater Block', 'apc'), 'fields' => $repeater_fields, 'desc' => __('Repeater field description', 'apc')));
/**
 * To Create a Conditional Block first create an array of fields (just like a repeater block
 * use the same functions as above but add true as a last param
 */
$Conditinal_fields[] = $options_panel->addText('con_text_field_id', array('name' => __('My Text ', 'apc')), true);
$Conditinal_fields[] = $options_panel->addTextarea('con_textarea_field_id', array('name' => __('My Textarea ', 'apc')), true);
$Conditinal_fields[] = $options_panel->addImage('con_image_field_id', array('name' => __('My Image ', 'apc')), true);
$Conditinal_fields[] = $options_panel->addCheckbox('con_checkbox_field_id', array('name' => __('My Checkbox  ', 'apc')), true);
/**
 * Then just add the fields to the repeater block
 */
//conditinal block
$options_panel->addCondition('conditinal_fields', array('name' => __('Enable conditinal fields? ', 'apc'), 'desc' => __('<small>Turn ON if you want to enable the <strong>conditinal fields</strong>.</small>', 'apc'), 'fields' => $Conditinal_fields, 'std' => false));
/**
 * Close 5th tab