function import() { $response = array('global' => array('error' => 1)); $Notice = new ThemeNotice(); $result = $this->download(); if ($result) { $response['global']['error'] = 0; } else { $Notice->addError(ThemeHelper::getFormName('import_google_font', false), ThemeHelper::esc_html('Cannot import list of fonts')); $response['local'] = $Notice->getError(); } $response['global']['notice'] = $Notice->createHTML(THEME_PATH_TEMPLATE . 'notice.php'); echo json_encode($response); exit; }
<?php foreach ($this->data['dictionary']['sortDirection'] as $index => $value) { echo '<option value="' . ThemeHelper::esc_attr($index) . '" ' . ThemeHelper::selectedIf($this->data['option']['blog_sort_direction'], $index, false) . '>' . ThemeHelper::esc_html($value[0]) . '</option>'; } ?> </select> </div> </li> <li> <h5><?php esc_html_e('Automatic excerpt length', THEME_DOMAIN); ?> </h5> <span class="to-legend"><?php esc_html_e('Number of words in automatic excerpt.', THEME_DOMAIN); ?> </span> <div> <input type="text" name="<?php ThemeHelper::getFormName('blog_automatic_excerpt_length'); ?> " id="<?php ThemeHelper::getFormName('blog_automatic_excerpt_length'); ?> " value="<?php echo ThemeHelper::esc_attr($this->data['option']['blog_automatic_excerpt_length']); ?> " maxlength="3"/> </div> </li> </ul>
<ul class="to-form-field-list"> <li> <h5><?php esc_html_e('Footer layout', THEME_DOMAIN); ?> </h5> <span class="to-legend"><?php esc_html_e('Select layout of widgets in footer. This option works only if this widget area is selected as sidebar in footer.', THEME_DOMAIN); ?> </span> <div class="to-clear-fix"> <select name="<?php ThemeHelper::getFormName('widget_area_footer_layout'); ?> " id="<?php ThemeHelper::getFormName('widget_area_footer_layout'); ?> "> <?php foreach ($this->data['dictionary']['layout'] as $index => $value) { echo '<option value="' . ThemeHelper::esc_attr($index) . '" ' . ThemeHelper::selectedIf($this->data['option']['widget_area_footer_layout'], $index, false) . '>' . ThemeHelper::esc_html($index) . '</option>'; } ?> </select> </div> </li> </ul> </div> <script type="text/javascript"> jQuery(document).ready(function($) {
foreach ($this->data['dictionary']['responsiveMedia'] as $index => $value) { if ($index == 1) { continue; } ?> <li> <h5><?php echo sprintf(esc_html__('CSS styles for page width between %s px and %s px.', THEME_DOMAIN), $value['min-width'], $value['max-width']); ?> </h5> <span class="to-legend"><?php echo sprintf(esc_html__('CSS styles for page width between %s px and %s px.', THEME_DOMAIN), $value['min-width'], $value['max-width']); ?> </span> <div> <textarea id="<?php ThemeHelper::getFormName('custom_css_responsive_' . $index); ?> " name="<?php ThemeHelper::getFormName('custom_css_responsive_' . $index); ?> " rows="1" cols="1" class="css-editor"><?php echo ThemeHelper::esc_html($this->data['option']['custom_css_responsive_' . $index]); ?> </textarea> </div> </li> <?php } ?> </ul>
" value="1" <?php ThemeHelper::checkedIf($this->data['option']['fancybox_video_close_button'], 1); ?> /> <label for="<?php ThemeHelper::getFormName('fancybox_video_close_button_1'); ?> "><?php esc_html_e('Enable', THEME_DOMAIN); ?> </label> <input type="radio" name="<?php ThemeHelper::getFormName('fancybox_video_close_button'); ?> " id="<?php ThemeHelper::getFormName('fancybox_video_close_button_0'); ?> " value="0" <?php ThemeHelper::checkedIf($this->data['option']['fancybox_video_close_button'], 0); ?> /> <label for="<?php ThemeHelper::getFormName('fancybox_video_close_button_0'); ?> "><?php esc_html_e('Disable', THEME_DOMAIN); ?> </label> </div> </li> </ul>
<ul class="to-form-field-list"> <li> <h5><?php esc_html_e('404 error page', THEME_DOMAIN); ?> </h5> <span class="to-legend"><?php esc_html_e('Get settings for 404 page from selected page.', THEME_DOMAIN); ?> </span> <div class="to-clear-fix"> <select name="<?php ThemeHelper::getFormName('page_404_page_id'); ?> " id="<?php ThemeHelper::getFormName('page_404_page_id'); ?> "> <?php foreach ($this->data['dictionary']['page'] as $value) { echo '<option value="' . ThemeHelper::esc_attr($value->ID) . '" ' . ThemeHelper::selectedIf($this->data['option']['page_404_page_id'], $value->ID, false) . '>' . ThemeHelper::esc_html($value->post_title) . '</option>'; } ?> </select> </div> </li> </ul>
<input type="text" name="<?php ThemeHelper::getFormName('font_h3_line_height'); ?> " id="<?php ThemeHelper::getFormName('font_h3_line_height'); ?> " value="<?php echo ThemeHelper::esc_attr($this->data['option']['font_h3_line_height']); ?> " maxlength="255"/> </div> </li> </ul> <script type="text/javascript"> jQuery(document).ready(function($) { var element=$('.to').themeOptionElement();; element.createGoogleFontAutocomplete('#<?php ThemeHelper::getFormName('font_h3_family_google'); ?> '); element.createSlider('#<?php ThemeHelper::getFormName('font_h3_size_1_slider'); ?> ',1,100,<?php echo (int) $this->data['option']['font_h3_size_1']; ?> ); }); </script>
echo ThemeHelper::esc_attr($this->data['option']['go_to_page_top_animation_duration']); ?> " maxlength="5"/> </div> </li> <li> <h5><?php esc_html_e('Easing', THEME_DOMAIN); ?> </h5> <span class="to-legend"><?php esc_html_e('Easing method of animation.', THEME_DOMAIN); ?> </span> <div class="to-clear-fix"> <select name="<?php ThemeHelper::getFormName('go_to_page_top_animation_easing'); ?> " id="<?php ThemeHelper::getFormName('go_to_page_top_animation_easing'); ?> "> <?php foreach ($this->data['dictionary']['easingType'] as $index => $value) { echo '<option value="' . ThemeHelper::esc_attr($index) . '" ' . ThemeHelper::selectedIf($this->data['option']['go_to_page_top_animation_easing'], $index, false) . '>' . ThemeHelper::esc_html($value[0]) . '</option>'; } ?> </select> </div> </li> </ul>
" id="<?php ThemeHelper::getFormName('favicon_url'); ?> " class="to-float-left" value="<?php echo ThemeHelper::esc_attr($this->data['option']['favicon_url']); ?> " /> <input type="button" name="<?php ThemeHelper::getFormName('favicon_url_browse'); ?> " id="<?php ThemeHelper::getFormName('favicon_url_browse'); ?> " class="to-button-browse to-button" value="<?php esc_attr_e('Browse', THEME_DOMAIN); ?> "/> </div> </li> </ul> <script type="text/javascript"> jQuery(document).ready(function($) { var element=$('.to').themeOptionElement();; element.bindBrowseMedia('#<?php ThemeHelper::getFormName('favicon_url_browse'); ?> '); }); </script>
" value="1" <?php ThemeHelper::checkedIf($this->data['option']['responsive_mode_enable'], 1); ?> /> <label for="<?php ThemeHelper::getFormName('responsive_mode_enable_1'); ?> "><?php esc_html_e('Enable', THEME_DOMAIN); ?> </label> <input type="radio" name="<?php ThemeHelper::getFormName('responsive_mode_enable'); ?> " id="<?php ThemeHelper::getFormName('responsive_mode_enable_0'); ?> " value="0" <?php ThemeHelper::checkedIf($this->data['option']['responsive_mode_enable'], 0); ?> /> <label for="<?php ThemeHelper::getFormName('responsive_mode_enable_0'); ?> "><?php esc_html_e('Disable', THEME_DOMAIN); ?> </label> </div> </li> </ul>
</li> <li> <h5><?php esc_html_e('Page background color', THEME_DOMAIN); ?> </h5> <span class="to-legend"><?php esc_html_e('Page background color in HEX.', THEME_DOMAIN); ?> </span> <div> <input type="text" class="to-color-picker" value="<?php echo ThemeHelper::esc_attr($this->data['option']['page_background_color']); ?> " id="<?php ThemeHelper::getFormName('page_background_color'); ?> " name="<?php ThemeHelper::getFormName('page_background_color'); ?> " maxlength="11"/> </div> </li> </ul> </div> <script type="text/javascript"> jQuery(document).ready(function($) { $('.to').themeOptionElement({init:true}); }); </script>
esc_html_e('Type of easing for scrolling animation.', THEME_DOMAIN); ?> </span> <div class="to-clear-fix"> <select name="<?php ThemeHelper::getFormName('menu_scroll_animation_easing'); ?> " id="<?php ThemeHelper::getFormName('menu_scroll_animation_easing'); ?> "> <?php foreach ($this->data['dictionary']['easingType'] as $index => $value) { echo '<option value="' . ThemeHelper::esc_attr($index) . '" ' . ThemeHelper::selectedIf($this->data['option']['menu_scroll_animation_easing'], $index, false) . '>' . ThemeHelper::esc_html($value[0]) . '</option>'; } ?> </select> </div> </li> </ul> <script type="text/javascript"> jQuery(document).ready(function($) { var element=$('.to').themeOptionElement();; element.bindBrowseMedia('#<?php ThemeHelper::getFormName('menu_logo_src_browse'); ?> '); }); </script>
echo ThemeHelper::esc_html($value->data->display_name); ?> </label> <?php } ?> </div> </li> <li> <h5><?php esc_html_e('Disable maintenance mode for IP addreses', THEME_DOMAIN); ?> </h5> <span class="to-legend"><?php esc_html_e('Allow to visit page (in normal mode) visitors from selected (seperated by line break) IP addresses:', THEME_DOMAIN); ?> </span> <div> <textarea id="<?php ThemeHelper::getFormName('maintenance_mode_ip_address'); ?> " name="<?php ThemeHelper::getFormName('maintenance_mode_ip_address'); ?> " rows="1" cols="1"><?php echo ThemeHelper::esc_html($this->data['option']['maintenance_mode_ip_address']); ?> </textarea> </div> </li> </ul>
" value="1" <?php ThemeHelper::checkedIf($this->data['option']['copy_selection_enable'], 1); ?> /> <label for="<?php ThemeHelper::getFormName('copy_selection_enable_1'); ?> "><?php esc_html_e('Enable', THEME_DOMAIN); ?> </label> <input type="radio" name="<?php ThemeHelper::getFormName('copy_selection_enable'); ?> " id="<?php ThemeHelper::getFormName('copy_selection_enable_0'); ?> " value="0" <?php ThemeHelper::checkedIf($this->data['option']['copy_selection_enable'], 0); ?> /> <label for="<?php ThemeHelper::getFormName('copy_selection_enable_0'); ?> "><?php esc_html_e('Disable', THEME_DOMAIN); ?> </label> </div> </li> </ul>
<ul class="to-form-field-list"> <li> <h5><?php esc_html_e('Automatic excerpt length', THEME_DOMAIN); ?> </h5> <span class="to-legend"><?php esc_html_e('Number of words in automatic excerpt.', THEME_DOMAIN); ?> </span> <div> <input type="text" name="<?php ThemeHelper::getFormName('comment_automatic_excerpt_length'); ?> " id="<?php ThemeHelper::getFormName('comment_automatic_excerpt_length'); ?> " value="<?php echo ThemeHelper::esc_attr($this->data['option']['comment_automatic_excerpt_length']); ?> " maxlength="3"/> </div> </li> </ul>
function adminOptionPanelSave() { $option = ThemeHelper::getPostOption(); ThemeHelper::removeUIndex($option, 'maintenance_mode_user_id'); $response = array('global' => array('error' => 1)); $CSS = new ThemeCSS(); $Blog = new ThemeBlog(); $Notice = new ThemeNotice(); $Easing = new ThemeEasing(); $FancyBox = new ThemeFancybox(); $Background = new ThemeBackground(); $Validation = new ThemeValidation($Notice); $ResponsiveMode = new ThemeResponsiveMode($this->responsiveMode); $media = $ResponsiveMode->getMedia(); $invalidValue = esc_html__('Invalid value', THEME_DOMAIN); /* Main */ $Validation->notice('isNumber', array($option['header_enable'], 0, 1), array(ThemeHelper::getFormName('header_enable', false), $invalidValue)); if (!array_key_exists($option['header_background_image_repeat'], $Background->backgroundRepeat)) { $Notice->addError(ThemeHelper::getFormName('header_background_image_repeat', false), $invalidValue); } if (!array_key_exists($option['header_background_image_size_1'], $Background->backgroundSize)) { $Notice->addError(ThemeHelper::getFormName('header_background_image_size_1', false), $invalidValue); } /* Blog */ if (!in_array($option['blog_sort_field'], array_keys($Blog->sortPostBlogField))) { $Notice->addError(ThemeHelper::getFormName('blog_sort_field', false), $invalidValue); } if (!in_array($option['blog_sort_direction'], array_keys($Blog->sortDirection))) { $Notice->addError(ThemeHelper::getFormName('blog_sort_direction', false), $invalidValue); } $Validation->notice('isNumber', array($option['blog_automatic_excerpt_length'], 0, 999), array(ThemeHelper::getFormName('blog_automatic_excerpt_length', false), $invalidValue)); /* Post */ $Validation->notice('isNumber', array($option['post_category_visible'], 0, 1), array(ThemeHelper::getFormName('post_category_visible', false), $invalidValue)); $Validation->notice('isNumber', array($option['post_author_visible'], 0, 1), array(ThemeHelper::getFormName('post_author_visible', false), $invalidValue)); $Validation->notice('isNumber', array($option['post_tag_visible'], 0, 1), array(ThemeHelper::getFormName('post_tag_visible', false), $invalidValue)); $Validation->notice('isNumber', array($option['post_comment_count_visible'], 0, 1), array(ThemeHelper::getFormName('post_comment_count_visible', false), $invalidValue)); $Validation->notice('isNumber', array($option['post_navigation_visible'], 0, 1), array(ThemeHelper::getFormName('post_navigation_visible', false), $invalidValue)); /* Plugins / Menu top */ if (!in_array($option['menu_responsive_mode'], $this->responsiveMode)) { $Notice->addError(ThemeHelper::getFormName('menu_responsive_mode', false), $invalidValue); } $Validation->notice('isNumber', array($option['menu_sticky_enable'], 0, 1), array(ThemeHelper::getFormName('menu_sticky_enable', false), $invalidValue)); $Validation->notice('isNumber', array($option['menu_hide_scroll_enable'], 0, 1), array(ThemeHelper::getFormName('menu_hide_scroll_enable', false), $invalidValue)); $Validation->notice('isNumber', array($option['menu_animation_enable'], 0, 1), array(ThemeHelper::getFormName('menu_animation_enable', false), $invalidValue)); $Validation->notice('isNumber', array($option['menu_animation_speed_open'], 0, 99999), array(ThemeHelper::getFormName('menu_animation_speed_open', false), $invalidValue)); $Validation->notice('isNumber', array($option['menu_animation_speed_close'], 0, 99999), array(ThemeHelper::getFormName('menu_animation_speed_close', false), $invalidValue)); $Validation->notice('isNumber', array($option['menu_animation_delay'], 0, 99999), array(ThemeHelper::getFormName('menu_animation_delay', false), $invalidValue)); $Validation->notice('isNumber', array($option['menu_scroll_animation_enable'], 0, 1), array(ThemeHelper::getFormName('menu_scroll_animation_enable', false), $invalidValue)); $Validation->notice('isNumber', array($option['menu_scroll_animation_speed'], 0, 99999), array(ThemeHelper::getFormName('menu_scroll_animation_speed', false), $invalidValue)); if (!in_array($option['menu_scroll_animation_easing'], array_keys($Easing->easingType))) { $Notice->addError(ThemeHelper::getFormName('menu_scroll_animation_easing', false), $invalidValue); } /* Footer */ $Validation->notice('isNumber', array($option['footer_enable'], 0, 1), array(ThemeHelper::getFormName('footer_enable', false), $invalidValue)); $Validation->notice('isNumber', array($option['footer_sticky_enable'], 0, 1), array(ThemeHelper::getFormName('footer_sticky_enable', false), $invalidValue)); $Validation->notice('isNumber', array($option['footer_top_enable'], 0, 1), array(ThemeHelper::getFormName('footer_top_enable', false), $invalidValue)); if (!array_key_exists($option['footer_top_background_image_repeat'], $Background->backgroundRepeat)) { $Notice->addError(ThemeHelper::getFormName('footer_top_background_image_repeat', false), $invalidValue); } if (!array_key_exists($option['footer_top_background_image_size_1'], $Background->backgroundSize)) { $Notice->addError(ThemeHelper::getFormName('footer_top_background_image_size_1', false), $invalidValue); } $Validation->notice('isNumber', array($option['footer_bottom_enable'], 0, 1), array(ThemeHelper::getFormName('footer_bottom_enable', false), $invalidValue)); /* Content copying */ $Validation->notice('isNumber', array($option['right_click_enable'], 0, 1), array(ThemeHelper::getFormName('right_click_enable', false), $invalidValue)); $Validation->notice('isNumber', array($option['copy_selection_enable'], 0, 1), array(ThemeHelper::getFormName('copy_selection_enable', false), $invalidValue)); /* Responsive mode */ $Validation->notice('isNumber', array($option['responsive_mode_enable'], 0, 1), array(ThemeHelper::getFormName('responsive_mode_enable', false), $invalidValue)); /* Go to page to */ $Validation->notice('isNumber', array($option['go_to_page_top_enable'], 0, 1), array(ThemeHelper::getFormName('go_to_page_top_enable', false), $invalidValue)); $Validation->notice('isNotEmpty', array($option['go_to_page_top_hash']), array(ThemeHelper::getFormName('go_to_page_top_hash', false), $invalidValue)); $Validation->notice('isNumber', array($option['go_to_page_top_animation_enable'], 0, 1), array(ThemeHelper::getFormName('go_to_page_top_animation_enable', false), $invalidValue)); $Validation->notice('isNumber', array($option['go_to_page_top_animation_duration'], 0, 99999), array(ThemeHelper::getFormName('go_to_page_top_animation_duration', false), $invalidValue)); if (!in_array($option['go_to_page_top_animation_easing'], array_keys($Easing->easingType))) { $Notice->addError(ThemeHelper::getFormName('go_to_page_top_animation_easing', false), $invalidValue); } /* Font */ $font = array('base', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'); foreach ($font as $value) { foreach ($media as $mediaIndex => $mediaValue) { $Validation->notice('isNumber', array($option['font_' . $value . '_size_' . $mediaIndex], 1, 100), array(ThemeHelper::getFormName('font_' . $value . '_size_' . $mediaIndex, false), $invalidValue)); } if (!in_array($option['font_' . $value . '_style'], array_keys($CSS->fontStyle))) { $Notice->addError(ThemeHelper::getFormName('font_' . $value . '_style', false), $invalidValue); } if (!in_array($option['font_' . $value . '_weight'], array_keys($CSS->fontWeight))) { $Notice->addError(ThemeHelper::getFormName('font_' . $value . '_weight', false), $invalidValue); } } /* Plugin / Fancybox for images */ $Validation->notice('isNumber', array($option['fancybox_image_padding'], 0, 999), array(ThemeHelper::getFormName('fancybox_image_padding', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_image_margin'], 0, 999), array(ThemeHelper::getFormName('fancybox_image_margin', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_image_min_width'], 1, 9999), array(ThemeHelper::getFormName('fancybox_image_min_width', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_image_min_height'], 1, 9999), array(ThemeHelper::getFormName('fancybox_image_min_height', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_image_max_width'], 1, 9999), array(ThemeHelper::getFormName('fancybox_image_max_width', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_image_max_height'], 1, 9999), array(ThemeHelper::getFormName('fancybox_image_max_height', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_image_helper_button_enable'], 0, 1), array(ThemeHelper::getFormName('fancybox_image_helper_button_enable', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_image_autoresize'], 0, 1), array(ThemeHelper::getFormName('fancybox_image_autoresize', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_image_autocenter'], 0, 1), array(ThemeHelper::getFormName('fancybox_image_autocenter', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_image_fittoview'], 0, 1), array(ThemeHelper::getFormName('fancybox_image_fittoview', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_image_arrow'], 0, 1), array(ThemeHelper::getFormName('fancybox_image_arrow', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_image_close_button'], 0, 1), array(ThemeHelper::getFormName('fancybox_image_close_button', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_image_close_click'], 0, 1), array(ThemeHelper::getFormName('fancybox_image_close_click', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_image_next_click'], 0, 1), array(ThemeHelper::getFormName('fancybox_image_next_click', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_image_mouse_wheel'], 0, 1), array(ThemeHelper::getFormName('fancybox_image_mouse_wheel', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_image_autoplay'], 0, 1), array(ThemeHelper::getFormName('fancybox_image_autoplay', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_image_loop'], 0, 1), array(ThemeHelper::getFormName('fancybox_image_loop', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_image_playspeed'], 1, 99999), array(ThemeHelper::getFormName('fancybox_image_playspeed', false), $invalidValue)); if (!in_array($option['fancybox_image_animation_effect_open'], array_keys($FancyBox->transitionType))) { $Notice->addError(ThemeHelper::getFormName('fancybox_image_animation_effect_open', false), $invalidValue); } if (!in_array($option['fancybox_image_animation_effect_close'], array_keys($FancyBox->transitionType))) { $Notice->addError(ThemeHelper::getFormName('fancybox_image_animation_effect_close', false), $invalidValue); } if (!in_array($option['fancybox_image_animation_effect_next'], array_keys($FancyBox->transitionType))) { $Notice->addError(ThemeHelper::getFormName('fancybox_image_animation_effect_next', false), $invalidValue); } if (!in_array($option['fancybox_image_animation_effect_previous'], array_keys($FancyBox->transitionType))) { $Notice->addError(ThemeHelper::getFormName('fancybox_image_animation_effect_previous', false), $invalidValue); } if (!in_array($option['fancybox_image_easing_open'], array_keys($Easing->easingType))) { $Notice->addError(ThemeHelper::getFormName('fancybox_image_easing_open', false), $invalidValue); } if (!in_array($option['fancybox_image_easing_close'], array_keys($Easing->easingType))) { $Notice->addError(ThemeHelper::getFormName('fancybox_image_easing_close', false), $invalidValue); } if (!in_array($option['fancybox_image_easing_next'], array_keys($Easing->easingType))) { $Notice->addError(ThemeHelper::getFormName('fancybox_image_easing_next', false), $invalidValue); } if (!in_array($option['fancybox_image_easing_previous'], array_keys($Easing->easingType))) { $Notice->addError(ThemeHelper::getFormName('fancybox_image_easing_previous', false), $invalidValue); } $Validation->notice('isNumber', array($option['fancybox_image_speed_open'], 1, 99999), array(ThemeHelper::getFormName('fancybox_image_speed_open', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_image_speed_close'], 1, 99999), array(ThemeHelper::getFormName('fancybox_image_speed_close', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_image_speed_next'], 1, 99999), array(ThemeHelper::getFormName('fancybox_image_speed_next', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_image_speed_previous'], 1, 99999), array(ThemeHelper::getFormName('fancybox_image_speed_previous', false), $invalidValue)); /* Plugin / Fancybox for videos */ $Validation->notice('isNumber', array($option['fancybox_video_padding'], 0, 999), array(ThemeHelper::getFormName('fancybox_video_padding', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_video_margin'], 0, 999), array(ThemeHelper::getFormName('fancybox_video_margin', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_video_min_width'], 1, 9999), array(ThemeHelper::getFormName('fancybox_video_min_width', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_video_min_height'], 1, 9999), array(ThemeHelper::getFormName('fancybox_video_min_height', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_video_max_width'], 1, 9999), array(ThemeHelper::getFormName('fancybox_video_max_width', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_video_max_height'], 1, 9999), array(ThemeHelper::getFormName('fancybox_video_max_height', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_video_autoresize'], 0, 1), array(ThemeHelper::getFormName('fancybox_video_autoresize', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_video_autocenter'], 0, 1), array(ThemeHelper::getFormName('fancybox_video_autocenter', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_video_fittoview'], 0, 1), array(ThemeHelper::getFormName('fancybox_video_fittoview', false), $invalidValue)); $Validation->notice('isNumber', array($option['fancybox_video_close_button'], 0, 1), array(ThemeHelper::getFormName('fancybox_video_close_button', false), $invalidValue)); /* Plugin / Maintenance mode */ $Validation->notice('isNumber', array($option['maintenance_mode_enable'], 0, 1), array(ThemeHelper::getFormName('maintenance_mode_enable', false), $invalidValue)); if ($Notice->isError()) { $response['local'] = $Notice->getError(); } else { $response['global']['error'] = 0; ThemeOption::updateOption($option); $this->createCSSFile(); } $response['global']['notice'] = $Notice->createHTML(THEME_PATH_TEMPLATE . 'notice.php'); echo json_encode($response); exit; }
esc_html_e('These data are updated automatically every 12 hours. Use this option only when fonts aren\'t visible in theme.', THEME_DOMAIN); ?> </span> <input type="button" name="<?php ThemeHelper::getFormName('import_google_font'); ?> " id="<?php ThemeHelper::getFormName('import_google_font'); ?> " class="to-button margin-0" value="<?php esc_attr_e('Import', THEME_DOMAIN); ?> "/> </li> </ul> <script type="text/javascript"> jQuery(document).ready(function($) { $('#<?php ThemeHelper::getFormName('import_google_font'); ?> ').bind('click',function(e) { e.preventDefault(); $('#action').val('theme_admin_option_page_import_google_font'); $('#to_form').submit(); $('#action').val('theme_admin_option_page_save'); }); }); </script>
$i = 0; foreach ($this->data['dictionary']['postCategory'] as $index => $value) { $i++; ?> <input type="checkbox" name="<?php ThemeHelper::getFormName('post_category[]'); ?> " id="<?php ThemeHelper::getFormName('post_category_' . $i); ?> " value="<?php echo ThemeHelper::esc_attr($index); ?> " <?php ThemeHelper::checkedIf($this->data['option']['post_category'], $index); ?> /> <label for="<?php ThemeHelper::getFormName('post_category_' . $i); ?> "><?php echo ThemeHelper::esc_html($value); ?> </label> <?php } ?> </div> </li> </ul> </div>
?> </h5> <span class="to-legend"><?php esc_html_e('Line height with selected unit.', THEME_DOMAIN); ?> </span> <div> <input type="text" name="<?php ThemeHelper::getFormName('font_h5_line_height'); ?> " id="<?php ThemeHelper::getFormName('font_h5_line_height'); ?> " value="<?php echo ThemeHelper::esc_attr($this->data['option']['font_h5_line_height']); ?> " maxlength="255"/> </div> </li> </ul> <script type="text/javascript"> jQuery(document).ready(function($) { var element=$('.to').themeOptionElement();; element.createGoogleFontAutocomplete('#<?php ThemeHelper::getFormName('font_h5_family_google'); ?> '); }); </script>
?> <br/> <?php esc_html_e('The first value sets the width, the second value sets the height. If only one value is given, the second is set to "auto".', THEME_DOMAIN); ?> <br/> </span> <div> <input type="text" value="<?php echo ThemeHelper::esc_attr($this->data['option']['header_background_image_size_2']); ?> " id="<?php ThemeHelper::getFormName('header_background_image_size_2'); ?> " name="<?php ThemeHelper::getFormName('header_background_image_size_2'); ?> "/> </div> </li> </ul> <script type="text/javascript"> jQuery(document).ready(function($) { var element=$('.to').themeOptionElement();; element.bindBrowseMedia('#<?php ThemeHelper::getFormName('header_background_image_src_browse'); ?> '); }); </script>
" value="1" <?php ThemeHelper::checkedIf($this->data['option']['post_navigation_visible'], 1); ?> /> <label for="<?php ThemeHelper::getFormName('post_navigation_visible_1'); ?> "><?php esc_html_e('Yes', THEME_DOMAIN); ?> </label> <input type="radio" name="<?php ThemeHelper::getFormName('post_navigation_visible'); ?> " id="<?php ThemeHelper::getFormName('post_navigation_visible_0'); ?> " value="0" <?php ThemeHelper::checkedIf($this->data['option']['post_navigation_visible'], 0); ?> /> <label for="<?php ThemeHelper::getFormName('post_navigation_visible_0'); ?> "><?php esc_html_e('No', THEME_DOMAIN); ?> </label> </div> </li> </ul>
?> </span> <input type="text" name="<?php ThemeHelper::getFormName('fancybox_image_speed_next'); ?> " id="<?php ThemeHelper::getFormName('fancybox_image_speed_next'); ?> " value="<?php echo ThemeHelper::esc_attr($this->data['option']['fancybox_image_speed_next']); ?> " maxlength="5"/> </div> <div> <span class="to-legend-field"><?php esc_html_e('Previous:', THEME_DOMAIN); ?> </span> <input type="text" name="<?php ThemeHelper::getFormName('fancybox_image_speed_previous'); ?> " id="<?php ThemeHelper::getFormName('fancybox_image_speed_previous'); ?> " value="<?php echo ThemeHelper::esc_attr($this->data['option']['fancybox_image_speed_previous']); ?> " maxlength="5"/> </div> </li> </ul>
<ul class="to-form-field-list"> <li> <h5><?php esc_html_e('Custom javascript code', THEME_DOMAIN); ?> </h5> <span class="to-legend"><?php esc_html_e('Don\'t enter <script> tags. These tags will be added automatically.', THEME_DOMAIN); ?> </span> <div> <textarea id="<?php ThemeHelper::getFormName('custom_js_code'); ?> " name="<?php ThemeHelper::getFormName('custom_js_code'); ?> " rows="1" cols="1"><?php echo ThemeHelper::esc_html($this->data['option']['custom_js_code']); ?> </textarea> </div> </li> </ul>
esc_html_e('Disable', THEME_DOMAIN); ?> </label> </div> </li> <li> <h5><?php esc_html_e('Bottom footer content', THEME_DOMAIN); ?> </h5> <span class="to-legend"><?php esc_html_e('Bottom footer content.', THEME_DOMAIN); ?> </span> <div> <?php wp_editor($this->data['option']['footer_bottom_content'], ThemeHelper::getFormName('footer_bottom_content', false)); ?> </div> </li> </ul> <script type="text/javascript"> jQuery(document).ready(function($) { var element=$('.to').themeOptionElement({init:false});; element.bindBrowseMedia('#<?php ThemeHelper::getFormName('footer_top_background_image_src_browse'); ?> '); }); </script>