Exemplo n.º 1
0
 function section_persistent()
 {
     $header_options = array('navbar_fixed' => array('default' => false, 'version' => 'pro', 'type' => 'check', 'inputlabel' => __('Enable Fixed Navigation Bar', 'pagelines'), 'title' => __('Enable Fixed Navigation Bar', 'pagelines'), 'shortexp' => __('Applies a fixed navigation bar to the top of your site', 'pagelines'), 'exp' => __('Use this feature to add the NavBar section as a fixed navigation bar on the top of your site.', 'pagelines')), 'navbar_logo' => array('default' => $this->base_url . '/logo.png', 'version' => 'pro', 'type' => 'image_upload', 'inputlabel' => __('Fixed NavBar Logo', 'pagelines'), 'title' => __('Fixed NavBar - NavBar Logo', 'pagelines'), 'shortexp' => __('Applies a fixed navigation bar to the top of your site', 'pagelines'), 'exp' => __('Use this feature to add the NavBar section as a fixed navigation bar on the top of your site.<br/><br/><strong>Notes:</strong> <br/>1. Only visible in Fixed Mode.<br/>2. Image Height is constricted to a maximum 29px.', 'pagelines')), 'navbar_multi_option_theme' => array('default' => '', 'type' => 'multi_option', 'selectvalues' => array('fixed_navbar_theme' => array('default' => 'black-trans', 'type' => 'select', 'inputlabel' => __('Fixed NavBar - Select Theme', 'pagelines'), 'selectvalues' => array('black-trans' => array('name' => __('Black Transparent (Default)', 'pagelines')), 'blue' => array('name' => __('Blue', 'pagelines')), 'grey' => array('name' => __('Light Grey', 'pagelines')), 'orange' => array('name' => __('Orange', 'pagelines')), 'red' => array('name' => __('Red', 'pagelines')))), 'navbar_theme' => array('default' => 'black-trans', 'type' => 'select', 'inputlabel' => __('Standard NavBar - Select Theme', 'pagelines'), 'selectvalues' => array('black-trans' => array('name' => __('Black Transparent (Default)', 'pagelines')), 'blue' => array('name' => __('Blue', 'pagelines')), 'grey' => array('name' => __('Light Grey', 'pagelines')), 'orange' => array('name' => __('Orange', 'pagelines')), 'red' => array('name' => __('Red', 'pagelines'))))), 'title' => __('NavBar and Fixed NavBar Theme', 'pagelines'), 'shortexp' => __('Select the color and theme of the NavBar', 'pagelines'), 'exp' => __('The NavBar comes with several color options. Select one to automatically configure.', 'pagelines')), 'navbar_multi_option_menu' => array('default' => '', 'type' => 'multi_option', 'selectvalues' => array('fixed_navbar_menu' => array('default' => 'black-trans', 'type' => 'select_menu', 'inputlabel' => __('Fixed NavBar - Select Menu', 'pagelines')), 'navbar_menu' => array('default' => 'black-trans', 'type' => 'select_menu', 'inputlabel' => __('Standard NavBar - Select Menu', 'pagelines'))), 'title' => __('NavBar and Fixed NavBar Menu', 'pagelines'), 'shortexp' => __('Select the WordPress Menu for the NavBar(s)', 'pagelines'), 'exp' => __('The NavBar uses WordPress menus. Select one for use.', 'pagelines')), 'navbar_multi_check' => array('default' => '', 'type' => 'check_multi', 'selectvalues' => array('navbar_enable_hover' => array('inputlabel' => __('Activate dropdowns on hover.', 'pagelines')), 'fixed_navbar_alignment' => array('inputlabel' => __('Fixed NavBar - Align Menu Right? (Defaults Left)', 'pagelines')), 'fixed_navbar_hidesearch' => array('inputlabel' => __('Fixed NavBar - Hide Searchform?', 'pagelines')), 'navbar_alignment' => array('inputlabel' => __('Standard NavBar - Align Menu Right? (Defaults Left)', 'pagelines')), 'navbar_hidesearch' => array('inputlabel' => __('Standard NavBar - Hide Searchform?', 'pagelines'))), 'inputlabel' => __('Configure Options for NavBars', 'pagelines'), 'title' => __('NavBar and Fixed NavBar Configuration Options', 'pagelines'), 'shortexp' => __('Control various appearance options for the NavBars', 'pagelines'), 'exp' => ''), 'navbar_title' => array('type' => 'text', 'inputlabel' => __('NavBar Title', 'pagelines'), 'title' => __('NavBar Title', 'pagelines'), 'shortexp' => __('Applies text to NavBar on small screens. Not available on Fixed NavBar', 'pagelines'), 'exp' => __('Add text to the NavBar to serve as a title, but only displayed on small screens.', 'pagelines')));
     $option_args = array('name' => 'NavBar', 'array' => $header_options, 'icon' => $this->icon, 'position' => 6);
     pl_add_options_page($option_args);
     //pl_global_option( array( 'menu' => 'header_and_footer', 'options' => $header_options, 'location' => 'top' ) );
     if (ploption('navbar_fixed')) {
         build_passive_section(array('sid' => $this->class_name));
         add_action('pagelines_before_page', create_function('', 'echo pl_source_comment("Fixed NavBar Section");'));
         add_action('pagelines_before_page', array(&$this, 'passive_section_template'), 10, 2);
         pagelines_add_bodyclass('navbar_fixed');
     }
 }
Exemplo n.º 2
0
 function process_styles()
 {
     wp_enqueue_style('open-sans', '//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=latin-ext,latin', false, '20130605');
     if (pl_draft_mode()) {
         pagelines_add_bodyclass('pl-editor');
     }
     $this->handler->process_styles();
 }
Exemplo n.º 3
0
 function process_styles()
 {
     if (pl_draft_mode()) {
         pagelines_add_bodyclass('pl-editor');
     }
     $this->handler->process_styles();
 }
Exemplo n.º 4
0
 function parse_config()
 {
     $clone_was_set = false;
     foreach ($this->map as $region => &$g) {
         if (!isset($g) || !is_array($g) || empty($g)) {
             $g = array(array('object' => 'PLSectionArea'));
         }
         foreach ($g as $area => &$a) {
             // If object isn't set, create blank section area
             if (!isset($a['object']) || !$a['object']) {
                 $a['object'] = 'PLSectionArea';
             }
             // If no ID, set up as new section
             if (!isset($a['clone'])) {
                 $a['clone'] = $this->load_new_section_from_map($a);
                 $clone_was_set = true;
             }
             $a = wp_parse_args($a, $this->meta_defaults($area));
             $a['set'] = $this->get_section_settings($a['clone']);
             $a['draw'] = 'area';
             $this->section_list[] = $a;
             $this->section_list_unique[$a['object']] = $a;
             if (!isset($a['content']) || !is_array($a['content'])) {
                 continue;
             }
             foreach ($a['content'] as $key => &$meta) {
                 if (!isset($meta['clone'])) {
                     $meta['clone'] = $this->load_new_section_from_map($meta);
                     $clone_was_set = true;
                 }
                 $meta = wp_parse_args($meta, $this->meta_defaults($key));
                 $meta['set'] = $this->get_section_settings($meta['clone']);
                 $meta['draw'] = 'content';
                 if (!empty($meta['content'])) {
                     foreach ($meta['content'] as $subkey => &$sub_meta) {
                         if (!isset($sub_meta['clone'])) {
                             $sub_meta['clone'] = $this->load_new_section_from_map($sub_meta);
                             $clone_was_set = true;
                         }
                         $sub_meta = wp_parse_args($sub_meta, $this->meta_defaults($subkey));
                         $sub_meta['set'] = $this->get_section_settings($sub_meta['clone']);
                         $sub_meta['draw'] = 'content';
                         $this->section_list[] = $sub_meta;
                         $this->section_list_unique[$sub_meta['object']] = $sub_meta;
                     }
                     unset($sub_meta);
                     // set by reference
                     $this->section_list[] = $meta;
                     $this->section_list_unique[$meta['object']] = $meta;
                 } else {
                     $this->section_list[] = $meta;
                     $this->section_list_unique[$meta['object']] = $meta;
                 }
             }
             unset($meta);
             // set by reference
         }
         unset($a);
         // set by reference
     }
     // This sets a map for the page, if it isn't set with new clone IDs the options wont
     // work until a user action causes the map to be saved, non-ideal
     if ($clone_was_set) {
         pagelines_add_bodyclass('pl-save-map-on-load');
     }
 }
Exemplo n.º 5
0
function load_prettify()
{
    pagelines_add_bodyclass('prettify-on');
    wp_enqueue_script('prettify', PL_JS . '/prettify/prettify.js');
    wp_enqueue_style('prettify', PL_JS . '/prettify/prettify.css');
    add_action('wp_head', create_function('', 'echo pl_js_wrap("prettyPrint()");'), 14);
}
Exemplo n.º 6
0
function pagelines_head_common()
{
    global $pagelines_ID;
    $oset = array('post_id' => $pagelines_ID);
    pagelines_register_hook('pagelines_code_before_head');
    // Hook
    printf('<meta http-equiv="Content-Type" content="%s; charset=%s" />', get_bloginfo('html_type'), get_bloginfo('charset'));
    pagelines_source_attribution();
    // // Auto handle wp_title, added in WP 4.1
    if (!function_exists('_wp_render_title_tag')) {
        printf('<title>%s</title>', wp_title('', false));
    }
    // Allow for extension deactivation of all css
    if (!has_action('override_pagelines_css_output')) {
        // RTL Language Support
        // wordpress autoloads from child theme so if child theme has no rtl we need to load ours.
        if (is_rtl() && is_child_theme() && !is_file(sprintf('%s/rtl.css', get_stylesheet_directory())) || is_rtl() && !is_child_theme()) {
            add_action('wp_print_styles', create_function('', 'pagelines_load_css_relative( "rtl.css", "pagelines-rtl" );'), 99);
        }
    }
    if (pl_setting('facebook_headers') && !has_action('disable_facebook_headers') && VPRO) {
        pagelines_facebook_header();
    }
    if (pl_setting('load_prettify_libs')) {
        pagelines_add_bodyclass('prettify-on');
        wp_enqueue_script('prettify', PL_JS . '/prettify/prettify.min.js');
        wp_enqueue_style('prettify', PL_JS . '/prettify/prettify.css');
        add_action('wp_head', create_function('', 'echo pl_js_wrap("prettyPrint()");'), 14);
    }
    add_action('wp_head', create_function('', 'echo pl_source_comment("Start >> Meta Tags and Inline Scripts", 2);'), 0);
    add_action('wp_print_styles', create_function('', 'echo pl_source_comment("Styles");'), 0);
    add_action('wp_print_scripts', create_function('', 'echo pl_source_comment("Scripts");'), 0);
    add_action('wp_print_footer_scripts', create_function('', 'echo pl_source_comment("Footer Scripts");'), 0);
    add_action('admin_bar_menu', create_function('', 'echo pl_source_comment("WordPress Admin Bar");'), 0);
    add_action('wp_head', 'pagelines_meta_tags', 9);
    add_action('wp_head', 'pl_scripts_on_ready', 10);
    // Headerscripts option > custom code
    if (pl_setting('headerscripts') && pl_setting('headerscripts') != default_headerscript()) {
        add_action('wp_head', create_function('', 'print_pagelines_option("headerscripts");'), 25);
    }
    if (pl_setting('asynch_analytics')) {
        add_action('pagelines_head_last', create_function('', 'echo pl_setting("asynch_analytics");'), 25);
    }
}
Exemplo n.º 7
0
    function section_head()
    {
        $fixpos = $this->opt('ba_fotos_nav_nav_mode');
        $dropup = 'fotos-nav-fixed-bott' == $fixpos ? true : 0;
        $id = $this->get_the_id();
        $margin = pl_setting('ba_fotos_nav_margin');
        ?>
<script>
			jQuery(window).load(function(){

				jQuery('.fotos-nav-menu.fotos-nav-menu-<?php 
        echo $this->get_the_id();
        ?>
').smartmenus({
					bottomToTopSubMenus:<?php 
        echo $dropup;
        ?>
				});

				<?php 
        if ('fotos-nav-fixed-top' == $fixpos) {
            ?>
					adminbar = jQuery('#wpadminbar').height();
					jQuery('#fotos-navigation<?php 
            echo $id;
            ?>
').css({'top':adminbar});
				<?php 
        } elseif ('fotos-nav-fixed-bott' == $fixpos) {
            ?>
					toolbar = jQuery('#PageLinesToolbox').height();
					jQuery('#fotos-navigation<?php 
            echo $id;
            ?>
').css({'bottom':toolbar});
				<?php 
        } else {
            ?>
					return false;
				<?php 
        }
        ?>
			});
		</script><?php 
        if ($fixpos) {
            $top = 'fotos-nav-fixed-top' == $fixpos ? 'fotos-nav-fixed fotos-nav-fixed-top' : false;
            $top .= 'fotos-nav-fixed-bott' == $fixpos ? 'fotos-nav-fixed fotos-nav-fixed-bottom' : false;
            $top .= 'fotos-nav-vert-mode' == $fixpos ? 'fotos-nav-vert-mode' : false;
            pagelines_add_bodyclass($top);
        }
        if ($margin) {
            ?>
			<style>
			.fotos-nav-menu {
				margin:<?php 
            echo $margin;
            ?>
			}
			</style>
		<?php 
        }
    }