'."\n"; if ( $value['type'] == "open-tab" || $value['type'] == "close-tab") { } else { $output .= '

' . esc_html( $value['name'] ) . '

' . "\n"; } $output .= '
' . "\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 .= ''; break; // Radio Box case "radio": $name = $option_name .'['. $value['id'] .']'; foreach ($value['options'] as $key => $option) { $id = $option_name . '-' . $value['id'] .'-'. $key; $output .= ''; } 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 .= '' . $option .''; } 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 .= ''; } 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 .= ''; // Font Face $output .= ''; // Font Weight $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 .= ''; // Background Position $output .= ''; // Background 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 .= '' . esc_html( $value['name'] ) . ''; $output .= '
'; break; case "open-tab": $output .= '
'; break; case "close-tab": $output .= '
'; break; } if ( ( $value['type'] != "heading" ) && ( $value['type'] != "info" ) ) { if ( $value['type'] != "checkbox" ) { $output .= '
'; } $output .= '
'; if ( $value['type'] != "checkbox" ) { $output .= '
' . wp_kses( $explain_value, $allowedtags) . '
'."\n"; } $output .= '
'."\n"; } } $output .= ''; return array($output,$menu); }