Beispiel #1
0
	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' );
	}
    public static function footer_scripts()
    {
        ?>
			<?php 
        if (current_user_can('edit_post', get_the_id())) {
            ?>
				<link rel="stylesheet" id="admin-bar-css" href="<?php 
            echo site_url();
            ?>
/wp-includes/css/admin-bar.min.css" type="text/css" media="all">
				<?php 
            wp_admin_bar_render();
            ?>
			
				<!-- TODO get customizer to be live -->
				<script type="text/javascript" src="<?php 
            echo site_url();
            ?>
/wp-includes/js/json2.min.js"></script>
				<script type="text/javascript" src="<?php 
            echo site_url();
            ?>
/wp-includes/js/underscore.min.js"></script>
				<script type="text/javascript" src="<?php 
            echo site_url();
            ?>
/wp-includes/js/customize-base.min.js"></script>
				<script type="text/javascript" src="<?php 
            echo site_url();
            ?>
/wp-includes/js/customize-preview.min.js"></script>
				<script type="text/javascript" src="<?php 
            echo SI_RESOURCES;
            ?>
admin/js/customizer.js"></script>
			<?php 
        }
        ?>
		<?php 
    }
 /**
  * Displays Wordpress theme header (and administration menu bar if available).
  */
 public function getHeader()
 {
     \get_header();
     \_wp_admin_bar_init();
     \wp_admin_bar_render();
 }