static function sections() { //Init the static sections variable static $sections; //Init the default sections $defaults = array('seo' => array('title' => __('SEO Options', 'optimizepress'), 'module' => 'seo', 'options' => op_page_config('mod_options', 'seo'), 'on_off' => false), 'scripts' => array('title' => __('Other Scripts', 'optimizepress'), 'module' => 'scripts', 'options' => op_page_config('mod_options', 'scripts'), 'on_off' => false), 'launch_funnel' => array('title' => __('Launch Funnel', 'optimizepress'), 'module' => 'launch_funnel', 'options' => op_page_config('mod_options', 'launch_funnel'), 'module_type' => 'page'), 'exit_redirect' => array('title' => __('Exit Redirect', 'optimizepress'), 'module' => 'exit_redirect', 'options' => op_page_config('mod_options', 'exit_redirect'), 'module_type' => 'page'), 'mobile_redirect' => array('title' => __('Mobile Redirection', 'optimizepress'), 'module' => 'mobile_redirect', 'options' => op_page_config('mod_options', 'mobile_redirection'), 'module_type' => 'page'), 'launch_gateway' => array('title' => __('Launch Gateway', 'optimizepress'), 'module' => 'launch_gateway', 'options' => op_page_config('mod_options', 'launch_gateway'), 'module_type' => 'page'), 'lightbox' => array('title' => __('Lightbox Pop', 'optimizepress'), 'module' => 'lightbox', 'options' => op_page_config('mod_options', 'lightbox'), 'module_type' => 'page'), 'comments' => array('title' => __('Comments System', 'optimizepress'), 'module' => 'comments', 'options' => op_page_config('mod_options', 'comments'), 'on_off' => false)); //If there are no sections set, then we must set them if (!isset($sections)) { //Add the default sections to the array $sections = array('seo' => $defaults['seo'], 'scripts' => $defaults['scripts'], 'launch_funnel' => $defaults['launch_funnel'], 'exit_redirect' => $defaults['exit_redirect'], 'mobile_redirect' => $defaults['mobile_redirect']); //If the SEO options is set to no, then we remove SEO as an option if (OP_SEO_ENABLED != 'Y') { unset($sections['seo']); } //Get the keys from the array $keys = array_keys($sections); //Loop through each section key foreach ($keys as $name) { //Check if this section is disabled and remove from array if so if (op_page_config('disable', 'functionality', $name) === true) { unset($sections[$name]); } } //Apply filters to the sections $sections = apply_filters('op_edit_sections_page_functionality', $sections); $sections = apply_filters('op_edit_sections_page_functionality_' . op_page_option('theme', 'type'), $sections); } //Return the sections return $sections; }
function sections() { static $sections; if (!isset($sections)) { $section_names = array('content_layout' => 'Pre-Made Content Layouts'); $sections = array(); foreach ($section_names as $name => $title) { if (!(op_page_config('disable', 'content_layout', $name) === true)) { $sections[$name] = array('title' => __($title, OP_SN), 'on_off' => false); $func = array($this, $name); if (is_callable($func)) { $sections[$name]['action'] = $func; } $func = array($this, 'save_' . $name); if (is_callable($func)) { $sections[$name]['save_action'] = $func; } } } $sections = apply_filters('op_edit_sections_page_content_layout', $sections); } return $sections; }
function save_advanced($op) { $advanced = op_page_option('color_scheme_advanced'); $advanced = is_array($advanced) ? $advanced : array(); $typography = op_typography_elements(); $current_typography = op_page_option('typography'); if (!is_array($current_typography)) { $current_typography = op_page_config('default_config', 'typography'); if (!is_array($current_typography)) { $current_typography = array(); } } if (!isset($current_typography['color_elements'])) { $current_typography['color_elements'] = array(); } $elements = array('page' => array('link_color' => 'link_color', 'link_hover_color' => 'link_hover_color'), 'footer' => array('text_color' => 'footer_text_color', 'link_color' => 'footer_link_color', 'link_hover_color' => 'footer_link_hover_color'), 'feature_area' => array('text_color' => 'feature_text_color', 'link_color' => 'feature_link_color', 'link_hover_color' => 'feature_link_hover_color')); $options = $this->_advanced_sections(); foreach ($options as $section => $settings) { $vals = op_get_var($op, $section, array()); if (!isset($advanced[$section])) { $advanced[$section] = array(); } $start_color = ''; foreach ($settings['elements'] as $name => $options) { $tmp = op_get_var($vals, $name); //Check if this is a gradient. If so, and the bottom color is empty, set to first color if (strstr($name, '_start')) { $start_color = $tmp; } if (strstr($name, '_end') && empty($tmp)) { $tmp = $start_color; } if (isset($options['text_decoration'])) { $newtmp = array('color' => op_get_var($tmp, 'color'), 'text_decoration' => op_get_var($tmp, 'text_decoration')); } else { $newtmp = $tmp; } $advanced[$section][$name] = $newtmp; if (isset($elements[$section])) { if (isset($elements[$section][$name])) { $current_typography['color_elements'][$elements[$section][$name]] = $newtmp; } } } } op_update_page_option('typography', $current_typography); /*$options = array( 'header' => array('nav_bar_start','nav_bar_end','nav_bar_link'), 'feature_area' => array('feature_start','feature_end'), 'footer' => array('footer_start','footer_end'), 'page' => array('repeating_bg','bg_color','link_color') ); foreach($options as $name => $fields){ $vals = op_get_var($op,$name,array()); if(!isset($advanced[$name])){ $advanced[$name] = array(); } foreach($fields as $f){ $advanced[$name][$f] = op_get_var($vals,$f); } }*/ op_update_page_option('color_scheme_advanced', $advanced); }
function save_footer_area($op) { $footer_area = op_page_option('footer_area'); $footer_area = is_array($footer_area) ? $footer_area : array(); $footer_area['enabled'] = op_get_var($op, 'enabled', 'N'); $footer_area['nav'] = op_get_var($op, 'nav'); $footer_area['font_shadow'] = op_get_var($op, 'font_shadow'); $footer_area['font_weight'] = op_get_var($op, 'font_weight'); $footer_area['font_size'] = op_get_var($op, 'font_size'); $footer_area['font_family'] = op_get_var($op, 'font_family'); if (!(op_page_config('disable', 'layout', 'footer_area', 'large_footer') === true)) { $lf = op_get_var($op, 'large_footer', array()); $footer_area['large_footer'] = array('enabled' => op_get_var($lf, 'enabled', 'N')); } $fd = op_get_var($op, 'footer_disclaimer', array()); $footer_area['footer_disclaimer'] = array('enabled' => op_get_var($fd, 'enabled', 'N'), 'message' => op_get_var($fd, 'message')); op_update_page_option('footer_area', $footer_area); }
?> <div class="clear"></div> </div> <div class="op-header-layout-below"<?php if ($cur_layout !== 'below') { echo ' style="display:none"'; } ?> > <label for="op_header_layout_bgimg" class="form-title"><?php _e('Upload a Banner Image', OP_SN); ?> </label> <p class="op-micro-copy"><?php printf(__('Upload a header image up to %spx in width with any graphics on it', OP_SN), op_page_config('header_width')); ?> </p> <?php op_upload_field('op[header_layout][bgimg]', $header_logo_setup['bgimg']); ?> </div> <label for="op_header_layout_repeatbgimg" class="form-title"><?php _e('Upload Repeating Header Background Image', OP_SN); ?> </label> <p class="op-micro-copy"><?php _e('This would normally be a gradient. Upload a repeating header background image which will be tiled horizontally on your header. We recommend you use a gradient of your choice which is 1px by 250px or the same height as the banner image above if you have uploaded one', OP_SN); ?> </p>
function _sections() { $sections = array('layout' => array('title' => __('Layout', OP_SN), 'description' => __('Customize the layout of your template. Setup your headers, navigation bars, feature areas and footers.', OP_SN)), 'color_schemes' => array('title' => __('Colour Scheme', OP_SN), 'description' => __('Customize the colour scheme for your page. You can use the advanced section to customize individual element colours', OP_SN)), 'functionality' => array('title' => __('On-Page Functionality', OP_SN), 'description' => __('Control the additional functionality and options for your page below. You can also use the options below to add any custom script code to your page', OP_SN))); $i = 1; foreach ($sections as $name => $section) { if (!(op_page_config('disable', $name) === true)) { $class = str_replace('_', ' ', $name); $class = 'OptimizePress_Sections_' . str_replace(' ', '_', ucwords($class)); require_once OP_LIB . 'sections/page/' . $name . '.php'; $this->sections[$name] = array('object' => new $class(), 'title' => '' . __($section['title'], OP_SN), 'description' => __($section['description'], OP_SN)); $i++; } } }
function op_init_page_theme($load_modules = true) { require_once OP_FUNC . 'page.php'; op_page_file('functions'); op_page_file('functions', array(), OP_PAGES . 'global/'); $tpl_type = op_page_option('theme', 'type'); $tpl_dir = op_page_option('theme', 'dir'); if ($tpl_dir) { define('OP_PAGE_DIR', OP_PAGES . $tpl_type . '/' . $tpl_dir . '/'); define('OP_PAGE_DIR_REL', '/pages/' . $tpl_type . '/' . $tpl_dir . '/'); define('OP_PAGE_URL', OP_URL . 'pages/' . $tpl_type . '/' . $tpl_dir . '/'); require_once OP_FUNC . 'feature_area.php'; $class = 'OptimizePress_Page_Feature_Area'; if (file_exists(OP_PAGE_DIR . 'feature_area.php')) { require_once OP_PAGE_DIR . 'feature_area.php'; } elseif (file_exists(OP_PAGES . 'global/feature_areas/' . $tpl_type . '.php')) { require_once OP_PAGES . 'global/feature_areas/' . $tpl_type . '.php'; } else { $class = 'OptimizePress_Page_Feature_Area_Base'; } $GLOBALS['op_feature_area'] = new $class(); } if ($load_modules) { if (!(op_page_config('disable', 'functionality') === true)) { require_once OP_LIB . 'sections/page/functionality.php'; $object = new OptimizePress_Sections_Functionality(); $GLOBALS['functionality_sections'] = $object->sections(); foreach ($GLOBALS['functionality_sections'] as $name => $section) { if (isset($section['module'])) { op_mod($section['module'], op_get_var($section, 'module_type', 'blog'), array('section' => $name)); } } } do_action('op_page_module_init'); } }
</label> <p class="op-micro-copy"><?php _e('If you would like to change the font for this navigation menu, you may change these settings below. We recommend using a menu with no more than five items on it.', OP_SN); ?> </p> <?php $font_family = !empty($footer_area['font_family']) ? $footer_area['font_family'] : $footer_defaults['font_family']; $font_weight = !empty($footer_area['font_weight']) ? $footer_area['font_weight'] : $footer_defaults['font_weight']; $font_size = !empty($footer_area['font_size']) ? $footer_area['font_size'] : $footer_defaults['font_size']; $font_shadow = !empty($footer_area['font_shadow']) ? $footer_area['font_shadow'] : $footer_defaults['font_shadow']; op_font_selector('op[footer_area]', array('family' => $font_family, 'style' => $font_weight, 'size' => $font_size, 'shadow' => $font_shadow), '<div class="op-micro-copy-font-selector">', '</div>', false); ?> <div class="clear"></div><br/> <?php if (!(op_page_config('disable', 'layout', 'footer_area', 'large_footer') === true)) { ?> <div class="op-bsw-grey-panel section-large_footer"> <div class="op-bsw-grey-panel-header cf"> <h3><a href="#"><?php _e('Extra Large Footer', OP_SN); ?> </a></h3> <?php $help_vid = op_help_vid(array('page', 'footer_area', 'large_footer'), true); ?> <div class="op-bsw-panel-controls<?php echo $help_vid == '' ? '' : ' op-bsw-panel-controls-help'; ?> cf"> <div class="show-hide-panel"><a href="#"></a></div>
/** * * Sections for headers and colour scheme settings * @return void */ function _sections($colorScheme = false) { if ($colorScheme) { $sections = array('color_schemes' => array('title' => __('Colour Scheme', OP_SN), 'description' => __('Customize the colour scheme for your page. You can use the advanced section to customize individual element colours', OP_SN))); } else { $sections = array('layout' => array('title' => __('Layout', OP_SN), 'description' => __('Customize the layout of your template. Setup your headers, navigation bars, feature areas and footers.', OP_SN))); } $i = 1; foreach ($sections as $name => $section) { if (!(op_page_config('disable', $name) === true)) { $class = str_replace('_', ' ', $name); $class = 'OptimizePress_Sections_' . str_replace(' ', '_', ucwords($class)); require_once OP_LIB . 'sections/page/' . $name . '.php'; $obj = new $class(); $this->sections[$name] = array('object' => $obj->sections(), 'title' => $i . '. ' . __($section['title'], OP_SN), 'description' => __($section['description'], OP_SN)); $i++; } } }
function op_page_advanced_color_scheme($css) { if (op_page_config('disable', 'color_schemes') === true) { return $css; } $advanced = op_page_option('color_scheme_advanced'); $advanced = is_array($advanced) ? $advanced : array(); $type = op_page_option('theme', 'type'); $options = array('page' => array(array('background-image', 'body', 'repeating_bg'), array('background-color', 'body', 'bg_color'), array('color', 'a, a:visited', "['link_color']['color']"), array('text-decoration', 'a,a:visited', "['link_color']['text_decoration']"), array('color', 'a:hover,a:hover', "['link_hover_color']['color']"), array('text-decoration', 'a:hover', "['link_hover_color']['text_decoration']")), 'feature_area' => array(array('gradient', '.featured-panel', 'feature_start', 'feature_end'), array('background-image', '.featured-panel', 'bg'), array('background-size', '.featured-panel', 'bg_options'), array('background-repeat', '.featured-panel', 'bg_options'), array('background-position', '.featured-panel', 'bg_options')), 'footer' => array(array('gradient', '.footer', 'footer_start', 'footer_end'), array('color', '.footer-navigation ul li a', "['footer_link_color']['color']"), array('text-decoration', '.footer-navigation ul li a', "['footer_link_color']['text_decoration']"), array('color', '.footer-navigation ul li a:hover', "['footer_link_hover_color']['color']"), array('text-decoration', '.footer-navigation ul li a:hover', "['footer_link_hover_color']['text_decoration']"), array('color', '.footer p', 'footer_text_color'), array('color', '.footer h1', 'footer_text_color'), array('color', '.footer h2', 'footer_text_color'), array('color', '.footer h3', 'footer_text_color'), array('color', '.footer h4', 'footer_text_color'), array('color', '.footer h5', 'footer_text_color'), array('color', '.footer h6', 'footer_text_color'), array('color', '.footer a', "['footer_link_color']['color']"), array('text-decoration', '.footer a', "['footer_link_color']['text_decoration']"), array('color', '.footer a:hover', "['footer_link_hover_color']['color']"), array('text-decoration', '.footer a:hover', "['footer_link_hover_color']['text_decoration']"), array('color', '.footer small.footer-copyright', 'footer_text_color'), array('color', '.footer small.footer-copyright a', "['footer_link_color']['color']"), array('text-decoration', '.footer small.footer-copyright a', "['footer_link_color']['text_decoration']"), array('color', '.footer small.footer-copyright a:hover', "['footer_link_hover_color']['color']"), array('text-decoration', '.footer small.footer-copyright a:hover', "['footer_link_hover_color']['text_decoration']"), array('color', '.footer small.footer-disclaimer', 'footer_text_color'), array('color', '.footer small.footer-disclaimer a', "['footer_link_color']['color']"), array('text-decoration', '.footer small.footer-disclaimer a', "['footer_link_color']['text_decoration']"), array('text-decoration', '.footer small.footer-disclaimer a:hover', "['footer_link_hover_color']['text_decoration']"), array('color', '.footer small.footer-disclaimer a:hover', "['footer_link_hover_color']['color']")), 'nav_bar_alongside' => array(array('background-color', 'body .container div.include-nav .navigation ul#navigation-alongside li:hover > a', 'nav_bar_bg_nav_hover'), array('background-color', 'body .container div.include-nav .navigation ul#navigation-alongside li ul.sub-menu li > a', 'nav_bar_bg'), array('background-color', 'body .container div.include-nav .navigation ul#navigation-alongside li ul.sub-menu li:hover > a', 'nav_bar_bg_hover'), array('color', 'body .container .include-nav .navigation ul li:hover > a,body .container .include-nav .navigation ul a:focus', 'nav_bar_hover'), array('color', 'div.include-nav .navigation ul li a', 'nav_bar_link'), array('color', 'body .container .include-nav .navigation ul li ul li:hover > a,body .container .include-nav .navigation ul li ul li a:focus', 'nav_bar_dd_hover'), array('color', 'div.include-nav .navigation ul li ul li a', 'nav_bar_dd_link')), 'nav_bar_above' => array(array('gradient', '.nav-bar-above', 'nav_bar_start', 'nav_bar_end', 'is_gradient' => false), array('gradient', '.nav-bar-above ul li:hover', 'nav_bar_hover_start', 'nav_bar_hover_end', 'is_gradient' => false), array('background-color', 'body .container .nav-bar-above .navigation ul ul li', 'nav_bar_bg', 'default' => 'nav_bar_end'), array('background-color', 'body .container .nav-bar-above .navigation ul ul li:hover > a,body .container .navigation ul a:focus', 'nav_bar_bg_hover_start'), array('color', '.nav-bar-above a, .nav-bar-above .navigation a', 'nav_bar_link'), array('color', 'body .container .nav-bar-above .navigation ul li:hover > a, body .container .nav-bar-above .navigation ul a:focus', 'nav_bar_hover'), array('color', 'body .container .nav-bar-above .navigation ul li ul li > a, body .container .nav-bar-above .navigation ul li ul a', 'nav_bar_dd_link'), array('color', 'body .container .nav-bar-above .navigation ul li ul li:hover > a,body .container .nav-bar-above .navigation ul li ul a:focus', 'nav_bar_dd_hover')), 'nav_bar_below' => array(array('gradient', '.nav-bar-below.op-page-header', 'nav_bar_start', 'nav_bar_end', 'is_gradient' => false), array('gradient', '.nav-bar-below ul li:hover', 'nav_bar_hover_start', 'nav_bar_hover_end', 'is_gradient' => false), array('background-color', 'body .container .nav-bar-below .navigation ul ul li', 'nav_bar_bg', 'default' => 'nav_bar_end'), array('background-color', 'body .container .nav-bar-below .navigation ul ul li:hover > a,body .container .nav-bar-below .navigation ul a:focus', 'nav_bar_bg_hover_start'), array('color', '.nav-bar-below a, .nav-bar-below .navigation a', 'nav_bar_link'), array('color', 'body .container .nav-bar-below .navigation ul li:hover > a,body .container .nav-bar-below .navigation ul a:focus', 'nav_bar_hover'), array('color', 'body .container .nav-bar-below .navigation ul li ul li > a,body .container .nav-bar-below .navigation ul li ul a:focus', 'nav_bar_dd_link'), array('color', 'body .container .nav-bar-below .navigation ul li ul li:hover > a,body .container .nav-bar-below .navigation ul li ul a:focus', 'nav_bar_dd_hover'))); if ($type != 'launch' && $type != 'landing') { $options['feature_title'] = array(array('gradient', '.product-feature-tour', 'feature_title_start', 'feature_title_end'), array('color', '.product-feature-tour h2', 'feature_title_text_color')); } $options = apply_filters('op_page_color_options_selectors', $options); $selectors = array(); foreach ($options as $section => $elements) { $vals = op_get_var($advanced, $section, array()); $selectors = op_page_css_element($selectors, $elements, $vals); } foreach ($selectors as $selector => $output) { $css .= $selector . '{' . implode('', $output) . '}'; } return $css; }
?> <div class="clear"></div> </div> <div class="op-header-layout-below"<?php if ($cur_layout !== 'below') { echo ' style="display:none"'; } ?> > <label for="op_header_layout_bgimg" class="form-title"><?php _e('Upload a Banner Image', 'optimizepress'); ?> </label> <p class="op-micro-copy"><?php printf(__('Upload a header image up to %spx in width with any graphics on it', 'optimizepress'), op_page_config('header_width')); ?> </p> <?php op_upload_field('op[header_layout][bgimg]', $header_logo_setup['bgimg']); ?> </div> <label for="op_header_layout_repeatbgimg" class="form-title"><?php _e('Upload Repeating Header Background Image', 'optimizepress'); ?> </label> <p class="op-micro-copy"><?php _e('This would normally be a gradient. Upload a repeating header background image which will be tiled horizontally on your header. We recommend you use a gradient of your choice which is 1px by 250px or the same height as the banner image above if you have uploaded one', 'optimizepress'); ?> </p>