Esempio n. 1
0
 function __construct()
 {
     $this->settings = op_page_option('feature_area');
     $this->enabled = true;
     $this->oldFeatures = false;
     $this->config = new stdClass();
     parent::__construct();
     //var_dump(op_get_var($this->settings,'type','A'));
     // here we put all styles that are using old feature areas for backward compatibility
     $oldFeatures = array();
     $which = op_get_var($this->settings, 'type', 'A');
     $this->which = $which;
     if (in_array($which, $oldFeatures)) {
         op_page_clean_layouts(array());
         //op_page_clear_settings();
         $this->oldFeatures = true;
         $this->get_options($which);
     } else {
         //op_page_clean_layouts(array());
         //op_page_clear_settings();
         $this->oldFeatures = false;
         $this->getOptions($which);
     }
     //var_dump($this->options);
     add_filter('op_page_color_options_selectors', array($this, 'color_scheme_selectors'));
     add_filter('op_page_color_options', array($this, 'color_scheme_selectors'));
     add_filter('op_typography_elements', array($this, 'typography'));
     add_filter('op_typography_output_elements', array($this, 'typography_selectors'));
 }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
 function __construct()
 {
     parent::__construct();
     $this->settings = op_page_option('feature_area');
     $this->enabled = true;
     $this->get_options();
 }
Esempio n. 4
0
 function display_settings($section_name, $config = array(), $return = false)
 {
     global $wpdb;
     $data = array('fieldid' => $this->get_fieldid($section_name), 'fieldname' => $this->get_fieldname($section_name), 'section_name' => $section_name);
     $funnel_dropdown = '';
     $current = intval(op_page_option($section_name, 'funnel_id'));
     $found = false;
     $funnels = $wpdb->get_results("SELECT id,title FROM `{$wpdb->prefix}optimizepress_launchfunnels` ORDER BY title ASC");
     $funnel_count = 0;
     if ($funnels) {
         $funnel_count = count($funnels);
         foreach ($funnels as $funnel) {
             if ($current < 1) {
                 $current = $funnel->id;
                 $found = true;
             } elseif ($current == $funnel->id) {
                 $found = true;
             }
             $funnel_dropdown .= '<option value="' . $funnel->id . '"' . ($current == $funnel->id ? ' selected="selected"' : '') . '>' . op_attr($funnel->title) . '</option>';
         }
     }
     $data['funnel_count'] = $funnel_count;
     $data['funnel_select'] = '<select name="' . $data['fieldname'] . '[funnel_id]" id="' . $data['fieldid'] . 'funnel_id">' . $funnel_dropdown . '</select>';
     $this->add_js = true;
     $out = $this->load_tpl('settings', $data);
     if ($return) {
         return $out;
     }
     echo $out;
 }
Esempio n. 5
0
 function __construct()
 {
     $this->settings = op_page_option('feature_area');
     $this->enabled = true;
     $this->get_options(op_get_var($this->settings, 'type', 'A'));
     parent::__construct();
 }
Esempio n. 6
0
 function __construct()
 {
     parent::__construct();
     $this->settings = op_page_option('feature_area');
     $this->style = op_get_var($this->settings, 'type', 'A');
     $this->enabled = true;
     $this->config = new stdClass();
     $this->get_style();
 }
Esempio n. 7
0
 function check_redirect()
 {
     $options = op_page_option('mobile_redirect');
     $url = op_get_var($options, 'url');
     if (op_get_var($options, 'enabled', 'N') == 'Y' && !empty($url)) {
         if ($this->is_mobile()) {
             header('Location: ' . $url);
             exit;
         }
     }
 }
Esempio n. 8
0
 function __construct()
 {
     $this->settings = op_page_option('feature_area');
     $this->enabled = op_get_var($this->settings, 'enabled') == 'Y';
     $style = op_get_var($this->settings, 'type');
     $style = $style >= 1 && $style <= 7 ? $style : 1;
     $this->style = $style;
     $this->get_options();
     add_filter('op_page_feature_area_launch_selection', array($this, 'style_selector'), 10, 2);
     parent::__construct();
 }
Esempio n. 9
0
<?php

$theme_option = op_page_option('feature_area', 'type');
$size_color = op_page_option('size_color');
if (is_array($size_color) && isset($size_color['box_color_start']) && isset($size_color['box_color_end']) && isset($size_color['box_width'])) {
    $box_color_start = $size_color['box_color_start'];
    $box_color_end = $size_color['box_color_end'];
    $box_width = $size_color['box_width'];
} else {
    $box_color_start = op_default_page_option($theme_option, 'size_color', 'box_color_start');
    $box_color_end = op_default_page_option($theme_option, 'size_color', 'box_color_end');
    $box_width = op_default_page_option($theme_option, 'size_color', 'box_width');
}
?>
<div class="op-bsw-grey-panel-content op-bsw-grey-panel-no-sidebar cf" id="op_page_layout_size_color">
    <label for="op_header_layout_box_color_start" class="form-title"><?php 
_e('Box background start colour', OP_SN);
?>
</label>
    <p class="op-micro-copy"><?php 
_e('Choose a box background start colour.', OP_SN);
?>
</p>
    <?php 
op_color_picker('op[size_color][box_color_start]', $box_color_start, 'op_size_color_box_color_start');
?>
    <label for="op_header_layout_box_color_end" class="form-title"><?php 
_e('Box background end colour', OP_SN);
?>
</label>
    <p class="op-micro-copy"><?php 
Esempio n. 10
0
 function save_size_color($op)
 {
     $theme_option = op_page_option('feature_area', 'type');
     $size_color = op_page_option('size_color');
     $size_color = $size_color === false ? array() : $size_color;
     $size_color['box_color_start'] = op_get_var($op, 'box_color_start', op_default_page_option($theme_option, 'size_color', 'box_color_start'));
     $size_color['box_color_end'] = op_get_var($op, 'box_color_end', op_default_page_option($theme_option, 'size_color', 'box_color_end'));
     $size_color['box_width'] = op_get_var($op, 'box_width', op_default_page_option($theme_option, 'size_color', 'box_width'));
     op_update_page_option('size_color', $size_color);
 }
Esempio n. 11
0
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;
}
Esempio n. 12
0
                $preview['li_class'] = $li_class;
                $previews[] = $preview;
            }
            echo $this->load_tpl('generic/img_radio_selector', array('previews' => $previews, 'classextra' => ''));
            ?>
	    </div>
	<?php 
        }
        ?>
	</div>
	<?php 
    }
}
// MEMBERSHIP PAGES!!!
if ($page_type == 'membership') {
    if (($theme_dir = op_page_option('theme', 'dir')) === false && count($themes) > 0) {
        $theme_dir = $themes[0]['dir'];
    }
    $post = get_post(OP_PAGEBUILDER_ID);
    ?>
	<div style="margin-bottom: 20px;">
	<p><?php 
    _e('Here you can create new products, categories, subcategories and content. To edit them, you must use Live editor for that particular page!', OP_SN);
    ?>
</p>
	<a id="opNewProduct" class="op_membership_button" href="#"><?php 
    _e('Create new course, product or membership portal', OP_SN);
    ?>
</a>
	<?php 
    if (OptimizePress_PageBuilder::productExist()) {
Esempio n. 13
0
 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);
 }
Esempio n. 14
0
echo $fieldid;
?>
time_days" class="form-title"><?php 
_e('Expire After');
?>
</label>
	<p class="op-micro-copy"><?php 
_e('Select the delay after the users first visit to expire the page.');
?>
</p>
    <?php 
$times = array('days' => array('name' => __('Days', OP_SN), 'length' => 365), 'hours' => array('name' => __('Hours', OP_SN), 'length' => 24), 'minutes' => array('name' => __('Minutes', OP_SN), 'length' => 59), 'seconds' => array('name' => __('Seconds', OP_SN), 'length' => 59));
foreach ($times as $name => $time) {
    echo '<select name="' . $fieldname . '[time][' . $name . ']" id="' . $fieldid . 'time_' . $name . '"><option value="">' . $time['name'] . '</option>';
    $length = $time['length'] + 1;
    $cur = op_page_option($section_name, 'time', $name);
    if ($cur === false) {
        $cur = '';
    }
    $add_0 = $name != 'days';
    for ($i = 0; $i < $length; $i++) {
        echo '<option value="' . $i . '"' . ($cur != '' && $cur == $i ? ' selected="selected"' : '') . '>' . ($add_0 && $i < 10 ? '0' : '') . $i . '</option>';
    }
    echo '</select>';
}
?>

	<label for="<?php 
echo $fieldid;
?>
url" class="form-title"><?php 
Esempio n. 15
0
 function gateway_key()
 {
     $gateway_override = op_page_option('launch_funnel', 'gateway_override');
     $found = false;
     if (op_get_var($gateway_override, 'enabled') == 'Y') {
         if (($key = op_get_var($gateway_override, 'code')) && $key != '') {
             $this->custom_key = $key;
             $this->use_custom = true;
             $found = true;
         }
         if (($url = op_get_var($gateway_override, 'redirect')) && $url != '') {
             $this->custom_redirect = $url;
         }
     }
     if (!$found) {
         $gateway_key = op_launch_option('gateway_key');
         if (op_get_var($gateway_key, 'enabled', 'N') == 'Y') {
             $this->gateway_key = $gateway_key['key'];
         }
     }
 }
Esempio n. 16
0
<?php

$class = defined('OP_LIVEEDITOR') ? ' op-live-editor' : '';
$type = op_page_option('feature_area', 'type');
if ($type == 'H' || $type == 'I') {
    $class .= ' fixed-width-page';
}
?>
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6<?php 
echo $class;
?>
" <?php 
language_attributes();
?>
> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7<?php 
echo $class;
?>
" <?php 
language_attributes();
?>
> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8<?php 
echo $class;
?>
" <?php 
language_attributes();
?>
> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html<?php 
Esempio n. 17
0
        ?>
</p>
								<input id="opContentName" type="text" name="op[content][name]"
									value="<?php 
        echo $post->post_title;
        ?>
" /> <label><?php 
        _e('Content description', OP_SN);
        ?>
</label>
								<p><?php 
        _e('Enter the description for the content', OP_SN);
        ?>
</p>
								<textarea name="op[content][description]"><?php 
        echo stripslashes(base64_decode(op_page_option('membership', 'description')));
        ?>
</textarea>
								<?php 
        /*
        							<label><?php _e('Select product content type', OP_SN) ?></label>
        								<p><?php _e('This is how it will be presented', OP_SN) ?></p>
        								<div id="preset-option">
        								<?php echo $this->load_tpl('generic/img_radio_selector',array('previews'=>$preset_options,'classextra'=>'preset-type-select')); ?> 
        								</div> */
        ?>
							</div> 
							<?php 
    }
    ?>
							<?php 
Esempio n. 18
0
 /**
  * AJAX calls this function to save membership section of Live editor
  * @return void
  */
 function save_membership()
 {
     global $wpdb;
     $this->check_nonce();
     $this->init_page();
     $postId = $wpdb->escape($_POST['page_id']);
     if (defined("WS_PLUGIN__OPTIMIZEMEMBER_VERSION")) {
         c_ws_plugin__optimizemember_meta_box_saves::save_meta_boxes($postId);
     }
     // saving membership pages options
     $op = op_post('op');
     $current = op_page_option('membership', 'layout');
     // this happens only if we have something to save (it is a membership page!)
     if (!empty($op['pageType']['type']) && $op['pageType']['type'] == 'product') {
         update_post_meta($op['pageId'], 'type', 'product');
         op_update_page_option('membership', 'layout', $op['page']['preset_option']);
         // change title and slug
         $post = array('ID' => $op['pageId'], 'post_title' => $op['product']['name'], 'post_name' => sanitize_title($op['product']['name']), 'post_parent' => '');
         wp_update_post($post);
     }
     if (empty($op['pageType']['type']) && !empty($op) && empty($op['type'])) {
         // saving product!
         update_post_meta($op['pageId'], 'type', 'product');
         op_update_page_option('membership', 'layout', $op['page']['preset_option']);
         // change title and slug
         $post = array('ID' => $op['pageId'], 'post_title' => $op['product']['name'], 'post_name' => sanitize_title($op['product']['name']), 'post_parent' => '');
         wp_update_post($post);
     } else {
         if ($op['pageType']['type'] == 'category') {
             $page_id = $op['pageId'];
             $post = array('ID' => $op['pageId'], 'post_title' => $op['category']['name'], 'post_name' => sanitize_title($op['category']['name']), 'post_parent' => $op['pageType']['product']);
             wp_update_post($post);
             $value = array('layout' => $op['page']['preset_option'], 'description' => base64_encode($op['category']['description']));
             update_post_meta($page_id, '_' . OP_SN . '_membership', maybe_serialize($value));
             $value = array('type' => 'membership', 'dir' => $op['theme']);
             update_post_meta($page_id, '_' . OP_SN . '_theme', maybe_serialize($value));
         } else {
             if ($op['pageType']['type'] == 'subcategory') {
                 $page_id = $op['pageId'];
                 $post = array('ID' => $op['pageId'], 'post_title' => $op['subcategory']['name'], 'post_name' => sanitize_title($op['subcategory']['name']), 'post_parent' => $op['subcategory']['category']);
                 wp_update_post($post);
                 $value = array('layout' => $op['page']['preset_option'], 'description' => base64_encode($op['subcategory']['description']));
                 update_post_meta($page_id, '_' . OP_SN . '_membership', maybe_serialize($value));
                 $value = array('type' => 'membership', 'dir' => $op['theme']);
                 update_post_meta($page_id, '_' . OP_SN . '_theme', maybe_serialize($value));
             } else {
                 if ($op['pageType']['type'] == 'content') {
                     if (!empty($op['content']['subcategory'])) {
                         $parentId = $op['content']['subcategory'];
                     } else {
                         if (!empty($op['content']['category'])) {
                             $parentId = $op['content']['category'];
                         } else {
                             $parentId = $op['pageType']['product'];
                         }
                     }
                     $page_id = $op['pageId'];
                     $post = array('ID' => $op['pageId'], 'post_title' => $op['content']['name'], 'post_name' => sanitize_title($op['content']['name']), 'post_parent' => $parentId);
                     wp_update_post($post);
                     $value = array('layout' => $op['page']['preset_option'], 'description' => base64_encode($op['content']['description']));
                     update_post_meta($page_id, '_' . OP_SN . '_membership', maybe_serialize($value));
                     $value = array('type' => 'membership', 'dir' => $op['theme']);
                     update_post_meta($page_id, '_' . OP_SN . '_theme', maybe_serialize($value));
                 }
             }
         }
         if (!empty($op['type'])) {
             $post = array('ID' => $op['pageId'], 'post_parent' => '');
             if ($op['type'] == 'product') {
                 wp_update_post($post);
             }
             update_post_meta($op['pageId'], 'type', $op['type']);
         }
     }
     //error_log(OP_PAGEBUILDER_ID);
     if (!empty($op['typeForChange'])) {
         $value = array('type' => 'membership', 'dir' => '1');
         update_post_meta(OP_PAGEBUILDER_ID, '_' . OP_SN . '_theme', maybe_serialize($value));
         update_post_meta(OP_PAGEBUILDER_ID, 'type', $op['typeForChange']);
     }
     /*
      * DAP integration
      */
     if (isset($op['membership']['dap_redirect_url'])) {
         update_post_meta($postId, 'dap_redirect_url', $op['membership']['dap_redirect_url']);
     }
     /*
      * Fast Member integration
      */
     if (isset($op['membership']['fast_member_redirect_url'])) {
         update_post_meta($postId, 'fast_member_redirect_url', $op['membership']['fast_member_redirect_url']);
     }
     /*
      * iMember360 integration
      */
     if (isset($op['membership']['imember_redirect_url'])) {
         update_post_meta($postId, 'imember_redirect_url', $op['membership']['imember_redirect_url']);
     }
     echo json_encode(array('done' => true));
     exit;
 }
Esempio n. 19
0
 function page_file($tpl, $data = array(), $path = null)
 {
     static $tpl_dir, $tpl_type;
     if (!isset($tpl_dir)) {
         $tpl_dir = op_page_option('theme', 'dir');
         $tpl_type = op_page_option('theme', 'type');
     }
     if ($tpl_dir) {
         $data['theme_url'] = OP_URL . 'pages/' . $tpl_type . '/' . $tpl_dir . '/';
         $data['theme_path'] = OP_PAGES . $tpl_type . '/' . $tpl_dir . '/';
         $data['img_url'] = $data['theme_url'] . 'img/';
         $path = is_null($path) ? $data['theme_path'] : $path;
         return $this->_load_file($path . $tpl . '.php', $data, false);
     }
     return '';
 }
Esempio n. 20
0
 function save_step_3()
 {
     if (isset($_POST['theme_id']) && ($conf = op_load_page_config($_POST['theme_id']))) {
         $cur = op_page_option('theme', 'dir');
         if ($cur === false || $cur != $_POST['theme_id']) {
             // removed clearing settings on theme/type change
             //op_page_clear_settings();
             //op_page_clean_layouts(array());
             op_update_page_option('theme', 'dir', $_POST['theme_id']);
         }
         $type = op_page_option('theme', 'type');
         if ($type == 'membership') {
             $this->save_membership_settings($conf);
         } elseif ($type == 'landing') {
             if ($feature = op_post('op', 'feature_area', $_POST['theme_id'])) {
                 op_update_page_option('feature_area', 'type', $feature);
                 op_update_page_option('feature_area', 'enabled', 'Y');
                 /*
                 					$feature_area = op_page_option('feature_area');
                 					if(!$feature_area){
                 						$feature_area = array();
                 					}
                 					$feature_area['type'] = $feature;
                 					$feature_area['enabled'] = 'Y';
                 					op_update_page_option('feature_area',$feature_area);*/
             }
         }
     }
     $this->_redirect();
 }
Esempio n. 21
0
function op_page_url($path, $dir = null, $type = null)
{
    static $page_type;
    if (!isset($page_type)) {
        $page_type = op_page_option('theme', 'type');
    }
    if (is_null($dir)) {
        $dir = op_page_option('theme', 'dir');
    }
    return OP_URL . 'pages/' . $page_type . '/' . $dir . '/' . ltrim($path, '/');
}
Esempio n. 22
0
<?php

global $post;
$class = defined('OP_LIVEEDITOR') ? ' op-live-editor' : '';
$feature = op_page_option('feature_area', 'type');
$box_width = op_page_option('size_color', 'box_width');
$box_color_start = op_page_option('size_color', 'box_color_start');
$box_color_end = op_page_option('size_color', 'box_color_end');
$box_style = 'width:' . $box_width . 'px;' . op_generate_css_background($box_color_start, $box_color_end);
$style = '';
if ($landing = op_page_option('landing_bg', 'image')) {
    $style = ' style="background-image:url(\'' . $landing . '\');"';
}
?>
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6 featured-panel-style-4<?php 
echo $class;
?>
" <?php 
language_attributes();
echo $style;
?>
> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7 featured-panel-style-4<?php 
echo $class;
?>
" <?php 
language_attributes();
echo $style;
?>
> <![endif]-->
Esempio n. 23
0
function op_page_set_saved_settings($result, $keep_options = array())
{
    $get_layout = true;
    $merge_scripts = false;
    $layout_settings = unserialize(base64_decode($result->settings));
    foreach ($keep_options as $keep) {
        if ($keep == 'content') {
            $get_layout = false;
        } elseif ($keep == 'scripts') {
            $merge_scripts = true;
        } elseif ($keep == 'color_scheme') {
            if (isset($layout_settings['color_scheme_advanced'])) {
                unset($layout_settings['color_scheme_advanced']);
            }
            if (isset($layout_settings['color_scheme_template'])) {
                unset($layout_settings['color_scheme_template']);
            }
        } elseif (isset($layout_settings[$keep])) {
            unset($layout_settings[$keep]);
        }
    }
    foreach ($layout_settings as $option => $settings) {
        if (!empty($settings)) {
            $settings = unserialize(base64_decode($settings));
            $current = op_page_option($option);
            if ($option == 'scripts') {
                if ($merge_scripts === true) {
                    $new_scripts = array();
                    $script_opts = array('header', 'footer', 'css');
                    foreach ($script_opts as $opt) {
                        $cur = op_get_var($current, $opt, array());
                        $new = op_get_var($settings, $opt, array());
                        foreach ($new as $n) {
                            $cur[] = $n;
                        }
                        $new_scripts[$opt] = $cur;
                    }
                    $current = $new_scripts;
                } else {
                    $current = $settings;
                }
            } else {
                if (is_array($current) && is_array($settings)) {
                    $current = array_merge($current, $settings);
                } else {
                    $current = $settings;
                }
            }
            op_update_page_option($option, $current);
        }
    }
    if ($get_layout === true) {
        $layouts = unserialize(base64_decode($result->layouts));
        if (is_array($layouts)) {
            foreach ($layouts as $type => $layout) {
                op_page_update_layout($layout, $type);
            }
        }
    }
}
Esempio n. 24
0
 function preset_import()
 {
     global $wpdb;
     if (op_page_option('launch_funnel', 'enabled')) {
         $entry = $wpdb->get_col($wpdb->prepare("SELECT page_id FROM `{$wpdb->prefix}optimizepress_launchfunnels_pages` WHERE `page_id` = %s AND `funnel_id` = %s", OP_PAGEBUILDER_ID, $data['funnel_id']));
         if (!$entry) {
             $wpdb->query($wpdb->prepare("DELETE FROM `{$wpdb->prefix}optimizepress_launchfunnels_pages` WHERE `page_id` = %s", OP_PAGEBUILDER_ID));
             $insert = array('funnel_id' => op_page_option('launch_funnel', 'funnel_id'), 'page_id' => OP_PAGEBUILDER_ID);
             $wpdb->insert($wpdb->prefix . 'optimizepress_launchfunnels_pages', $insert);
         }
     }
 }
Esempio n. 25
0
 function save_landing_bg($op)
 {
     $landing = op_page_option('landing_bg');
     $landing = $landing === false ? array() : $landing;
     $landing['image'] = op_get_var($op, 'image', op_default_page_option('landing_bg', 'image'));
     op_update_page_option('landing_bg', $landing);
 }
Esempio n. 26
0
<div class="op-bsw-grey-panel-content op-bsw-grey-panel-no-sidebar cf" id="op_page_layout_launch_nav">
    <label for="op_header_below_nav" class="form-title"><?php 
_e('Select Menu for Navigation Bar', OP_SN);
?>
</label>
    <p class="op-micro-copy"><?php 
_e('Select a menu to assign to this navigation bar. You can create new menus by going to Appearance > Menus in the Wordpress control panel', OP_SN);
?>
</p>
    <select id="op_launch_nav_nav" name="op[launch_nav][nav]"><option value=""><?php 
_e('None', OP_SN);
?>
</option>
    <?php 
$cur = op_page_option('launch_nav', 'nav');
foreach ($nav_menus as $nav) {
    echo '<option value="' . $nav->term_id . '"' . ($cur == $nav->term_id ? ' selected="selected"' : '') . '>' . $nav->name . '</option>';
}
?>
    </select>
</div>
Esempio n. 27
0
 function op_template_include($template, $use_template = true)
 {
     if ($use_template) {
         if ($id = get_queried_object_id()) {
             $status = get_post_status($id);
             if ($status == 'publish' || (current_user_can('edit_posts') || current_user_can('edit_pages'))) {
                 if (get_post_meta($id, '_' . OP_SN . '_pagebuilder', true) == 'Y') {
                     op_init_page($id);
                     if (op_page_option('launch_funnel', 'enabled') == 'Y' && ($launch_info = op_page_option('launch_suite_info'))) {
                         require_once OP_FUNC . 'launch.php';
                     }
                     $theme = op_page_option('theme');
                     $file = OP_PAGES . $theme['type'] . '/' . $theme['dir'] . '/template.php';
                     if (file_exists($file)) {
                         return apply_filters('op_check_page_availability', $file);
                     }
                 }
             }
         }
     }
     return $template;
 }
Esempio n. 28
0
		</div>
        <div class="op-bsw-grey-panel-content op-bsw-grey-panel-no-sidebar">
            <label for="op_header_alongside_nav" class="form-title"><?php 
_e('Select Menu for Navigation Bar', OP_SN);
?>
</label>
            <p class="op-micro-copy"><?php 
_e('Select a menu to assign to this navigation bar. You can create new menus by going to Appearance > Menus in the Wordpress control panel', OP_SN);
?>
</p>
            <select id="op_header_alongside_nav" name="op[header_layout][nav_bar_alongside][nav]"><option value=""><?php 
_e('None', OP_SN);
?>
</option>
            <?php 
$cur = op_page_option('header_layout', 'nav_bar_alongside', 'nav');
foreach ($nav_menus as $nav) {
    echo '<option value="' . $nav->term_id . '"' . ($cur == $nav->term_id ? ' selected="selected"' : '') . '>' . $nav->name . '</option>';
}
?>
            </select>

	    <label for="op_header_layout_nav_bar_alongside_font" class="form-title"><?php 
_e('Select Navigation Bar Font (optional)', OP_SN);
?>
</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.', OP_SN);
?>
</p>
			<div class="op-micro-copy-font-selector">
Esempio n. 29
0
 function save_features()
 {
     //opLog('POST: ' . print_r($_POST, true));
     //opLog('OPTIONS :' . print_r($this->options, true));
     $font_options = op_page_option('feature_area', 'settings', 'font_options');
     if (!is_array($font_options)) {
         $font_options = array();
     }
     if ($this->enabled && count($this->options) > 0) {
         foreach ($this->options as $name => $options) {
             if ($name == 'template') {
                 continue;
             }
             $op = op_post('feature_area', $name);
             $mod_options = op_get_var($options, 'mod_options', array());
             $module = op_mod($options['module'], op_get_var($options, 'module_type', 'blog'))->save_settings(array('feature_area', $name), $mod_options, $op, true, true);
             if ($options['module'] == 'content_fields') {
                 if (isset($module[0])) {
                     $font_options[$name] = $module[1];
                     $module = $module[0];
                 }
             }
             op_update_page_option('feature_area', 'settings', $name, $module);
         }
     }
     op_update_page_option('feature_area', 'settings', 'font_options', $font_options);
 }
Esempio n. 30
0
<?php

$footer_area = op_page_option('footer_area');
$footer_defaults = op_default_option('site_footer');
?>

<div class="op-bsw-grey-panel-content op-bsw-grey-panel-no-sidebar cf" id="op_page_layout_footer_area">
    <label for="op_footer_area_nav" class="form-title"><?php 
_e('Footer Navigation', OP_SN);
?>
</label>
    <p class="op-micro-copy"><?php 
_e('Select a source for the menu to be assigned to the footer links (next to the copyright message). Select none to show no menu', OP_SN);
?>
</p>
    <select id="op_footer_area_nav" name="op[footer_area][nav]"><option value=""><?php 
_e('None', OP_SN);
?>
</option>
    <?php 
$cur = !empty($footer_area['nav']) ? $footer_area['nav'] : $footer_defaults['nav'];
foreach ($nav_menus as $nav) {
    echo '<option value="' . $nav->term_id . '"' . ($cur == $nav->term_id ? ' selected="selected"' : '') . '>' . $nav->name . '</option>';
}
?>
    </select>
    
    <label for="op_footer_area_font" class="form-title"><?php 
_e('Select Navigation Bar Font (optional)', OP_SN);
?>
</label>