function launch_navigation($atts) { $op_fonts = new OptimizePress_Fonts(); extract(shortcode_atts(array('style' => 1, 'font_size' => '', 'font_family' => '', 'font_style' => '', 'font_color' => '', 'font_spacing' => '', 'font_shadow' => ''), $atts)); $active = $inactive = ''; switch ($style) { case 1: case 2: $active = '<a href="{link}"><img width="163" height="102" src="{image}" alt="" /> {text}</a>'; $inactive = '<p><img width="163" height="102" src="{image}" alt="" /> {text}</p>'; break; case 3: $active = '<p><a href="{link}">{text}</a></p>'; $inactive = '<p><span>{text}</span></p>'; break; case 4: case 7: case 8: case 9: $active = '<a href="{link}">{text}</a>'; $inactive = '<span>{text}</span>'; break; case 10: $active = '<a href="{link}"><div class="thumb"><img src="{image}" class="scale-with-grid" /></div><span>{text}</span></a>'; $inactive = '<div class="thumb"><img src="{image}" class="scale-with-grid" /></div><span>{text}</span>'; break; } $str = ''; $menu_items = _op_launch_menu_list(); if (!empty($menu_items)) { foreach ($menu_items as $menu) { $tpl = $inactive; $class = ''; if ($menu['active'] === true) { /*$class = 'active';*/ $class = ''; $tpl = $active; } if ($menu['selected'] === true) { $class .= ($class == '' ? '' : ' ') . 'active current-page'; } if (!empty($menu['text'])) { $menu['text'] = stripslashes($menu['text']); } $str .= '<li' . ($class == '' ? '' : ' class="' . $class . '"') . '>' . op_convert_template($tpl, $menu) . '</li>'; } $font_family_css = ''; $font_style_css = ''; $font_shadow_css = ''; if (!empty($font_family) && $font_family != 'undefined') { $font_family_css = 'font-family: ' . $font_family . ';'; $op_fonts->add_font($font_family); } if (!empty($font_style) && $font_style != 'undefined') { if ($font_style == 'italic') { $font_style_css = 'font-style: italic;'; } elseif ($font_style == 'bold italic') { $font_style_css = 'font-style: italic; font-weight: bold;'; } else { $font_style_css = 'font-weight: ' . $font_style . ';'; } } if (!empty($font_shadow) && $font_shadow != 'undefined') { switch (strtolower(str_replace(' ', '', $font_shadow))) { case '': case 'none': $font_shadow_css = 'none'; break; case 'light': $font_shadow_css = '1px 1px 0px rgba(255,255,255,0.5)'; break; case 'dark': default: $font_shadow_css = '0 1px 1px #000000, 0 1px 1px rgba(0, 0, 0, 0.5)'; } $font_shadow_css = 'text-shadow: ' . $font_shadow_css . ';'; } $id = op_generate_id(); $className = $style >= 7 && $style <= 10 ? 'launch-nav-style-' . $style : 'video-navigation-' . $style; $str = ' <style> #video-navigation-' . $id . ' ul li a{ ' . (!empty($font_size) && $font_size != 'undefined' ? 'font-size: ' . $font_size . 'px;' : '') . ' ' . (!empty($font_family_css) ? $font_family_css : '') . ' ' . (!empty($font_style_css) ? $font_style_css : '') . ' ' . (!empty($font_color) && $font_color != 'undefined' ? 'color: ' . $font_color . ';' : '') . ' ' . (!empty($font_spacing) && $font_spacing != 'undefined' ? 'letter-spacing: ' . $font_spacing . 'px;' : '') . ' ' . (!empty($font_shadow_css) ? $font_shadow_css : '') . ' } </style> <div id="video-navigation-' . $id . '" class="video-navigation ' . $className . '"> <ul class="cf">' . $str . '</ul> </div>'; } else { if (is_admin()) { $str = '<p>' . __('This navigation bar will only display when added to a page which has been added to funnel as a funnel stage', OP_SN) . '</p>'; } } return $str; }
static function feature_box_creator($atts, $content = '') { // Decode encoded chars $atts = op_urldecode($atts); //Extract the attributes into variables $data = shortcode_atts(array('style' => '1', 'letter_spacing' => '', 'width' => '', 'top_margin' => '', 'bottom_margin' => '', 'top_padding' => '', 'bottom_padding' => '', 'left_padding' => '', 'right_padding' => '', 'alignment' => '', 'bg_color' => '', 'bg_color_end' => '', 'border_color' => '', 'border_weight' => '', 'border_radius' => '', 'border_style' => '', 'content' => '', 'font' => '', 'id' => op_generate_id()), $atts); //Set the temporary asset tag to the feature box creator self::$temp_tag = 'feature_box_creator'; //Instantiate the OP Fonts class $op_fonts = new OptimizePress_Fonts(); //Add font style includes to page $op_fonts->add_font($atts['font_font']); //Get font style string for content $data['font'] = str_replace('"', '\'', op_asset_font_style($atts, 'font_')); //Set up font $original_font_str = $GLOBALS['OP_LIVEEDITOR_FONT_STR']; $GLOBALS['OP_LIVEEDITOR_FONT_STR'] = !empty($data['font']) ? array('elements' => array('p', 'a'), 'style_str' => $data['font']) : $GLOBALS['OP_LIVEEDITOR_FONT_STR']; //Get content $args = func_get_args(); //Get the content for adding an element field $content = call_user_func_array(array('OptimizePress_Default_Assets', '_add_element_field'), $args); //Process content from above $data['content'] = op_process_asset_content($content); //Set the font back to the original string $GLOBALS['OP_LIVEEDITOR_FONT_STR'] = $GLOBALS['OP_LIVEEDITOR_DEPTH'] == 1 ? $original_font_str : $GLOBALS['OP_LIVEEDITOR_FONT_STR']; //Clear out any current templates _op_tpl('clear'); //Return the HTML from the template return _op_tpl('_load_file', OP_ASSETS . 'tpls/feature_box_creator/style_' . $data['style'] . '.php', $data, true); }
function theme1_output_css($css = '') { $op_fonts = new OptimizePress_Fonts(); if (($start = op_get_option('color_scheme_fields', 'start')) && ($end = op_get_option('color_scheme_fields', 'end'))) { $css .= ' .featured-panel { background: ' . $end . '; background: -moz-linear-gradient(top, ' . $start . ' 0%, ' . $end . ' 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,' . $start . '), color-stop(100%,' . $end . ')); background: -webkit-linear-gradient(top, ' . $start . ' 0%,' . $end . ' 100%); background: -o-linear-gradient(top, ' . $start . ' 0%,' . $end . ' 100%); background: -ms-linear-gradient(top, ' . $start . ' 0%,' . $end . ' 100%); background: linear-gradient(top, ' . $start . ' 0%,' . $end . ' 100%)); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\'' . $start . '\', endColorstr=\'' . $end . '\',GradientType=0 ); } .op-page-header{ background: ' . $end . '; background: -moz-linear-gradient(top, ' . $start . ' 0%, ' . $end . ' 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,' . $start . '), color-stop(100%,' . $end . ')); background: -webkit-linear-gradient(top, ' . $start . ' 0%,' . $end . ' 100%); background: -o-linear-gradient(top, ' . $start . ' 0%,' . $end . ' 100%); background: -ms-linear-gradient(top, ' . $start . ' 0%,' . $end . ' 100%); background: linear-gradient(top, ' . $start . ' 0%,' . $end . ' 100%)); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\'' . $start . '\', endColorstr=\'' . $end . '\',GradientType=0 ); }'; } if ($top_nav_font = op_get_option('color_scheme_fields', 'top_nav_font')) { $op_fonts->add_font($top_nav_font['font_family']); $nav_weight = ''; if ($top_nav_font['font_weight'] == '300') { $nav_weight = 'font-weight: 300;'; } elseif ($top_nav_font['font_weight'] == 'italic') { $nav_weight = 'font-style: italic;'; } elseif (strtolower($top_nav_font['font_weight']) == 'bold italic') { $nav_weight = 'font-weight: bold; font-style: italic;'; } elseif (strtolower($top_nav_font['font_weight']) == 'normal') { $nav_weight = 'font-weight: normal;'; } elseif (strtolower($top_nav_font['font_weight']) == 'bold') { $nav_weight = 'font-weight: bold;'; } $nav_shadow = ''; switch (strtolower(str_replace(' ', '', $top_nav_font['font_shadow']))) { case 'light': $nav_shadow = 'text-shadow: 1px 1px 0px rgba(255,255,255,0.5);'; break; case 'dark': $nav_shadow = 'text-shadow: 0 1px 1px #000000, 0 1px 1px rgba(0, 0, 0, 0.5);'; break; case 'textshadow': case 'none': default: $nav_shadow = 'text-shadow: none;'; } $css .= ' body #nav-top.navigation,body #nav-top.navigation ul li a {'; if (!empty($top_nav_font['font_family'])) { $css .= ' font-family: ' . op_font_str($top_nav_font['font_family']) . ';'; } if (!empty($top_nav_font['font_size'])) { $css .= ' font-size: ' . $top_nav_font['font_size'] . 'px;'; } $css .= $nav_shadow . $nav_weight; $css .= '}'; } if ($top_nav = op_get_option('color_scheme_fields', 'top_nav_color')) { $css .= ' body #nav-top.navigation,body #nav-top.navigation ul ul li { background-color: ' . $top_nav . ' }'; } if ($link_color = op_get_option('color_scheme_fields', 'link_color')) { $css .= ' body #nav-top.navigation ul#navigation-above li a{ color: ' . $link_color . ' }'; } if ($top_nav_hover_link = op_get_option('color_scheme_fields', 'top_nav_hover_link')) { $css .= ' body #nav-top.navigation ul#navigation-above li:hover a{ color: ' . $top_nav_hover_link . ' }'; } if ($top_nav_dd = op_get_option('color_scheme_fields', 'top_nav_dd')) { $css .= ' body #nav-top.navigation ul#navigation-above li ul.sub-menu a { background-color: ' . $top_nav_dd . ' }'; } if ($top_nav_dd_hover = op_get_option('color_scheme_fields', 'top_nav_dd_hover')) { $css .= ' body #nav-top.navigation ul#navigation-above li ul.sub-menu li:hover a { background-color: ' . $top_nav_dd_hover . ' }'; } if ($top_nav_dd_link = op_get_option('color_scheme_fields', 'top_nav_dd_link')) { $css .= ' body #nav-top.navigation ul#navigation-above li ul.sub-menu li a { color: ' . $top_nav_dd_link . ' }'; } if ($top_nav_dd_hover_link = op_get_option('color_scheme_fields', 'top_nav_dd_hover_link')) { $css .= ' body #nav-top.navigation ul#navigation-above li ul.sub-menu li:hover a { color: ' . $top_nav_dd_hover_link . ' }'; } if ($headline = op_get_option('color_scheme_fields', 'headline_title')) { $css .= ' .op-page-header h2,.op-page-header h2 a, .op-page-header h2 span { color: ' . $headline . ' }'; } if ($layouts = op_theme_config('header_prefs', 'menu-positions')) { $cur_layout = op_get_current_item($layouts, op_default_option('header_prefs', 'menu-position')); $layout = $layouts[$cur_layout]; if (isset($layout['link_color']) && $layout['link_color'] === true) { if ($link_color = op_get_option('header_prefs', 'link_color')) { $css .= ' ' . $layout[op_default_option('header_prefs', 'color_dropdowns') == 'Y' ? 'dropdown_selector' : 'link_selector'] . ' { color: ' . $link_color . ' }'; } } } $widths = theme1_column_widths(); if (isset($widths['main-sidebar']) && $widths['main-sidebar'] != 309) { $css .= ' .main-content .main-sidebar, .main-content .sidebar-bg { width:' . $widths['main-sidebar'] . 'px }' . (isset($widths['main-content']) ? ' .main-content-area { width:' . $widths['main-content'] . 'px }' : ''); } if (($cols = op_get_option('footer_prefs', 'value')) && ($widths = op_get_option('footer_prefs', 'widths'))) { if ($cols > 1) { $cols = $cols > 4 ? 4 : $cols; $cols++; for ($i = 1; $i < $cols; $i++) { $int = intval(op_get_var($widths, $i, 0)); if ($int > 0) { $css .= ' .sub-footer .col:nth-child(' . $i . '){width:' . $int . 'px}'; } } } else { $css .= ' .sub-footer .col{width:' . op_theme_config('footer_prefs', 'full_width') . 'px;margin-right:0}'; } } return $css; }
function save_step_4() { $op_fonts = new OptimizePress_Fonts(); $op = $_POST['op']; foreach ($this->sections as $name => $section) { $sections = $section['object']->sections(); foreach ($sections as $section_name => $section_section) { if (is_array($section_section)) { if (isset($section_section['save_action'])) { call_user_func_array($section_section['save_action'], array(op_get_var($op, $section_name, array()))); } if (isset($section_section['module'])) { $mod_ops = op_get_var($op, $section_name, array()); $opts = op_get_var($section_section, 'options', array()); op_mod($section_section['module'], op_get_var($section_section, 'module_type', 'blog'))->save_settings($section_name, $opts, $mod_ops); } } } } //Set this page's typography settings to be that of the defaults $default_typography = op_default_option('default_typography'); if (!empty($default_typography) && isset($default_typography['font_elements'])) { foreach ($default_typography['font_elements'] as $typography) { $op_fonts->add_font($typography['font']); } op_update_page_option('typography', $default_typography); } if (op_has_error()) { $this->error = __('There was a problem processing the form, please review the errors below', OP_SN); } /* else { $this->notification = __('Your page settings have been updated.',OP_SN); }*/ $this->_redirect(); }
function op_page_footer() { $op_fonts = new OptimizePress_Fonts(); if (($footer = op_page_option('footer_area')) !== false && op_get_var($footer, 'enabled') == 'Y') { ?> <div class="full-width footer small-footer-text"> <?php if (!(op_page_config('disable', 'layout', 'footer_area', 'large_footer') === true)) { if (isset($footer['large_footer']) && isset($footer['large_footer']['enabled']) && $footer['large_footer']['enabled'] == 'Y') { echo $GLOBALS['op_footer_layout']; } } ?> <div class="row"> <div class="fixed-width"> <?php //Init the style variables $font_family_style = ''; $font_weight_style = ''; $font_size_style = ''; $font_style = ''; //If not empty, set the font family style and add font to system if (!empty($footer['font_family'])) { $op_fonts->add_font($footer['font_family']); $font_family_style .= 'font-family: "' . $footer['font_family'] . '", sans-serif;'; } //If not empty, set the font style if (!empty($footer['font_weight'])) { if (strstr(strtolower($footer['font_weight']), '300')) { $font_weight_style .= 'font-weight: 300;'; } if (strstr(strtolower($footer['font_weight']), 'bold')) { $font_weight_style .= 'font-weight: bold;'; } if (strstr(strtolower($footer['font_weight']), 'italic')) { $font_weight_style .= 'font-style: italic;'; } } //If not empty, set the font size if (!empty($footer['font_size'])) { $font_size_style .= 'font-size: ' . $footer['font_size'] . 'px;'; } //If not empty, set the font shadow if (!empty($footer['font_shadow'])) { $textShadow = ''; switch (strtolower(str_replace(' ', '', $footer['font_shadow']))) { case 'textshadow': case 'none': $textShadow = 'none'; break; case 'light': $textShadow = '1px 1px 0px rgba(255,255,255,0.5)'; break; case 'dark': default: $textShadow = '0 1px 1px #000000, 0 1px 1px rgba(0, 0, 0, 0.5)'; } $font_style .= 'text-shadow: ' . $textShadow . ';'; } //Output the styles to the page echo ' <style> .footer-navigation ul li a, .footer-navigation ul li a:hover{ ' . $font_family_style . $font_size_style . $font_style . $font_weight_style . ' } .footer, .footer p, .op-promote a, .footer .footer-copyright, .footer .footer-disclaimer{ ' . $font_family_style . $font_style . $font_weight_style . ' } .footer p{ ' . $font_size_style . ' } </style> '; //Get the disclaimer text ready $disclaimer = op_get_var($footer, 'footer_disclaimer', array()); $site_footer = op_default_option('site_footer'); $disc = !empty($disclaimer['message']) ? $disclaimer['message'] : $site_footer['disclaimer']; //Print out the disclaimer if it's not empty echo !empty($disc) && $disclaimer['enabled'] == 'Y' ? '<small class="footer-disclaimer">' . stripslashes($disc) . '</small>' : ''; //Echo out the nav if it's set echo !empty($footer['nav']) ? ' <nav class="footer-navigation"> <ul id="nav-footer" class="inline-nav"> ' . wp_nav_menu(array('menu' => $footer['nav'], 'items_wrap' => '%3$s', 'container' => false, 'depth' => 1, 'echo' => false)) . ' </ul> </nav> ' : ''; //Print out the copyright notice //$copy = op_default_option('copyright_notice'); echo !empty($site_footer['copyright']) ? '<p class="footer-copyright">' . $site_footer['copyright'] . '</p>' : ''; //Display any additional information op_mod('promotion')->display(); ?> </div> </div> </div> <?php } }
bloginfo('pingback_url'); ?> " /> <?php if (is_singular() && get_option('thread_comments')) { wp_enqueue_script('comment-reply', false, array(OP_SN . '-noconflict-js'), OP_VERSION); } wp_head(); ?> </head> <body <?php body_class(is_home() ? op_mod('feature_area')->is_enabled('home_feature') ? 'has-feature-area' : 'no-feature-area' : ''); ?> > <?php $op_fonts = new OptimizePress_Fonts(); $header_prefs = op_get_option('header_prefs'); $alongside = op_get_option('header_prefs', 'menu-position') == 'alongside'; $has_nav = has_nav_menu('primary'); $img = op_theme_img('', true); ?> <div class="wrapper"> <div class="header"> <nav id="nav-top" class="navigation"> <div class="content-width cf"> <?php if (has_nav_menu('header_info_bar')) { ?> <ul id="navigation-above"><?php wp_nav_menu(array('theme_location' => 'header_info_bar', 'items_wrap' => '%3$s', 'container' => false, 'walker' => new Op_Arrow_Walker_Nav_Menu())); ?>