コード例 #1
0
 /**
  * Return an instance of this class.
  *
  * @since     1.0.0
  *
  * @return    object    A single instance of this class.
  */
 public static function get_instance()
 {
     // If the single instance hasn't been set, set it now.
     if (null == self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
コード例 #2
0
ファイル: functions.php プロジェクト: danielcoats/schoolpress
function seed_csp4_head()
{
    $o = seed_csp4_get_settings();
    extract($o);
    // CSS
    $output = '';
    $output .= "<!-- Bootstrap and default Style -->\n";
    $output .= '<link rel="stylesheet" href="' . SEED_CSP4_PLUGIN_URL . 'themes/default/bootstrap/css/bootstrap.min.css">' . "\n";
    $output .= '<link rel="stylesheet" href="' . SEED_CSP4_PLUGIN_URL . 'themes/default/style.css">' . "\n";
    if (is_rtl()) {
        $output .= '<link rel="stylesheet" href="' . SEED_CSP4_PLUGIN_URL . 'themes/default/rtl.css">' . "\n";
    }
    $output .= '<style type="text/css">' . "\n";
    // Calculated Styles
    $output .= '/* calculated styles */' . "\n";
    ob_start();
    ?>

	/* Background Style */
    html{
    	height:100%;
		<?php 
    if (!empty($bg_image)) {
        ?>
			<?php 
        if (isset($bg_cover) && in_array('1', $bg_cover)) {
            ?>
				background: <?php 
            echo $bg_color;
            ?>
 url('<?php 
            echo $bg_image;
            ?>
') no-repeat top center fixed;
				-webkit-background-size: cover;
				-moz-background-size: cover;
				-o-background-size: cover;
				background-size: cover;
			<?php 
        } else {
            ?>
				background: <?php 
            echo $bg_color;
            ?>
 url('<?php 
            echo $bg_image;
            ?>
') <?php 
            echo $bg_repeat;
            ?>
 <?php 
            echo $bg_position;
            ?>
 <?php 
            echo $bg_attahcment;
            ?>
;
			<?php 
        }
        ?>
        <?php 
    } else {
        if (!empty($bg_color)) {
            ?>
        	background: <?php 
            echo $bg_color;
            ?>
;
		<?php 
        }
    }
    ?>
    }
    .seed-csp4 body{
    	height:100%;
			<?php 
    if (!empty($bg_effect)) {
        ?>
				background: transparent url('<?php 
        echo plugins_url('images/bg-' . $bg_effect . '.png', __FILE__);
        ?>
') repeat;
			<?php 
    } else {
        ?>
				background: transparent;
			<?php 
    }
    ?>
	}

	<?php 
    if (!empty($max_width)) {
        ?>
	#seed-csp4-content{
    	max-width: <?php 
        echo intval($max_width);
        ?>
px;
	}
	<?php 
    }
    ?>

	<?php 
    if (!empty($enable_well)) {
        ?>
	#seed-csp4-content{
		min-height: 20px;
		padding: 19px;
		background-color: #f5f5f5;
		border: 1px solid #e3e3e3;
		border-radius: 4px;
	}
	<?php 
    }
    ?>

    /* Text Styles */
    <?php 
    if (!empty($text_font)) {
        ?>
	    .seed-csp4 body{
	        font-family: <?php 
        echo SEED_CSP4::get_font_family($text_font);
        ?>
	    }

	    .seed-csp4 h1, .seed-csp4 h2, .seed-csp4 h3, .seed-csp4 h4, .seed-csp4 h5, .seed-csp4 h6{
	        font-family: <?php 
        echo SEED_CSP4::get_font_family($text_font);
        ?>
	    }
    <?php 
    }
    ?>

    <?php 
    if (!empty($text_color)) {
        ?>
		.seed-csp4 body{
			color:<?php 
        echo $text_color;
        ?>
;
		}
    <?php 
    }
    ?>

    <?php 
    if (!empty($link_color)) {
        ?>
    <?php 
        if (empty($headline_color)) {
            $headline_color = $link_color;
        }
        ?>
    <?php 
    }
    ?>


    <?php 
    if (!empty($headline_color)) {
        ?>
		.seed-csp4 h1, .seed-csp4 h2, .seed-csp4 h3, .seed-csp4 h4, .seed-csp4 h5, .seed-csp4 h6{
			color:<?php 
        echo $headline_color;
        ?>
;
		}
    <?php 
    }
    ?>


    <?php 
    if (!empty($link_color)) {
        ?>
		.seed-csp4 a, .seed-csp4 a:visited, .seed-csp4 a:hover, .seed-csp4 a:active{
			color:<?php 
        echo $link_color;
        ?>
;
		}


    <?php 
    }
    $output .= ob_get_clean();
    $output .= '</style>' . "\n";
    // Javascript
    $output .= "<!-- JS -->\n";
    $include_url = includes_url();
    $last = $include_url[strlen($include_url) - 1];
    if ($last != '/') {
        $include_url = $include_url . '/';
    }
    if (empty($enable_wp_head_footer)) {
        $output .= '<script src="' . $include_url . 'js/jquery/jquery.js"></script>' . "\n";
    }
    $output .= '<script src="' . SEED_CSP4_PLUGIN_URL . 'themes/default/bootstrap/js/bootstrap.js"></script>' . "\n";
    $output .= '<script src="' . SEED_CSP4_PLUGIN_URL . 'themes/default/js/script.js"></script>' . "\n";
    // Header Scripts
    if (!empty($header_scripts)) {
        $output .= "<!-- Header Scripts -->\n";
        $output .= $header_scripts;
    }
    // Google Analytics
    if (!empty($ga_analytics)) {
        $output .= "<!-- Google Analytics -->\n";
        $output .= $ga_analytics;
    }
    // Modernizr
    $output .= "<!-- Modernizr -->\n";
    $output .= '<script src="' . SEED_CSP4_PLUGIN_URL . 'themes/default/js/modernizr.min.js"></script>' . "\n";
    return $output;
}