'.$value['desc'].'
';
$input_array=explode(',',$input_value);
foreach ($value['options'] as $option) {
$class='';
if (in_array($option['id'], $input_array)) {
$class = ' selected-check';
}
echo '';
}
echo '
';
$this->close_option($value);
}
/**
* Prints a text field with a color picker option.
*
* EXAMPLE USAGE:
* ------------------------------------------------------------------------------------------
* array(
* "name" => "Headings color",
* "id" => $shortname."_heading_color",
* "type" => "color"
* )
* ------------------------------------------------------------------------------------------
* @param $value the array that contains all the data for the option
*/
public function print_color($value){
echo $this->before_option_title.$value['name'].$this->after_option_title;
$std = isset($value['std'])?$value['std']:"";
$input_value = $this->get_field_value($value['id'], $std);
echo '#';
echo '';
$this->close_option($value);
}
/**
* Prints a text field with an upload button.
*
* EXAMPLE USAGE:
* ------------------------------------------------------------------------------------------
* array(
* "name" => "Logo image",
* "id" => $shortname."_logo_image",
* "type" => "upload"
* )
* ------------------------------------------------------------------------------------------
* @param $value the array that contains all the data for the option
*/
public function print_upload($value){
echo $this->before_option_title.$value['name'].$this->after_option_title;
$std = isset($value['std'])?$value['std']:"";
$input_value = $this->get_field_value($value['id'], $std);
echo '';
echo ''; $this->close_option($value); } /** * Prints a checkbox - this is the ON/OFF widget with an animation. * * EXAMPLE USAGE: * ------------------------------------------------------------------------------------------ * array( * "name" => "Checkbox Title", * "id" => $shortname."_test_check", * "type" => "checkbox", * "std" => "off" * ) * ------------------------------------------------------------------------------------------ * @param $value the array that contains all the data for the option */ public function print_checkbox($value){ echo $this->before_option_title.$value['name'].$this->after_option_title; $input_value = $this->get_field_value($value['id'], $value['std']); echo '
';
if($input_value=='true'){
$input_value='on';
}
if($input_value=='false'){
$input_value='off';
}
echo '';
$this->close_option($value);
}
/**
* Prints a widget for selecting styles for the theme. Generally it prints different buttons with
* different styles set to them so that the user can select one of them. It can be mostly used for
* selecting a color or a pattern from a given range.
*
* EXAMPLE USAGE OF PATTERNS:
* ------------------------------------------------------------------------------------------
* array(
* "name" => "Theme Pattern",
* "id" => $shortname."_pattern",
* "type" => "pattern",
* "options" => $patterns
* )
* ------------------------------------------------------------------------------------------
* @param $value the array that contains all the data for the option
* @param $type the type of the buttons, so far the supported values are "color" and "pattern"
*/
public function print_stylebox($value, $type){
echo $this->before_option_title.$value['name'].$this->after_option_title;
$std = isset($value['std'])?$value['std']:"";
$input_value = $this->get_field_value($value['id'], $std);
echo '
';
echo '
';
$this->close_option($value);
}
/**
* Prints a custom set of fields with an Add button - this field will be mostly used when
* several items that share the same data structure needs to be added. For example, this can be very
* useful for adding images to the slider with different options- title, link, etc.
* So far the fields that are supported by this function are text field, text field with upload button and a
* textarea.
*
* EXAMPLE USAGE:
* ------------------------------------------------------------------------------------------
* array(
* "name"=>"Add Slider Image",
* "id"=>'thumbnail_slider',
* "type"=>"custom",
* "button_text"=>'Add image',
* "preview"=>"thumbnail_image_name",
* "fields"=>array(
* array('id'=>'thumbnail_image_name', 'type'=>'upload', 'name'=>'Image URL'),
* array('id'=>'thumbnail_image_title', 'type'=>'text', 'name'=>'Image Title'),
* array('id'=>'thumbnail_image_desc', 'type'=>'textarea', 'name'=>'Image Description')
* )
* )
* ------------------------------------------------------------------------------------------
* @param $value the array that contains all the data for the option
*/
public function print_custom($value){
echo $this->before_option_title.$value['name'].$this->after_option_title.'- ';
$counter=0;
foreach ($value['options'] as $option) {
//set a style the option if this is an option for selecting a color or pattern
if($type=='pattern') {
//this is a pattern, set a background image to it
$style='background-image:url('.PEXETO_PATTERNS_URL.$option.');';
}elseif($type=='color'){
//this is a color, set background color to it
$style='background-color:#'.$option.';';
}
$class=$option==$input_value?'selected-style':'';
echo '
- '; } echo '
'; $field_ids=array(); $field_names=array(); $is_textarea=array(); foreach($value['fields'] as $field){ echo '
'.$field['name'].'';
switch($field['type']){
case 'text':
//print a standart text field
echo '';
$is_textarea[]="false";
break;
case 'upload':
//print a field with an upload button
echo '';
echo '
'; echo ''; $preview=$field['id']; $is_textarea[]="false"; break; case 'textarea': //print a textarea echo ''; $is_textarea[]="true"; break; case 'imageselect': //print a textarea echo ''; $is_textarea[]="false"; break; break; } $std = isset($value['std'])?$value['std']:""; $saved_value=$this->get_field_value( $field['id'].'s',$std ); $saved_value=stripslashes($saved_value); //echo '
';
echo ''; echo ''; $preview=$field['id']; $is_textarea[]="false"; break; case 'textarea': //print a textarea echo ''; $is_textarea[]="true"; break; case 'imageselect': //print a textarea echo ''; $is_textarea[]="false"; break; break; } $std = isset($value['std'])?$value['std']:""; $saved_value=$this->get_field_value( $field['id'].'s',$std ); $saved_value=stripslashes($saved_value); //echo '