function options() { /* Handle Color Select Options and output the required CSS for them... */ $this->css .= '/* Options */' . "\n\n"; foreach (get_option_array() as $menuitem) { foreach ($menuitem as $optionid => $option_info) { if ($option_info['type'] == 'css_option' && pagelines_option($optionid)) { if (isset($option_info['css_prop']) && isset($option_info['selectors'])) { $css_units = isset($option_info['css_units']) ? $option_info['css_units'] : ''; $this->css .= $option_info['selectors'] . '{' . $option_info['css_prop'] . ':' . pagelines_option($optionid) . $css_units . ';}' . "\n"; } } if ($option_info['type'] == 'colorpicker' && pagelines_option($optionid)) { if (isset($option_info['css_prop'])) { $this->css .= $option_info['selectors'] . '{' . $option_info['css_prop'] . ':' . pagelines_option($optionid) . ';}' . "\n"; } else { $this->css .= $option_info['selectors'] . '{color:' . pagelines_option($optionid) . ';}' . "\n"; } } } } $this->css .= "\n\n"; }
function __construct() { $this->option_array = get_option_array(); $this->build_header(); $this->build_body(); $this->build_footer(); }
/** * CSS Rendering In <head> */ function render_css() { global $pagelines_ID; $css = ''; if (has_action('override_pagelines_css_output')) { return; } foreach (get_option_array() as $menu) { foreach ($menu as $oid => $o) { if (!is_array($o)) { $o = array(); } $oset = array('post_id' => $pagelines_ID); $o['val'] = ploption($oid, $oset); if (!empty($o['selectvalues']) && is_array($o['selectvalues'])) { foreach ($o['selectvalues'] as $sid => $s) { $o['selectvalues'][$sid]['val'] = ploption($sid, $oset); } } if (!ploption('supersize_bg', $oset) && isset($o['type']) && $o['type'] == 'background_image' && ploption($oid . '_url', $oset)) { $bg_repeat = ploption($oid . '_repeat', $oset) ? ploption($oid . '_repeat', $oset) : 'no-repeat'; $bg_attach = ploption($oid . '_attach', $oset) ? ploption($oid . '_attach', $oset) : 'scroll'; $bg_pos_vert = ploption($oid . '_pos_vert', $oset) || ploption($oid . '_pos_vert', $oset) == 0 ? (int) ploption($oid . '_pos_vert', $oset) : '0'; $bg_pos_hor = ploption($oid . '_pos_hor', $oset) || ploption($oid . '_pos_hor', $oset) == 0 ? (int) ploption($oid . '_pos_hor', $oset) : '50'; $bg_selector = ploption($oid . '_selector', $oset) ? ploption($oid . '_selector', $oset) : $o['selectors']; $bg_url = ploption($oid . '_url', $oset); $css .= sprintf('%s{ background-image:url(%s);}', $bg_selector, $bg_url); $css .= sprintf('%s{ background-repeat: %s;}', $bg_selector, $bg_repeat); $css .= sprintf('%s{ background-attachment: %s;}', $bg_selector, $bg_attach); $css .= sprintf('%s{ background-position: %s%% %s%%;}', $bg_selector, $bg_pos_hor, $bg_pos_vert); } elseif (isset($o['type']) && $o['type'] == 'colorpicker') { $this->render_css_colors($oid, $o['cssgroup'], $o['css_prop']); } elseif (isset($o['type']) && $o['type'] == 'color_multi') { foreach ($o['selectvalues'] as $mid => $m) { $cprop = isset($m['css_prop']) ? $m['css_prop'] : 'color'; if ($m['val'] != '' && isset($m['selectors']) && $m['selectors'] != '') { $rules = $this->load_the_props($cprop, $m['val']); $rules .= do_color_math($mid, $m, $m['val']); $css .= sprintf('%s %s{%s} /* %s */ %s %s', "\n", $m['selectors'], $rules, $mid, "\n", "\n"); } else { $cgroup = isset($m['cssgroup']) ? $m['cssgroup'] : null; $cprop = isset($m['css_prop']) ? $m['css_prop'] : null; $this->render_css_colors($mid, $m, $cgroup, $cprop); } } } } } $css .= $this->parse_css_factory(); return $css; }
/** * * @TODO do * */ function pagelines_process_reset_options($option_array = null) { if (isset($_POST['pl_reset_settings']) && current_user_can('edit_themes')) { do_action('extend_flush'); if (isset($_POST['the_pl_setting']) && !isset($_POST['reset_callback'])) { update_option($_POST['the_pl_setting'], array()); } if (isset($_POST['reset_callback'])) { call_user_func($_POST['reset_callback']); } } $option_array = isset($option_array) ? $option_array : get_option_array(); foreach ($option_array as $menuitem => $options) { foreach ($options as $oid => $o) { if (isset($o['type']) && $o['type'] == 'reset' && ploption($oid)) { call_user_func($o['callback']); // Set the 'reset' option back to not set !important pagelines_update_option($oid, null); wp_redirect(admin_url(PL_SETTINGS_URL . '&reset=true&opt_id=' . $oid)); exit; } } } }
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo CORE_JS; ?> /colorpicker/css/colorpicker.css" /> <script type="text/javascript" src="<?php echo CORE_JS; ?> /colorpicker/js/colorpicker.js"></script> <script type="text/javascript">/*<![CDATA[*/ jQuery(document).ready(function(){ //Color Picker <?php foreach (get_option_array() as $menuitem) { foreach ($menuitem as $optionid => $option_info) { if ($option_info['type'] == 'colorpicker') { $color = pagelines_option($optionid); ?> jQuery('#<?php echo $optionid; ?> _picker').children('div').css('backgroundColor', '<?php echo $color; ?> '); jQuery('#<?php echo $optionid; ?> _picker').ColorPicker({
function setup_google_loaders(){ foreach (get_option_array() as $menuitem): foreach($menuitem as $oid => $o): if( $o['type'] == 'typography' ): $style_id = get_epanel_option_id($oid, 'font_style'); $initial_style = $this->gfont_base_uri. $this->gfont_key(epanel_sub_option($oid, 'font')); echo '<link id="'.$style_id.'" rel="stylesheet" media="screen" type="text/css" href="'.$initial_style.'" />'; endif; endforeach; endforeach; }
function pagelines_process_reset_options() { foreach (get_option_array() as $menuitem => $options) { foreach ($options as $optionid => $o) { if ($o['type'] == 'reset' && pagelines_option($optionid)) { call_user_func($o['callback']); // Set the 'reset' option back to not set !important pagelines_update_option($optionid, null); wp_redirect(admin_url('admin.php?page=pagelines&reset=true&opt_id=' . $optionid)); exit; } } } }
function options(){ /* Handle Color Select Options and output the required CSS for them... */ if( $this->comments ) $this->css .= '/* Options --------------- */'.$this->nl2; foreach (get_option_array() as $menuitem){ foreach($menuitem as $optionid => $option_info){ if($option_info['type'] == 'css_option' && pagelines_option($optionid)){ if(isset($option_info['css_prop']) && isset($option_info['selectors'])){ $css_units = (isset($option_info['css_units'])) ? $option_info['css_units'] : ''; $this->css .= $option_info['selectors'].'{'.$option_info['css_prop'].':'.pagelines_option($optionid).$css_units.';}'.$this->nl; } } if( $option_info['type'] == 'background_image' && pagelines_option($optionid.'_url')){ $bg_repeat = (pagelines_option($optionid.'_repeat')) ? pagelines_option($optionid.'_repeat'): 'no-repeat'; $bg_pos_vert = (pagelines_option($optionid.'_pos_vert') || pagelines_option($optionid.'_pos_vert') == 0 ) ? (int) pagelines_option($optionid.'_pos_vert') : '0'; $bg_pos_hor = (pagelines_option($optionid.'_pos_hor') || pagelines_option($optionid.'_pos_hor') == 0 ) ? (int) pagelines_option($optionid.'_pos_hor') : '50'; $bg_selector = (pagelines_option($optionid.'_selector')) ? pagelines_option($optionid.'_selector') : $option_info['selectors']; $bg_url = pagelines_option($optionid.'_url'); $this->css .= $bg_selector ."{background-image:url('".$bg_url."');}".$this->nl; $this->css .= $bg_selector ."{background-repeat:".$bg_repeat.";}".$this->nl; $this->css .= $bg_selector ."{background-position:".$bg_pos_hor."% ".$bg_pos_vert."%;}".$this->nl; } if($option_info['type'] == 'colorpicker'){ $this->_css_colors($optionid, $option_info['selectors'], $option_info['css_prop']); } elseif($option_info['type'] == 'color_multi'){ foreach($option_info['selectvalues'] as $moption_id => $m_option_info){ $the_css_selectors = (isset($m_option_info['selectors'])) ? $m_option_info['selectors'] : null ; $the_css_property = (isset($m_option_info['css_prop'])) ? $m_option_info['css_prop'] : null ; $this->_css_colors($moption_id, $the_css_selectors, $the_css_property); } } } } $this->css .= $this->nl2; }
/** * * @TODO document * */ function render_css() { $css = ''; foreach (get_option_array() as $mid) { foreach ($mid as $oid => $o) { if (isset($o['type']) && $o['type'] == 'typography') { $type = ploption($oid); $font_id = $type['font']; // Don't render if font isn't set. if (isset($font_id) && isset($this->foundry[$font_id])) { if ($this->foundry[$font_id]['google']) { $google_fonts[] = $font_id; } $type_selectors = $o['selectors']; if (isset($type['selectors']) && !empty($type['selectors'])) { $type_selectors .= ',' . trim(trim($type['selectors']), ','); } $type_css = $this->get_type_css($type); $type_css_keys[] = $type_selectors . '{' . $type_css . '}'; } } } } if (isset($google_fonts) && is_array($google_fonts)) { $css .= $this->google_import($google_fonts); } // Render the font CSS if (isset($type_css_keys) && is_array($type_css_keys)) { foreach ($type_css_keys as $typeface) { $css .= $typeface; } } return $css; }
function options(){ // Color and other options handler $this->css .= '/* Options --------------- */'."\n\n"; foreach (get_option_array() as $menuitem){ foreach($menuitem as $optionid => $option_info){ if($option_info['type'] == 'css_option' && epanel_option($optionid)){ if(isset($option_info['css_prop']) && isset($option_info['selectors'])){ $css_units = (isset($option_info['css_units'])) ? $option_info['css_units'] : ''; $this->css .= $option_info['selectors'].'{'.$option_info['css_prop'].':'.epanel_option($optionid).$css_units.';}'."\n"; } } if( $option_info['type'] == 'background_image' && epanel_option($optionid.'_url')){ $bg_repeat = (epanel_option($optionid.'_repeat')) ? epanel_option($optionid.'_repeat'): 'no-repeat'; $bg_pos_vert = (epanel_option($optionid.'_pos_vert') || epanel_option($optionid.'_pos_vert') == 0 ) ? (int) epanel_option($optionid.'_pos_vert') : '0'; $bg_pos_hor = (epanel_option($optionid.'_pos_hor') || epanel_option($optionid.'_pos_hor') == 0 ) ? (int) epanel_option($optionid.'_pos_hor') : '50'; $bg_selector = (epanel_option($optionid.'_selector')) ? epanel_option($optionid.'_selector') : $option_info['selectors']; $bg_url = epanel_option($optionid.'_url'); $this->css .= $bg_selector ."{background-image:url('".$bg_url."');}"."\n"; $this->css .= $bg_selector ."{background-repeat:".$bg_repeat.";}"."\n"; $this->css .= $bg_selector ."{background-position:".$bg_pos_hor."% ".$bg_pos_vert."%;}"."\n"; } if($option_info['type'] == 'colorpicker'){ $this->_css_colors($optionid, $option_info['selectors'], $option_info['css_prop']); } elseif($option_info['type'] == 'color_multi'){ foreach($option_info['selectvalues'] as $moption_id => $m_option_info){ $the_css_selectors = (isset($m_option_info['selectors'])) ? $m_option_info['selectors'] : null ; $the_css_property = (isset($m_option_info['css_prop'])) ? $m_option_info['css_prop'] : null ; $this->_css_colors($moption_id, $the_css_selectors, $the_css_property); } } } } $this->css .= "\n\n"; }
/** * * @TODO document * */ function get_pro_call() { global $pl_section_factory; $usections = $pl_section_factory->unavailable_sections; ?> <div id="vpro_billboard" class="vpro-billboard"> <div class="vpro-billboard-pad"> <div class="vpro_billboard_height fix"> <a class="vpro_thumb" href="<?php echo VPRO_TOUR . '?ref=le-admin'; ?> "><img src="<?php echo PL_IMAGES; ?> /pro-thumb.png" alt="<?php echo VPRO_NAME; ?> " /></a> <div class="vpro_desc"> <strong style="font-size: 1.2em">You Are Using PageLines Lite Edition</strong><br/> <strong>PageLines Lite</strong> is the <strong>free version</strong> of <?php echo VPRO_NAME; ?> .<br/> Upgrade to the Pro edition for more sections & options, no credit link, enhanced social & SEO, support and <a href="http://www.pagelines.com/tour?ref=le-admin">more...</a><br/> <?php $features_js = 'onClick="jQuery(\'.vpro-billboard\').find(\'.whatsmissing\').fadeToggle();"'; $pro_buttons = OptEngine::superlink(__('Why Upgrade? ↓', 'pagelines'), 'grey', 'left', '#', $features_js); $target = 'target="_blank"'; $pro_buttons .= OptEngine::superlink(__('PageLines Tour', 'pagelines'), 'grey', 'left', VPRO_TOUR . '?ref=le-admin', $target); $pro_buttons .= OptEngine::superlink(__('Upgrade Now →', 'pagelines'), 'blue', 'left', VPRO_PRICING . '?ref=le-admin', $target); printf('<div class="pro_buttons fix">%s</div>', $pro_buttons); ?> </div> </div> <div class="whatsmissing"> <h3> Why You'll Love the Professional or Developer edition... </h3> <p> When you upgrade you get 30+ pro drag & drop sections, 200+ CMS options, SEO and social enhancements and way, way more. </p> <p> The pro version way more control options. For advanced users, there is also a Developer version that supports "integrations" and WP "multisite"... To learn more see the <a href="http://www.pagelines.com/pricing?ref=le-admin">pricing page</a> or <a href="http://www.pagelines.com/tour?ref=le-admin">PageLines tour</a>... </p> <p> <strong>Some specifics:</strong> </p> <?php if (isset($usections) && is_array($usections)) { ?> <p class="mod"><strong>Professional Sections In Pro Version</strong><br/> <?php $list_sections = array(); foreach ($usections as $unavailable_section) { $list_sections[] = $unavailable_section->name; } echo join(' · ', $list_sections); ?> </p> <?php } ?> <?php $unavailable_section_areas = get_unavailable_section_areas(); if (isset($unavailable_section_areas) && is_array($unavailable_section_areas)) { ?> <p class="mod"><strong>New Templates and Template Areas</strong> (i.e. places to put sections)<br/> <?php foreach ($unavailable_section_areas as $unavailable_section_area_name) { ?> <?php echo $unavailable_section_area_name; if ($unavailable_section_area_name !== end($unavailable_section_areas)) { echo ' · '; } ?> <?php } ?> </p> <?php } ?> <p class="mod"><strong>New Settings & Options</strong><br/> <?php $list = array(); foreach (get_option_array(true) as $optionset) { foreach ($optionset as $oid => $o) { if (isset($o['version']) && $o['version'] == 'pro') { $list[] = $o['title']; } } } echo join(' · ', $list); ?> </p> </div> </div> </div> <?php }
/** * Option Interface Body, including vertical tabbed nav * */ function build_body(){ global $pl_section_factory; ?> <div id="tabs"> <ul id="tabsnav"> <li><span class="graphic top"> </span></li> <?php foreach($this->option_array as $menu => $oids):?> <li> <a class="<?php echo $menu;?> tabnav-element" href="#<?php echo $menu;?>"> <span><?php echo ucwords( str_replace('_',' ',$menu) );?></span> </a> </li> <?php endforeach;?> <li><span class="graphic bottom"> </span></li> <div class="framework_loading"> <a href="http://www.pagelines.com/forum/topic.php?id=6489#post-34852" target="_blank" title="Javascript Issue Detector"><span class="framework_loading_gif" > </span></a> </div> </ul> <div id="thetabs" class="fix"> <?php if(!VPRO):?> <div id="vpro_billboard" class=""> <div class="vpro_billboard_height"> <a class="vpro_thumb" href="<?php echo PROVERSIONOVERVIEW;?>"><img src="<?php echo PL_IMAGES;?>/pro-thumb-125x50.png" alt="<?php echo PROVERSION;?>" /></a> <div class="vpro_desc"> <strong style="font-size: 1.2em">Get the Pro Version </strong><br/> <?php echo THEMENAME;?> is the free version of <?php echo PROVERSION;?>, a premium product by <a href="http://www.pagelines.com" target="_blank">PageLines</a>.<br/> Buy <?php echo PROVERSION;?> for tons more options, sections and templates.<br/> <a class="vpro_link" href="#" onClick="jQuery(this).parent().parent().parent().find('.whatsmissing').slideToggle();">Pro Features ↓</a> <a class="vpro_link" href="<?php echo PROVERSIONOVERVIEW;?>">Why Pro?</a> <a class="vpro_link" href="<?php echo PROVERSIONDEMO;?>"><?php echo PROVERSION;?> Demo</a> <?php if(defined('PROBUY')):?><a class="vpro_link vpro_call" href="<?php echo PROBUY;?>"><strong>Buy Now →</strong></a><?php endif;?> </div> </div> <div class="whatsmissing"> <h3>Pro Only Features</h3> <?php if(isset($pl_section_factory->unavailable_sections) && is_array($pl_section_factory->unavailable_sections)):?> <p class="mod"><strong>Pro Sections</strong> (drag & drop)<br/> <?php foreach( $pl_section_factory->unavailable_sections as $unavailable_section ):?> <?php echo $unavailable_section->name;if($unavailable_section !== end($pl_section_factory->unavailable_sections)) echo ' · ';?> <?php endforeach;?></p> <?php endif;?> <?php $unavailable_section_areas = get_unavailable_section_areas(); if(isset($unavailable_section_areas) && is_array($unavailable_section_areas)):?> <p class="mod"><strong>Pro Templates & Section Areas</strong> (i.e. places to put sections)<br/> <?php foreach( $unavailable_section_areas as $unavailable_section_area_name ):?> <?php echo $unavailable_section_area_name; if($unavailable_section_area_name !== end($unavailable_section_areas)) echo ' · ';?> <?php endforeach;?></p> <?php endif;?> <p class="mod"><strong>Pro Settings & Options</strong><br/> <?php foreach( get_option_array(true) as $optionset ): foreach ( $optionset as $oid => $o): if( isset($o['version']) && $o['version'] == 'pro' ): echo $o['title']; echo ' · '; endif; endforeach; endforeach;?></p> <p class="mod"><strong>Plus additional meta options, integrated plugins, technical support, and more...</strong></p> </div> </div> <?php endif;?> <?php foreach($this->option_array as $menu => $oids):?> <div id="<?php echo $menu;?>" class="tabinfo"> <?php if( stripos($menu, '_') !== 0 ): ?> <div class="tabtitle"><?php echo ucwords(str_replace('_',' ',$menu));?></div> <?php endif;?> <?php foreach($oids as $oid => $o){ $this->option_engine($oid, $o); } ?> <div class="clear"></div> </div> <?php endforeach; ?> </div> <!-- End the tabs --> </div> <!-- End tabs --> <?php }