예제 #1
0
/**
 *
 * @TODO document
 *
 */
function pagelines_theme_settings_scripts()
{
    // Add Body Class
    add_filter('admin_body_class', 'pagelines_admin_body_class');
    wp_enqueue_script('jquery-ajaxupload', PL_ADMIN_JS . '/jquery.ajaxupload.js', array('jquery'), PL_CORE_VERSION);
    wp_enqueue_script('jquery-cookie', PL_ADMIN_JS . '/jquery.ckie.js', array('jquery'), PL_CORE_VERSION);
    wp_enqueue_script('jquery-ui-core');
    wp_enqueue_script('jquery-ui-tabs');
    wp_enqueue_script('jquery-ui-dialog');
    wp_enqueue_script('script-pagelines-settings', PL_ADMIN_JS . '/script.settings.js', array('jquery'), PL_CORE_VERSION);
    wp_enqueue_script('jquery-ui-effects', PL_ADMIN_JS . '/jquery.effects.js', array('jquery'), PL_CORE_VERSION);
    // just has highlight effect
    wp_enqueue_script('jquery-ui-draggable');
    wp_enqueue_script('jquery-ui-sortable');
    wp_enqueue_script('script-pagelines-common', PL_ADMIN_JS . '/script.common.js', array('jquery'), PL_CORE_VERSION);
    // Prettify
    wp_enqueue_script('codemirror', PL_ADMIN_JS . '/codemirror/codemirror.js', array('jquery'), PL_CORE_VERSION);
    wp_enqueue_script('codemirror-css', PL_ADMIN_JS . '/codemirror/css/css.js', array('jquery'), PL_CORE_VERSION);
    wp_enqueue_script('codemirror-less', PL_ADMIN_JS . '/codemirror/less/less.js', array('jquery'), PL_CORE_VERSION);
    wp_enqueue_script('codemirror-js', PL_ADMIN_JS . '/codemirror/javascript/javascript.js', array('jquery'), PL_CORE_VERSION);
    wp_enqueue_script('codemirror-xml', PL_ADMIN_JS . '/codemirror/xml/xml.js', array('jquery'), PL_CORE_VERSION);
    wp_enqueue_script('codemirror-html', PL_ADMIN_JS . '/codemirror/htmlmixed/htmlmixed.js', array('jquery'), PL_CORE_VERSION);
    wp_enqueue_style('codemirror', PL_ADMIN_JS . '/codemirror/codemirror.css');
    // Color Picker
    wp_enqueue_script('colorpicker-js', PL_ADMIN_JS . '/colorpicker/js/colorpicker.js', array('jquery'), PL_CORE_VERSION);
    wp_enqueue_style('colorpicker', PL_ADMIN_JS . '/colorpicker/css/colorpicker.css');
    wp_enqueue_script('jquery-colorbox', PL_ADMIN_JS . '/colorbox/jquery.colorbox-min.js', array('jquery'), PL_CORE_VERSION);
    wp_enqueue_style('colorbox', PL_ADMIN_JS . '/colorbox/colorbox.css');
    wp_enqueue_script('thickbox');
    wp_enqueue_style('thickbox');
    wp_enqueue_script('jquery-layout', PL_ADMIN_JS . '/jquery.layout.js', array('jquery'), PL_CORE_VERSION);
    // PageLines CSS objects
    pagelines_load_css_relative('css/objects.css', 'pagelines-objects');
    $custom_css = array('lineNumbers' => true, 'mode' => 'text/x-less', 'lineWrapping' => true);
    $headers = array('lineNumbers' => true, 'mode' => 'text/html', 'lineWrapping' => true);
    wp_localize_script('script-pagelines-common', 'cm_customcss', apply_filters('pagelines_customcss_cm_options', $custom_css));
    wp_localize_script('script-pagelines-common', 'cm_headers', apply_filters('pagelines_headerscripts_cm_options', $headers));
}
/**
 * PageLines <head> Includes
 *
 */
function pagelines_head_common(){
	
	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_title_tag();
	
	if(!VDEV)
		echo "<!-- Platform WordPress Framework By PageLines - www.PageLines.com -->\n";
		
	/*
		Meta Images
	*/
	if(pagelines_option('pagelines_favicon'))
		printf('<link rel="shortcut icon" href="%s" type="image/x-icon" />%s', pagelines_option('pagelines_favicon'), "\n");
	
	if(pagelines_option('pagelines_touchicon'))
		printf('<link rel="apple-touch-icon" href="%s" />%s', pagelines_option('pagelines_touchicon'), "\n");

	if(!apply_filters( 'pagelines_xfn', '' ))
		echo '<link rel="profile" href="http://gmpg.org/xfn/11" />'."\n";

	
	// bbPress Header... doesn't support hooks, or they need to be reloaded.
	if( pagelines_bbpress_forum() ){ 			
		pagelines_load_css( bb_get_stylesheet_uri(), 'pagelines-bbpress', CORE_VERSION);
		bb_feed_head();
		bb_head(); 
	}

	// Get Pro Styles
	if(VPRO)
		pagelines_load_css_relative('pro/pro.css', 'pagelines-pro');
	
	// Get Main Styles

	pagelines_load_css(  get_bloginfo('stylesheet_url'), 'pagelines-stylesheet', pagelines_get_style_ver());

	// RTL Language Support
	if(is_rtl()) 
		pagelines_load_css_relative( 'rtl.css', 'pagelines-rtl');
	
	// Queue Common Javascript Libraries
	wp_enqueue_script("jquery"); 
	
	// Fix IE and special handling
	pagelines_fix_ie();
	
	// Cufon replacement 
	pagelines_font_replacement();
	
	// Headerscripts option > custom code
	print_pagelines_option('headerscripts'); // Header Scripts Input Option
}
예제 #3
0
/**
 * PageLines <head> Includes
 *
 */
function pagelines_head_common()
{
    global $pagelines_ID;
    $oset = array('post_id' => $pagelines_ID);
    pagelines_register_hook('pagelines_code_before_head');
    // Hook
    //pagelines_source_attribution();
    // Allow for extension deactivation of all css
    if (!has_action('override_pagelines_css_output')) {
        // Multisite CSS
        if (is_multisite()) {
            pagelines_load_css_relative('css/multisite.css', 'pagelines-multisite');
        }
        // Allow for PHP include of Framework CSS
        //		if( !apply_filters( 'disable_pl_framework_css', '' ) )
        //			pagelines_load_css(  PL_PARENT_URL.'/style.css', 'pagelines-framework', pagelines_get_style_ver( true ));
        // 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 (ploption('facebook_headers') && !has_action('disable_facebook_headers') && VPRO) {
        pagelines_facebook_header();
    }
    // Fix IE and special handling
    if (pl_detect_ie()) {
        pagelines_fix_ie();
    }
    // Cufon replacement
    pagelines_font_replacement();
    if (ploption('load_prettify_libs')) {
        load_prettify();
    }
    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 (ploption('headerscripts')) {
        add_action('wp_head', create_function('', 'print_pagelines_option("headerscripts");'), 25);
    }
    if (ploption('asynch_analytics')) {
        add_action('pagelines_head_last', create_function('', 'echo ploption("asynch_analytics");'), 25);
    }
}