本文整理汇总了PHP中CMS_Asset::add_cms_js方法的典型用法代码示例。如果您正苦于以下问题:PHP CMS_Asset::add_cms_js方法的具体用法?PHP CMS_Asset::add_cms_js怎么用?PHP CMS_Asset::add_cms_js使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMS_Asset
的用法示例。
在下文中一共展示了CMS_Asset::add_cms_js方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$asset = new CMS_Asset();
$asset->add_themes_css('bootstrap.min.css', '{{ used_theme }}', 'default');
$asset->add_themes_css('style.css', '{{ used_theme }}', 'default');
$asset->add_themes_css('css/roboto.min.css', '{{ used_theme }}', 'default');
$asset->add_themes_css('css/material.min.css', '{{ used_theme }}', 'default');
$asset->add_themes_css('css/ripples.min.css', '{{ used_theme }}', 'default');
echo $asset->compile_css();
?>
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="{{ site_favicon }}">
<style type="text/css">{{ widget_name:section_custom_style }}</style>
</head>
<body>
<?php
echo $template['js'];
$asset->add_cms_js("bootstrap/js/bootstrap.min.js");
$asset->add_themes_js('js/ripples.min.js', '{{ used_theme }}', 'default');
$asset->add_themes_js('js/material.min.js', '{{ used_theme }}', 'default');
$asset->add_themes_js('script.js', '{{ used_theme }}', 'default');
echo $asset->compile_js();
?>
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script type="text/javascript">{{ widget_name:section_custom_script }}</script>
{{ widget_name:section_top_fix }}
{{ widget_name:static_accessories_slideshow }}
<div class="container">
<div class="row-fluid">
<div>
示例2:
<?php
echo $template['metadata'];
?>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="{{ site_favicon }}">
<!-- Le styles -->
<?php
$asset = new CMS_Asset();
$asset->add_themes_css('style.css', 'minimal', 'default');
$asset->add_themes_css('bootstrap.min.css', 'minimal', 'default');
echo $asset->compile_css();
$asset->add_cms_js("bootstrap/js/bootstrap.min.js");
$asset->add_cms_js('validate/js/number.js');
$asset->add_themes_js('script.js', 'minimal', 'default');
echo $asset->compile_js(TRUE);
?>
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="{{ site_favicon }}">
</head>
<body>
{{ widget_name:quicklink }}
示例3:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="<?php
echo $cms['site_favicon'];
?>
">
<!-- Le styles -->
<?php
$asset = new CMS_Asset();
$asset->add_themes_css('style.css', $cms['site_theme'], 'default');
$asset->add_cms_css('bootstrap/css/bootstrap-all.min.css');
echo $asset->compile_css();
$asset->add_cms_js('nocms/js/jquery.js');
$asset->add_cms_js("bootstrap/js/bootstrap-all.min.js");
$asset->add_themes_js('script.js', $cms['site_theme'], 'default');
echo $asset->compile_js(TRUE);
?>
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="<?php
echo $cms['site_favicon'];
?>
">
示例4: cms_widgets
/**
* @author goFrendiAsgard
* @param parent_id, max_menu_depth
* @desc return navigation child if parent_id specified, else it will return root navigation
*/
public final function cms_widgets()
{
$user_name = $this->cms_username();
$user_id = $this->cms_userid();
$not_login = !$user_name ? "TRUE" : "FALSE";
$login = $user_name ? "TRUE" : "FALSE";
$super_user = $user_id == 1 ? "TRUE" : "FALSE";
$query = $this->db->query("SELECT \n \t\t\twidget_id, widget_name, is_static, title, \n \t\t\tdescription, url, slug, static_content \n FROM cms_widget AS w WHERE\n ( \n (authorization_id = 1) OR\n (authorization_id = 2 AND {$not_login}) OR\n (authorization_id = 3 AND {$login}) OR\n (\n (authorization_id = 4 AND {$login}) AND \n (\n (SELECT COUNT(*) FROM cms_group_user AS gu WHERE gu.group_id=1 AND gu.user_id ='" . addslashes($user_id) . "')>0\n OR {$super_user} OR\n (SELECT COUNT(*) FROM cms_group_widget AS gw\n WHERE \n gw.widget_id=w.widget_id AND\n gw.group_id IN \n (SELECT group_id FROM cms_group_user WHERE user_id = '" . addslashes($user_id) . "')\n )>0\n )\n )\n ) AND active=1");
$result = array();
foreach ($query->result() as $row) {
// generate widget content
$content = '';
if ($row->is_static == 1) {
$content = $this->cms_parse_keyword($row->static_content);
} else {
// url
$url = $row->url;
if (!strpos(strtolower($url), 'http')) {
$url = base_url($url);
}
// script
$script = '$.ajax({';
$script .= 'url:"' . $url . '",';
$script .= 'data:{_only_content:true},';
$script .= 'success:function(response){';
$script .= '$("div#_cms_widget_' . $row->widget_id . '").html(response);';
$script .= '}';
$script .= '});';
// asset
$asset = new CMS_Asset();
$asset->add_cms_js('nocms/js/jquery.js');
$asset->add_string_js($script);
// content
$content .= '<div id="_cms_widget_' . $row->widget_id . '">';
$content .= $asset->compile_js(true);
$content .= '</div>';
}
// make widget based on slug
if (!isset($result[$row->slug])) {
$result[$row->slug] = array();
}
$result[$row->slug][] = array("widget_id" => $row->widget_id, "widget_name" => $row->widget_name, "title" => $this->cms_lang($row->title), "description" => $row->description, "content" => $content);
}
return $result;
}
示例5: ucwords
}
foreach ($config_list as $config_name => $value) {
$option_tag .= '<option value="{{ ' . $config_name . ' }}">configuration : ' . $config_name . '</option>';
$selected = '';
}
// option for languages
$option_language = '';
foreach ($language_list as $language) {
$selected = $language == $current_language ? 'selected' : '';
$option_language .= '<option ' . $selected . ' value="' . $language . '">' . ucwords($language) . '</option>';
}
$asset = new CMS_Asset();
$asset->add_cms_css('grocery_crud/css/jquery_plugins/chosen/chosen.css');
$asset->add_cms_css('grocery_crud/themes/flexigrid/css/flexigrid.css');
echo $asset->compile_css();
$asset->add_cms_js("grocery_crud/js/jquery_plugins/jquery.chosen.min.js");
$asset->add_cms_js("grocery_crud/js/jquery_plugins/config/jquery.chosen.config.js");
echo $asset->compile_js();
?>
<style type="text/css">
.text-area-section{
resize: none;
white-space: nowrap;
overflow: auto;
min-width: 385px!important;
min-height: 75px!important;
margin-top: 10px!important;
font-family: Courier;
font-size: small;
}
</style>