/** * Generates the options fields that are used in the form. */ static function optionsframework_fields() { global $allowedtags; $options_framework = new Options_Framework(); $option_name = $options_framework->get_option_name(); $settings = get_option($option_name); $options =& Options_Framework::_optionsframework_options(); $counter = 0; $menu = ''; foreach ($options as $value) { $val = ''; $select_value = ''; $output = ''; // Wrap all options if ($value['type'] != "heading" && $value['type'] != "info" && $value['type'] != "title" && $value['type'] != 'groupstart' && $value['type'] != 'groupend') { // Keep all ids lowercase with no spaces $value['id'] = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($value['id'])); $id = 'section-' . $value['id']; $class = 'section'; if (isset($value['type'])) { $class .= ' section-' . $value['type']; } if (isset($value['class'])) { $class .= ' ' . $value['class']; } $output .= '<div id="' . esc_attr($id) . '" class="' . esc_attr($class) . '">' . "\n"; if (isset($value['name'])) { $output .= '<h4 class="heading">' . esc_html($value['name']) . '</h4>' . "\n"; } if ($value['type'] != 'editor') { $output .= '<div class="option">' . "\n" . '<div class="controls">' . "\n"; } else { $output .= '<div class="option">' . "\n" . '<div>' . "\n"; } } // Set default value to $val if (isset($value['std'])) { $val = $value['std']; } // If the option is already saved, override $val if ($value['type'] != 'heading' && $value['type'] != 'info' && $value['type'] != "title" && $value['type'] != 'groupstart' && $value['type'] != 'groupend') { 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']; } // Set the placeholder if one exists $placeholder = ''; if (isset($value['placeholder'])) { $placeholder = ' placeholder="' . esc_attr($value['placeholder']) . '"'; } if (has_filter('optionsframework_' . $value['type'])) { $output .= apply_filters('optionsframework_' . $value['type'], $option_name, $value, $val); } switch ($value['type']) { // Basic text input case 'text': $output .= '<input id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" type="text" value="' . esc_attr($val) . '"' . $placeholder . ' />'; break; // Basic number input // Basic number input case 'number': $output .= '<input id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" type="number" min="1" max="1000" value="' . esc_attr($val) . '"' . $placeholder . ' step="1" />'; break; // Password input // Password input case 'password': $output .= '<input id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" type="password" value="' . esc_attr($val) . '" />'; break; // Textarea // Textarea case 'textarea': $rows = '8'; //if ( isset( $value['settings']['rows'] ) ) { // $custom_rows = $value['settings']['rows']; // if ( is_numeric( $custom_rows ) ) { // $rows = $custom_rows; // } // } if (isset($value['rows'])) { $custom_rows = $value['rows']; if (is_numeric($custom_rows)) { $rows = $custom_rows; } } $val = stripslashes($val); $output .= '<textarea id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" rows="' . $rows . '"' . $placeholder . '>' . esc_textarea($val) . '</textarea>'; break; //Ap-Mag Textarea //Ap-Mag Textarea case 'apmagtextarea': $rows = '10'; if (isset($value['settings']['rows'])) { $custom_rows = $value['settings']['rows']; if (is_numeric($custom_rows)) { $rows = $custom_rows; } } //$val = stripslashes( $val ); $output .= '<textarea id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" rows="' . $rows . '"' . $placeholder . '>' . $val . '</textarea>'; break; // Select Box // Select Box case 'select': $output .= '<select class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" id="' . esc_attr($value['id']) . '">'; foreach ($value['options'] as $key => $option) { $output .= '<option' . selected($val, $key, false) . ' value="' . esc_attr($key) . '">' . esc_html($option) . '</option>'; } $output .= '</select>'; break; // Box // Box case "radio": $name = $option_name . '[' . $value['id'] . ']'; foreach ($value['options'] as $key => $option) { $id = $option_name . '-' . $value['id'] . '-' . $key; $output .= '<div class="radio"><input class="of-input of-radio" type="radio" name="' . esc_attr($name) . '" id="' . esc_attr($id) . '" value="' . esc_attr($key) . '" ' . checked($val, $key, false) . ' /><label for="' . esc_attr($id) . '">' . esc_html($option) . '</label></div>'; } break; // Image Selectors // Image Selectors case "images": $name = $option_name . '[' . $value['id'] . ']'; foreach ($value['options'] as $key => $option) { $selected = ''; if ($val != '' && $val == $key) { $selected = ' of-radio-img-selected'; } $output .= '<input type="radio" id="' . esc_attr($value['id'] . '_' . $key) . '" class="of-radio-img-radio" value="' . esc_attr($key) . '" name="' . esc_attr($name) . '" ' . checked($val, $key, false) . ' />'; $output .= '<div class="of-radio-img-label">' . esc_html($key) . '</div>'; $output .= '<img src="' . esc_url($option) . '" alt="' . $option . '" class="of-radio-img-img' . $selected . '" onclick="document.getElementById(\'' . esc_attr($value['id'] . '_' . $key) . '\').checked=true;" />'; } break; // Checkbox // Checkbox case "checkbox": $output .= '<input id="' . esc_attr($value['id']) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" ' . checked($val, 1, false) . ' />'; $output .= '<label class="explain" for="' . esc_attr($value['id']) . '">' . wp_kses($explain_value, $allowedtags) . '</label>'; break; // Switch // Switch case "switch": $output .= '<div class="switch_options">'; $output .= '<span class="switch_enable">' . esc_attr($value['on']) . '</span>'; $output .= '<span class="switch_disable">' . esc_attr($value['off']) . '</span>'; $output .= '<input id="' . esc_attr($value['id']) . '" type="hidden" class="switch_val" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" value="' . esc_attr($val) . '"/>'; $output .= '</div>'; break; // SliderUI // SliderUI case "sliderui": $s_min = $s_max = $s_step = $s_edit = ''; $s_edit = ' readonly="readonly"'; if (!isset($value['min'])) { $s_min = '0'; } else { $s_min = $value['min']; } if (!isset($value['max'])) { $s_max = $s_min + 1; } else { $s_max = $value['max']; } if (!isset($value['step'])) { $s_step = '1'; } else { $s_step = $value['step']; } //values $s_data = 'data-id="' . $value['id'] . '" data-val="' . esc_attr($val) . '" data-min="' . $s_min . '" data-max="' . $s_max . '" data-step="' . $s_step . '"'; //html output $output .= '<input type="text" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" id="' . esc_attr($value['id']) . '" value="' . esc_attr($val) . '" ' . $s_edit . ' />'; $output .= '<div id="' . $value['id'] . '-slider" class="ap_sliderui" ' . $s_data . '></div>'; break; // Multicheck // 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 .= '<input id="' . esc_attr($id) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr($name) . '" ' . $checked . ' /><label for="' . esc_attr($id) . '">' . esc_html($label) . '</label>'; } break; // Color picker // Color picker case "color": $default_color = ''; if (isset($value['std'])) { if ($val != $value['std']) { $default_color = ' data-default-color="' . $value['std'] . '" '; } } $output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" id="' . esc_attr($value['id']) . '" class="of-color" type="text" value="' . esc_attr($val) . '"' . $default_color . ' />'; break; // Uploader // Uploader case "upload": $output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $val, null); break; // Install Demo // Install Demo case 'demo': $output .= '<a href="#">' . __('Install Demo', 'accesspress-mag') . '</a>'; break; // Typography // Typography case 'typography': unset($font_size, $font_style, $font_face, $font_color); $typography_defaults = array('size' => $value['size'] . "px", 'face' => $value['face'], 'style' => $value['style'], 'color' => $value['color']); $typography_stored = wp_parse_args($val, $typography_defaults); $accesspress_pro_font_list = get_option('accesspress_mag_google_font'); $font_family = $typography_stored['face']; $font_array = accesspress_search_key($accesspress_pro_font_list, 'family', $font_family); $variants_array = $font_array['0']['variants']; $typography_options = array('sizes' => of_recognized_font_sizes(), 'faces' => of_recognized_font_faces(), 'styles' => $variants_array, 'color' => true); if (isset($value['options'])) { $typography_options = wp_parse_args($value['options'], $typography_options); } // Font Size if ($typography_options['sizes']) { $font_size = '<select class="of-typography of-typography-size" name="' . esc_attr($option_name . '[' . $value['id'] . '][size]') . '" id="' . esc_attr($value['id'] . '_size') . '">'; $sizes = $typography_options['sizes']; foreach ($sizes as $i) { $size = $i . 'px'; $font_size .= '<option value="' . esc_attr($size) . '" ' . selected($typography_stored['size'], $size, false) . '>' . esc_html($size) . '</option>'; } $font_size .= '</select>'; } // Font Face if ($typography_options['faces']) { $font_face = '<select class="of-typography of-typography-face" name="' . esc_attr($option_name . '[' . $value['id'] . '][face]') . '" id="' . esc_attr($value['id'] . '_face') . '">'; $faces = $typography_options['faces']; foreach ($faces as $key => $face) { $font_face .= '<option value="' . esc_attr($key) . '" ' . selected($typography_stored['face'], $key, false) . '>' . esc_html($face) . '</option>'; } $font_face .= '</select>'; } // Font Styles if ($typography_options['styles']) { $font_style = '<select class="of-typography of-typography-style" name="' . $option_name . '[' . $value['id'] . '][style]" id="' . $value['id'] . '_style">'; $styles = $typography_options['styles']; foreach ($styles as $key => $style) { $font_style .= '<option value="' . esc_attr($key) . '" ' . selected($typography_stored['style'], $key, false) . '>' . $style . '</option>'; } $font_style .= '</select>'; } // Font Color if ($typography_options['color']) { $default_color = ''; if (isset($value['std']['color'])) { if ($val != $value['std']['color']) { $default_color = ' data-default-color="' . $value['std']['color'] . '" '; } } $font_color = '<input name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" class="of-color of-typography-color type="text" value="' . esc_attr($typography_stored['color']) . '"' . $default_color . ' />'; } // Allow modification/injection of typography fields $typography_fields = compact('font_size', 'font_face', 'font_style', 'font_color'); $typography_fields = apply_filters('of_typography_fields', $typography_fields, $typography_stored, $option_name, $value); $output .= implode('', $typography_fields); $output .= '<div class="typographytextbox" id="' . $value['id'] . '">The Quick Brown Fox Jumps Over The Lazy Dog. 1234567890</div>'; break; // Background // Background case 'background': $background = $val; // Background Color //$default_color = ''; // if ( isset( $value['std']['color'] ) ) { // if ( $val != $value['std']['color'] ) // $default_color = ' data-default-color="' .$value['std']['color'] . '" '; // } // $output .= '<input name="' . esc_attr( $option_name . '[' . $value['id'] . '][color]' ) . '" id="' . esc_attr( $value['id'] . '_color' ) . '" class="of-color of-background-color" type="text" value="' . esc_attr( $background['color'] ) . '"' . $default_color .' />'; // Background Image if (!isset($background['image'])) { $background['image'] = ''; } $output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $background['image'], null, esc_attr($option_name . '[' . $value['id'] . '][image]')); $class = 'of-background-properties'; if ('' == $background['image']) { $class .= ' hide'; } $output .= '<div class="' . esc_attr($class) . '">'; // Background Repeat $output .= '<select class="of-background of-background-repeat" name="' . esc_attr($option_name . '[' . $value['id'] . '][repeat]') . '" id="' . esc_attr($value['id'] . '_repeat') . '">'; $repeats = of_recognized_background_repeat(); foreach ($repeats as $key => $repeat) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background['repeat'], $key, false) . '>' . esc_html($repeat) . '</option>'; } $output .= '</select>'; // Background Position $output .= '<select class="of-background of-background-position" name="' . esc_attr($option_name . '[' . $value['id'] . '][position]') . '" id="' . esc_attr($value['id'] . '_position') . '">'; $positions = of_recognized_background_position(); foreach ($positions as $key => $position) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background['position'], $key, false) . '>' . esc_html($position) . '</option>'; } $output .= '</select>'; // Background Attachment $output .= '<select class="of-background of-background-attachment" name="' . esc_attr($option_name . '[' . $value['id'] . '][attachment]') . '" id="' . esc_attr($value['id'] . '_attachment') . '">'; $attachments = of_recognized_background_attachment(); foreach ($attachments as $key => $attachment) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background['attachment'], $key, false) . '>' . esc_html($attachment) . '</option>'; } $output .= '</select>'; $output .= '</div>'; break; // Editor // Editor case 'editor': $output .= '<div class="explain">' . wp_kses($explain_value, $allowedtags) . '</div>' . "\n"; echo $output; $textarea_name = esc_attr($option_name . '[' . $value['id'] . ']'); $default_editor_settings = array('textarea_name' => $textarea_name, 'media_buttons' => false, 'tinymce' => array('plugins' => 'wordpress')); $editor_settings = array(); if (isset($value['settings'])) { $editor_settings = $value['settings']; } $editor_settings = array_merge($default_editor_settings, $editor_settings); wp_editor($val, $value['id'], $editor_settings); $output = ''; break; // Info // Info case "info": $id = ''; $class = 'section'; if (isset($value['id'])) { $id = 'id="' . esc_attr($value['id']) . '" '; } if (isset($value['type'])) { $class .= ' section-' . $value['type']; } if (isset($value['class'])) { $class .= ' ' . $value['class']; } $output .= '<div ' . $id . 'class="' . esc_attr($class) . '">' . "\n"; if (isset($value['name'])) { $output .= '<h4 class="heading">' . esc_html($value['name']) . '</h4>' . "\n"; } if (isset($value['desc'])) { $output .= '<div class="option"><div class="explain">' . wp_kses($value['desc'], $allowedtags) . '</div></div>' . "\n"; //$output .= $value['desc'] . "\n"; } $output .= '</div>' . "\n"; break; // Heading for Navigation // Heading for Navigation case "heading": $counter++; if ($counter >= 2) { $output .= '</div>' . "\n"; } $class = ''; $class = !empty($value['id']) ? $value['id'] : $value['name']; $class = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($class)); $output .= '<div id="options-group-' . $counter . '" class="group ' . $class . '">'; $output .= '<h3>' . esc_html($value['name']) . '</h3>' . "\n"; break; // Custom Static Heading for Navigation // Custom Static Heading for Navigation case 'static_heading': break; //Custom Group Start //Custom Group Start case 'groupstart': $id = ''; $group = ''; $class = 'section'; if (isset($value['id'])) { $id = 'id="' . esc_attr($value['id']) . '" '; } if (isset($value['type'])) { $class .= ' section-' . $value['type']; } if (isset($value['class'])) { $class .= ' ' . $value['class']; } if (isset($value['group'])) { $group .= '[' . $value['group'] . ']'; } $output .= '<div ' . $id . 'class="' . esc_attr($class) . '">' . "\n"; if (isset($value['name'])) { $output .= '<h4 class="group-heading">' . esc_html($value['name']) . '<span class="heading-arrow side"><i class="fa fa-angle-right"></i></span></h4>' . "\n"; } $output .= '<div class="group-content">'; $output .= '<input class="section-order" type="hidden" name="' . esc_attr($option_name . $group . '[' . $value['id'] . ']') . '">' . "\n"; break; // Button // Button case "button": $output .= '<a id="' . esc_attr($value['id']) . '" class="button-primary" href="javascript:void(0);">' . esc_attr($value['button_name']) . '</a>' . "\n"; if (!empty($value['html'])) { $output .= wp_kses_post($value['html']); } break; //Custom Group End //Custom Group End case 'groupend': $output .= '</div></div>' . "\n"; break; } if ($value['type'] != "heading" && ($value['type'] != "info" && $value['type'] != "title" && $value['type'] != 'groupstart' && $value['type'] != 'groupend')) { $output .= '</div>'; if ($value['type'] != "checkbox" && $value['type'] != "editor") { $output .= '<div class="explain">' . wp_kses($explain_value, $allowedtags) . '</div>' . "\n"; } $output .= '</div></div>' . "\n"; } echo $output; } // Outputs closing div if there tabs if (Options_Framework_Interface::optionsframework_tabs() != '') { echo '</div>'; } }
/** * Builds out the options panel. * * If we were using the Settings API as it was intended we would use * do_settings_sections here. But as we don't want the settings wrapped in a table, * we'll call our own custom optionsframework_fields. See options-interface.php * for specifics on how each individual field is generated. * * Nonces are provided using the settings_fields() * * @since 1.7.0 */ function options_page() { ?> <div class="clear"></div> <div id="optionsframework-wrap" class="wrap tutannet-themeoption"> <div class="theme-header clearfix"> <div class="tutannet-logo"> <img src="<?php echo get_template_directory_uri(); ?> /images/logo.png" alt="<?php esc_attr_e('TuTanNet', 'tutannet'); ?> " /> <div class="theme-name"> <?php $theme = wp_get_theme(); echo $theme->get('Name') . " " . $theme->get('Version'); ?> </div> </div> <?php //$menu = $this->menu_settings(); ?> <!--<div class="big-title"><?php //echo esc_html( $menu['page_title'] ); ?> </div>--> </div> <div class="nav-tab-wrapper"> <?php echo Options_Framework_Interface::optionsframework_tabs(); ?> </div> <div id="optionsframework-metabox" class="metabox-holder"> <div id="optionsframework" class="postbox"> <div class="save-message"><?php settings_errors('options-framework'); ?> </div> <form action="options.php" method="post"> <?php settings_fields('optionsframework'); ?> <?php Options_Framework_Interface::optionsframework_fields(); /* Settings */ ?> <div id="optionsframework-submit"> <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e('Save Options', 'tutannet'); ?> " /> <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e('Restore Defaults', 'tutannet'); ?> " onclick="return confirm( '<?php print esc_js(__('Click OK to reset. Any theme settings will be lost!', 'tutannet')); ?> ' );" /> <div class="clear"></div> </div> </form> </div> <!-- / #container --> </div> <?php do_action('optionsframework_after'); ?> <div class="clear"></div> </div> <!-- / .wrap --> <?php }
/** * Builds out the options panel. * * If we were using the Settings API as it was intended we would use * do_settings_sections here. But as we don't want the settings wrapped in a table, * we'll call our own custom optionsframework_fields. See options-interface.php * for specifics on how each individual field is generated. * * Nonces are provided using the settings_fields() * * @since 1.7.0 */ function options_page() { ?> <div id="optionsframework-wrap" class="wrap"> <?php $menu = $this->menu_settings(); ?> <h2><?php echo esc_html($menu['page_title']); ?> </h2> <h2 class="nav-tab-wrapper"> <?php echo Options_Framework_Interface::optionsframework_tabs(); ?> </h2> <?php settings_errors('options-framework'); ?> <div id="optionsframework-metabox" class="metabox-holder"> <div id="optionsframework" class="postbox"> <form action="options.php" method="post"> <?php settings_fields('optionsframework'); ?> <?php Options_Framework_Interface::optionsframework_fields(); /* Settings */ ?> <div id="optionsframework-submit"> <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e('Save Options', 'textdomain'); ?> " /> <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e('Restore Defaults', 'textdomain'); ?> " onclick="return confirm( '<?php print esc_js(__('Click OK to reset. Any theme settings will be lost!', 'textdomain')); ?> ' );" /> <div class="clear"></div> </div> </form> </div> <!-- / #container --> </div> <?php do_action('optionsframework_after'); ?> </div> <!-- / .wrap --> <?php }
/** * Builds out the options panel. * * If we were using the Settings API as it was intended we would use * do_settings_sections here. But as we don't want the settings wrapped in a table, * we'll call our own custom optionsframework_fields. See options-interface.php * for specifics on how each individual field is generated. * * Nonces are provided using the settings_fields() * * @since 1.7.0 */ function options_page() { ?> <div class="clear"></div> <div id="optionsframework-wrap" class="wrap apmag-themeoption"> <div class="theme-header clearfix"> <div class="accesspress-mag-logo"> <img src="<?php echo get_template_directory_uri(); ?> /images/logo.png" alt="<?php esc_attr_e('AccessPress Mag', 'accesspress-mag'); ?> " /> <div class="theme-name"> <?php $theme = wp_get_theme(); echo $theme->get('Name') . " V" . $theme->get('Version') . __(' - Theme Option Panel', 'accesspress-mag'); ?> </div> </div> <div class="ak-socials"> <p><?php _e('Like/Follow us for New Updates', 'accesspress-mag'); ?> </p> <iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FAccessPress-Themes%2F1396595907277967&width&layout=button&action=like&show_faces=false&share=false&height=35&appId=1411139805828592" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:20px; width:50px " allowTransparency="true"></iframe> <a href="https://twitter.com/apthemes" class="twitter-follow-button" data-show-count="false" data-lang="en">Follow @apthemes</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> <p> <a target="_blank" href="<?php echo esc_url('http://doc.accesspressthemes.com/accesspress-mag-pro-doc'); ?> "><?php _e('Online Documentation', 'accesspress-mag'); ?> </a> | <a target="_blank" href="<?php echo esc_url('http://accesspressthemes.com/support'); ?> "><?php _e('Support Forum', 'accesspress-mag'); ?> </a> </p> </div> <?php //$menu = $this->menu_settings(); ?> <!--<div class="big-title"><?php //echo esc_html( $menu['page_title'] ); ?> </div>--> </div> <div class="nav-tab-wrapper"> <?php echo Options_Framework_Interface::optionsframework_tabs(); ?> </div> <div id="optionsframework-metabox" class="metabox-holder"> <div id="optionsframework" class="postbox"> <div class="save-message"><?php settings_errors('options-framework'); ?> </div> <form action="options.php" method="post"> <?php settings_fields('optionsframework'); ?> <?php Options_Framework_Interface::optionsframework_fields(); /* Settings */ ?> <div id="optionsframework-submit"> <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e('Save Options', 'accesspress-mag'); ?> " /> <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e('Restore Defaults', 'accesspress-mag'); ?> " onclick="return confirm( '<?php print esc_js(__('Click OK to reset. Any theme settings will be lost!', 'accesspress-mag')); ?> ' );" /> <div class="clear"></div> </div> </form> </div> <!-- / #container --> </div> <?php do_action('optionsframework_after'); ?> <div class="clear"></div> </div> <!-- / .wrap --> <?php }
/** * Builds out the options panel. * * If we were using the Settings API as it was intended we would use * do_settings_sections here. But as we don't want the settings wrapped in a table, * we'll call our own custom optionsframework_fields. See options-interface.php * for specifics on how each individual field is generated. * * Nonces are provided using the settings_fields() * * @since 1.7.0 */ function options_page() { ?> <div id="optionsframework" class="wrap"> <?php settings_errors('options-framework'); ?> <div class="new_options_container"> <form action="options.php" method="post"> <?php settings_fields('optionsframework'); ?> <div class="new_options_container_top"> <div class="new_options_container_top_logo"> <a href="http://www.themealley.com/"><img src="<?php echo get_template_directory_uri(); ?> /images/logo.png" /></a> </div> <div class="new_options_container_top_twit"> <div class="new_options_container_top_twit_bookmark"> <div class="new_options_container_top_twit_bookmarkf"> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div class="fb-like" data-href="http://www.facebook.com/ThemeAlley" data-send="false" data-layout="box_count" data-width="450" data-show-faces="false"></div> </div> <div class="new_options_container_top_twit_bookmarkt"> <a href="https://twitter.com/share" class="twitter-share-button" data-lang="en" data-url="https://www.themealley.com/" data-count="vertical" data-text="Responsive WordPress Themes">Tweet</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> </div> <div class="new_options_container_top_twit_bookmarkg"> <!-- Place this tag where you want the +1 button to render --> <g:plusone size="tall" href="https://www.themealley.com/"></g:plusone> <!-- Place this render call where appropriate --> <script type="text/javascript"> (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })(); </script> </div> </div> </div> <div class="new_options_container_top_rate"> <a href="http://www.themealley.com/business/?a_aid=tskk&a_bid=550dad4a&chan=<?php echo wp_get_theme(); ?> "> <img src="<?php echo get_template_directory_uri(); ?> /images/rate.png" /> </a> </div> </div><!-- .new_options_container_top --> <div id="countrytabs" class="new_options_container_middle"> <ul class="shadetabs"> <li class="big"><a href="#country1"><h6><?php echo __('General', 'alexandria'); ?> </h6><p><?php echo __('Settings', 'alexandria'); ?> </p></a></li> <li class="small"><a href="#country2"><p><?php echo __('Social Settings', 'alexandria'); ?> </p></a></li> <li class="big"><a href="#country10"><h6><?php echo __('Logo Section', 'alexandria'); ?> </h6><p><?php echo __('Settings', 'alexandria'); ?> </p></a></li> <li class="big"><a href="#country3"><h6><?php echo __('Header', 'alexandria'); ?> </h6><p><?php echo __('Settings', 'alexandria'); ?> </p></a></li> <li class="big"><a href="#country4"><h6><?php echo __('Layout', 'alexandria'); ?> </h6><p><?php echo __('Settings', 'alexandria'); ?> </p></a></li> <li class="small"><a href="#country5"><p><?php echo __('Biz One Settings', 'alexandria'); ?> </p></a></li> <li class="small"><a href="#country7"><p><?php echo __('Biz Two Settings', 'alexandria'); ?> </p></a></li> <li class="small"><a href="#country9"><p><?php echo __('Standard Blog Settings', 'alexandria'); ?> </p></a></li> <li class="big"><a href="#country19"><h6><?php echo __('Portfolio', 'alexandria'); ?> </h6><p><?php echo __('Settings', 'alexandria'); ?> </p></a></li> <li class="big"><a href="#country11"><h6><?php echo __('Footer', 'alexandria'); ?> </h6><p><?php echo __('Settings', 'alexandria'); ?> </p></a></li> </ul> <div class="shadetabscontent"> <?php Options_Framework_Interface::optionsframework_fields(); /* Settings */ ?> </div><!-- .shadetabscontent --> <script type="text/javascript"> jQuery(document).ready(function(){ jQuery.noConflict(); jQuery('#countrytabs').tabs(); }); </script> </div><!-- #new_options_container_middle --> <div class="new_options_container_bottom"> <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e(__('Save Options', 'alexandria')); ?> " /> <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e(__('Restore Defaults', 'alexandria')); ?> " onclick="return confirm( '<?php print esc_js(__('Click OK to reset. Any theme settings will be lost!', 'alexandria')); ?> ' );" /> </div><!-- .new_options_container_bottom --> </form> </div><!-- .new_options_container --> </div><!-- #optionsframework --> <?php }
/** * Builds out the options panel. * * If we were using the Settings API as it was intended we would use * do_settings_sections here. But as we don't want the settings wrapped in a table, * we'll call our own custom optionsframework_fields. See options-interface.php * for specifics on how each individual field is generated. * * Nonces are provided using the settings_fields() * * @since 1.7.0 */ function options_page() { ?> <div id="optionsframework-wrap" class="wrap clearfix"> <?php $menu = $this->menu_settings(); ?> <div class="theme-header clearfix"> <div class="accesspress-root-logo"> <img src="<?php echo get_template_directory_uri(); ?> /inc/option-framework/images/logo.png" alt="<?php esc_attr_e('AccessPress Themes', 'accesspress-store'); ?> " /> </div> <div class="ak-socials"> <p><?php _e('Follow us for new updates', 'accesspress-store'); ?> </p> <div class="social-bttns"> </div> </div> </div> <h2 class="nav-tab-wrapper"> <?php echo Options_Framework_Interface::optionsframework_tabs(); ?> </h2> <div id="optionsframework-metabox" class="metabox-holder"> <?php settings_errors('options-framework'); ?> <div id="optionsframework" class="postbox"> <form action="options.php" method="post"> <?php settings_fields('optionsframework'); ?> <?php Options_Framework_Interface::optionsframework_fields(); /* Settings */ ?> <div id="optionsframework-submit"> <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e('Save Options', 'accesspress-store'); ?> " /> <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e('Restore Defaults', 'accesspress-store'); ?> " onclick="return confirm( '<?php print esc_js(__('Click OK to reset. Any theme settings will be lost!', 'accesspress-store')); ?> ' );" /> <div class="clear"></div> </div> </form> </div> <!-- / #container --> </div> <?php do_action('optionsframework_after'); ?> </div> <!-- / .wrap --> <div class="clearfix"></div> <?php }
/** * Builds out the options panel. * * If we were using the Settings API as it was intended we would use * do_settings_sections here. But as we don't want the settings wrapped in a table, * we'll call our own custom optionsframework_fields. See options-interface.php * for specifics on how each individual field is generated. * * Nonces are provided using the settings_fields() * * @since 1.7.0 */ function options_page() { ?> <div class="clear"></div> <div id="optionsframework-wrap" class="wrap apmag-themeoption"> <div class="theme-header clearfix"> <div class="accesspress-mag-logo"> <img src="<?php echo get_template_directory_uri(); ?> /images/logo.png" alt="<?php esc_attr_e('AccessPress Mag', 'accesspress-mag'); ?> " /> <div class="theme-name"> <?php $theme = wp_get_theme(); echo $theme->get('Name') . " V" . $theme->get('Version') . __(' - Theme Option Panel', 'accesspress-mag'); ?> </div> </div> <div class="ak-socials"> <p> <a target="_blank" href="<?php echo esc_url('http://accesspressthemes.com/accesspress-mag/'); ?> "><?php _e('Demo', 'accesspress-mag'); ?> </a> | <a target="_blank" href="<?php echo esc_url('https://accesspressthemes.com/accesspress-mag-documentation'); ?> "><?php _e('Documentation', 'accesspress-mag'); ?> </a> | <!--<a target="_blank" href="<?php //echo esc_url( 'https://wordpress.org/support/theme/accesspress-mag'); ?> "><?php //_e( 'Support', 'accesspress-mag'); ?> </a>--> <?php echo sprintf(__('Any question!! Click <a href="%s" target="_blank">here</a> for Live Chat.', 'accesspress-mag'), esc_url('https://accesspressthemes.com/contact/')); ?> </p> </div> <?php //$menu = $this->menu_settings(); ?> <!--<div class="big-title"><?php //echo esc_html( $menu['page_title'] ); ?> </div>--> </div> <div class="nav-tab-wrapper"> <?php echo Options_Framework_Interface::optionsframework_tabs(); ?> </div> <div id="optionsframework-metabox" class="metabox-holder"> <div id="optionsframework" class="postbox"> <div class="save-message"><?php settings_errors('options-framework'); ?> </div> <form action="options.php" method="post"> <?php settings_fields('optionsframework'); ?> <?php Options_Framework_Interface::optionsframework_fields(); /* Settings */ ?> <div id="optionsframework-submit"> <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e('Save Options', 'accesspress-mag'); ?> " /> <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e('Restore Defaults', 'accesspress-mag'); ?> " onclick="return confirm( '<?php print esc_js(__('Click OK to reset. Any theme settings will be lost!', 'accesspress-mag')); ?> ' );" /> <div class="clear"></div> </div> </form> </div> <!-- / #container --> </div> <div class="promo-banner clearfix"> <div class="banner-image"> <img src="<?php echo get_template_directory_uri() . '/inc/option-framework/images/upgrade-mag-pro.jpg'; ?> " /> </div> <div class="button-link"> <?php $pro_demo_link = 'http://demo.accesspressthemes.com/accesspress-mag-pro'; $pro_upgrade_link = 'https://accesspressthemes.com/wordpress-themes/accesspress-mag-pro/'; ?> <a href="<?php echo esc_url($pro_demo_link); ?> " target="_blank"><img src="<?php echo get_template_directory_uri() . '/inc/option-framework/images/demo-btn.png'; ?> "/></a> <a href="<?php echo esc_url($pro_upgrade_link); ?> " target="_blank"><img src="<?php echo get_template_directory_uri() . '/inc/option-framework/images/upgrade-btn.png'; ?> "/></a> </div> <div class="any-question"> <?php echo sprintf(__('Any question!! Click <a href="%s" target="_blank"> here!! </a> for live chat', 'accesspress-mag'), esc_url('https://accesspressthemes.com/contact/')); ?> </div> <div class="view-features"> <h3><?php _e('View Features', 'accesspress-mag'); ?> <span>+<span></h3> <div style="display:none" class="view-features-img"> <img src="<?php echo get_template_directory_uri() . '/inc/option-framework/images/upgrade-mag-pro-features.jpg'; ?> " /> </div> </div> </div> <?php do_action('optionsframework_after'); ?> <div class="clear"></div> </div> <!-- / .wrap --> <?php }
/** * Builds out the options panel. * * If we were using the Settings API as it was intended we would use * do_settings_sections here. But as we don't want the settings wrapped in a table, * we'll call our own custom optionsframework_fields. See options-interface.php * for specifics on how each individual field is generated. * * Nonces are provided using the settings_fields() * * @since 1.7.0 */ function options_page() { ?> <div id="optionsframework-themepromo"> <div class="promo-inner"> <h3>Support</h3> <div class="inside"> <p>The best way to contact me with <b>support questions</b> and <b>bug reports</b> is via our <a href="<?php esc_attr_e('http://facebook.com/templatesnext/', 'textdomain'); ?> " target="_blank">facebook page</a>.</p> <p>If you like i-craft please rate us at <a href="<?php esc_attr_e('http://wordpress.org/support/view/theme-reviews/i-craft', 'textdomain'); ?> " target="_blank">WordPress.org</a> and like our <a href="<?php esc_attr_e('http://facebook.com/templatesnext/', 'textdomain'); ?> " target="_blank">facebook page</a>. </p> </div> </div> </div> <div id="optionsframework-wrap" class="wrap"> <?php $menu = $this->menu_settings(); ?> <div class="promo-2"> <div class="promo-wrap"> <a href="<?php esc_attr_e('http://templatesnext.org/icraft/', 'textdomain'); ?> " target="_blank">i-craft Demo</a> <a href="<?php esc_attr_e('http://templatesnext.org/icraft/docs', 'textdomain'); ?> ">Documentation</a> <div class="donate"> <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="M2HN47K2MQHAN"> <table> <tr><td><input type="hidden" name="on0" value="If you like my work, buy me">If you like my work, buy me</td></tr><tr><td><select name="os0"> <option value="a cup of coffee">1 cup of coffee $10.00 USD</option> <option value="2 cup of coffee">2 cup of coffee $20.00 USD</option> <option value="3 cup of coffee">3 cup of coffee $30.00 USD</option> </select> </td></tr> </table> <input type="hidden" name="currency_code" value="USD"> <input type="image" src="https://www.paypalobjects.com/en_GB/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online."> <img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1"> </form> </div> </div> </div> <h2><?php echo esc_html($menu['page_title']); ?> </h2> <h2 class="nav-tab-wrapper"> <?php echo Options_Framework_Interface::optionsframework_tabs(); ?> </h2> <?php settings_errors('options-framework'); ?> <div id="optionsframework-metabox" class="metabox-holder"> <div id="optionsframework" class="postbox"> <form action="options.php" method="post"> <?php settings_fields('optionsframework'); ?> <?php Options_Framework_Interface::optionsframework_fields(); /* Settings */ ?> <div id="optionsframework-submit"> <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e('Save Options', 'theme-textdomain'); ?> " /> <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e('Restore Defaults', 'theme-textdomain'); ?> " onclick="return confirm( '<?php print esc_js(__('Click OK to reset. Any theme settings will be lost!', 'theme-textdomain')); ?> ' );" /> <div class="clear"></div> </div> </form> </div> <!-- / #container --> </div> <?php do_action('optionsframework_after'); ?> </div> <!-- / .wrap --> <?php }
/** * Builds out the options panel. * * If we were using the Settings API as it was intended we would use * do_settings_sections here. But as we don't want the settings wrapped in a table, * we'll call our own custom optionsframework_fields. See options-interface.php * for specifics on how each individual field is generated. * * Nonces are provided using the settings_fields() * * @since 1.7.0 */ function options_page() { ?> <div id="optionsframework-wrap" class="wrap"> <?php $menu = $this->menu_settings(); ?> <h2><?php echo esc_html($menu['page_title']); ?> </h2> <h2 class="nav-tab-wrapper"> <?php echo Options_Framework_Interface::optionsframework_tabs(); ?> </h2> <?php settings_errors('options-framework'); ?> <div id="optionsframework-metabox" class="metabox-holder"> <div id="optionsframework" class="postbox"> <form action="options.php" method="post"> <?php settings_fields('optionsframework'); ?> <?php Options_Framework_Interface::optionsframework_fields(); /* Settings */ ?> <div id="optionsframework-submit"> <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e('Guardar', 'textdomain'); ?> " /> <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e('Valores por Defecto', 'textdomain'); ?> " onclick="return confirm( '<?php print esc_js(__('¿Estas Seguro?. Se perderan todas las conficuraciones que hallas guardado!', 'textdomain')); ?> ' );" /> <div class="clear"></div> </div> </form> </div> <!-- / #container --> </div> <?php do_action('optionsframework_after'); ?> </div> <!-- / .wrap --> <?php }
/** * Builds out the options panel. * * If we were using the Settings API as it was intended we would use * do_settings_sections here. But as we don't want the settings wrapped in a table, * we'll call our own custom optionsframework_fields. See options-interface.php * for specifics on how each individual field is generated. * * Nonces are provided using the settings_fields() * * @since 1.7.0 */ function options_page() { ?> <div id="optionsframework-wrap" class="wrap"> <?php $menu = $this->menu_settings(); ?> <h2><?php echo esc_html($menu['page_title']); ?> </h2> <h2 class="nav-tab-wrapper"> <?php echo Options_Framework_Interface::optionsframework_tabs(); ?> </h2> <?php settings_errors('options-framework'); ?> <div id="optionsframework-metabox" class="metabox-holder"> <div id="optionsframework" class="postbox"> <form action="options.php" method="post"> <?php settings_fields('optionsframework'); ?> <?php Options_Framework_Interface::optionsframework_fields(); /* Settings */ ?> <div id="optionsframework-submit"> <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e('Save Options', 'consultant'); ?> " /> <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e('Restore Defaults', 'consultant'); ?> " onclick="return confirm( '<?php print esc_js(__('Click OK to reset. Any theme settings will be lost!', 'consultant')); ?> ' );" /> <div class="clear"></div> <div id="go_pro"> <h1>Go for Pro Version!</h1> <p>This is a free version of consultant. Get your own copy of professional version if you need to setup your theme with Unlimited homepage Slides , Full width page template, Forum support and much more. <a href="http://antthemes.com/?page_id=215" target="blank">Click Here to Learn More Now</a> </p> </div> </div> </form> </div> <!-- / #container --> </div> <?php do_action('optionsframework_after'); ?> </div> <!-- / .wrap --> <?php }
/** * Generates the options fields that are used in the form. */ static function optionsframework_fields() { global $allowedtags, $themename; $optionsframework_settings = get_option(vpanel_options); // Gets the unique option id if (isset($optionsframework_settings['id'])) { $option_name = $optionsframework_settings['id']; } else { $option_name = vpanel_options; } $settings = get_option($option_name); $options =& Options_Framework::_optionsframework_options(); $counter = 0; $menu = ''; foreach ($options as $value) { $val = ''; $select_value = ''; $output = ''; // Wrap all options if ($value['type'] != "heading" && $value['type'] != "info" && $value['type'] != "content" && $value['type'] != 'hidden') { // Keep all ids lowercase with no spaces $value['id'] = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($value['id'])); $id = 'section-' . $value['id']; $class = 'section'; if (isset($value['type'])) { $class .= ' section-' . $value['type']; } if (isset($value['class'])) { $class .= ' ' . $value['class']; } $output .= '<div id="' . esc_attr($id) . '" class="' . esc_attr($class) . '">' . "\n"; if (isset($value['name'])) { $output .= '<h4 class="heading">' . esc_html($value['name']) . '</h4>' . "\n"; } if ($value['type'] != 'editor' && $value['type'] != 'upload' && $value['type'] != 'background' && $value['type'] != 'sidebar' && $value['type'] != 'roles') { $output .= '<div class="option">' . "\n" . '<div class="controls">' . "\n"; } else { if ($value['type'] == 'upload' || $value['type'] == 'background') { $output .= '<div class="option">' . "\n" . '<div class="controls controls-upload">' . "\n"; } else { if ($value['type'] == 'sidebar') { $output .= '<div class="option">' . "\n" . '<div class="controls controls-sidebar">' . "\n"; } else { if ($value['type'] == 'roles') { $output .= '<div class="option">' . "\n" . '<div class="controls controls-role">' . "\n"; } else { $output .= '<div class="option">' . "\n" . '<div>' . "\n"; } } } } } // Set default value to $val if (isset($value['std'])) { $val = $value['std']; } // If the option is already saved, override $val if ($value['type'] != 'heading' && $value['type'] != 'info' && $value['type'] != 'content') { 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']; } if (has_filter('vpanel_' . $value['type'])) { $output .= apply_filters('vpanel_' . $value['type'], $option_name, $value, $val); } switch ($value['type']) { // Basic text input case 'text': $output .= '<input id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" type="text" value="' . esc_attr($val) . '">'; break; // input hidden // input hidden case 'hidden': $output .= '<input id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" type="hidden" value="' . esc_attr($val) . '">'; break; // Password input // Password input case 'password': $output .= '<input id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" type="password" value="' . esc_attr($val) . '">'; break; // Textarea // Textarea case 'textarea': $rows = '8'; if (isset($value['settings']['rows'])) { $custom_rows = $value['settings']['rows']; if (is_numeric($custom_rows)) { $rows = $custom_rows; } } $val = stripslashes($val); $output .= '<textarea id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" rows="' . $rows . '">' . esc_textarea($val) . '</textarea>'; break; // Role Box // Role Box case 'roles': global $wp_roles; $roles = get_option(esc_attr($value['id'])); $k = 0; $output .= ' <input id="role_name" type="text" name="role_name" value=""> <input id="role_add" type="button" value="+ Add new group"> <div class="clear"></div> <ul id="roles_list" class="roles_list">'; if ($roles) { //echo $role["id"]."<pre>";print_r($wp_roles->roles);echo "</pre>"; foreach ($roles as $role) { $k++; unset($wp_roles->roles[$role["id"]]); $output .= '<li><div class="widget-head">' . esc_html($role["group"]) . '<a class="del-builder-item del-role-item">x</a></div> <div class="widget-content"> <div class="widget-content-div"> <label for="roles[' . $k . '][group]">Type here the group name .</label> <input id="roles[' . $k . '][group]" type="text" name="roles[' . $k . '][group]" value="' . (isset($role["group"]) && $role["group"] != '' ? esc_html($role["group"]) : '') . '"> <input type="hidden" class="group_id" name="roles[' . $k . '][id]" value="group_' . $k . '"> <div class="clearfix"></div> <input id="roles[' . $k . '][ask_question]" type="checkbox" name="roles[' . $k . '][ask_question]"' . (isset($role["ask_question"]) && $role["ask_question"] == 'on' ? ' checked="checked"' : '') . '> <label for="roles[' . $k . '][ask_question]">Select ON to add a question .</label> <div class="clearfix"></div> <input id="roles[' . $k . '][show_question]" type="checkbox" name="roles[' . $k . '][show_question]"' . (isset($role["show_question"]) && $role["show_question"] == 'on' ? ' checked="checked"' : '') . '> <label for="roles[' . $k . '][show_question]">Select ON to show other questions .</label> <div class="clearfix"></div> <input id="roles[' . $k . '][add_answer]" type="checkbox" name="roles[' . $k . '][add_answer]"' . (isset($role["add_answer"]) && $role["add_answer"] == 'on' ? ' checked="checked"' : '') . '> <label for="roles[' . $k . '][add_answer]">Select ON to add a answer .</label> <div class="clearfix"></div> <input id="roles[' . $k . '][show_answer]" type="checkbox" name="roles[' . $k . '][show_answer]"' . (isset($role["show_answer"]) && $role["show_answer"] == 'on' ? ' checked="checked"' : '') . '> <label for="roles[' . $k . '][show_answer]">Select ON to show other answers .</label> <div class="clearfix"></div> <input id="roles[' . $k . '][add_post]" type="checkbox" name="roles[' . $k . '][add_post]"' . (isset($role["add_post"]) && $role["add_post"] == 'on' ? ' checked="checked"' : '') . '> <label for="roles[' . $k . '][add_post]">Select ON to add a post .</label> <div class="clearfix"></div> </div> </div> </li>'; } } $output .= '</ul><div class="clear"></div>'; $output .= '<ul class="roles_list">'; $roles_default = get_option("roles_default"); $old_roles = $wp_roles->roles; foreach ($old_roles as $key_r => $value_r) { $output .= '<li> <div class="widget-head">' . esc_html($value_r['name']) . '</div> <div class="widget-content"> <div class="widget-content-div"> <input id="roles_default[' . $key_r . '][ask_question]" type="checkbox" name="roles_default[' . $key_r . '][ask_question]"' . (isset($roles_default[$key_r]["ask_question"]) && $roles_default[$key_r]["ask_question"] == 'on' ? ' checked="checked"' : '') . '> <label for="roles_default[' . $key_r . '][ask_question]">Select ON to add a question .</label> <div class="clearfix"></div> <input id="roles_default[' . $key_r . '][show_question]" type="checkbox" name="roles_default[' . $key_r . '][show_question]"' . (isset($roles_default[$key_r]["show_question"]) && $roles_default[$key_r]["show_question"] == 'on' ? ' checked="checked"' : '') . '> <label for="roles_default[' . $key_r . '][show_question]">Select ON to show other questions .</label> <div class="clearfix"></div> <input id="roles_default[' . $key_r . '][add_answer]" type="checkbox" name="roles_default[' . $key_r . '][add_answer]"' . (isset($roles_default[$key_r]["add_answer"]) && $roles_default[$key_r]["add_answer"] == 'on' ? ' checked="checked"' : '') . '> <label for="roles_default[' . $key_r . '][add_answer]">Select ON to add a answer .</label> <div class="clearfix"></div> <input id="roles_default[' . $key_r . '][show_answer]" type="checkbox" name="roles_default[' . $key_r . '][show_answer]"' . (isset($roles_default[$key_r]["show_answer"]) && $roles_default[$key_r]["show_answer"] == 'on' ? ' checked="checked"' : '') . '> <label for="roles_default[' . $key_r . '][show_answer]">Select ON to show other answers .</label> <div class="clearfix"></div> <input id="roles_default[' . $key_r . '][add_post]" type="checkbox" name="roles_default[' . $key_r . '][add_post]"' . (isset($roles_default[$key_r]["add_post"]) && $roles_default[$key_r]["add_post"] == 'on' ? ' checked="checked"' : '') . '> <label for="roles_default[' . $key_r . '][add_post]">Select ON to add a post .</label> <div class="clearfix"></div> </div> </div> </li>'; } $output .= '</ul><div class="clear"></div>'; $output .= '<script type="text/javascript">roles_j = ' . ($k + 1) . ';</script>'; break; // Sections // Sections case 'sections': $output .= '<ul id="sort-sections">'; $order_sections_li = $val; if (empty($order_sections_li)) { $order_sections_li = array(1 => "advertising", 2 => "author", 3 => "related", 4 => "comments", 5 => "next_previous"); } $order_sections = $order_sections_li; $i = 0; foreach ($order_sections as $key_r => $value_r) { $i++; if ($value_r == "") { unset($order_sections[$key_r]); } else { $output .= '<li id="' . esc_attr($value_r) . '" class="ui-state-default"> <div class="widget-head"><span>'; if ($value_r == "next_previous") { $output .= esc_attr("Next and Previous articles"); } else { if ($value_r == "advertising") { $output .= esc_attr("Advertising"); } else { if ($value_r == "author") { $output .= esc_attr("About the author"); } else { if ($value_r == "related") { $output .= esc_attr("Related articles"); } else { if ($value_r == "comments") { $output .= esc_attr("Comments"); } } } } } $output .= '</span></div> <input name="' . esc_attr($option_name . '[' . $value['id'] . '][' . esc_attr($i) . ']') . '" value="'; if ($value_r == "next_previous") { $output .= esc_attr("next_previous"); } else { if ($value_r == "advertising") { $output .= esc_attr("advertising"); } else { if ($value_r == "author") { $output .= esc_attr("author"); } else { if ($value_r == "related") { $output .= esc_attr("related"); } else { if ($value_r == "comments") { $output .= esc_attr("comments"); } } } } } $output .= '" type="hidden"> </li>'; } } $output .= '</ul>'; break; // Sidebar Box // Sidebar Box case 'sidebar': $output .= ' <input id="sidebar_name" type="text" name="sidebar_name" value=""> <input id="sidebar_add" type="button" value="+ Add new sidebar"> <div class="clear"></div> <ul id="sidebars_list">'; $sidebars = get_option(esc_attr($value['id'])); if ($sidebars) { foreach ($sidebars as $sidebar) { $output .= '<li><div class="widget-head">' . esc_html($sidebar) . '<input id="sidebars" name="sidebars[]" type="hidden" value="' . esc_html($sidebar) . '"><a class="del-builder-item del-sidebar-item">x</a></div></li>'; } } $output .= '</ul>'; break; // Select Box // Select Box case 'select': $output .= '<select class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" id="' . esc_attr($value['id']) . '">'; foreach ($value['options'] as $key => $option) { $output .= '<option' . selected($val, $key, false) . ' value="' . esc_attr($key) . '">' . esc_html($option) . '</option>'; } $output .= '</select>'; break; // Radio Box // Radio Box case "radio": $name = $option_name . '[' . $value['id'] . ']'; foreach ($value['options'] as $key => $option) { $id = $option_name . '-' . $value['id'] . '-' . $key; $output .= '<input class="of-input of-radio ' . (isset($value['class']) ? esc_attr($value['class']) : '') . '" type="radio" name="' . esc_attr($name) . '" id="' . esc_attr($id) . '" value="' . esc_attr($key) . '" ' . checked($val, $key, false) . '><label for="' . esc_attr($id) . '">' . esc_html($option) . '</label>'; } break; // Image Selectors // Image Selectors case "images": $name = $option_name . '[' . $value['id'] . ']'; foreach ($value['options'] as $key => $option) { $selected = ''; if ($val != '' && $val == $key) { $selected = ' of-radio-img-selected'; } $output .= '<input type="radio" id="' . esc_attr($value['id'] . '_' . $key) . '" class="of-radio-img-radio" value="' . esc_attr($key) . '" name="' . esc_attr($name) . '" ' . checked($val, $key, false) . '>'; $output .= '<div class="of-radio-img-label">' . esc_html($key) . '</div>'; $output .= '<img src="' . esc_url($option) . '" alt="' . $option . '" class="of-radio-img-img ' . (isset($value['class']) ? esc_attr($value['class']) : '') . '' . $selected . '" onclick="document.getElementById(\'' . esc_attr($value['id'] . '_' . $key) . '\').checked=true;">'; } break; // Checkbox // Checkbox case "checkbox": $output .= '<input id="' . esc_attr($value['id']) . '" class="checkbox of-input vpanel_checkbox" type="checkbox" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" ' . checked($val, 1, false) . '>'; $output .= '<label class="explain explain-checkbox" for="' . esc_attr($value['id']) . '">' . wp_kses($explain_value, $allowedtags) . '</label>'; break; // Multicheck // 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 .= '<input id="' . esc_attr($id) . '" class="checkbox of-input vpanel_multicheck" type="checkbox" name="' . esc_attr($name) . '" ' . $checked . '><label for="' . esc_attr($id) . '">' . esc_html($label) . '</label>'; } break; // Color picker // Color picker case "color": $default_color = ''; if (isset($value['std'])) { if ($val != $value['std']) { $default_color = ' data-default-color="' . $value['std'] . '" '; } } $output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" id="' . esc_attr($value['id']) . '" class="of-color ' . (isset($value['class']) ? esc_attr($value['class']) : '') . '" type="text" value="' . esc_attr($val) . '"' . $default_color . '>'; break; // Uploader // Uploader case "upload": $output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $val, null); break; // Typography // Typography case 'typography': unset($font_size, $font_style, $font_face, $font_color); $typography_defaults = array('size' => '', 'face' => '', 'style' => '', 'color' => ''); $typography_stored = wp_parse_args($val, $typography_defaults); $typography_options = array('sizes' => of_recognized_font_sizes(), 'faces' => of_recognized_font_faces(), 'styles' => of_recognized_font_styles(), 'color' => true); if (isset($value['options'])) { $typography_options = wp_parse_args($value['options'], $typography_options); } // Font Size if ($typography_options['sizes']) { $font_size = '<select class="of-typography of-typography-size" name="' . esc_attr($option_name . '[' . $value['id'] . '][size]') . '" id="' . esc_attr($value['id'] . '_size') . '">'; $sizes = $typography_options['sizes']; foreach ($sizes as $i) { $size = $i . 'px'; $font_size .= '<option value="' . esc_attr($size) . '" ' . (is_string($typography_stored['size']) ? selected($typography_stored['size'], $size, false) : "") . '>' . esc_html($size) . '</option>'; } $font_size .= '</select>'; } // Font Face if ($typography_options['faces']) { $font_face = '<select class="of-typography of-typography-face" name="' . esc_attr($option_name . '[' . $value['id'] . '][face]') . '" id="' . esc_attr($value['id'] . '_face') . '">'; $faces = $typography_options['faces']; foreach ($faces as $key => $face) { $font_face .= '<option value="' . esc_attr($key) . '" ' . selected($typography_stored['face'], $key, false) . '>' . esc_html($face) . '</option>'; } $font_face .= '</select>'; } // Font Styles if ($typography_options['styles']) { $font_style = '<select class="of-typography of-typography-style" name="' . $option_name . '[' . $value['id'] . '][style]" id="' . $value['id'] . '_style">'; $styles = $typography_options['styles']; foreach ($styles as $key => $style) { $font_style .= '<option value="' . esc_attr($key) . '" ' . selected($typography_stored['style'], $key, false) . '>' . $style . '</option>'; } $font_style .= '</select>'; } // Font Color if ($typography_options['color']) { $default_color = ''; if (isset($value['std']['color'])) { if ($val != $value['std']['color']) { $default_color = ' data-default-color="' . $value['std']['color'] . '" '; } } $font_color = '<input name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" class="of-color of-typography-color type="text" value="' . esc_attr($typography_stored['color']) . '"' . $default_color . '>'; } // Allow modification/injection of typography fields $typography_fields = compact('font_size', 'font_face', 'font_style', 'font_color'); $typography_fields = apply_filters('of_typography_fields', $typography_fields, $typography_stored, $option_name, $value); $output .= implode('', $typography_fields); break; // Background // Background case 'background': $background = $val; // Background Color $default_color = ''; if (isset($value['std']['color'])) { if ($val != $value['std']['color']) { $default_color = ' data-default-color="' . $value['std']['color'] . '" '; } } $output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" class="of-color of-background-color" type="text" value="' . esc_attr($background['color']) . '"' . $default_color . '>'; // Background Image if (!isset($background['image'])) { $background['image'] = ''; } $output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $background['image'], null, esc_attr($option_name . '[' . $value['id'] . '][image]')); $class = 'of-background-properties ' . (isset($value['class']) ? esc_attr($value['class']) : '') . ''; if ('' == $background['image']) { $class .= ' hide'; } $output .= '<div class="' . esc_attr($class) . '">'; // Background Repeat $output .= '<select class="of-background of-background-repeat" name="' . esc_attr($option_name . '[' . $value['id'] . '][repeat]') . '" id="' . esc_attr($value['id'] . '_repeat') . '">'; $repeats = of_recognized_background_repeat(); foreach ($repeats as $key => $repeat) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background['repeat'], $key, false) . '>' . esc_html($repeat) . '</option>'; } $output .= '</select>'; // Background Position $output .= '<select class="of-background of-background-position" name="' . esc_attr($option_name . '[' . $value['id'] . '][position]') . '" id="' . esc_attr($value['id'] . '_position') . '">'; $positions = of_recognized_background_position(); foreach ($positions as $key => $position) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background['position'], $key, false) . '>' . esc_html($position) . '</option>'; } $output .= '</select>'; // Background Attachment $output .= '<select class="of-background of-background-attachment" name="' . esc_attr($option_name . '[' . $value['id'] . '][attachment]') . '" id="' . esc_attr($value['id'] . '_attachment') . '">'; $attachments = of_recognized_background_attachment(); foreach ($attachments as $key => $attachment) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background['attachment'], $key, false) . '>' . esc_html($attachment) . '</option>'; } $output .= '</select>'; $output .= '</div>'; break; // export // export case 'export': $rows = '8'; if (isset($value['settings']['rows'])) { $custom_rows = $value['settings']['rows']; if (is_numeric($custom_rows)) { $rows = $custom_rows; } } $output .= '<textarea id="' . esc_attr($value['id']) . '" class="of-input builder_select" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" rows="' . $rows . '">' . esc_textarea($value['export']) . '</textarea>'; break; // import // import case 'import': $rows = '8'; $output .= '<textarea id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" rows="' . $rows . '"></textarea>'; break; // Editor // Editor case 'editor': //$output .= '<div class="explain">' . wp_kses( $explain_value, $allowedtags ) . '</div>'."\n"; $output .= '<div class="vpanel_editor"></div>'; echo $output; $textarea_name = esc_attr($option_name . '[' . $value['id'] . ']'); $default_editor_settings = array('textarea_name' => $textarea_name, 'media_buttons' => "vpanel_editor", 'tinymce' => array('plugins' => 'wordpress')); $editor_settings = array(); if (isset($value['settings'])) { $editor_settings = $value['settings']; } $editor_settings = array_merge($default_editor_settings, $editor_settings); wp_editor($val, $value['id'], $editor_settings); $output = ''; break; // Content // Content case "content": if (isset($value['content'])) { $output .= $value['content'] . "\n"; } break; // Info // Info case "info": $id = ''; $class = 'section'; if (isset($value['id'])) { $id = 'id="' . esc_attr($value['id']) . '" '; } if (isset($value['type'])) { $class .= ' section-' . $value['type']; } if (isset($value['class'])) { $class .= ' ' . $value['class']; } $output .= '<div ' . $id . 'class="' . esc_attr($class) . '">' . "\n"; if (isset($value['name'])) { $output .= '<h4 class="heading">' . $value['name'] . '</h4>' . "\n"; } if (isset($value['desc'])) { $output .= apply_filters('of_sanitize_info', $value['desc']) . "\n"; } $output .= '</div>' . "\n"; break; // Heading for Navigation // Heading for Navigation case "heading": $counter++; if ($counter >= 2) { $output .= '</div>' . "\n"; } $class = ''; $class = !empty($value['id']) ? $value['id'] : $value['name']; $class = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($class)); $output .= '<div id="options-group-' . $counter . '" class="group ' . $class . '">'; $output .= '<h3>' . esc_html($value['name']) . '</h3>' . "\n"; break; } if (isset($value['type'])) { if ($value['type'] != "heading" && $value['type'] != "info" && $value['type'] != "content" && $value['type'] != 'hidden') { $output .= '</div>'; if ($value['type'] != "checkbox" && $value['type'] != "editor") { $output .= '<div class="explain vpanel_help"><div class="tooltip_s" original-title="' . wp_kses($explain_value, $allowedtags) . '"><i class="dashicons dashicons-info"></i></div></div>' . "\n"; } $output .= '</div></div>' . "\n"; } } echo $output; } // Outputs closing div if there tabs if (Options_Framework_Interface::optionsframework_tabs() != '') { echo '</div>'; } }
/** * Builds out the options panel. * * If we were using the Settings API as it was intended we would use * do_settings_sections here. But as we don't want the settings wrapped in a table, * we'll call our own custom optionsframework_fields. See options-interface.php * for specifics on how each individual field is generated. * * Nonces are provided using the settings_fields() * * @since 1.7.0 */ function options_page() { global $themename; ?> <div id="optionsframework-wrap"> <form action="options.php" id="main_options_form" method="post"> <div class="optionsframework-header"> <a href="http://themeforest.net/item/ask-me-responsive-questions-answers-wordpress/7935874?ref=2codeThemes" target="_blank"></a> <input type="submit" class="button-primary vpanel_save" name="update" value="<?php esc_attr_e('Save Options', 'vbegy'); ?> "> <div class="vpanel_social"> <ul> <li><a class="vpanel_social_f" href="https://www.facebook.com/2code.info" target="_blank"><i class="dashicons dashicons-facebook"></i></a></li> <li><a class="vpanel_social_t" href="#" target="_blank"><i class="dashicons dashicons-twitter"></i></a></li> <li><a class="vpanel_social_e" href="#" target="_blank"><i class="dashicons dashicons-email-alt"></i></a></li> <li><a class="vpanel_social_s" href="#" target="_blank"><i class="dashicons dashicons-sos"></i></a></li> </ul> </div> <div class="clear"></div> </div> <div class="optionsframework-content"> <h2 class="nav-tab-wrapper"> <?php echo Options_Framework_Interface::optionsframework_tabs(); ?> </h2> <?php settings_errors('options-framework'); ?> <div id="optionsframework-metabox" class="metabox-holder"> <div id="optionsframework" class="postbox"> <?php Options_Framework_Interface::optionsframework_fields(); /* Settings */ ?> <div id="ajax-saving"><i class="dashicons dashicons-yes"></i><?php _e("Saving", "vbegy"); ?> </div> <div id="ajax-reset"><i class="dashicons dashicons-info"></i><?php _e("Reseting Options", "vbegy"); ?> </div> </div> <!-- / #container --> </div> <?php do_action('optionsframework_after'); ?> <div class="clear"></div> </div> <div class="optionsframework-footer"> <input type="submit" class="button-primary vpanel_save" name="update" value="<?php esc_attr_e('Save Options', 'vbegy'); ?> "> <div id="loading"></div> <input type="submit" class="reset-button button-secondary" id="reset_c" name="reset" value="<?php esc_attr_e('Restore Defaults', 'vbegy'); ?> "> <div class="clear"></div> </div> </form> </div> <!-- / .wrap --> <?php }
/** * Builds out the options panel. * * If we were using the Settings API as it was intended we would use * do_settings_sections here. But as we don't want the settings wrapped in a table, * we'll call our own custom optionsframework_fields. See options-interface.php * for specifics on how each individual field is generated. * * Nonces are provided using the settings_fields() * * @since 1.7.0 */ function options_page() { ?> <div id="optionsframework-wrap" class="wrap"> <?php $menu = $this->menu_settings(); ?> <div class="theme-header clearfix"> <div class="accesspresslite-logo"> <img src="<?php echo get_template_directory_uri(); ?> /inc/options-framework/images/logo.png" alt="<?php esc_attr_e('AccessPress Lite', 'accesspress_parallax'); ?> " /> </div> <div class="ak-socials"> </div> </div> <div class="nav-tab-wrapper"> <?php echo Options_Framework_Interface::optionsframework_tabs(); ?> </div> <?php settings_errors('options-framework'); ?> <div id="optionsframework-metabox" class="metabox-holder"> <div id="optionsframework" class="postbox"> <form action="options.php" method="post"> <?php settings_fields('optionsframework'); ?> <?php Options_Framework_Interface::optionsframework_fields(); /* Settings */ ?> <div id="optionsframework-submit"> <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e('Save Options', 'accesspress_parallax'); ?> " /> <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e('Restore Defaults', 'accesspress_parallax'); ?> " onclick="return confirm( '<?php print esc_js(__('Click OK to reset. Any theme settings will be lost!', 'accesspress_parallax')); ?> ' );" /> <div class="clear"></div> </div> </form> </div> <!-- / #container --> <div class="update-banner"> <img src="<?php echo get_template_directory_uri(); ?> /inc/options-framework/images/upgrade-top.jpg"> <div class="button-link"> <a href="<?php echo esc_url('http://accesspressthemes.com/accesspress-parallax-pro/'); ?> " target="_blank"><img src="<?php echo get_template_directory_uri(); ?> /inc/options-framework/images/demo-btn.png"></a> <a href="<?php echo esc_url('https://accesspressthemes.com/wordpress-themes/accesspress-parallax-pro/'); ?> " target="_blank"><img src="<?php echo get_template_directory_uri(); ?> /inc/options-framework/images/upgrade-btn.png"></a> </div> <img src="<?php echo get_template_directory_uri(); ?> /inc/options-framework/images/upgrade-bottom.jpg"> <div class="button-link"> <a href="<?php echo esc_url('http://accesspressthemes.com/accesspress-parallax-pro/'); ?> " target="_blank"><img src="<?php echo get_template_directory_uri(); ?> /inc/options-framework/images/demo-btn.png"></a> <a href="<?php echo esc_url('https://accesspressthemes.com/wordpress-themes/accesspress-parallax-pro/'); ?> " target="_blank"><img src="<?php echo get_template_directory_uri(); ?> /inc/options-framework/images/upgrade-btn.png"></a> </div> <div class="any-question"> <?php echo sprintf(__('Any question!! Click <a href="%s" target="_blank">here</a> for Live Chat.', 'accesspress_parallax'), esc_url('https://accesspressthemes.com/contact/')); ?> </div> </div> </div> <?php do_action('optionsframework_after'); ?> </div> <!-- / .wrap --> <?php $optionsframework_settings = get_option('optionsframework'); $optionsframework_settings_array = get_option($optionsframework_settings['id']); if (empty($optionsframework_settings_array)) { ?> <div class="ap-popup-wrapper"> <div class="ap-popup-close">×</div> <h4><?php _e('Like our Facebook page and don\'t miss any updates!', 'accesspress_parallax'); ?> </h4> <iframe style="border: none; overflow: hidden; width: 340px; height: 260px;" src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FAccessPress-Themes%2F1396595907277967&width=340&height=260&colorscheme=light&show_faces=true&header=false&stream=false&show_border=true&appId=1411139805828592" width="340" height="260" frameborder="0" scrolling="no"></iframe> </div> <div class="ap-popup-bg"></div> <?php } ?> <?php }
/** * Builds out the options panel. * * If we were using the Settings API as it was intended we would use * do_settings_sections here. But as we don't want the settings wrapped in a table, * we'll call our own custom optionsframework_fields. See options-interface.php * for specifics on how each individual field is generated. * * Nonces are provided using the settings_fields() * * @since 1.7.0 */ function options_page() { ?> <div id="optionsframework" class="wrap"> <?php settings_errors('options-framework'); ?> <div class="new_options_container"> <form action="options.php" method="post"> <?php settings_fields('optionsframework'); ?> <div class="new_options_container_top"> <div class="new_options_container_top_logo"> <a href="http://www.themealley.com/"><img src="<?php echo get_template_directory_uri(); ?> /images/logo.png" /></a> </div> <div class="new_options_container_top_rate"> <a href="http://www.themealley.com/business/?a_aid=tskk&a_bid=550dad4a&chan=<?php echo wp_get_theme(); ?> "> <img src="<?php echo get_template_directory_uri(); ?> /images/rate.png" /> </a> </div> </div><!-- .new_options_container_top --> <div id="countrytabs" class="new_options_container_middle"> <ul class="shadetabs"> <li class="big"><a href="#country1"><h6><?php echo __('General', 'alexandria'); ?> </h6><p><?php echo __('Settings', 'alexandria'); ?> </p></a></li> <li class="small"><a href="#country2"><p><?php echo __('Social Settings', 'alexandria'); ?> </p></a></li> <li class="big"><a href="#country10"><h6><?php echo __('Logo Section', 'alexandria'); ?> </h6><p><?php echo __('Settings', 'alexandria'); ?> </p></a></li> <li class="big"><a href="#country3"><h6><?php echo __('Header', 'alexandria'); ?> </h6><p><?php echo __('Settings', 'alexandria'); ?> </p></a></li> <li class="small"><a href="#country6"><p><?php echo __('Header One Settings', 'alexandria'); ?> </p></a></li> <li class="big"><a href="#country4"><h6><?php echo __('Layout', 'alexandria'); ?> </h6><p><?php echo __('Settings', 'alexandria'); ?> </p></a></li> <li class="small"><a href="#country5"><p><?php echo __('Biz One Settings', 'alexandria'); ?> </p></a></li> <li class="small"><a href="#country7"><p><?php echo __('Biz Two Settings', 'alexandria'); ?> </p></a></li> <li class="small"><a href="#country12"><p><?php echo __('Biz Four Settings', 'alexandria'); ?> </p></a></li> <li class="small"><a href="#country13"><p><?php echo __('Ecom One Settings', 'alexandria'); ?> </p></a></li> <li class="small"><a href="#country9"><p><?php echo __('Standard Blog Settings', 'alexandria'); ?> </p></a></li> <li class="big"><a href="#country11"><h6><?php echo __('Footer', 'alexandria'); ?> </h6><p><?php echo __('Settings', 'alexandria'); ?> </p></a></li> </ul> <div class="shadetabscontent"> <?php Options_Framework_Interface::optionsframework_fields(); /* Settings */ ?> </div><!-- .shadetabscontent --> <script type="text/javascript"> jQuery(document).ready(function(){ jQuery.noConflict(); jQuery('#countrytabs').tabs(); }); </script> </div><!-- #new_options_container_middle --> <div class="new_options_container_bottom"> <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e(__('Save Options', 'alexandria')); ?> " /> <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e(__('Restore Defaults', 'alexandria')); ?> " onclick="return confirm( '<?php print esc_js(__('Click OK to reset. Any theme settings will be lost!', 'alexandria')); ?> ' );" /> </div><!-- .new_options_container_bottom --> </form> </div><!-- .new_options_container --> </div><!-- #optionsframework --> <?php }
/** * Builds out the options panel. * * If we were using the Settings API as it was intended we would use * do_settings_sections here. But as we don't want the settings wrapped in a table, * we'll call our own custom optionsframework_fields. See options-interface.php * for specifics on how each individual field is generated. * * Nonces are provided using the settings_fields() * * @since 1.7.0 */ function options_page() { ?> <div id="optionsframework-wrap" class="wrap"> <?php $menu = $this->menu_settings(); ?> <h2><?php echo esc_html($menu['page_title']); ?> </h2> <div class="proversion"> <h3><?php _e('Upgrade to Pro version!', 'kage'); ?> </h3> <a href="<?php echo esc_url('http://www.pwtthemes.com/theme/kage-responsive-wordpress-theme'); ?> " target="_blank" class="upgradepro"><?php _e('Upgrade to Pro', 'kage'); ?> </a> <a href="<?php echo esc_url('http://www.pwtthemes.com/demo/kage'); ?> " target="_blank" class="donate"><?php _e('Demo', 'kage'); ?> </a> <p><?php _e('If you need assistance, please do not hesitate to', 'kage'); ?> <a href="<?php echo esc_url('http://www.pwtthemes.com/contact'); ?> " target="_blank"><?php _e('contact us', 'kage'); ?> </a></p> </div> <h2 class="nav-tab-wrapper"> <?php echo Options_Framework_Interface::optionsframework_tabs(); ?> </h2> <?php settings_errors('options-framework'); ?> <div id="optionsframework-metabox" class="metabox-holder"> <div id="optionsframework" class="postbox"> <form action="options.php" method="post"> <?php settings_fields('optionsframework'); ?> <?php Options_Framework_Interface::optionsframework_fields(); /* Settings */ ?> <div id="optionsframework-submit"> <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e('Save Options', 'kage'); ?> " /> <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e('Restore Defaults', 'kage'); ?> " onclick="return confirm( '<?php print esc_js(__('Click OK to reset. Any theme settings will be lost!', 'kage')); ?> ' );" /> <div class="clear"></div> </div> </form> </div> <!-- / #container --> </div> <?php do_action('optionsframework_after'); ?> </div> <!-- / .wrap --> <?php }
/** * Builds out the options panel. * * If we were using the Settings API as it was intended we would use * do_settings_sections here. But as we don't want the settings wrapped in a table, * we'll call our own custom optionsframework_fields. See options-interface.php * for specifics on how each individual field is generated. * * Nonces are provided using the settings_fields() * * @since 1.7.0 */ function options_page() { ?> <div id="optionsframework-wrap" class="wrap"> <?php $menu = $this->menu_settings(); ?> <h2><?php echo esc_html($menu['page_title']); ?> </h2> <h2 class="nav-tab-wrapper"> <?php echo Options_Framework_Interface::optionsframework_tabs(); ?> </h2> <?php settings_errors('options-framework'); ?> <div id="optionsframework-metabox" class="metabox-holder"> <div id="optionsframework" class="postbox"> <form action="options.php" method="post"> <?php settings_fields('optionsframework'); ?> <?php Options_Framework_Interface::optionsframework_fields(); /* Settings */ ?> <div id="optionsframework-submit"> <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e('Guadar Opciones', 'webtranslations'); ?> " /> <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e('Restaurar a valores por defecto', 'webtranslations'); ?> " onclick="return confirm( '<?php print esc_js(__('Click OK para restaurar. Cualquier cambio en la plantilla se perderá!', 'webtranslations')); ?> ' );" /> <div class="clear"></div> </div> </form> </div> <!-- / #container --> </div> <?php do_action('optionsframework_after'); ?> </div> <!-- / .wrap --> <?php }
/** * Builds out the options panel. * * If we were using the Settings API as it was intended we would use * do_settings_sections here. But as we don't want the settings wrapped in a table, * we'll call our own custom optionsframework_fields. See options-interface.php * for specifics on how each individual field is generated. * * Nonces are provided using the settings_fields() * * @since 1.7.0 */ function options_page() { ?> <div id="optionsframework-wrap" class="wrap clearfix"> <?php $menu = $this->menu_settings(); ?> <div class="theme-header clearfix"> <div class="accesspress-root-logo"> <img src="<?php echo get_template_directory_uri(); ?> /inc/panel/images/logo.png" alt="<?php esc_attr_e('AccessPress Themes', 'accesspress-root'); ?> " /> </div> <div class="ak-socials"> <p></p> <div class="social-bttns"> </div> </div> </div> <div class="optionsframework-holder"> <div class="nav-tab-wrapper"> <?php echo Options_Framework_Interface::optionsframework_tabs(); ?> </div> <div id="optionsframework-metabox" class="metabox-holder"> <?php settings_errors('options-framework'); ?> <div id="optionsframework" class="postbox"> <form action="options.php" method="post"> <?php settings_fields('optionsframework'); ?> <?php Options_Framework_Interface::optionsframework_fields(); /* Settings */ ?> <div id="optionsframework-submit" class="clearfix"> <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e('Save Options', 'accesspress-root'); ?> " /> <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e('Restore Defaults', 'accesspress-root'); ?> " onclick="return confirm( '<?php print esc_js(__('Click OK to reset. Any theme settings will be lost!', 'accesspress-root')); ?> ' );" /> </div> </form> </div> <!-- / #container --> </div> <div class="upgrade-pro"> <h3><?php _e('Upgrade to Root Pro', 'accesspress-root'); ?> </h3> <div class="update-banner"> <img src="<?php echo get_template_directory_uri(); ?> /inc/panel/images/upgrade-top.jpg"> </div> <div class="button-link"> <a href="<?php echo esc_url('https://accesspressthemes.com/accesspress-root-pro/'); ?> " target="_blank"><img src="<?php echo get_template_directory_uri(); ?> /inc/panel/images/demo-btn.png"></a> <a href="<?php echo esc_url('https://accesspressthemes.com/wordpress-themes/accesspress-root-pro/'); ?> " target="_blank"><img src="<?php echo get_template_directory_uri(); ?> /inc/panel/images/upgrade-btn.png"></a> </div> <div class="any-question"> <?php echo sprintf(__('Any question!! Click <a href="%s" target="_blank">here</a> for Live Chat', 'accesspress_ray'), esc_url('https://accesspressthemes.com/contact/')); ?> . </div> <h4 class="pro-feature-title">Pro Features +</h4> <div class="feature-img"> <img src="<?php echo get_template_directory_uri(); ?> /inc/panel/images/upgrade-side.jpg"/> </div> </div> <?php do_action('optionsframework_after'); ?> </div> </div> <!-- / .wrap --> <div class="clearfix"></div> <?php }
/** * Builds out the options panel. * * If we were using the Settings API as it was intended we would use * do_settings_sections here. But as we don't want the settings wrapped in a table, * we'll call our own custom optionsframework_fields. See options-interface.php * for specifics on how each individual field is generated. * * Nonces are provided using the settings_fields() * * @since 1.7.0 */ function options_page() { ?> <div id="optionsframework-wrap" class="wrap"> <?php $menu = $this->menu_settings(); ?> <h2><?php echo esc_html($menu['page_title']); ?> </h2> <h2 class="nav-tab-wrapper"> <?php echo Options_Framework_Interface::optionsframework_tabs(); ?> </h2> <div style="padding-top:10px;font-size:15px;"><a href="<?php echo esc_url(SKT_PRO_THEME_URL); ?> " target="_blank"><?php _e('Buy PRO version for only $39 with more features.', 'skt-white'); ?> </a></div> <?php if (isset($_GET['msg']) && !isset($_GET['settings-updated'])) { ?> <div class="updated <?php if ($_GET['msg'] == "success") { echo "fade"; } ?> settings-error" id="setting-error-save_options" style="display: block;"> <?php if ($_GET['msg'] == "error") { ?> <p style="color:#FF0000"><strong>Current active theme is not matching</strong></p> <?php } elseif ($_GET['msg'] == "success") { ?> <p><strong>Option Imported successfully</strong></p> <?php } ?> </div> <?php } ?> <?php settings_errors('options-framework'); ?> <div id="optionsframework-metabox" class="metabox-holder"> <div id="optionsframework" class="postbox" style="width:72%; float:left;"> <form action="options.php" method="post"> <?php settings_fields('optionsframework'); ?> <?php Options_Framework_Interface::optionsframework_fields(); /* Settings */ ?> <div id="optionsframework-submit"> <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e('Save Options', 'skt-white'); ?> " /> <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e('Restore Defaults', 'skt-white'); ?> " onclick="return confirm( '<?php print esc_js(__('Click OK to reset. Any theme settings will be lost!', 'skt-white')); ?> ' );" /> <div class="clear"></div> </div> </form> </div> <!-- / #container --> <div style="width:25%; float:right;" class="postbox-container side"> <div class="meta-box-sortables ui-sortable"> <div class="postbox"> <h3 class="hndle"><span><?php _e('Our Themes', 'skt-white'); ?> </span></h3> <div class="inside"> <p><a target="_blank" href="<?php echo esc_url(SKT_THEME_URL); ?> "><img style="max-width:100%" src="<?php echo get_template_directory_uri(); ?> /images/sktskill.jpg"></a></p> </div> </div> <div class="postbox"> <h3 class="hndle"><span><?php _e('Need more features?', 'skt-white'); ?> </span></h3> <div class="inside"> <p><em><a href="<?php echo esc_url(SKT_PRO_THEME_URL); ?> " target="_blank"><?php _e('Buy PRO version for only $39 with more features', 'skt-white'); ?> </a></em></p> </div> </div> <div class="postbox"> <h3 class="hndle"><span><?php _e('Documentation', 'skt-white'); ?> </span></h3> <div class="inside"> <p><em><?php _e('For documentation and support check this link', 'skt-white'); ?> : <strong><a href="<?php echo esc_url(SKT_THEME_DOC); ?> " target="_blank">SKT White Documentation</a></strong></em></p> </div> </div> </div> </div> </div> <?php do_action('optionsframework_after'); ?> </div> <!-- / .wrap --> <?php }
/** * Generates the options fields that are used in the form. */ static function optionsframework_fields() { global $allowedtags; $optionsframework_settings = get_option('optionsframework'); // Gets the unique option id if (isset($optionsframework_settings['id'])) { $option_name = $optionsframework_settings['id']; } else { $option_name = 'optionsframework'; } $settings = get_option($option_name); $options =& Options_Framework::_optionsframework_options(); $counter = 0; $menu = ''; foreach ($options as $value) { $val = ''; $select_value = ''; $output = ''; // Wrap all options if ($value['type'] != "heading" && $value['type'] != "info") { // Keep all ids lowercase with no spaces $value['id'] = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($value['id'])); $id = 'section-' . $value['id']; if ($value['type'] != "widget-area") { $class = 'section'; } else { $class = 'section2'; } if (isset($value['type'])) { $class .= ' section-' . $value['type']; } if (isset($value['class'])) { $class .= ' ' . $value['class']; } $output .= '<div id="' . esc_attr($id) . '" class="' . esc_attr($class) . '">' . "\n"; if (isset($value['name'])) { $output .= '<h4 class="heading">' . esc_html($value['name']) . '</h4>' . "\n"; } if ($value['type'] != 'editor') { $output .= '<div class="option">' . "\n" . '<div class="controls">' . "\n"; } else { $output .= '<div class="option">' . "\n" . '<div>' . "\n"; } } // Set default value to $val if (isset($value['std'])) { $val = $value['std']; } // If the option is already saved, override $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']; } if (has_filter('optionsframework_' . $value['type'])) { $output .= apply_filters('optionsframework_' . $value['type'], $option_name, $value, $val); } switch ($value['type']) { // Basic text input case 'text': $output .= '<input id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" type="text" value="' . esc_attr($val) . '" />'; break; // Password input // Password input case 'password': $output .= '<input id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" type="password" value="' . esc_attr($val) . '" />'; break; // Textarea // Textarea case 'textarea': $rows = '8'; if (isset($value['settings']['rows'])) { $custom_rows = $value['settings']['rows']; if (is_numeric($custom_rows)) { $rows = $custom_rows; } } $val = stripslashes($val); $output .= '<textarea id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" rows="' . $rows . '">' . esc_textarea($val) . '</textarea>'; break; // Select Box // Select Box case 'select': $output .= '<select class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" id="' . esc_attr($value['id']) . '">'; foreach ($value['options'] as $key => $option) { $output .= '<option' . selected($val, $key, false) . ' value="' . esc_attr($key) . '">' . esc_html($option) . '</option>'; } $output .= '</select>'; break; // Radio Box // Radio Box case "radio": $name = $option_name . '[' . $value['id'] . ']'; foreach ($value['options'] as $key => $option) { $id = $option_name . '-' . $value['id'] . '-' . $key; $output .= '<input class="of-input of-radio" type="radio" name="' . esc_attr($name) . '" id="' . esc_attr($id) . '" value="' . esc_attr($key) . '" ' . checked($val, $key, false) . ' /><label for="' . esc_attr($id) . '">' . esc_html($option) . '</label>'; } break; // Image Selectors // Image Selectors case "images": $name = $option_name . '[' . $value['id'] . ']'; foreach ($value['options'] as $key => $option) { $selected = ''; if ($val != '' && $val == $key) { $selected = ' of-radio-img-selected'; } $output .= '<input type="radio" id="' . esc_attr($value['id'] . '_' . $key) . '" class="of-radio-img-radio" value="' . esc_attr($key) . '" name="' . esc_attr($name) . '" ' . checked($val, $key, false) . ' />'; $output .= '<div class="of-radio-img-label">' . esc_html($key) . '</div>'; $output .= '<img src="' . esc_url($option) . '" alt="' . $option . '" class="of-radio-img-img' . $selected . '" onclick="document.getElementById(\'' . esc_attr($value['id'] . '_' . $key) . '\').checked=true;" />'; } break; // Checkbox // Checkbox case "checkbox": $output .= '<input id="' . esc_attr($value['id']) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" ' . checked($val, 1, false) . ' />'; $output .= '<label class="explain" for="' . esc_attr($value['id']) . '">' . wp_kses($explain_value, $allowedtags) . '</label>'; break; // Multicheck // 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 .= '<input id="' . esc_attr($id) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr($name) . '" ' . $checked . ' /><label for="' . esc_attr($id) . '">' . esc_html($label) . '</label>'; } break; // Color picker // Color picker case "color": $default_color = ''; if (isset($value['std'])) { if ($val != $value['std']) { $default_color = ' data-default-color="' . $value['std'] . '" '; } } $output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" id="' . esc_attr($value['id']) . '" class="of-color" type="text" value="' . esc_attr($val) . '"' . $default_color . ' />'; break; // Uploader // Uploader case "upload": $output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $val, null); break; // Typography // Typography case 'typography': unset($font_size, $font_style, $font_face, $font_color); $typography_defaults = array('size' => '', 'face' => '', 'style' => '', 'color' => ''); $typography_stored = wp_parse_args($val, $typography_defaults); $typography_options = array('sizes' => of_recognized_font_sizes(), 'faces' => of_recognized_font_faces(), 'styles' => of_recognized_font_styles(), 'color' => true); if (isset($value['options'])) { $typography_options = wp_parse_args($value['options'], $typography_options); } // Font Size if ($typography_options['sizes']) { $font_size = '<select class="of-typography of-typography-size" name="' . esc_attr($option_name . '[' . $value['id'] . '][size]') . '" id="' . esc_attr($value['id'] . '_size') . '">'; $sizes = $typography_options['sizes']; foreach ($sizes as $i) { $size = $i . 'px'; $font_size .= '<option value="' . esc_attr($size) . '" ' . selected($typography_stored['size'], $size, false) . '>' . esc_html($size) . '</option>'; } $font_size .= '</select>'; } // Font Face if ($typography_options['faces']) { $font_face = '<select class="of-typography of-typography-face" name="' . esc_attr($option_name . '[' . $value['id'] . '][face]') . '" id="' . esc_attr($value['id'] . '_face') . '">'; $faces = $typography_options['faces']; foreach ($faces as $key => $face) { $font_face .= '<option value="' . esc_attr($key) . '" ' . selected($typography_stored['face'], $key, false) . '>' . esc_html($face) . '</option>'; } $font_face .= '</select>'; } // Font Styles if ($typography_options['styles']) { $font_style = '<select class="of-typography of-typography-style" name="' . $option_name . '[' . $value['id'] . '][style]" id="' . $value['id'] . '_style">'; $styles = $typography_options['styles']; foreach ($styles as $key => $style) { $font_style .= '<option value="' . esc_attr($key) . '" ' . selected($typography_stored['style'], $key, false) . '>' . $style . '</option>'; } $font_style .= '</select>'; } // Font Color if ($typography_options['color']) { $default_color = ''; if (isset($value['std']['color'])) { if ($val != $value['std']['color']) { $default_color = ' data-default-color="' . $value['std']['color'] . '" '; } } $font_color = '<input name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" class="of-color of-typography-color type="text" value="' . esc_attr($typography_stored['color']) . '"' . $default_color . ' />'; } // Allow modification/injection of typography fields $typography_fields = compact('font_size', 'font_face', 'font_style', 'font_color'); $typography_fields = apply_filters('of_typography_fields', $typography_fields, $typography_stored, $option_name, $value); $output .= implode('', $typography_fields); break; // Background // Background case 'background': $background = $val; // Background Color $default_color = ''; if (isset($value['std']['color'])) { if ($val != $value['std']['color']) { $default_color = ' data-default-color="' . $value['std']['color'] . '" '; } } $output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" class="of-color of-background-color" type="text" value="' . esc_attr($background['color']) . '"' . $default_color . ' />'; // Background Image if (!isset($background['image'])) { $background['image'] = ''; } $output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $background['image'], null, esc_attr($option_name . '[' . $value['id'] . '][image]')); $class = 'of-background-properties'; if ('' == $background['image']) { $class .= ' hide'; } $output .= '<div class="' . esc_attr($class) . '">'; // Background Repeat $output .= '<select class="of-background of-background-repeat" name="' . esc_attr($option_name . '[' . $value['id'] . '][repeat]') . '" id="' . esc_attr($value['id'] . '_repeat') . '">'; $repeats = of_recognized_background_repeat(); foreach ($repeats as $key => $repeat) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background['repeat'], $key, false) . '>' . esc_html($repeat) . '</option>'; } $output .= '</select>'; // Background Position $output .= '<select class="of-background of-background-position" name="' . esc_attr($option_name . '[' . $value['id'] . '][position]') . '" id="' . esc_attr($value['id'] . '_position') . '">'; $positions = of_recognized_background_position(); foreach ($positions as $key => $position) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background['position'], $key, false) . '>' . esc_html($position) . '</option>'; } $output .= '</select>'; // Background Attachment $output .= '<select class="of-background of-background-attachment" name="' . esc_attr($option_name . '[' . $value['id'] . '][attachment]') . '" id="' . esc_attr($value['id'] . '_attachment') . '">'; $attachments = of_recognized_background_attachment(); foreach ($attachments as $key => $attachment) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background['attachment'], $key, false) . '>' . esc_html($attachment) . '</option>'; } $output .= '</select>'; $output .= '</div>'; break; // Editor // Editor case 'editor': $output .= '<div class="explain">' . wp_kses($explain_value, $allowedtags) . '</div>' . "\n"; echo $output; $textarea_name = esc_attr($option_name . '[' . $value['id'] . ']'); $default_editor_settings = array('textarea_name' => $textarea_name, 'media_buttons' => false, 'tinymce' => array('plugins' => 'wordpress')); $editor_settings = array(); if (isset($value['settings'])) { $editor_settings = $value['settings']; } $editor_settings = array_merge($default_editor_settings, $editor_settings); wp_editor($val, $value['id'], $editor_settings); $output = ''; break; // Info // Info case "info": $id = ''; $class = 'section'; if (isset($value['id'])) { $id = 'id="' . esc_attr($value['id']) . '" '; } if (isset($value['type'])) { $class .= ' section-' . $value['type']; } if (isset($value['class'])) { $class .= ' ' . $value['class']; } $output .= '<div ' . $id . 'class="' . esc_attr($class) . '">' . "\n"; if (isset($value['name'])) { $output .= '<h4 class="heading">' . esc_html($value['name']) . '</h4>' . "\n"; } if (isset($value['desc'])) { $output .= apply_filters('of_sanitize_info', $value['desc']) . "\n"; } $output .= '</div>' . "\n"; break; // Heading for Navigation // Heading for Navigation case "heading": $counter++; if ($counter >= 2) { $output .= '</div>' . "\n"; } $class = ''; $class = !empty($value['id']) ? $value['id'] : $value['name']; $class = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($class)); $output .= '<div id="options-group-' . $counter . '" class="group ' . $class . '">'; $output .= '<h3>' . esc_html($value['name']) . '</h3>' . "\n"; break; //=custom type //=custom type case "start_group": $class = ''; $class = !empty($value['id']) ? $value['id'] : $value['name']; $output .= '<div class="tab_item_group ' . $class . '">'; break; case "end_group": $output .= '</div>'; break; case "title": $output .= '<div class="group_title' . $class . '"></div>'; break; case "widget-area": $list_item = get_option('_meris_home_widget_area'); if ($list_item != "" || $val != "") { if ($list_item == "") { $list_item = $val; } $list_array = json_decode($list_item, true); $list_item_str = ''; if (isset($list_array['section-widget-area-name']) && is_array($list_array['section-widget-area-name'])) { $num = count($list_array['section-widget-area-name']); for ($i = 0; $i < $num; $i++) { $areaname = isset($list_array['section-widget-area-name'][$i]) ? $list_array['section-widget-area-name'][$i] : ""; $sanitize_areaname = sanitize_title($areaname); $color = isset($list_array['list-item-color'][$i]) ? $list_array['list-item-color'][$i] : ""; $image = isset($list_array['list-item-image'][$i]) ? $list_array['list-item-image'][$i] : ""; $repeat = isset($list_array['list-item-repeat'][$i]) ? $list_array['list-item-repeat'][$i] : ""; $position = isset($list_array['list-item-position'][$i]) ? $list_array['list-item-position'][$i] : ""; $attachment = isset($list_array['list-item-attachment'][$i]) ? $list_array['list-item-attachment'][$i] : ""; $layout = isset($list_array['widget-area-layout'][$i]) ? $list_array['widget-area-layout'][$i] : ""; $padding = isset($list_array['widget-area-padding'][$i]) ? $list_array['widget-area-padding'][$i] : ""; $column = isset($list_array['widget-area-column'][$i]) ? $list_array['widget-area-column'][$i] : ""; $columns = isset($list_array['widget-area-column-item'][$sanitize_areaname]) ? $list_array['widget-area-column-item'][$sanitize_areaname] : ""; $list_item_array = array("areaname" => $areaname, "sanitize_areaname" => $sanitize_areaname, "color" => $color, "image" => $image, "repeat" => $repeat, "position" => $position, "attachment" => $attachment, "layout" => $layout, "column" => $column, "columns" => $columns, "num" => $i, "padding" => $padding); $list_item_str .= meris_widget_area_generator($list_item_array, false); } } } $output .= '<div id="section-widget" class=""> <select name="widget_layout" id="widget_layout"><option value="1">' . __("choose column", "meris") . '</option> <option value="1">' . __("1 column", "meris") . '</option> <option value="2">' . __("2 columns", "meris") . '</option> <option value="3">' . __("3 columns", "meris") . '</option> <option value="4">' . __("4 columns", "meris") . '</option> </select> <input type="text" id="list-item-val" size="20" name="list-item-val" value="" placeholder="' . __("Widget Area Name", "meris") . '" />'; // $output .= '<p style="display:block;clear: both;height:30px;"><a href="javascript:;" style="float:left;margin-right:20px;" class="button-primary" id="addItem">' . __("Add Item", "meris") . '</a> <span id="list-item-notice" style=" color:red;"></span></p></div>'; $output .= '<div id="list-widget-areas">' . $list_item_str . '</div>'; break; } if ($value['type'] != "heading" && $value['type'] != "info") { $output .= '</div>'; if ($value['type'] != "checkbox" && $value['type'] != "editor") { $output .= '<div class="explain">' . wp_kses($explain_value, $allowedtags) . '</div>' . "\n"; } $output .= '</div></div>' . "\n"; } echo $output; } // Outputs closing div if there tabs if (Options_Framework_Interface::optionsframework_tabs() != '') { echo '</div>'; } }
/** * Builds out the options panel. * * If we were using the Settings API as it was intended we would use * do_settings_sections here. But as we don't want the settings wrapped in a table, * we'll call our own custom optionsframework_fields. See options-interface.php * for specifics on how each individual field is generated. * * Nonces are provided using the settings_fields() * * @since 1.7.0 */ function options_page() { ?> <div id="optionsframework-wrap" class="wrap"> <div class="theme-header clearfix"> <div class="accesspresslite-logo"> <img src="<?php echo get_template_directory_uri(); ?> /images/logo.png" alt="<?php esc_attr_e('AccessPress Staple', 'accesspress-staple'); ?> " /> </div> </div> <div class="optionsframework-holder clearfix"> <div class="nav-tab-wrapper"> <?php echo Options_Framework_Interface::optionsframework_tabs(); ?> </div> <div id="optionsframework-metabox" class="metabox-holder"> <div class="save-message"><?php settings_errors('options-framework'); ?> </div> <div id="optionsframework" class="postbox"> <form action="options.php" method="post"> <?php settings_fields('optionsframework'); ?> <?php Options_Framework_Interface::optionsframework_fields(); /* Settings */ ?> <div id="optionsframework-submit"> <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e('Save Options', 'accesspress-staple'); ?> " /> <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e('Restore Defaults', 'accesspress-staple'); ?> " onclick="return confirm( '<?php print esc_js(__('Click OK to reset. Any theme settings will be lost!', 'accesspress-staple')); ?> ' );" /> <div class="clear"></div> </div> </form> </div> <!-- / #container --> </div> <div class="promo-banner clearfix"> <div class="banner-image"> <h3><?php _e('Update to Pro', 'accesspress-staple'); ?> </h3> <img src="<?php echo get_template_directory_uri() . '/inc/options-framework/images/upgrade-staple-pro.jpg'; ?> " /> </div> <div class="button-link"> <a href="http://accesspressthemes.com/theme-demos/?theme=accesspress-staple" target="_blank"><img src="<?php echo get_template_directory_uri() . '/inc/options-framework/images/demo-btn.png'; ?> "/></a> <a href="https://accesspressthemes.com/wordpress-themes/accesspress-staple-pro/" target="_blank"><img src="<?php echo get_template_directory_uri() . '/inc/options-framework/images/upgrade-btn.png'; ?> "/></a> </div> <div class="any-question"> <?php echo sprintf(__('Any question!! Click <a href="%s" target="_blank">here</a> for live chat', 'accesspress-staple'), esc_url('https://accesspressthemes.com/contact/')); ?> </div> <div class="view-features"> <h3><?php _e('View Features', 'accesspress-staple'); ?> <span>+<span></h3> <div style="display:none" class="view-features-img"> <img src="<?php echo get_template_directory_uri() . '/inc/options-framework/images/upgrade-staple-pro-feature.jpg'; ?> " /> </div> </div> </div> </div> <?php do_action('optionsframework_after'); ?> </div> <!-- / .wrap --> <?php }
/** * Builds out the options panel. * * If we were using the Settings API as it was intended we would use * do_settings_sections here. But as we don't want the settings wrapped in a table, * we'll call our own custom optionsframework_fields. See options-interface.php * for specifics on how each individual field is generated. * * Nonces are provided using the settings_fields() * * @since 1.7.0 */ function options_page() { ?> <div id="optionsframework-wrap" class="wrap"> <?php $menu = $this->menu_settings(); ?> <div class="theme-header clearfix"> <div class="accesspresslite-logo"> <img src="<?php echo get_template_directory_uri(); ?> /inc/options-framework/images/logo.png" alt="<?php esc_attr_e('AccessPress Lite', 'accesspress-parallax'); ?> " /> </div> <div class="ak-socials"> <a target='_blank' href="<?php echo esc_url('http://accesspressthemes.com/theme-demos/?theme=accesspress-parallax'); ?> "><?php _e('Demo', 'accesspress-parallax'); ?> </a> <a target='_blank' href="<?php echo esc_url('https://accesspressthemes.com/documentation/theme-instruction-accesspress-parallax/'); ?> "><?php _e('Documentation/Video Tutorial', 'accesspress-parallax'); ?> </a> </div> </div> <div class="nav-tab-wrapper"> <?php echo Options_Framework_Interface::optionsframework_tabs(); ?> </div> <div id="optionsframework-metabox" class="metabox-holder"> <?php settings_errors('options-framework'); ?> <div id="optionsframework" class="postbox"> <form action="options.php" method="post"> <?php settings_fields('optionsframework'); ?> <?php Options_Framework_Interface::optionsframework_fields(); /* Settings */ ?> <div id="optionsframework-submit"> <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e('Save Options', 'accesspress-parallax'); ?> " /> <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e('Restore Defaults', 'accesspress-parallax'); ?> " onclick="return confirm( '<?php print esc_js(__('Click OK to reset. Any theme settings will be lost!', 'accesspress-parallax')); ?> ' );" /> <div class="clear"></div> </div> </form> </div> <!-- / #container --> <div class="update-banner"> <h3><?php _e('Upgrade to Parallax Pro', 'accesspress-parallax'); ?> </h3> <img src="<?php echo get_template_directory_uri(); ?> /inc/options-framework/images/upgrade-top.jpg"> <div class="button-link"> <a href="<?php echo esc_url('http://accesspressthemes.com/theme-demos/?theme=accesspress-parallax-pro'); ?> " target="_blank"><img src="<?php echo get_template_directory_uri(); ?> /inc/options-framework/images/demo-btn.png"></a> <a href="<?php echo esc_url('https://accesspressthemes.com/wordpress-themes/accesspress-parallax-pro/'); ?> " target="_blank"><img src="<?php echo get_template_directory_uri(); ?> /inc/options-framework/images/upgrade-btn.png"></a> </div> <div class="any-question"> <?php echo sprintf(__('Any question!! Click <a href="%s" target="_blank">here</a> for Live Chat.', 'accesspress-parallax'), esc_url('https://accesspressthemes.com/contact/')); ?> </div> <h3 class="pro-feature-title"><?php _e('Pro Features', 'accesspress-parallax'); ?> <span>›</span></h3> <div class="feature-img"> <img src="<?php echo get_template_directory_uri(); ?> /inc/options-framework/images/upgrade-bottom.jpg"> <div class="button-link"> <a href="<?php echo esc_url('http://accesspressthemes.com/theme-demos/?theme=accesspress-parallax-pro'); ?> " target="_blank"><img src="<?php echo get_template_directory_uri(); ?> /inc/options-framework/images/demo-btn.png"></a> <a href="<?php echo esc_url('https://accesspressthemes.com/wordpress-themes/accesspress-parallax-pro/'); ?> " target="_blank"><img src="<?php echo get_template_directory_uri(); ?> /inc/options-framework/images/upgrade-btn.png"></a> </div> </div> </div> </div> <?php do_action('optionsframework_after'); ?> </div> <!-- / .wrap --> <?php }
/** * Generates the options fields that are used in the form. */ static function optionsframework_fields() { global $allowedtags; $optionsframework_settings = get_option(ONETONE_OPTIONS_PREFIXED . 'optionsframework'); // Gets the unique option id if (isset($optionsframework_settings['id'])) { $option_name = $optionsframework_settings['id']; } else { $option_name = ONETONE_OPTIONS_PREFIXED . 'optionsframework'; } $settings = get_option($option_name); $options =& Options_Framework::_optionsframework_options(); $counter = 0; $menu = ''; foreach ($options as $value) { $val = ''; $select_value = ''; $output = ''; // Wrap all options if ($value['type'] != "heading" && $value['type'] != "info") { // Keep all ids lowercase with no spaces $value['id'] = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($value['id'])); $id = 'section-' . $value['id']; $class = 'section'; if (isset($value['type'])) { $class .= ' section-' . $value['type']; } if (isset($value['class'])) { $class .= ' ' . $value['class']; } $output .= '<div id="' . esc_attr($id) . '" class="' . esc_attr($class) . '">' . "\n"; if (isset($value['name'])) { $output .= '<h4 class="heading">' . esc_html($value['name']) . '</h4>' . "\n"; } if ($value['type'] != 'editor') { $output .= '<div class="option">' . "\n" . '<div class="controls">' . "\n"; } else { $output .= '<div class="option">' . "\n" . '<div>' . "\n"; } } // Set default value to $val if (isset($value['std'])) { $val = $value['std']; } // If the option is already saved, override $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']; } if (has_filter('optionsframework_' . $value['type'])) { $output .= apply_filters('optionsframework_' . $value['type'], $option_name, $value, $val); } switch ($value['type']) { // Basic text input case 'text': $output .= '<input id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" type="text" value="' . esc_attr($val) . '" />'; break; // Password input // Password input case 'password': $output .= '<input id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" type="password" value="' . esc_attr($val) . '" />'; break; // Textarea // Textarea case 'textarea': $rows = '8'; if (isset($value['settings']['rows'])) { $custom_rows = $value['settings']['rows']; if (is_numeric($custom_rows)) { $rows = $custom_rows; } } $val = stripslashes($val); $output .= '<textarea id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" rows="' . $rows . '">' . esc_textarea($val) . '</textarea>'; break; // Select Box // Select Box case 'select': $output .= '<select class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" id="' . esc_attr($value['id']) . '">'; foreach ($value['options'] as $key => $option) { $output .= '<option' . selected($val, $key, false) . ' value="' . esc_attr($key) . '">' . esc_html($option) . '</option>'; } $output .= '</select>'; break; // Radio Box // Radio Box case "radio": $name = $option_name . '[' . $value['id'] . ']'; foreach ($value['options'] as $key => $option) { $id = $option_name . '-' . $value['id'] . '-' . $key; $output .= '<input class="of-input of-radio" type="radio" name="' . esc_attr($name) . '" id="' . esc_attr($id) . '" value="' . esc_attr($key) . '" ' . checked($val, $key, false) . ' /><label for="' . esc_attr($id) . '">' . esc_html($option) . '</label>'; } break; // Image Selectors // Image Selectors case "images": $name = $option_name . '[' . $value['id'] . ']'; foreach ($value['options'] as $key => $option) { $selected = ''; if ($val != '' && $val == $key) { $selected = ' of-radio-img-selected'; } $output .= '<input type="radio" id="' . esc_attr($value['id'] . '_' . $key) . '" class="of-radio-img-radio" value="' . esc_attr($key) . '" name="' . esc_attr($name) . '" ' . checked($val, $key, false) . ' />'; $output .= '<div class="of-radio-img-label">' . esc_html($key) . '</div>'; $output .= '<img src="' . esc_url($option) . '" alt="' . $option . '" class="of-radio-img-img' . $selected . '" onclick="document.getElementById(\'' . esc_attr($value['id'] . '_' . $key) . '\').checked=true;" />'; } break; // Checkbox // Checkbox case "checkbox": $output .= '<input id="' . esc_attr($value['id']) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" ' . checked($val, 1, false) . ' />'; $output .= '<label class="explain" for="' . esc_attr($value['id']) . '">' . wp_kses($explain_value, $allowedtags) . '</label>'; break; // Multicheck // 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 .= '<input id="' . esc_attr($id) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr($name) . '" ' . $checked . ' /><label for="' . esc_attr($id) . '">' . esc_html($label) . '</label>'; } break; // Color picker // Color picker case "color": $default_color = ''; if (isset($value['std'])) { if ($val != $value['std']) { $default_color = ' data-default-color="' . $value['std'] . '" '; } } $output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" id="' . esc_attr($value['id']) . '" class="of-color" type="text" value="' . esc_attr($val) . '"' . $default_color . ' />'; break; // Uploader // Uploader case "upload": $output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $val, null); break; // Typography // Typography case 'typography': unset($font_size, $font_style, $font_face, $font_color); $typography_defaults = array('size' => '', 'face' => '', 'style' => '', 'color' => ''); $typography_stored = wp_parse_args($val, $typography_defaults); $typography_options = array('sizes' => of_recognized_font_sizes(), 'faces' => of_recognized_font_faces(), 'styles' => of_recognized_font_styles(), 'color' => true); if (isset($value['options'])) { $typography_options = wp_parse_args($value['options'], $typography_options); } // Font Size if ($typography_options['sizes']) { $font_size = '<select class="of-typography of-typography-size" name="' . esc_attr($option_name . '[' . $value['id'] . '][size]') . '" id="' . esc_attr($value['id'] . '_size') . '">'; $sizes = $typography_options['sizes']; foreach ($sizes as $i) { $size = $i . 'px'; $font_size .= '<option value="' . esc_attr($size) . '" ' . selected($typography_stored['size'], $size, false) . '>' . esc_html($size) . '</option>'; } $font_size .= '</select>'; } // Font Face if ($typography_options['faces']) { $font_face = '<select class="of-typography of-typography-face" name="' . esc_attr($option_name . '[' . $value['id'] . '][face]') . '" id="' . esc_attr($value['id'] . '_face') . '">'; $faces = $typography_options['faces']; foreach ($faces as $key => $face) { $font_face .= '<option value="' . esc_attr($key) . '" ' . selected($typography_stored['face'], $key, false) . '>' . esc_html($face) . '</option>'; } $font_face .= '</select>'; } // Font Styles if ($typography_options['styles']) { $font_style = '<select class="of-typography of-typography-style" name="' . $option_name . '[' . $value['id'] . '][style]" id="' . $value['id'] . '_style">'; $styles = $typography_options['styles']; foreach ($styles as $key => $style) { $font_style .= '<option value="' . esc_attr($key) . '" ' . selected($typography_stored['style'], $key, false) . '>' . $style . '</option>'; } $font_style .= '</select>'; } // Font Color if ($typography_options['color']) { $default_color = ''; if (isset($value['std']['color'])) { if ($val != $value['std']['color']) { $default_color = ' data-default-color="' . $value['std']['color'] . '" '; } } $font_color = '<input name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" class="of-color of-typography-color" type="text" value="' . esc_attr($typography_stored['color']) . '"' . $default_color . ' />'; } // Allow modification/injection of typography fields $typography_fields = compact('font_size', 'font_face', 'font_style', 'font_color'); $typography_fields = apply_filters('of_typography_fields', $typography_fields, $typography_stored, $option_name, $value); $output .= implode('', $typography_fields); break; // Background // Background case 'background': $background = $val; // Background Color $default_color = ''; if (isset($value['std']['color'])) { if ($val != $value['std']['color']) { $default_color = ' data-default-color="' . $value['std']['color'] . '" '; } } $output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" class="of-color of-background-color" type="text" value="' . esc_attr($background['color']) . '"' . $default_color . ' />'; // Background Image if (!isset($background['image'])) { $background['image'] = ''; } $output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $background['image'], null, esc_attr($option_name . '[' . $value['id'] . '][image]')); $class = 'of-background-properties'; if ('' == $background['image']) { $class .= ' hide'; } $output .= '<div class="' . esc_attr($class) . '">'; // Background Repeat $output .= '<select class="of-background of-background-repeat" name="' . esc_attr($option_name . '[' . $value['id'] . '][repeat]') . '" id="' . esc_attr($value['id'] . '_repeat') . '">'; $repeats = of_recognized_background_repeat(); foreach ($repeats as $key => $repeat) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background['repeat'], $key, false) . '>' . esc_html($repeat) . '</option>'; } $output .= '</select>'; // Background Position $output .= '<select class="of-background of-background-position" name="' . esc_attr($option_name . '[' . $value['id'] . '][position]') . '" id="' . esc_attr($value['id'] . '_position') . '">'; $positions = of_recognized_background_position(); foreach ($positions as $key => $position) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background['position'], $key, false) . '>' . esc_html($position) . '</option>'; } $output .= '</select>'; // Background Attachment $output .= '<select class="of-background of-background-attachment" name="' . esc_attr($option_name . '[' . $value['id'] . '][attachment]') . '" id="' . esc_attr($value['id'] . '_attachment') . '">'; $attachments = of_recognized_background_attachment(); foreach ($attachments as $key => $attachment) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background['attachment'], $key, false) . '>' . esc_html($attachment) . '</option>'; } $output .= '</select>'; $output .= '</div>'; break; // Editor // Editor case 'editor': $output .= '<div class="explain">' . wp_kses($explain_value, $allowedtags) . '</div>' . "\n"; echo $output; $textarea_name = esc_attr($option_name . '[' . $value['id'] . ']'); $default_editor_settings = array('textarea_name' => $textarea_name, 'media_buttons' => true, 'tinymce' => array('plugins' => 'wordpress')); $editor_settings = array(); if (isset($value['settings'])) { $editor_settings = $value['settings']; } $editor_settings = array_merge($default_editor_settings, $editor_settings); wp_editor($val, $value['id'], $editor_settings); $output = ''; break; // Info // Info case "info": $id = ''; $class = 'section'; if (isset($value['id'])) { $id = 'id="' . esc_attr($value['id']) . '" '; } if (isset($value['type'])) { $class .= ' section-' . $value['type']; } if (isset($value['class'])) { $class .= ' ' . $value['class']; } $output .= '<div ' . $id . 'class="' . esc_attr($class) . '">' . "\n"; if (isset($value['name'])) { $output .= '<h4 class="heading">' . esc_html($value['name']) . '</h4>' . "\n"; } if ($value['desc']) { $output .= apply_filters('of_sanitize_info', $value['desc']) . "\n"; } $output .= '</div>' . "\n"; break; // Heading for Navigation // Heading for Navigation case "heading": $counter++; if ($counter >= 2) { $output .= '</div>' . "\n"; } $class = ''; $class = !empty($value['id']) ? $value['id'] : $value['name']; $class = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($class)); $output .= '<div id="options-group-' . $counter . '" class="group ' . $class . '">'; $output .= '<h3>' . esc_html($value['name']) . '</h3>' . "\n"; break; case "start_group": $class = ''; $class = !empty($value['id']) ? $value['id'] : $value['name']; $output .= '<div class="tab_item_group ' . $class . '">'; break; case "end_group": $output .= '</div>'; break; case "title": $output .= '<div class="group_title' . $class . '"></div>'; break; } if ($value['type'] != "heading" && $value['type'] != "info") { $output .= '</div>'; if ($value['type'] != "checkbox" && $value['type'] != "editor") { $output .= '<div class="explain">' . wp_kses($explain_value, $allowedtags) . '</div>' . "\n"; } $output .= '</div></div>' . "\n"; } echo $output; } // Outputs closing div if there tabs if (Options_Framework_Interface::optionsframework_tabs() != '') { echo '</div>'; } }
/** * Builds out the options panel. * * If we were using the Settings API as it was intended we would use * do_settings_sections here. But as we don't want the settings wrapped in a table, * we'll call our own custom optionsframework_fields. See options-interface.php * for specifics on how each individual field is generated. * * Nonces are provided using the settings_fields() * * @since 1.7.0 */ function options_page() { ?> <div id="optionsframework-wrap" class="wrap"> <?php $menu = $this->menu_settings(); ?> <h2><?php echo esc_html($menu['page_title']); ?> </h2> <h2 class="nav-tab-wrapper"> <?php echo Options_Framework_Interface::optionsframework_tabs(); ?> </h2> <?php settings_errors('options-framework'); ?> <div id="optionsframework-metabox" class="metabox-holder"> <div id="optionsframework" class="postbox"> <form action="options.php" method="post"> <?php settings_fields('optionsframework'); ?> <?php Options_Framework_Interface::optionsframework_fields(); /* Settings */ ?> <div id="optionsframework-submit"> <input type="submit" class="button-primary" name="update" value="保存设置" /> <input type="submit" class="reset-button button-secondary" name="reset" value="重置" onclick="return confirm( '<?php print esc_js('您确定要重置所有选项吗?'); ?> ' );" /> <div class="clear"></div> </div> </form> </div> <!-- / #container --> </div> <?php do_action('optionsframework_after'); ?> </div> <!-- / .wrap --> <?php }
/** * Builds out the options panel. * * If we were using the Settings API as it was intended we would use * do_settings_sections here. But as we don't want the settings wrapped in a table, * we'll call our own custom optionsframework_fields. See options-interface.php * for specifics on how each individual field is generated. * * Nonces are provided using the settings_fields() * * @since 1.7.0 */ function options_page() { ?> <div id="optionsframework-wrap" class="wrap"> <?php $menu = $this->menu_settings(); ?> <h2><?php echo esc_html($menu['page_title']); ?> </h2> <h2 class="nav-tab-wrapper"> <?php echo Options_Framework_Interface::optionsframework_tabs(); ?> </h2> <div style="padding-top:10px;font-size:15px;"><a href="<?php echo esc_url(SKT_THEME_URL_DIRECT); ?> " target="_blank"><?php _e('Buy PRO version for only $39 with more features.', 'skt-iamone'); ?> </a></div> <?php settings_errors('options-framework'); ?> <div id="optionsframework-metabox" class="metabox-holder"> <div id="optionsframework" class="postbox" style="width:72%; float:left;"> <form action="options.php" method="post"> <?php settings_fields('optionsframework'); ?> <?php Options_Framework_Interface::optionsframework_fields(); /* Settings */ ?> <div id="optionsframework-submit"> <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e('Save Options', 'skt-iamone'); ?> " /> <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e('Restore Defaults', 'skt-iamone'); ?> " onclick="return confirm( '<?php print esc_js(__('Click OK to reset. Any theme settings will be lost!', 'skt-iamone')); ?> ' );" /> <div class="clear"></div> </div> </form> </div> <!-- / #container --> <div style="width:25%; float:right;" class="postbox-container side"> <div class="meta-box-sortables ui-sortable"> <div class="postbox"> <h3 class="hndle"><span>Our Themes</span></h3> <div class="inside"> <p><a target="_blank" href="<?php echo esc_url(SKT_THEME_URL); ?> "><img style="max-width:100%" src="<?php echo get_template_directory_uri(); ?> /images/sktskill.jpg"></a></p> </div> </div> <div class="postbox"> <h3 class="hndle"><span><?php _e('Documentation & Support', 'skt-iamone'); ?> </span></h3> <div class="inside"> <p><em><?php _e('For documentation and support check this link', 'skt-iamone'); ?> : <strong><a href="<?php echo esc_url(SKT_THEME_DOC); ?> " target="_blank"><?php _e('I Am One Documentation', 'skt-iamone'); ?> </a></strong></em></p> </div> </div> </div> </div> </div> <?php do_action('optionsframework_after'); ?> </div> <!-- / .wrap --> <?php }
/** * Generates the options fields that are used in the form. */ static function optionsframework_fields() { global $allowedtags; $options_framework = new Options_Framework(); $option_name = $options_framework->get_option_name(); $settings = get_option($option_name); $options =& Options_Framework::_optionsframework_options(); $counter = 0; $menu = ''; foreach ($options as $value) { $val = ''; $select_value = ''; $output = ''; // Wrap all options if ($value['type'] != "heading" && $value['type'] != "info") { // Keep all ids lowercase with no spaces $value['id'] = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($value['id'])); $id = 'section-' . $value['id']; $class = 'section'; if (isset($value['type'])) { $class .= ' section-' . $value['type']; } if (isset($value['class'])) { $class .= ' ' . $value['class']; } $output .= '<div id="' . esc_attr($id) . '" class="' . esc_attr($class) . '">' . "\n"; if (isset($value['name'])) { $output .= '<h4 class="heading">' . esc_html($value['name']) . '</h4>' . "\n"; } if ($value['type'] != 'editor') { $output .= '<div class="option">' . "\n" . '<div class="controls">' . "\n"; } else { $output .= '<div class="option">' . "\n" . '<div>' . "\n"; } } // Set default value to $val if (isset($value['std'])) { $val = $value['std']; } // If the option is already saved, override $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']; } // Set the placeholder if one exists $placeholder = ''; if (isset($value['placeholder'])) { $placeholder = ' placeholder="' . esc_attr($value['placeholder']) . '"'; } if (has_filter('optionsframework_' . $value['type'])) { $output .= apply_filters('optionsframework_' . $value['type'], $option_name, $value, $val); } switch ($value['type']) { // Basic text input case 'text': $output .= '<input id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" type="text" value="' . esc_attr($val) . '"' . $placeholder . ' />'; break; // Basic hidded input // Basic hidded input case 'hidden': $output .= '<input id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" type="hidden" value="' . esc_attr($val) . '"' . $placeholder . ' />'; break; // Basic text input // Basic text input case 'url': $output .= '<input id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" type="text" value="' . esc_url($val) . '"' . $placeholder . ' />'; break; // Password input // Password input case 'password': $output .= '<input id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" type="password" value="' . esc_attr($val) . '" />'; break; // Textarea // Textarea case 'textarea': $rows = '14'; if (isset($value['settings']['rows'])) { $custom_rows = $value['settings']['rows']; if (is_numeric($custom_rows)) { $rows = $custom_rows; } } $val = stripslashes($val); $output .= '<textarea id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" rows="' . $rows . '"' . $placeholder . '>' . esc_textarea($val) . '</textarea>'; break; // Select Box // Select Box case 'select': $output .= '<select class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" id="' . esc_attr($value['id']) . '">'; foreach ($value['options'] as $key => $option) { $output .= '<option' . selected($val, $key, false) . ' value="' . esc_attr($key) . '">' . esc_html($option) . '</option>'; } $output .= '</select>'; break; // Radio Box // Radio Box case "radio": $name = $option_name . '[' . $value['id'] . ']'; foreach ($value['options'] as $key => $option) { $id = $option_name . '-' . $value['id'] . '-' . $key; $output .= '<input class="of-input of-radio" type="radio" name="' . esc_attr($name) . '" id="' . esc_attr($id) . '" value="' . esc_attr($key) . '" ' . checked($val, $key, false) . ' /><label for="' . esc_attr($id) . '">' . esc_html($option) . '</label>'; } break; // Image Selectors // Image Selectors case "images": $name = $option_name . '[' . $value['id'] . ']'; foreach ($value['options'] as $key => $option) { $selected = ''; if ($val != '' && $val == $key) { $selected = ' of-radio-img-selected'; } $output .= '<input type="radio" id="' . esc_attr($value['id'] . '_' . $key) . '" class="of-radio-img-radio" value="' . esc_attr($key) . '" name="' . esc_attr($name) . '" ' . checked($val, $key, false) . ' />'; $output .= '<div class="of-radio-img-label">' . esc_html($key) . '</div>'; $output .= '<img src="' . esc_url($option) . '" alt="' . $option . '" class="of-radio-img-img' . $selected . '" onclick="document.getElementById(\'' . esc_attr($value['id'] . '_' . $key) . '\').checked=true;" />'; } break; // Checkbox // Checkbox case "checkbox": $output .= '<input id="' . esc_attr($value['id']) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" ' . checked($val, 1, false) . ' />'; $output .= '<label class="explain" for="' . esc_attr($value['id']) . '">' . wp_kses($explain_value, $allowedtags) . '</label>'; break; // Multicheck // 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 .= '<input id="' . esc_attr($id) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr($name) . '" ' . $checked . ' /><label for="' . esc_attr($id) . '">' . esc_html($label) . '</label>'; } break; // Color picker // Color picker case "color": $default_color = ''; if (isset($value['std'])) { if ($val != $value['std']) { $default_color = ' data-default-color="' . $value['std'] . '" '; } } $output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" id="' . esc_attr($value['id']) . '" class="of-color" type="text" value="' . esc_attr($val) . '"' . $default_color . ' />'; break; // Uploader // Uploader case "upload": $output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $val, null); break; // Typography // Typography case 'typography': unset($font_size, $font_style, $font_face, $font_color); $typography_defaults = array('size' => '', 'face' => '', 'style' => '', 'color' => ''); $typography_stored = wp_parse_args($val, $typography_defaults); $typography_options = array('sizes' => of_recognized_font_sizes(), 'faces' => of_recognized_font_faces(), 'styles' => of_recognized_font_styles(), 'color' => true); if (isset($value['options'])) { $typography_options = wp_parse_args($value['options'], $typography_options); } // Font Size if ($typography_options['sizes']) { $font_size = '<select class="of-typography of-typography-size" name="' . esc_attr($option_name . '[' . $value['id'] . '][size]') . '" id="' . esc_attr($value['id'] . '_size') . '">'; $sizes = $typography_options['sizes']; foreach ($sizes as $i) { $size = $i . 'px'; $font_size .= '<option value="' . esc_attr($size) . '" ' . selected($typography_stored['size'], $size, false) . '>' . esc_html($size) . '</option>'; } $font_size .= '</select>'; } // Font Face if ($typography_options['faces']) { $font_face = '<select class="of-typography of-typography-face" name="' . esc_attr($option_name . '[' . $value['id'] . '][face]') . '" id="' . esc_attr($value['id'] . '_face') . '">'; $faces = $typography_options['faces']; foreach ($faces as $key => $face) { $font_face .= '<option value="' . esc_attr($key) . '" ' . selected($typography_stored['face'], $key, false) . '>' . esc_html($face) . '</option>'; } $font_face .= '</select>'; } // Font Styles if ($typography_options['styles']) { $font_style = '<select class="of-typography of-typography-style" name="' . $option_name . '[' . $value['id'] . '][style]" id="' . $value['id'] . '_style">'; $styles = $typography_options['styles']; foreach ($styles as $key => $style) { $font_style .= '<option value="' . esc_attr($key) . '" ' . selected($typography_stored['style'], $key, false) . '>' . $style . '</option>'; } $font_style .= '</select>'; } // Font Color if ($typography_options['color']) { $default_color = ''; if (isset($value['std']['color'])) { if ($val != $value['std']['color']) { $default_color = ' data-default-color="' . $value['std']['color'] . '" '; } } $font_color = '<input name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" class="of-color of-typography-color type="text" value="' . esc_attr($typography_stored['color']) . '"' . $default_color . ' />'; } // Allow modification/injection of typography fields $typography_fields = compact('font_size', 'font_face', 'font_style', 'font_color'); $typography_fields = apply_filters('of_typography_fields', $typography_fields, $typography_stored, $option_name, $value); $output .= implode('', $typography_fields); break; // Background // Background case 'background': $background = $val; // Background Color $default_color = ''; if (isset($value['std']['color'])) { if ($val != $value['std']['color']) { $default_color = ' data-default-color="' . $value['std']['color'] . '" '; } } $output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" class="of-color of-background-color" type="text" value="' . esc_attr($background['color']) . '"' . $default_color . ' />'; // Background Image if (!isset($background['image'])) { $background['image'] = ''; } $output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $background['image'], null, esc_attr($option_name . '[' . $value['id'] . '][image]')); $class = 'of-background-properties'; if ('' == $background['image']) { $class .= ' hide'; } $output .= '<div class="' . esc_attr($class) . '">'; // Background Repeat $output .= '<select class="of-background of-background-repeat" name="' . esc_attr($option_name . '[' . $value['id'] . '][repeat]') . '" id="' . esc_attr($value['id'] . '_repeat') . '">'; $repeats = of_recognized_background_repeat(); foreach ($repeats as $key => $repeat) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background['repeat'], $key, false) . '>' . esc_html($repeat) . '</option>'; } $output .= '</select>'; // Background Position $output .= '<select class="of-background of-background-position" name="' . esc_attr($option_name . '[' . $value['id'] . '][position]') . '" id="' . esc_attr($value['id'] . '_position') . '">'; $positions = of_recognized_background_position(); foreach ($positions as $key => $position) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background['position'], $key, false) . '>' . esc_html($position) . '</option>'; } $output .= '</select>'; // Background Attachment $output .= '<select class="of-background of-background-attachment" name="' . esc_attr($option_name . '[' . $value['id'] . '][attachment]') . '" id="' . esc_attr($value['id'] . '_attachment') . '">'; $attachments = of_recognized_background_attachment(); foreach ($attachments as $key => $attachment) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background['attachment'], $key, false) . '>' . esc_html($attachment) . '</option>'; } $output .= '</select>'; // Background Size $output .= '<select class="of-background of-background-size" name="' . esc_attr($option_name . '[' . $value['id'] . '][size]') . '" id="' . esc_attr($value['id'] . '_size') . '">'; $sizes = of_recognized_background_size(); foreach ($sizes as $key => $size) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background['size'], $key, false) . '>' . esc_html($size) . '</option>'; } $output .= '</select>'; $output .= '</div>'; break; // Editor // Editor case 'editor': $output .= '<div class="explain">' . wp_kses($explain_value, $allowedtags) . '</div>' . "\n"; echo $output; $textarea_name = esc_attr($option_name . '[' . $value['id'] . ']'); $default_editor_settings = array('textarea_name' => $textarea_name, 'media_buttons' => false, 'tinymce' => array('plugins' => 'wordpress')); $editor_settings = array(); if (isset($value['settings'])) { $editor_settings = $value['settings']; } $editor_settings = array_merge($default_editor_settings, $editor_settings); wp_editor($val, $value['id'], $editor_settings); $output = ''; break; // Info // Info case "info": $id = ''; $class = 'section'; if (isset($value['id'])) { $id = 'id="' . esc_attr($value['id']) . '" '; } if (isset($value['type'])) { $class .= ' section-' . $value['type']; } if (isset($value['class'])) { $class .= ' ' . $value['class']; } $output .= '<div ' . $id . 'class="' . esc_attr($class) . '">' . "\n"; if (isset($value['name'])) { $output .= '<h4 class="heading">' . esc_html($value['name']) . '</h4>' . "\n"; } if (isset($value['desc'])) { $output .= $value['desc'] . "\n"; } $output .= '</div>' . "\n"; break; // Heading for Navigation // Heading for Navigation case "heading": $counter++; if ($counter >= 2) { $output .= '</div>' . "\n"; } $class = ''; $class = !empty($value['id']) ? $value['id'] : $value['name']; $class = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($class)); $output .= '<div id="options-group-' . $counter . '" class="group ' . $class . '">'; $output .= '<h3>' . esc_html($value['name']) . '</h3>' . "\n"; break; // Background // Background case 'parallaxsection': if (!empty($settings['parallax_section'])) { foreach ($settings['parallax_section'] as $i => $ival) { $background = $val; $output .= '<div class="sub-option clearfix" data-id="' . $i . '"><h3 class="title">' . __('Page Title: ', 'accesspress-parallax') . '<span></span><div class="section-toggle"><i class="fa fa-chevron-down"></i> </div></h3>'; $output .= '<div class="sub-option-inner" style="display:none">'; $output .= '<div class="inline-label">'; $output .= '<label>' . __('Page', 'accesspress-parallax') . '</label>'; $output .= '<select class="of-input ' . esc_attr($value['id'] . '_page') . '" name="' . esc_attr($option_name . '[' . $value['id'] . '][' . $i . '][page]') . '">'; foreach ($value['options'] as $key => $option) { $output .= '<option' . selected($background[$i]['page'], $key, false) . ' value="' . esc_attr($key) . '">' . esc_html($option) . '</option>'; } $output .= '</select>'; $output .= '</div>'; // Font Color $default_color = ''; if (isset($value['std']['font_color'])) { if ($val != $value['std']['font_color']) { $default_color = ' data-default-color="' . $value['std']['font_color'] . '" '; } } $output .= '<div class="color-picker inline-label">'; $output .= '<label class="">' . __('Font Color', 'accesspress-parallax') . '</label>'; $output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . '][' . $i . '][font_color]') . '" class="of-color of-background-color" type="text" value="' . esc_attr($background[$i]['font_color']) . '"' . $default_color . ' />'; $output .= '</div>'; // Background Color $default_color = ''; if (isset($value['std']['color'])) { if ($val != $value['std']['color']) { $default_color = ' data-default-color="' . $value['std']['color'] . '" '; } } $output .= '<div class="color-picker inline-label">'; $output .= '<label>' . __('Background Color', 'accesspress-parallax') . '</label>'; $output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . '][' . $i . '][color]') . '" class="of-color of-background-color" type="text" value="' . esc_attr($background[$i]['color']) . '"' . $default_color . ' />'; $output .= '</div>'; // Section Layout $output .= '<div class="inline-label">'; $output .= '<label>' . __('Layout', 'accesspress-parallax') . '</label>'; $output .= '<select class="of-section of-section-layout" name="' . esc_attr($option_name . '[' . $value['id'] . '][' . $i . '][layout]') . '">'; $layouts = of_recognized_layout(); foreach ($layouts as $key => $layout) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background[$i]['layout'], $key, false) . '>' . esc_html($layout) . '</option>'; } $output .= '</select>'; $output .= '</div>'; // Section Category $output .= '<div class="inline-label toggle-category">'; $output .= '<label>' . __('Category', 'accesspress-parallax') . '</label>'; $output .= '<select class="of-input of-section-category" name="' . esc_attr($option_name . '[' . $value['id'] . '][' . $i . '][category]') . '">'; foreach ($value['category'] as $key => $category) { $output .= '<option' . selected($background[$i]['category'], $key, false) . ' value="' . esc_attr($key) . '">' . esc_html($category) . '</option>'; } $output .= '</select>'; $output .= '</div>'; // Background Image if (!isset($background[$i]['image'])) { $background[$i]['image'] = ''; } $output .= '<div class="inline-label">'; $output .= '<label class="">' . __('Background Image', 'accesspress-parallax') . '</label>'; $output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $background[$i]['image'], null, esc_attr($option_name . '[' . $value['id'] . '][' . $i . '][image]')); $output .= '</div>'; $class = 'of-background-properties'; if ('' == $background[$i]['image']) { $class .= ' hide'; } $output .= '<div class="inline-label ' . esc_attr($class) . '">'; $output .= '<label>' . __('Background Settings', 'accesspress-parallax') . '</label>'; // Background Repeat $output .= '<div class="background-settings">'; $output .= '<div class="clearfix">'; $output .= '<select class="of-background of-background-repeat" name="' . esc_attr($option_name . '[' . $value['id'] . '][' . $i . '][repeat]') . '">'; $repeats = of_recognized_background_repeat(); foreach ($repeats as $key => $repeat) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background[$i]['repeat'], $key, false) . '>' . esc_html($repeat) . '</option>'; } $output .= '</select>'; // Background Position $output .= '<select class="of-background of-background-position" name="' . esc_attr($option_name . '[' . $value['id'] . '][' . $i . '][position]') . '">'; $positions = of_recognized_background_position(); foreach ($positions as $key => $position) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background[$i]['position'], $key, false) . '>' . esc_html($position) . '</option>'; } $output .= '</select>'; // Background Attachment $output .= '<select class="of-background of-background-attachment" name="' . esc_attr($option_name . '[' . $value['id'] . '][' . $i . '][attachment]') . '">'; $attachments = of_recognized_background_attachment(); foreach ($attachments as $key => $attachment) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background[$i]['attachment'], $key, false) . '>' . esc_html($attachment) . '</option>'; } $output .= '</select>'; // Background Size $output .= '<select class="of-background of-background-size" name="' . esc_attr($option_name . '[' . $value['id'] . '][' . $i . '][size]') . '">'; $sizes = of_recognized_background_size(); foreach ($sizes as $key => $size) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background[$i]['size'], $key, false) . '>' . esc_html($size) . '</option>'; } $output .= '</select>'; $output .= '</div></div>'; // Background Overlay $output .= '<div class="color-picker inline-label">'; $output .= '<label>' . __('Overlay', 'accesspress-parallax') . '</label>'; $output .= '<select class="of-background of-background-overlay" name="' . esc_attr($option_name . '[' . $value['id'] . '][' . $i . '][overlay]') . '">'; $overlays = of_recognized_background_overlay(); foreach ($overlays as $key => $overlay) { $output .= '<option value="' . esc_attr($key) . '" ' . selected($background[$i]['overlay'], $key, false) . '>' . esc_html($overlay) . '</option>'; } $output .= '</select>'; $output .= '</div>'; $output .= '</div>'; $output .= '<div class="button-primary remove-parallax">' . __('Remove', 'accesspress-parallax') . '</div></div>'; $output .= '</div>'; } } break; // Button // Button case "button": $output .= '<a id="' . esc_attr($value['id']) . '" class="button-primary" href="javascript:void(0);">' . __('Add New Section', 'accesspress-parallax') . '</a>' . "\n"; break; } if ($value['type'] != "heading" && $value['type'] != "info") { $output .= '</div>'; if ($value['type'] != "checkbox" && $value['type'] != "editor" && $value['type'] != "parallaxsection") { $output .= '<div class="explain">' . wp_kses($explain_value, $allowedtags) . '</div>' . "\n"; } $output .= '</div></div>' . "\n"; } echo $output; } // Outputs closing div if there tabs if (Options_Framework_Interface::optionsframework_tabs() != '') { echo '</div>'; } }