/** * * @TODO document * */ function section_template($clone_id = null) { $h_head = ploption('_highlight_head', $this->tset); $h_subhead = ploption('_highlight_subhead', $this->tset); $h_splash = ploption('_highlight_splash', $this->tset); $h_splash_position = ploption('_highlight_splash_position', $this->oset); $frame_class = ploption('_highlight_image_frame', $this->oset) ? 'pl-imageframe' : ''; if ($h_head || $h_subhead || $h_splash) { ?> <div class="highlight-area"> <?php if ($h_splash_position == 'top' && $h_splash) { printf('<div class="highlight-splash hl-image-top %s"><img src="%s" alt="" /></div>', $frame_class, $h_splash); } if ($h_splash_position != 'notext') { if ($h_head) { printf('<h1 class="highlight-head">%s</h1>', __($h_head, 'pagelines')); } if ($h_subhead) { printf('<h3 class="highlight-subhead subhead">%s</h3>', __($h_subhead, 'pagelines')); } } if ($h_splash_position != 'top' && $h_splash) { printf('<div class="highlight-splash hl-image-bottom %s"><img src="%s" alt="" /></div>', $frame_class, apply_filters('pl_highlight_splash', $h_splash)); } ?> </div> <?php } else { echo setup_section_notify($this, __('Set highlight page options to activate.', 'pagelines')); } }
/** * PHP5 constructor * @param bool $template_type */ function __construct($template_type = false) { global $post; global $pl_section_factory; global $passive_sections; // passive sections for loading $post = !isset($post) && isset($_GET['post']) ? get_post($_GET['post'], 'object') : $post; $this->factory = $pl_section_factory->sections; // All section control settings $sc_set = is_pagelines_special() ? PAGELINES_SPECIAL : PAGELINES_TEMPLATES; $this->scontrol = ploption('section-control', array('setting' => $sc_set)); $this->sc_default = ploption('section-control', array('setting' => PAGELINES_TEMPLATES)); $this->map = $this->get_map(); // Add passive sections $this->passive_sections = $passive_sections; /** * Template Type * This is how we decide which sections belong on the page */ if ($template_type != false) { $this->template_type = $template_type; } else { if (is_admin()) { $this->template_type = $this->admin_page_type_breaker(); } else { $this->template_type = $this->page_type_breaker(); } } if (!is_admin()) { $this->template_name = $this->page_type_name(); } $this->load_sections_on_hook_names(); }
/** * Section template. */ function section_template($clone_id) { $hero_lt_width = ploption('herounit_left_width', $this->oset); if (!$hero_lt_width) { $hero_lt_width = 'span6'; } $hero_rt_width = ploption('herounit_right_width', $this->oset); if (!$hero_rt_width) { $hero_rt_width = 'span6'; } $hero_title = ploption('pagelines_herounit_title', $this->tset); $hero_tag = ploption('pagelines_herounit_tagline', $this->tset); $hero_img = ploption('pagelines_herounit_image', $this->tset); $hero_butt_link = ploption('herounit_button_link', $this->oset); $hero_butt_text = ploption('herounit_button_text', $this->oset); $hero_butt_target = ploption('herounit_button_target', $this->oset) ? ' target="_blank"' : ''; $hero_butt_theme = ploption('herounit_button_theme', $this->oset); if ($hero_title) { ?> <div class="pl-hero-wrap row"> <?php if ($hero_lt_width) { printf('<div class="pl-hero %s">', $hero_lt_width); } ?> <?php if ($hero_title) { printf('<h1 class="m-bottom">%s</h1>', $hero_title); } if ($hero_tag) { printf('<p>%s</p>', $hero_tag); } if ($hero_butt_link) { printf('<a %s class="btn btn-%s btn-large" href="%s">%s</a> ', $hero_butt_target, $hero_butt_theme, $hero_butt_link, $hero_butt_text); } ?> </div> <?php if ($hero_rt_width) { printf('<div class="pl-hero-image %s">', $hero_rt_width); } ?> <?php if ($hero_img) { printf('<div class="hero_image"><img class="pl-imageframe" src="%s" /></div>', apply_filters('pl_hero_image', $hero_img)); } ?> </div> </div> <?php } else { echo setup_section_notify($this, __('Set Hero page options to activate.', 'pagelines')); } }
/** * Fix The WordPress Favicon by Site Title */ function pl_fix_admin_favicon() { if (!($image_url = ploption('pagelines_favicon'))) { return; } $css = "\n\t\t#wphead #header-logo {\n\t\t\tbackground: url({$image_url}) no-repeat scroll center center;\n\t\t}"; inline_css_markup('pagelines-wphead-img', $css); }
/** * Section template. */ function section_template() { $second_menu = ploption('_second_nav_menu', $this->oset) ? ploption('_second_nav_menu', $this->oset) : null; if (isset($second_menu)) { wp_nav_menu(array('menu_class' => 'secondnav_menu fix lcolor3', 'menu' => $second_menu, 'container' => null, 'container_class' => '', 'depth' => 1, 'fallback_cb' => 'pagelines_page_subnav')); } elseif (ploption('nav_use_hierarchy', $this->oset)) { pagelines_page_subnav(); } }
/** * * @TODO document * */ function register_actions() { $privelidge = ploption('hide_controls_meta') ? ploption('hide_controls_meta') : 'publish_posts'; if (!current_user_can($privelidge)) { return; } // Adds the box add_action('admin_menu', array(&$this, 'add_metapanel_box')); // Saves the options. add_action('post_updated', array(&$this, 'save_meta_options')); }
/** * Construct */ function __construct($oid, $o, $setting = PAGELINES_SETTINGS) { global $pagelines_template; global $pl_section_factory; $oset = array('setting' => $setting); $this->sc_settings = ploption('section-control', $oset); $this->sc_global = ploption('section-control', array('setting' => PAGELINES_TEMPLATES)); $this->sc_namespace = sprintf('%s[section-control]', $setting); $this->template_map = get_option(PAGELINES_TEMPLATE_MAP); $this->factory = $pl_section_factory->sections; $this->template = $pagelines_template; }
/** * 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 document * */ function __construct() { if (!VPRO && 'pagelines' == basename(pl_get_uri(false))) { update_option(PAGELINES_SETTINGS, pagelines_settings_defaults()); update_option(PAGELINES_TEMPLATE_MAP, the_template_map()); } /** * Insure the correct default logo is being displayed after import. */ if (!VPRO && 'logo-platform.png' == basename(ploption('pagelines_custom_logo'))) { plupop('pagelines_custom_logo', PL_IMAGES . '/logo.png'); } /** * Fix broken repeated excerpt problem on pagelines.com */ if (!VPRO && 'pagelines' == basename(pl_get_uri(false))) { if (!isset($a['content_blog']) || true != $a['content_blog']) { plupop('content_blog', true); } if (!isset($a['content_blog']) || true == $a['excerpt_blog']) { plupop('excerpt_blog', false); } /** * Fix broken templates */ $t = (array) get_option(PAGELINES_TEMPLATE_MAP, the_template_map()); $s = (array) get_option(PAGELINES_SPECIAL); $t['main']['templates']['posts']['sections'] = array('PageLinesQuickSlider', 'PageLinesBoxes'); $s['posts']['_pagelines_layout_mode'] = 'fullwidth'; update_option(PAGELINES_SPECIAL, $s); update_option(PAGELINES_TEMPLATE_MAP, $t); plupop('pagelines_version', CORE_VERSION); } /** * Upgrade from Platform(pro) to PageLines and import settings. */ $pagelines = get_option(PAGELINES_SETTINGS); $platform = get_option(PAGELINES_SETTINGS_LEGACY); if (is_array($pagelines)) { if (!isset($settings['pagelines_version'])) { plupop('pagelines_version', CORE_VERSION); } // were done. return; } if (is_array($platform)) { $this->upgrade($platform); } }
public function shortcode($atts, $content, $tag) { $data = array(); foreach ($this->get_options() as $key => $o) { $value = ploption($key); if ($value) { $data[$key] = sprintf($o['format'], $value); } } $data = array_filter($data); if (empty($data)) { return ''; } else { $icons = implode("\n", $data); return "<div class='social-icons'>{$icons}</div>"; } }
/** * * @TODO document * */ function section_head() { $arrows = ploption('drop_down_arrows') == 'on' ? 1 : 0; $shadows = ploption('drop_down_shadow') == 'on' ? 1 : 0; if (ploption('enable_drop_down')) { ?> <script type="text/javascript"> /* <![CDATA[ */ jQuery(document).ready(function() { jQuery('div.brandnav-nav ul.sf-menu').superfish({ delay: 100, speed: 'fast', autoArrows: <?php echo $arrows; ?> , dropShadows: <?php echo $shadows; ?> }); }); /* ]]> */ </script> <?php } }
/** * Section template. */ function section_template() { printf('<div class="branding_wrap fix">'); pagelines_main_logo(); pagelines_register_hook('pagelines_before_branding_icons', 'branding'); // Hook printf('<div class="icons" style="bottom: %spx; right: %spx;">', intval(pagelines_option('icon_pos_bottom')), pagelines_option('icon_pos_right')); pagelines_register_hook('pagelines_branding_icons_start', 'branding'); // Hook if (ploption('rsslink')) { printf('<a target="_blank" href="%s" class="rsslink"><img src="%s" alt="RSS"/></a>', apply_filters('pagelines_branding_rssurl', get_bloginfo('rss2_url')), $this->base_url . '/rss.png'); } if (VPRO) { if (ploption('twitterlink')) { printf('<a target="_blank" href="%s" class="twitterlink"><img src="%s" alt="Twitter"/></a>', ploption('twitterlink'), $this->base_url . '/twitter.png'); } if (ploption('facebooklink')) { printf('<a target="_blank" href="%s" class="facebooklink"><img src="%s" alt="Facebook"/></a>', ploption('facebooklink'), $this->base_url . '/facebook.png'); } if (ploption('linkedinlink')) { printf('<a target="_blank" href="%s" class="linkedinlink"><img src="%s" alt="LinkedIn"/></a>', ploption('linkedinlink'), $this->base_url . '/linkedin.png'); } if (ploption('youtubelink')) { printf('<a target="_blank" href="%s" class="youtubelink"><img src="%s" alt="Youtube"/></a>', ploption('youtubelink'), $this->base_url . '/youtube.png'); } if (ploption('gpluslink')) { printf('<a target="_blank" href="%s" class="gpluslink"><img src="%s" alt="Google+"/></a>', ploption('gpluslink'), $this->base_url . '/google.png'); } pagelines_register_hook('pagelines_branding_icons_end', 'branding'); // Hook } echo '</div></div>'; pagelines_register_hook('pagelines_after_branding_wrap', 'branding'); // Hook ?> <script type="text/javascript"> jQuery('.icons a').hover(function(){ jQuery(this).fadeTo('fast', 1); },function(){ jQuery(this).fadeTo('fast', 0.5);}); </script> <?php }
/** * Section template. */ function section_template() { $default = array(); if (ploption('footer_logo') && VPRO) { $default[] = sprintf('<a href="%s" class="home" title="%s"><img src="%s" alt="%s"/></a>', home_url(), __('Home', 'pagelines'), ploption('footer_logo'), get_bloginfo('name')); } else { $default[] = sprintf('<h3 class="site-title"><a class="home" href="%s" title="%s">%s</a></h3>', home_url(), __('Home', 'pagelines'), get_bloginfo('name')); } $default[] = sprintf('<h3 class="widget-title">%s</h3>%s', __('Pages', 'pagelines'), wp_nav_menu(array('menu_class' => 'footer-links list-links', 'theme_location' => 'footer_nav', 'depth' => 1, 'echo' => false))); $default[] = sprintf('<h3 class="widget-title">%s</h3><ul class="latest_posts">%s</ul>', __('The Latest', 'pagelines'), $this->recent_post()); $default[] = sprintf('<h3 class="widget-title">%s</h3><div class="findent footer-more">%s</div>', __('More', 'pagelines'), ploption('footer_more')); $default[] = sprintf('<div class="findent terms">%s</div>', ploption('footer_terms')); ob_start(); // dynamic sidebar always outputs if (!dynamic_sidebar($this->name)) { foreach ($default as $key => $c) { printf($this->markup_start, '', ''); echo $c; echo $this->markup_end; } } printf('<div class="fcolumns ppfull pprow"><div class="fcolumns-pad fix">%s</div></div><div class="clear"></div>', ob_get_clean()); }
/** * * @TODO document * */ function pagelines_register_settings() { register_setting(PAGELINES_SETTINGS, PAGELINES_SETTINGS, 'pagelines_settings_callback'); register_setting(PAGELINES_SPECIAL, PAGELINES_SPECIAL); register_setting(PAGELINES_TEMPLATES, PAGELINES_TEMPLATES); /* Typography Options */ $GLOBALS['pl_foundry'] = new PageLinesFoundry(); /* Import/Exporting */ pagelines_import_export(); pagelines_process_reset_options(); if (!isset($_REQUEST['page']) || $_REQUEST['page'] != 'pagelines') { return; } global $new_default_settings; /* New Default Options in Child Themes */ if (!isset($_GET['newoptions']) && pagelines_activate_or_reset() && !empty($new_default_settings)) { $type = sprintf('&%s=true', pagelines_activate_or_reset()); foreach ($new_default_settings as $key => $set) { plupop($set['key'], $set['value'], array('parent' => $set['parent'], 'subkey' => $set['subkey'], 'setting' => $set['setting'])); } wp_redirect(admin_url(PL_SETTINGS_URL . '&newoptions=true' . $type)); } /* Handle Reset of Options */ if (ploption('reset')) { update_option(PAGELINES_SETTINGS, pagelines_settings_defaults()); global $extension_control; $extension_control->flush_caches(); wp_redirect(admin_url(PL_SETTINGS_URL . '&reset=true')); exit; } }
/** * * Page-by-page options for PostPins * */ function section_optionator($settings) { $settings = wp_parse_args($settings, $this->optionator_default); $array = array(); $array['quick_slides'] = array('type' => 'count_select', 'count_start' => 1, 'count_number' => 10, 'default' => '3', 'inputlabel' => __('Number of Slides to Configure', 'pagelines'), 'title' => __('Number of Slides', 'pagelines'), 'shortexp' => __('Enter the number of QuickSlider slides. <strong>Default is 3</strong>', 'pagelines'), 'exp' => __("This number will be used to generate slides and option setup.", 'pagelines')); $array['quick_transition'] = array('type' => 'select', 'selectvalues' => array('fade' => array('name' => __('Use Fading Transition', 'pagelines')), 'slide_h' => array('name' => __('Use Slide/Horizontal Transition', 'pagelines'))), 'inputlabel' => __('Select Transition Type', 'pagelines'), 'title' => __('Slider Transition Type', 'pagelines'), 'shortexp' => __('Configure the way slides transfer to one another.', 'pagelines'), 'exp' => __("", 'pagelines')); $array['quick_nav'] = array('type' => 'select', 'selectvalues' => array('both' => array('name' => __('Use Both Arrow and Slide Control Navigation', 'pagelines')), 'none' => array('name' => __('No Navigation', 'pagelines')), 'control_only' => array('name' => __('Slide Controls Only', 'pagelines')), 'arrow_only' => array('name' => __('Arrow Navigation Only', 'pagelines'))), 'inputlabel' => __('Slider Navigation', 'pagelines'), 'title' => __('Slider Navigation mode', 'pagelines'), 'shortexp' => __('Configure the navigation for this slider.', 'pagelines'), 'exp' => __("", 'pagelines')); $array['quick_slideshow'] = array('type' => 'check', 'inputlabel' => __('Animate Slideshow Automatically?', 'pagelines'), 'title' => __('Automatic Slideshow?', 'pagelines'), 'shortexp' => __('Autoplay the slides, transitioning every 7 seconds.', 'pagelines'), 'exp' => __("", 'pagelines')); global $post_ID; $oset = array('post_id' => $post_ID, 'clone_id' => $settings['clone_id'], 'type' => $settings['type']); $slides = ploption('quick_slides', $oset) ? ploption('quick_slides', $oset) : $this->default_limit; for ($i = 1; $i <= $slides; $i++) { $array['quick_slide_' . $i] = array('type' => 'multi_option', 'selectvalues' => array('quick_image_' . $i => array('inputlabel' => __('Slide Image', 'pagelines'), 'type' => 'image_upload'), 'quick_img_alt_' . $i => array('inputlabel' => __('Image Alt', 'pagelines'), 'type' => 'text'), 'quick_text_' . $i => array('inputlabel' => __('Slide Text', 'pagelines'), 'type' => 'textarea'), 'quick_link_' . $i => array('inputlabel' => __('Slide Link URL', 'pagelines'), 'type' => 'text'), 'quick_text_location_' . $i => array('inputlabel' => __('Slide Text Location', 'pagelines'), 'type' => 'select', 'selectvalues' => array('right_bottom' => array('name' => 'Right/Bottom'), 'right_top' => array('name' => 'Right/Top'), 'left_bottom' => array('name' => 'Left/Bottom'), 'left_top' => array('name' => 'Left/Top')))), 'title' => __('QuickSlider Slide ', 'pagelines') . $i, 'shortexp' => __('Setup options for slide number ', 'pagelines') . $i, 'exp' => __('For best results all images in the slider should have the same dimensions.', 'pagelines')); } $metatab_settings = array('id' => 'quickslider_options', 'name' => __('QuickSlider', 'pagelines'), 'icon' => $this->icon, 'clone_id' => $settings['clone_id'], 'active' => $settings['active']); register_metatab($metatab_settings, $array); }
/** * * @TODO document * */ function draw_banners($b, $class = "") { ?> <div class="banner_container fix <?php echo $class; ?> "> <?php foreach ($b as $bpost) { $oset = array('post_id' => $bpost->ID); $banner_text_width = ploption('banner_text_width', $oset) ? ploption('banner_text_width', $oset) : 50; $banner_media_width = 100 - $banner_text_width; // Math $banner_align = ploption('banner_align', $oset) ? ploption('banner_align', $oset) : 'banner_left'; $pad = ploption('banner_text_padding', $oset); $banner_text_padding = $pad ? sprintf('padding:%s;', $pad) : "padding: 20px 40px"; $pad_flag = $pad ? 'with-pad' : 'no-pad'; ?> <div class="banner-area pprand-pad <?php echo $banner_align . ' ' . $pad_flag; ?> "> <div class="banner-text pprand" style="width:<?php echo $banner_text_width; ?> %;"> <div class="banner-text-pad pprand-pad" style="<?php echo $banner_text_padding; ?> "> <div class="banner-text-wrap"> <div class="banner-title"> <h2><?php echo do_shortcode($bpost->post_title); ?> </h2> </div> <div class="banner-content"> <?php echo apply_filters('the_content', do_shortcode($bpost->post_content) . pledit($bpost->ID)); ?> </div> </div> </div> </div> <div class="banner-media pprand" style="width:<?php echo $banner_media_width; ?> %;" > <div class="banner-media-pad pprand-pad"> <?php echo do_shortcode(self::_get_banner_media($oset)); ?> </div> </div> <div class="clear"></div> </div> <?php } ?> </div><div class="clear"></div> <?php }
/** * Section template. */ function section_template() { $call_title = ploption('pagelines_callout_header', $this->tset); $call_sub = ploption('pagelines_callout_subheader', $this->tset); $call_img = ploption('pagelines_callout_image', $this->oset); $call_link = ploption('pagelines_callout_button_link', $this->tset); $call_btext = ploption('pagelines_callout_button_text', $this->tset); $call_btheme = ploption('pagelines_callout_button_theme', $this->tset); $target = ploption('pagelines_callout_button_target', $this->oset) ? 'target="_blank"' : ''; $call_action_text = ploption('pagelines_callout_action_text', $this->oset) ? ploption('pagelines_callout_action_text', $this->oset) : __('Start Here', 'pagelines'); $styling_class = $call_sub ? 'with-callsub' : ''; $alignment = ploption('pagelines_callout_align', $this->oset); $call_align = $alignment == 'left' ? '' : 'rtimg'; if ($call_title || $call_img) { ?> <?php if ($alignment == 'center') { ?> <div class="callout-area fix callout-center <?php echo $styling_class; ?> "> <div class="callout_text"> <div class="callout_text-pad"> <?php $this->draw_text($call_title, $call_sub, $call_img); ?> </div> </div> <div class="callout_action <?php echo $call_align; ?> "> <?php $this->draw_action($call_link, $target, $call_img, $call_btheme, $call_btext); ?> </div> </div> <?php } else { ?> <div class="callout-area media fix <?php echo $styling_class; ?> "> <div class="callout_action img <?php echo $call_align; ?> "> <?php $this->draw_action($call_link, $target, $call_img, $call_btheme, $call_btext); ?> </div> <div class="callout_text bd"> <div class="callout_text-pad"> <?php $this->draw_text($call_title, $call_sub, $call_img); ?> </div> </div> </div> <?php } } else { echo setup_section_notify($this, __('Set Callout page options to activate.', 'pagelines')); } }
function section_template($clone_id = null) { $carousel_class = isset($clone_id) && $clone_id != 1 ? 'crsl' . $clone_id : 'crsl'; // Set Up Variables $carouselitems = ploption('carousel_items', $this->oset) ? ploption('carousel_items', $this->oset) : 30; $carousel_post_id = ploption('carousel_post_id', $this->oset) ? ploption('carousel_post_id', $this->oset) : null; $carousel_image_width = ploption('carousel_image_width', $this->oset) ? ploption('carousel_image_width', $this->oset) : 64; $carousel_image_height = ploption('carousel_image_height', $this->oset) ? ploption('carousel_image_height', $this->oset) : 64; $cmode = ploption('carousel_mode', $this->oset) ? ploption('carousel_mode', $this->oset) : null; $ngen_id = ploption('carousel_ngen_gallery', $this->oset) ? ploption('carousel_ngen_gallery', $this->oset) : 1; if ($cmode == 'flickr' && !function_exists('get_flickrRSS') || $cmode == 'ngen_gallery' && !function_exists('nggDisplayRandomImages')) { echo setup_section_notify($this, __("The <strong>plugin</strong> for the selected carousel mode needs to be activated (FlickrRSS or NextGen Gallery).", 'pagelines'), admin_url() . 'plugins.php', 'Setup Plugin'); } else { ?> <div class="<?php echo $carousel_class; ?> thecarousel"> <ul id="mycarousel" class="mycarousel"> <?php if (function_exists('nggDisplayRandomImages') && $cmode == 'ngen_gallery') { echo do_shortcode('[nggallery id=' . $ngen_id . ' template=plcarousel]'); } elseif (function_exists('get_flickrRSS') && $cmode == 'flickr') { if (!function_exists('get_and_delete_option')) { // fixes instantiation within the function in the plugin :/ get_flickrRSS(array('num_items' => $carouselitems, 'html' => '<li><a href="%flickr_page%" title="%title%"><img src="%image_square%" alt="%title%"/><span class="list-title">%title%</span></a></li>')); } } elseif ($cmode == 'hook') { pagelines_register_hook('pagelines_carousel_list'); } else { $carousel_post_query = 'numberposts=' . $carouselitems; if ($carousel_post_id) { $carousel_post_query .= '&category_name=' . $carousel_post_id; } $recentposts = get_posts($carousel_post_query); foreach ($recentposts as $cid => $c) { $a = array(); if (has_post_thumbnail($c->ID)) { $img_data = wp_get_attachment_image_src(get_post_thumbnail_id($c->ID)); $a['img'] = $img_data[0] != '' ? $img_data[0] : $this->base_url . '/post-blank.jpg'; $a['width'] = $img_data[1]; $a['height'] = $img_data[2]; } else { $a['img'] = $this->base_url . '/post-blank.jpg'; $a['width'] = 100; $a['height'] = 100; } $args = array('title' => $c->post_title, 'link' => get_permalink($c->ID), 'img' => $a['img'], 'maxheight' => $carousel_image_height, 'maxwidth' => $carousel_image_width, 'height' => $a['height'], 'width' => $a['width']); echo $this->carousel_item($args); } } ?> </ul> </div> <?php } }
/** * * @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; }
/** * * @TODO document * */ function post_meta_setup() { $pt_tab_options = array('feature_styling' => array('type' => 'multi_option', 'title' => __('Feature Design Style', 'pagelines'), 'shortexp' => __('The basic styling of the feature', 'pagelines'), 'selectvalues' => array('feature-style' => array('type' => 'select', 'inputlabel' => __('Feature Text Position', 'pagelines'), 'selectvalues' => array('text-left' => array('name' => __('Text On Left', 'pagelines')), 'text-right' => array('name' => __('Text On Right', 'pagelines')), 'text-bottom' => array('name' => __('Text On Bottom', 'pagelines')), 'text-none' => array('name' => __('Full Width Background Image - No Text - Links Entire BG', 'pagelines')))), 'feature-design' => array('type' => 'select', 'inputlabel' => __('Feature Design Style', 'pagelines'), 'selectvalues' => array('fstyle-darkbg-overlay' => array('name' => __('White Text - Dark Feature Background - Transparent Text Overlay (Default)', 'pagelines')), 'fstyle-lightbg' => array('name' => __('Black Text - Light Feature Background with Border - No Overlay', 'pagelines')), 'fstyle-darkbg' => array('name' => __('White Text - Dark Feature Background - No Overlay', 'pagelines')), 'fstyle-nobg' => array('name' => __('Black Text - No Feature Background - No Overlay', 'pagelines')))))), 'feature_media_stuff' => array('type' => 'multi_option', 'title' => __('Feature Media', 'pagelines'), 'shortexp' => __('The media that the feature will use', 'pagelines'), 'selectvalues' => array('feature-background-image' => array('inputlabel' => __('Full Size - Feature Background Image', 'pagelines'), 'type' => 'image_upload'), 'feature-media-image' => array('version' => 'pro', 'type' => 'image_upload', 'inputlabel' => __('Media Area - Image (optional)', 'pagelines')), 'feature-media' => array('version' => 'pro', 'type' => 'textarea', 'inputlabel' => __('Feature HTML (video embeds etc, In Media Area)', 'pagelines')), 'feature-media-full' => array('version' => 'pro', 'type' => 'check', 'inputlabel' => __('Make Feature HTML Full Width', 'pagelines')), 'feature-thumb' => array('inputlabel' => __('Thumb Navigation - Upload Feature Thumbnail (50px by 30px)', 'pagelines'), 'type' => 'image_upload'), 'feature-name' => array('default' => '', 'inputlabel' => __('Names Navigation - Enter Text', 'pagelines'), 'type' => 'text'))), 'feature-link-url' => array('shortexp' => __('Adding a URL here will add a link to your feature slide', 'pagelines'), 'title' => __('Feature Link URL', 'pagelines'), 'label' => __('Enter Feature Link URL', 'pagelines'), 'type' => 'text', 'exp' => __('Adds a More link to your text. If you have Full Width Background Image mode selected, the entire slide will be linked.', 'pagelines')), 'feature-link-text' => array('default' => 'More', 'shortexp' => __('Enter the text you would like in your feature link', 'pagelines'), 'title' => __('Link Text', 'pagelines'), 'label' => __('Enter Feature Link Text', 'pagelines'), 'type' => 'text', 'size' => 'small')); $posts_mode = ploption('posts_feature_control') ? true : false; // Add options for correct post type. $post_types = $posts_mode ? array($this->ptID, 'post') : array($this->ptID); $pt_panel = array('id' => 'feature-metapanel', 'name' => __('Feature Setup Options', 'pagelines'), 'posttype' => $post_types, 'hide_tabs' => true); $pt_panel = new PageLinesMetaPanel($pt_panel); $pt_tab = array('id' => 'feature-type-metatab', 'name' => __('Feature Setup Options', 'pagelines'), 'icon' => $this->icon); $pt_panel->register_tab($pt_tab, $pt_tab_options); }
<?php pagelines_template_area('pagelines_sidebar1', 'sidebar1'); // Hook ?> </div> </div> <?php } if ($pagelines_layout->num_columns == 3) { ?> <div id="sidebar2" class="scolumn"> <div class="scolumn-pad"> <?php pagelines_template_area('pagelines_sidebar2', 'sidebar2'); // Hook ?> </div> </div> <?php } if (ploption('sidebar_wrap_widgets') == 'bottom') { pagelines_template_area('pagelines_sidebar_wrap', 'sidebar_wrap'); // Hook } ?> </div> <?php } pagelines_register_hook('pagelines_after_sidebar_wrap'); // Hook }
/** * Backports from v3. Wrapper for ploption. * * ploption * $this->opt * ... * * @package PageLines Framework * @subpackage Sections * @since 2.4.2 * * @param $key * @param $oset - @since 2.4.5.2 */ function opt($key, $oset = false) { $o = is_array($oset) ? $oset : array(); if (isset($this->oset) && is_array($this->oset)) { $o = array_merge($this->oset, $o); } return ploption($key, $o); }
// Load admin only functions from sections do_global_meta_options(); // Load the global meta settings tab /** * Build Version */ require_once PL_INCLUDES . '/version.php'; require_once PL_INCLUDES . '/class.render.css.php'; if (defined('WP_CLI') && WP_CLI) { require_once PL_INCLUDES . '/cli.commands.php'; } /** * Load site actions */ require_once PL_INCLUDES . '/actions.site.php'; if (ploption('enable_debug')) { require_once PL_ADMIN . '/class.debug.php'; } /** * Run the pagelines_init Hook */ pagelines_register_hook('pagelines_hook_init'); // Hook if (is_admin()) { include PL_ADMIN . '/init.admin.php'; } /** * Load updater class */ //require_once (PL_ADMIN.'/class.updates.php'); //
/** * * @TODO document * */ function draw_boxes($p, $args) { setup_postdata($p); $oset = array('post_id' => $p->ID); $box_link = plmeta('the_box_icon_link', $oset); $box_icon = plmeta('the_box_icon', $oset); $box_target = plmeta('the_box_icon_target', $oset) ? 'target="_blank"' : ''; $class = plmeta('box_class', $oset) ? plmeta('box_class', $oset) : null; $image = $box_icon ? self::_get_box_image($p, $box_icon, $box_link, $this->thumb_size, $box_target) : ''; $title_text = $box_link ? sprintf('<a %s href="%s">%s</a>', $box_target, $box_link, $p->post_title) : $p->post_title; $title = do_shortcode(sprintf('<div class="fboxtitle"><h3>%s</h3></div>', $title_text)); if (plmeta('box_more_text', $oset)) { $more_text = plmeta('box_more_text', $oset); } elseif (ploption('box_more_text', $this->oset)) { $more_text = ploption('box_more_text', $this->oset); } else { $more_text = false; } $more_link = $box_link && $more_text ? sprintf('<span class="fboxmore-wrap"><a class="fboxmore" href="%s" %s>%s</a></span>', $box_link, $box_target, $more_text) : ''; $more_link = apply_filters('box_more_link', $more_link); $content = sprintf('<div class="fboxtext">%s %s %s</div>', do_shortcode($p->post_content), pledit($p->ID), $more_link); $info = $this->thumb_type != 'only_thumbs' ? sprintf('<div class="fboxinfo fix bd">%s%s</div>', $title, $content) : ''; return sprintf('<div id="%s" class="fbox %s"><div class="media box-media %s"><div class="blocks box-media-pad">%s%s</div></div></div>', 'fbox_' . $p->ID, $class, $this->thumb_type, $image, $info); }
/** * * @TODO document * */ function _get_background_image_control($oid, $o) { $bg = $this->_background_image_array(); $oset = array('post_id' => $o['pid'], 'setting' => $this->settings_field); // set value, id, name foreach ($bg as $k => $i) { $bgid = $oid . $k; if ($this->settings_field == 'meta') { $bg[$k]['val'] = plmeta($bgid, $oset); $bg[$k]['input_name'] = $bgid; $bg[$k]['input_id'] = get_pagelines_option_id($bgid); } elseif ($this->settings_field == PAGELINES_SPECIAL) { $oset['subkey'] = $bgid; $bg[$k]['val'] = ploption($o['special'], $oset); $bg[$k]['input_name'] = plname($o['special'], $oset); $bg[$k]['input_id'] = plid($o['special'], $oset); } else { $bg[$k]['val'] = ploption($bgid, $oset); $bg[$k]['input_id'] = plid($bgid, $oset); $bg[$k]['input_name'] = plname($bgid, $oset); } $bg[$k] = wp_parse_args($bg[$k], $o); } $this->_get_image_upload_option($oid . '_url', $bg['_url']); $this->_get_select_option($oid . '_repeat', $bg['_repeat']); $this->_get_count_select_option($oid . '_pos_vert', $bg['_pos_vert']); $this->_get_count_select_option($oid . '_pos_hor', $bg['_pos_hor']); $this->_get_select_option($oid . '_attach', $bg['_attach']); }
/** * Backports from v3. Wrapper for ploption. * * @package PageLines Framework * @subpackage Sections * @since 2.4.2 * * @param $option */ function opt($option) { if (isset($this->oset)) { return ploption($option, $this->oset); } else { return ploption($option); } }
function grid($data, $args = array()) { $defaults = array('data' => 'query', 'per_row' => 3, 'format' => 'img_grid', 'paged' => false, 'has_img' => true, 'image_field' => false, 'img_default' => null, 'img_width' => '100%', 'title' => '', 'title_link' => '', 'class' => 'pagelines-grid', 'row_class' => 'gridrow', 'content_len' => 10, 'callback' => false, 'margin' => true, 'hovercard' => false); $a = wp_parse_args($args, $defaults); if ($a['data'] == 'users' || $a['data'] == 'array_callback') { $posts = $data; } else { // The Query global $wp_query; $wp_query = $data; $posts = $data->posts; if (!is_array($posts)) { return; } } // Standard Variables $out = ''; $total = count($posts); $count = 1; $default_img = isset($a['img_default']) ? sprintf('<img src="%s" alt="%s"/>', $a['img_default'], __('No Image', 'pagelines')) : ''; $margin_class = $a['margin'] ? '' : 'ppfull'; if ($a['hovercard']) { $out .= pl_js_wrap(sprintf('jQuery(".vignette").hover(function(){jQuery(this).find(".hovercard").fadeIn();}, function(){jQuery(this).find(".hovercard").fadeOut();});')); } // Grid loop foreach ($posts as $pid => $p) { // Grid Stuff $start = grid_row_start($count, $total, $a['per_row']) ? sprintf('<div class="pprow grid-row fix %s">', $margin_class) : ''; $end = grid_row_end($count, $total, $a['per_row']) ? '</div>' : ''; $last_class = grid_row_end($count, $total, $a['per_row']) ? 'pplast' : ''; // Content $content = ''; if ($a['callback']) { $content = call_user_func($a['callback'], $p, $a); } else { setup_postdata($p); $oset = array('post_id' => $p->ID); // The Image if ($a['image_field'] && ploption($a['image_field'], $oset)) { $thumb = sprintf('<img src="%s" alt="thumb" />', ploption($a['image_field'], $oset)); } elseif (has_post_thumbnail($p->ID)) { $thumb = get_the_post_thumbnail($p->ID); } else { $thumb = $default_img; } $hovercard = $a['hovercard'] ? sprintf('<div class="hovercard"><span>%s</span></div>', $p->post_title) : ''; $image = sprintf('<a href="%s" class="img grid-img" style="width: %s"><div class="grid-img-pad"><div class="grid-img-frame"><div class="vignette">%s%s</div></div></div></a>', get_permalink($p->ID), $a['img_width'], $thumb, $hovercard); $content .= $image; // Text if ($a['format'] == 'media') { $content .= sprintf('<div class="bd grid-content"><h4><a href="%s">%s</a></h4> <p>%s %s %s</p></div>', get_permalink($p->ID), $p->post_title, custom_trim_excerpt($p->post_content, $a['content_len']), sprintf('<a href="%s" >More →</a>', get_permalink($p->ID)), pledit($p->ID)); } } // Column Box Wrapper $out .= sprintf('%s<div class="grid-element pp%s %s %s"><div class="grid-element-pad">%s</div></div>%s', $start, $a['per_row'], $a['format'], $last_class, $content, $end); $count++; } if ($a['paged']) { ob_start(); pagelines_pagination(); $pages = ob_get_clean(); } else { $pages = ''; } $title_link = $a['title_link'] != '' ? sprintf('<a href="%s" class="button title-link">See All</a>', $a['title_link']) : ''; $title = $a['title'] != '' ? sprintf('<div class="grid-title"><div class="grid-title-pad fix"><h4 class="gtitle">%s</h4>%s</div></div>', $a['title'], $title_link) : ''; $wrap = sprintf('<div class="plgrid %s"><div class="plgrid-pad">%s%s%s</div></div>', $a['class'], $title, $out, $pages); return $wrap; }
/** * Whether or not uncompressed styles should be served. * @return [type] [description] */ public static function serve_pristine() { return defined('SCRIPT_DEBUG') && SCRIPT_DEBUG || is_pl_debug() || !ploption('pl_minify'); }
function pagelines_show_clip($count, $paged) { if (!VPRO) { return false; } $archives = apply_filters('pagelines_full_width_archives', false); if ((is_home() || $archives) && ploption('blog_layout_mode') == 'magazine' && $count <= ploption('full_column_posts') && $paged == 0) { return false; } elseif (ploption('blog_layout_mode') != 'magazine') { return false; } elseif (is_page() || is_single()) { return false; } else { return true; } }
private static function get_purge_key() { return ploption(self::PL_OPT_KEY); }