' . "\n" . '
' . "\n";
}
// Set default value to $val
if ( isset( $value['std']) ) {
$val = $value['std'];
}
// If the option is already saved, ovveride $val
if ( ($value['type'] != 'heading') && ($value['type'] != 'info')) {
if ( isset($settings[($value['id'])]) ) {
$val = $settings[($value['id'])];
// Striping slashes of non-array options
if (!is_array($val)) {
$val = stripslashes($val);
}
}
}
// If there is a description save it for labels
$explain_value = '';
if ( isset( $value['desc'] ) ) {
$explain_value = $value['desc'];
}
switch ( $value['type'] ) {
// Basic text input
case 'text':
$output .= '
';
break;
// Textarea
case 'textarea':
$cols = '8';
$ta_value = '';
if(isset($value['options'])){
$ta_options = $value['options'];
if(isset($ta_options['cols'])){
$cols = $ta_options['cols'];
} else { $cols = '8'; }
}
$val = stripslashes( $val );
$output .= '
';
break;
// Select Box
case ($value['type'] == 'select'):
$output .= '
';
foreach ($value['options'] as $key => $option ) {
$selected = '';
if( $val != '' ) {
if ( $val == $key) { $selected = ' selected="selected"';}
}
$output .= '' . esc_html( $option ) . ' ';
}
$output .= ' ';
break;
// Radio Box
case "radio":
$name = $option_name .'['. $value['id'] .']';
foreach ($value['options'] as $key => $option) {
$id = $option_name . '-' . $value['id'] .'-'. $key;
$output .= '
' . esc_html( $option ) . ' ';
}
break;
// Image Selectors
case "images":
$name = $option_name .'['. $value['id'] .']';
foreach ( $value['options'] as $key => $option ) {
$selected = '';
$checked = '';
if ( $val != '' ) {
if ( $val == $key ) {
$selected = ' t4p-radio-img-selected';
$checked = ' checked="checked"';
}
}
$output .= '
';
$output .= '
' . esc_html( $key ) . '
';
$output .= '
';
}
break;
// Checkbox
case "checkbox":
$output .= '
';
$output .= '
' . wp_kses( $explain_value, $allowedtags) . '
';
break;
// Multicheck
case "multicheck":
foreach ($value['options'] as $key => $option) {
$checked = '';
$label = $option;
$option = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($key));
$id = $option_name . '-' . $value['id'] . '-'. $option;
$name = $option_name . '[' . $value['id'] . '][' . $option .']';
if ( isset($val[$option]) ) {
$checked = checked($val[$option], 1, false);
}
$output .= '
' . esc_html( $label ) . ' ';
}
break;
// Color picker
case "color":
$output .= '
';
$output .= '
';
break;
// Uploader
case "upload":
$output .= evolve_medialibrary_uploader( $value['id'], $val, null ); // New AJAX Uploader using Media Library
break;
// Typography
case 'typography':
$typography_stored = $val;
// Font Size
$output .= '
';
for ($i = 9; $i < 71; $i++) {
$size = $i . 'px';
$output .= '' . esc_html( $size ) . ' ';
}
$output .= ' ';
// Font Face
$output .= '
';
$faces = evl_recognized_font_faces();
foreach ( $faces as $key => $face ) {
$output .= '' . esc_html( $face ) . ' ';
}
$output .= ' ';
// Font Weight
$output .= '
';
/* Font Style */
$styles = evl_recognized_font_styles();
foreach ( $styles as $key => $style ) {
$output .= ''. $style .' ';
}
$output .= ' ';
// Font Color
$output .= '
';
$output .= '
';
break;
// Background
case 'background':
$background = $val;
// Background Color
$output .= '
';
$output .= '
';
// Background Image - New AJAX Uploader using Media Library
if (!isset($background['image'])) {
$background['image'] = '';
}
$output .= evolve_medialibrary_uploader( $value['id'], $background['image'], null, '',0,'image');
$class = 'of-background-properties';
if ( '' == $background['image'] ) {
$class .= ' hide';
}
$output .= '
';
// Background Repeat
$output .= '';
$repeats = evl_recognized_background_repeat();
foreach ($repeats as $key => $repeat) {
$output .= ''. esc_html( $repeat ) . ' ';
}
$output .= ' ';
// Background Position
$output .= '';
$positions = evl_recognized_background_position();
foreach ($positions as $key=>$position) {
$output .= ''. esc_html( $position ) . ' ';
}
$output .= ' ';
// Background Attachment
$output .= '';
$attachments = evl_recognized_background_attachment();
foreach ($attachments as $key => $attachment) {
$output .= '' . esc_html( $attachment ) . ' ';
}
$output .= ' ';
$output .= '
';
break;
// Info
case "info":
$class = 'section';
if ( isset( $value['type'] ) ) {
$class .= ' section-' . $value['type'];
}
if ( isset( $value['class'] ) ) {
$class .= ' ' . $value['class'];
}
$output .= '
' . "\n";
if ( isset($value['name']) ) {
$output .= '
' . esc_html( $value['name'] ) . ' ' . "\n";
}
if ( $value['desc'] ) {
$output .= apply_filters('evl_sanitize_info', $value['desc'] ) . "\n";
}
$output .= '
' . "\n";
break;
// Heading
case "heading":
if ($counter >= 2) {
$output .= '
'."\n";
}
$jquery_click_hook = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($value['name']) );
$jquery_click_hook = "section-" . $jquery_click_hook;
$menu .= '
' . wp_kses( $explain_value, $allowedtags) . '