public function template_footer() {
		// custom CSS
		if (!empty($this->settings['custom_css'])) {
			echo '<style type="text/css">'.$this->settings['custom_css'].'</style>';
		}

		// footer code
		echo $this->settings['footer_code'];
		
		if ( ! $this->is_editor() ) return; // below scripts only needed when in editor mode

		echo '<link rel="stylesheet" href="'.WPLAUNCHER_URI.'css/wplauncher-editor.css">';
		echo '<link rel="stylesheet" href="'.WPLAUNCHER_URI.'css/wplauncher-admin.css">'; // some admin bar css is in there

		// color picker
		echo '<script>var wpColorPickerL10n = {"clear":"'.__('Clear', $this->plugin_slug).'","defaultString":"Default","pick":"Select Color","current":"Current Color"};</script>';
		echo '<link rel="stylesheet" href="' . WPLAUNCHER_URI . 'css/color-picker.min.css' .'">';
		echo '<script src="' . WPLAUNCHER_URI . 'js/jquery.core.min.js' . '"></script>';
		echo '<script src="' . WPLAUNCHER_URI . 'js/jquery.widget.min.js' .'"></script>';
		echo '<script src="' . WPLAUNCHER_URI . 'js/jquery.mouse.min.js' .'"></script>';
		echo '<script src="' . WPLAUNCHER_URI . 'js/jquery.draggable.min.js' .'"></script>';
		echo '<script src="' . WPLAUNCHER_URI . 'js/jquery.slider.min.js' .'"></script>';
		echo '<script src="' . WPLAUNCHER_URI . 'js/iris.min.js' .'"></script>';
		echo '<script src="' . WPLAUNCHER_URI . 'js/color-picker.js' .'"></script>';

		// media uploader '/wp-admin/media-upload.php?type=image&post_id=1&TB_iframe=true&flash=0'
		echo '<script>var wplauncher_media_upload_url = "'.add_query_arg(array('type' => 'image', 'post_id' => 0, 'TB_iframe' => 'true', 'flash' => 0), admin_url( 'media-upload.php' )).'"</script>';
		echo '<script>var thickboxL10n = {"next":"Next >","prev":"< Prev","image":"Image","of":"of","close":"Close","noiframes":"This feature requires inline frames. You have iframes disabled or your browser does not support them.","loadingAnimation":""};</script>';
		echo '<script src="' . WPLAUNCHER_URI . 'js/underscore.min.js' .'"></script>';
		echo '<script src="' . WPLAUNCHER_URI . 'js/thickbox.js' .'"></script>';
		echo '<script src="' . WPLAUNCHER_URI . 'js/shortcode.min.js' .'"></script>';
		echo '<link rel="stylesheet" href="' . WPLAUNCHER_URI . 'css/thickbox.css' .'">';
		echo '<script src="' . WPLAUNCHER_URI . 'js/media-upload.js' .'"></script>';
		

		// "Replicate" the admin bar
		// Can be disabled using filter if needed
		if (apply_filters( 'wplauncher_show_admin_bar', true )) {
			?><link rel="stylesheet" id="open-sans-css"  href="//fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&#038;subset=latin%2Clatin-ext&#038;ver=4.1.5" type="text/css" media="all" />
			<link rel="stylesheet" href="<?php echo includes_url( 'css/dashicons.min.css' ); ?>">
			<link rel="stylesheet" href="<?php echo includes_url( 'css/admin-bar.min.css' ); ?>">
			<script type="text/javascript" src="<?php echo includes_url( 'js/admin-bar.min.js' ); ?>"></script>
			<?php wp_admin_bar_header(); _admin_bar_bump_cb(); _wp_admin_bar_init(); wp_admin_bar_render();
		}

		echo '<script src="'.WPLAUNCHER_URI.'js/wplauncher-editor.js"></script>';

		do_action( 'wplauncher_after_footer' );
	}
Exemple #2
0
 function set_xpress_block_header($mydirname)
 {
     ob_start();
     bloginfo('stylesheet_url');
     $stylesheet_link = "\t" . '<link rel="stylesheet" href="' . ob_get_contents() . '" type="text/css" media="screen" />';
     ob_end_clean();
     $block_stylesheet_link = "\t" . '<link rel="stylesheet" href="' . get_block_stylesheet_url($mydirname) . '" type="text/css" media="screen" />';
     ob_start();
     $now_ob_level = ob_get_level();
     wp_head();
     ob_end_flush_child($now_ob_level);
     $header_str = ob_get_contents();
     ob_end_clean();
     if (function_exists('_admin_bar_bump_cb')) {
         //remove admin_bar_bump_cb
         ob_start();
         _admin_bar_bump_cb();
         $admin_bar_bump_cb_str = ob_get_contents();
         ob_end_clean();
         $header_str = str_replace_ex($admin_bar_bump_cb_str, '', $header_str);
     }
     if (function_exists('wp_admin_bar_header')) {
         //remove wp_adminbar_header
         ob_start();
         wp_admin_bar_header();
         $wp_admin_bar_header_str = ob_get_contents();
         ob_end_clean();
         $header_str = str_replace_ex($wp_admin_bar_header_str, '', $header_str);
     }
     $pattern = '<\\s*link\\s+rel\\s*=[^>]*?>';
     $header_str = preg_replace("/" . $pattern . "/s", '', $header_str);
     $pattern = '<\\s*meta\\s+name\\s*=[^>]*?>';
     $header_str = preg_replace("/" . $pattern . "/i", '', $header_str);
     //		$pattern = "<style type.*<\/style>";
     //		$header_str = preg_replace("/".$pattern."/s" , '' , $header_str);
     $pattern = "^\\s*\n";
     $header_str = preg_replace("/" . $pattern . "/m", '', $header_str);
     $pattern = "^";
     $header_str = preg_replace("/" . $pattern . "/m", "\t", $header_str);
     ob_start();
     global $show_admin_bar;
     $show_admin_bar = false;
     //remove adminbar
     wp_footer();
     $footer_str = ob_get_contents();
     ob_end_clean();
     $pattern = "^";
     $footer_str = preg_replace("/" . $pattern . "/m", "\t", $footer_str);
     $block_header = "<!-- XPressME added block header -->\n";
     $block_header .= "\t<!-- from bloginfo('stylesheet_url') -->\n";
     $block_header .= $stylesheet_link . "\n";
     $block_header .= $block_stylesheet_link . "\n";
     $block_header .= "\t<!-- from wp_head() -->\n";
     $block_header .= $header_str . "\n";
     $block_header .= "\t<!-- from wp_footer() -->\n";
     $block_header .= $footer_str . "\n";
     $block_header .= "<!-- end of XPressME added block header -->\n";
     $data = array();
     $data['block_header'] = $block_header;
     xpress_block_header_cash_write($mydirname, $data);
 }