本文整理汇总了PHP中CSS::add方法的典型用法代码示例。如果您正苦于以下问题:PHP CSS::add方法的具体用法?PHP CSS::add怎么用?PHP CSS::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSS
的用法示例。
在下文中一共展示了CSS::add方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initDisplay
/**
* Initialize requires CSS and JS files.
*/
public static function initDisplay()
{
static $inited = false;
if (!$inited) {
JS::add('/js/video-js.min.js', false);
JS::startup('videojs.options.flash.swf = "/swf/video-js.swf"');
CSS::add('/css/video-js.min.css');
$inited = true;
}
}
示例2: me
e.preventDefault();
<?= $action ?>();
return false;
}
<?}
}?>
return true;
}
</script>
<script type="text/javascript" src="/socket.io/socket.io.js"></script>
<?
CSS::add("/styles/jquery-ui-1.8.17.custom.css");
CSS::add("/styles/pic.css");
CSS::emit();
JS::add("/offensive/js/jquery-1.7.1.min.js");
JS::add("/offensive/js/tmbolib.js");
JS::add("/offensive/js/jquery-ui-1.8.17.custom.min.js");
JS::add("/offensive/js/jquery.ba-outside-events.min.js");
JS::add("/offensive/js/subscriptions.js");
JS::add("/offensive/js/irsz.js");
JS::add("/offensive/js/picui.js");
JS::add("/offensive/js/analytics.js");
JS::emit();
?>
<script type="text/javascript">
var me = {
hide_nsfw: <?= me()->getPref("hide_nsfw") == 1 ? 'true' : 'false' ?>,
hide_tmbo: <?= me()->getPref("hide_tmbo") == 1 ? 'true' : 'false' ?>,
示例3: styles
/**
* Styles output, if cache exsists will return cached file, else will cache then return cached file
*
* @param array
*
* return array
*/
public static function styles($todo)
{
if (!empty($todo)) {
$dir = self::get_page_cache_dir('styles');
if (!$dir) {
return $todo;
}
$enque_styles = array();
$fname = self::$is_footer ? 'footer' : 'header';
$cache_dir = self::create_scripts_dir('styles', $fname);
$file_path = self::get_cache_dir(true);
$file_path .= $dir . pathinfo($cache_dir, PATHINFO_BASENAME);
if (!self::$is_footer || is_file($cache_dir)) {
$enque_styles[] = 'themify_cache_' . $fname;
wp_enqueue_style('themify_cache_' . $fname, $file_path, array(), THEMIFY_VERSION);
}
if (is_file($cache_dir)) {
return $enque_styles;
}
global $wp_styles;
foreach ($todo as $handler) {
if (isset($wp_styles->registered[$handler]) && $wp_styles->registered[$handler]->src && !isset(self::$header_styles[$handler]) && !isset(self::$footer_styles[$handler])) {
if (!isset($wp_styles->registered[$handler]->extra['conditional']) || !$wp_styles->registered[$handler]->extra['conditional'] || !$wp_styles->registered[$handler]['args'] || $wp_styles->registered[$handler]['args'] == 'screen' || $wp_styles->registered[$handler]['args'] == 'all') {
if (self::$is_footer || $wp_styles->groups[$handler] == 1) {
self::$footer_styles[$handler]['src'] = $wp_styles->registered[$handler]->src;
} else {
self::$header_styles[$handler]['src'] = $wp_styles->registered[$handler]->src;
}
} else {
$enque_styles[] = $handler;
}
}
}
$styles = self::$is_footer ? self::$footer_styles : self::$header_styles;
$minifier = new CSS();
foreach ($styles as $value) {
if (self::is_remote($value['src'])) {
if (strpos($value['src'], '//') === 0) {
$value['src'] = 'http:' . $value['src'];
}
$response = wp_remote_get($value['src'], array('timeout' => 4, 'sslverify' => false));
if (is_array($response)) {
$minifier->add($response['body']);
}
} else {
$path = self::get_full_path($value['src']);
if (!file_exists($path)) {
$response = wp_remote_get($value['src'], array('timeout' => 4, 'sslverify' => false));
if (is_array($response)) {
$minifier->add($response['body']);
}
} else {
$minifier->add($path);
}
}
}
if (self::$is_footer) {
$temp_dir = pathinfo($cache_dir);
$cache_dir = $temp_dir['dirname'] . '/' . $temp_dir['filename'] . '-tmp.css';
$content = $minifier->minify();
self::$footer_file['css'] = array('dir' => $cache_dir, 'path' => $file_path);
if (file_put_contents($cache_dir, $content, FILE_APPEND)) {
return $enque_styles;
}
} else {
$minifier->minify($cache_dir);
return $enque_styles;
}
}
return $todo;
}
示例4: GraphicAdmin
$cat: Which menucategory to show, default = all
************************************************************************************/
function GraphicAdmin($cat = 'all')
{
global $CLASS, $cpgtpl;
require_once CORE_PATH . 'classes/cpg_adminmenu.php';
if ($CLASS['adminmenu']->display($cat, 'graph')) {
$cpgtpl->set_filenames(array('body' => 'admin/index_body.html'));
$cpgtpl->display('body');
}
}
$op = !empty($_GET['op']) ? $_GET['op'] : (isset($_POST['op']) ? $_POST['op'] : 'index');
if ($MAIN_CFG['global']['admingraphic'] >= '4' || strtolower($op) == 'forums') {
JS::add('includes/javascript/JSCookMenu.js');
JS::add('themes/default/javascript/cookmenu.js');
CSS::add('themes/default/style/cookmenu.css');
}
global $CPG_SESS;
if ($op == 'logout') {
unset($CPG_SESS['admin']);
$redir = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : $mainindex;
cpg_error(_YOUARELOGGEDOUT, _ADMINMENU_LOGOUT, $redir);
} else {
if ($CLASS['member']->admin_id) {
if (!preg_match('#^([a-zA-Z0-9_\\-]+)$#', $op)) {
cpg_error(sprintf(_ERROR_BAD_CHAR, strtolower(_ADMIN)), _SEC_ERROR);
}
$Module = new Module('Admin');
Blocks::$showblocks = $Module->sides;
$Blocks = new Blocks(-1);
require_once CORE_PATH . 'classes/cpg_adminmenu.php';
示例5: title
<title><?
if( function_exists( 'title' ) ) {
echo title();
}
else {
echo "[ this might be offensive ]";
}
?></title>
<META NAME="ROBOTS" CONTENT="NOARCHIVE">
<link rel="icon" href="/favicon.ico" />
<link rel="shortcut icon" href="/favicon.ico" />
<script type="text/javascript" src="/socket.io/socket.io.js"></script>
<?
CSS::add("/styles/filepilestyle.css");
CSS::add("/styles/oldskool.css");
CSS::add("/styles/index.css");
JS::add("/offensive/js/jquery-1.7.1.min.js");
JS::add("/offensive/js/tmbolib.js");
if(function_exists('head')) {
head();
}
JS::add("/offensive/js/analytics.js");
CSS::emit();
JS::emit();
if(function_exists('head_post_js')) {
head_post_js();
}
?>
<script type="text/javascript">
var me = {
hide_nsfw: <?= me()->getPref("hide_nsfw") == 1 ? 'true' : 'false' ?>,
示例6:
$message = "Your account is now active. <a href=\"./\">Click here</a> to log in.";
}
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title></title>
<?
CSS::add("/styles/filepilestyle.css");
CSS::add("/styles/oldskool.css");
CSS::emit();
?>
<style type="text/css">
.vote, label {
font-weight:bold;
font-size:9px;
}
#content {
margin-left:auto;
margin-right:auto;
text-align:left;
line-height: 15px;
width:771px;