本文整理汇总了PHP中Template::theme_url方法的典型用法代码示例。如果您正苦于以下问题:PHP Template::theme_url方法的具体用法?PHP Template::theme_url怎么用?PHP Template::theme_url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Template
的用法示例。
在下文中一共展示了Template::theme_url方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gravatar_link
function gravatar_link($email=null, $size=48, $alt='', $title='', $class='', $id='')
{
// Set our default image based on required size.
$default_image = Template::theme_url('images/user.png');
// Set our minimum site rating to PG
$rating = 'PG';
// Border color
$border = 'd6d6d6';
// URL for Gravatar
$gravatarURL = "http://www.gravatar.com/avatar.php?gravatar_id=%s&default=%s&size=%s&border=%s&rating=%s";
$avatarURL = sprintf
(
$gravatarURL,
md5($email),
$default_image,
$size,
$border,
$rating
);
return '<img src="'. $avatarURL .'" width="'. $size .'" height="'. $size . '" alt="'. $alt .'" title="'. $title .'" class="'. $class .'" id="'. $id .'" />';
}
示例2: gravatar_link
/**
* Creates an image link based on Gravatar for the specified email address.
* It will default to the site's generic image if none is found for
* the user.
*
* Note that if gravatar does not have an image that matches the criteria,
* it will return a link to an image under *your_theme/images/user.png*.
* Also, by explicity omitting email you're denying http-req to gravatar.com.
*
* @param $email string The email address to check for. If NULL, defaults to theme img.
* @param $size int The width (and height) of the resulting image to grab.
* @param $alt string Alt text to be put in the link tag.
* @param $title string The title text to be put in the link tag.
* @param $class string Any class(es) that should be assigned to the link tag.
* @param $id string The id (if any) that should put in the link tag.
*
* @return string The resulting image tag.
*/
function gravatar_link($email = NULL, $size = 48, $alt = '', $title = '', $class = NULL, $id = NULL)
{
// Set our default image based on required size.
$default_image = Template::theme_url('images/user.png');
// Set our minimum site rating to PG
$rating = 'PG';
// Border color
$border = 'd6d6d6';
// If email null, means we don't want gravatar.com HTTP request
if ($email) {
// Check if HTTP or HTTPS Request should be used
if (isset($_SERVER['HTTPS'])) {
$http_protocol = "https://secure.";
} else {
$http_protocol = "http://www.";
}
// URL for Gravatar
$gravatarURL = $http_protocol . "gravatar.com/avatar.php?gravatar_id=%s&default=%s&size=%s&border=%s&rating=%s";
$avatarURL = sprintf($gravatarURL, md5($email), $default_image, $size, $border, $rating);
} else {
$avatarURL = $default_image;
}
$alt = htmlentities($alt, ENT_QUOTES, 'UTF-8');
$title = htmlentities($title, ENT_QUOTES, 'UTF-8');
$id = $id !== NULL ? ' id="' . $id . '" ' : ' ';
$class = $class !== NULL ? ' class="' . $class . '"' : ' ';
return '<img src="' . $avatarURL . '" width="' . $size . '" height="' . $size . '" alt="' . $alt . '" title="' . $title . '" ' . $class . $id . ' />';
}
示例3: __construct
/**
* Constructor
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->load->model('orders/orders_model');
$this->load->model('comments/comments_model');
$this->lang->load('orders');
Assets::add_js('codeigniter-csrf.js');
Assets::add_js(Template::theme_url('js/editors/ckeditor/ckeditor.js'));
}
示例4: __construct
/**
* Constructor
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->load->model(array('profile/profile_model', 'profile_users/profile_users_model', 'team/team_model', 'registration/registration_model', 'registration_team/registration_team_model'));
$this->lang->load('profile');
$this->load->library('session');
Assets::add_js('//cdn.tinymce.com/4/tinymce.min.js');
Assets::add_js(Template::theme_url('js/editors/tiny_mce_init.js'));
Assets::add_module_js('profile', 'profile.js');
}
示例5: __construct
/**
* Constructor
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->auth->restrict($this->permissionView);
$this->load->model('orders/orders_model');
$this->lang->load('orders');
Assets::add_js(Template::theme_url('js/editors/ckeditor/ckeditor.js'));
$this->form_validation->set_error_delimiters("<span class='error'>", "</span>");
Template::set_block('sub_nav', 'settings/_sub_nav');
Assets::add_module_js('orders', 'orders.js');
}
示例6: add_news
/**
* add_news.
*
* Displays a default list of news articles. The nbumber of articles displayed is managed via
* the news.default_article_count setting.
*
* @return <void> This function outputs to the Template::render() function
*
*/
public function add_news()
{
$settings = $this->_settings;
if ($this->input->post('submit')) {
$this->load->module('news/content');
$uploadData = array();
$upload = true;
if (isset($_FILES['attachment']) && is_array($_FILES['attachment']) && $_FILES['attachment']['error'] != 4) {
$uploadData = $this->content->handle_upload();
if (isset($uploadData['error']) && !empty($uploadData['error'])) {
$upload = false;
}
}
if (count($uploadData) > 0 && $upload || count($uploadData) == 0 && $upload) {
if ($id = $this->content->save_article($uploadData)) {
$article = $this->news_model->find($id);
$this->load->model('activities/activity_model');
$this->activity_model->log_activity($this->current_user->id, 'Created Article: ' . $article->id, 'news');
Template::set_message('Article successfully submitted. It will be reviewed by the news moderator.', 'success');
Template::set_view('index');
Template::render();
} else {
Template::set_message('There was a problem creating the article: ' . $this->news_model->error);
}
} else {
Template::set_message('There was a problem saving the file attachment: ' . $uploadData['error']);
}
}
if ($settings['news.public_submissions'] == 1) {
$showForm = true;
if ($settings['news.public_submitters'] == 1) {
$cookie = unserialize($this->input->cookie($this->config->item('sess_cookie_name')));
$showForm = isset($cookie['logged_in']);
$error = 'You must be <a href="' . site_url('/login/') . '">logged in</a> to post news to this site.';
unset($cookie);
}
if ($showForm) {
$this->load->helper('form');
Assets::add_css(array(Template::theme_url('js/editors/markitup/skins/markitup/style.css'), Template::theme_url('js/editors/markitup/sets/default/style.css'), css_path() . 'chosen.css', css_path() . 'bootstrap-datepicker.css'));
Assets::add_js(array(Template::theme_url('js/editors/markitup/jquery.markitup.js'), Template::theme_url('js/editors/markitup/sets/default/set.js'), js_path() . 'chosen.jquery.min.js', js_path() . 'bootstrap-datepicker.js'));
Template::set('public', true);
Template::set('settings', $settings);
Template::set('toolbar_title', lang('us_create_news'));
Template::set_view('content/news_form');
Template::render();
} else {
show_error($error, 501, 'Form Access Error');
}
} else {
show_error('<h2>Sorry</h2><br />Public news submissions are not currently available.<br /><a href="' . site_url() . '">Return to the site</a>.', 501, 'Public News Submission not available');
}
}
示例7: __construct
/**
* Constructor
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->auth->restrict('Site.Reports.View');
$this->auth->restrict('Bonfire.Activities.View');
$this->lang->load('activities');
$this->lang->load('datatable');
Template::set('toolbar_title', lang('activity_title'));
Assets::add_js(Template::theme_url('js/bootstrap.js'));
Assets::add_js($this->load->view('reports/activities_js', null, true), 'inline');
Assets::add_js(array(Template::theme_url('js/jquery.dataTables.min.js')));
Assets::add_js(array(Template::theme_url('js/bootstrap-dataTables.js')));
Assets::add_css(array(Template::theme_url('css/datatable.css')));
Assets::add_css(array(Template::theme_url('css/bootstrap-dataTables.css')));
//Assets::add_module_css ('activities', 'datatables.css');
if (has_permission('Activities.User.View') || has_permission('Activities.Module.View') || has_permission('Activities.Date.View')) {
Template::set_block('sub_nav', 'reports/_sub_nav');
}
}
示例8: __construct
/**
* Checks Auth Permissions and setups all java-scripts and other stuff
*
* @property CI_Pagination $pagination
* @property MY_Model $my_model
* @property news_model $news_model
* @property author_model $author_model
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->auth->restrict('News.Content.View');
$this->load->model('news/news_model');
$this->load->model('news/author_model');
$this->load->helper('news');
$this->lang->load('news');
$this->load->helper('author');
$this->load->library('pagination');
$this->_settings = $this->settings_model->select('name,value')->find_all_by('module', 'news');
Assets::add_css(array(Template::theme_url('js/editors/markitup/skins/markitup/style.css'), Template::theme_url('js/editors/markitup/sets/default/style.css'), css_path() . 'chosen.css', css_path() . 'bootstrap-datepicker.css'));
Assets::add_js(array(Template::theme_url('js/editors/markitup/jquery.markitup.js'), Template::theme_url('js/editors/markitup/sets/default/set.js'), js_path() . 'chosen.jquery.min.js', js_path() . 'bootstrap-datepicker.js'));
$the_path = $this->_settings['news.upload_dir_path'];
$this->_news_dir = realpath($the_path);
if (!is_dir($this->_news_dir) && !is_writeable($this->_news_dir)) {
Template::set_message('Attachment Upload Directory is not write-able: ' . $this->_news_dir, 'error');
log_message('error', 'Attachment Upload Directory is not write-able: ' . $this->_news_dir);
}
Template::set_block('sub_nav', 'content/_sub_nav');
}
示例9: theme_view
<?php
Assets::add_js(array(Template::theme_url('js/bootstrap.min.js'), Template::theme_url('js/jwerty.js')), 'external', true);
echo theme_view('partials/_header');
?>
<div class="container-fluid body">
<div class="row-fluid">
<div class="span2">
<?php
echo Template::block('sidebar');
?>
</div>
<div class="span10">
<?php
echo Template::message();
?>
<?php
echo isset($content) ? $content : Template::content();
?>
</div>
</div>
</div>
<?php
echo theme_view('partials/_footer');
示例10: if
<div class="view split-view">
<!-- List -->
<div class="view">
<?php if (isset($logs) && is_array($logs) && count($logs)) : ?>
<div class="scrollable">
<div class="list-view" id="user-list">
<?php foreach ($logs as $log) : ?>
<?php if ($log != 'index.html') : ?>
<div class="list-item" data-id="<?php echo $log ?>">
<img src="<?php echo Template::theme_url('images/issue.png') ?>" />
<p>
<b><?php
echo date('F j, Y', strtotime(str_replace('.php', '', str_replace('log-', '', $log))));
?></b><br/>
<?php echo $log ?>
</p>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div> <!-- /list -->
</div>
<?php else : ?>
<div class="notification information">
<p>No logs found.</p>
</div>
示例11: if
<div class="view split-view">
<!-- Role List -->
<div class="view">
<?php if (isset($roles) && is_array($roles) && count($roles)) : ?>
<div class="scrollable">
<div class="list-view" id="role-list">
<?php foreach ($roles as $role) : ?>
<div class="list-item with-icon" data-id="<?php echo $role->role_id ?>">
<img src="<?php echo Template::theme_url('images/customers.png') ?>" />
<p>
<b><?php echo $role->role_name ?></b><br/>
<span class="small"><?php echo $role->description ?></span>
</p>
</div>
<?php endforeach; ?>
</div> <!-- /list-view -->
</div>
<?php else: ?>
<div class="notification attention">
<p>There aren't any roles in the system. <?php echo anchor('admin/settings/roles/create', 'Create a new role.') ?></p>
</div>
<?php endif; ?>
</div>
<!-- Role Editor -->
示例12: foreach
<!-- Role List -->
<div class="view">
<?php
if (isset($modules) && is_array($modules) && count($modules)) {
?>
<div class="scrollable">
<div class="list-view" id="module-list">
<?php
foreach ($modules as $module => $config) {
?>
<div class="list-item with-icon" data-id="<?php
echo $config['name'];
?>
">
<img src="<?php
echo Template::theme_url('images/database.png');
?>
" />
<p>
<b><?php
echo $config['name'];
?>
</b><br/>
<span class="small"><?php
echo isset($config['description']) ? $config['description'] : lang('mb_generic_description');
?>
</span>
</p>
</div>
<?php
示例13:
<p><b>Development</b><br/>
<span><?php echo $settings['development']['default']['hostname'] .'/'. $settings['development']['default']['database'] ?></span>
</p>
</div>
<div class="list-item with-icon" data-id="testing">
<img src="<?php echo Template::theme_url('images/database.png') ?>" />
<p><b>Staging/Test</b><br/>
<span><?php echo $settings['testing']['default']['hostname'] .'/'. $settings['testing']['default']['database'] ?></span>
</p>
</div>
<div class="list-item with-icon" data-id="production">
<img src="<?php echo Template::theme_url('images/database.png') ?>" />
<p><b>Production</b><br/>
<span><?php echo $settings['production']['default']['hostname'] .'/'. $settings['production']['default']['database'] ?></span>
</p>
</div>
</div>
</div>
</div> <!-- /vertical-panel -->
<!-- Editor -->
<div id="content" class="view">
<div class="scrollable" id="ajax-content">
示例14: render_menu
/**
* Renders a list-based menu (with submenus) for each context.
*
* @param string $mode What to output in the top menu ('icon'/'text'/'both').
* @param string $order_by The sort order of the elements ('normal'/'reverse'/'asc'/'desc').
* @param boolean $top_level_only If true, output only the top-level links.
* @param boolean $benchmark If true, output benchmark start/end marks.
*
* @return string A string with the built navigation.
*/
public static function render_menu($mode = 'text', $order_by = 'normal', $top_level_only = false, $benchmark = false)
{
if ($benchmark) {
self::$ci->benchmark->mark('render_menu_start');
}
// As long as the contexts were set with setContexts(), the required contexts
// should be in place. However, it's still a good idea to make sure an array
// of contexts was provided.
$contexts = self::getContexts();
if (empty($contexts) || !is_array($contexts)) {
die(self::$ci->lang->line('bf_no_contexts'));
}
// Sorting (top-level menus).
switch ($order_by) {
case 'reverse':
$contexts = array_reverse($contexts);
break;
case 'asc':
natsort($contexts);
break;
case 'desc':
rsort($contexts);
break;
case 'normal':
case 'default':
default:
break;
}
$template = '';
if ($mode == 'text') {
$template = self::$templateContextText;
} else {
$template = self::$templateContextImage;
if ($mode == 'both') {
$template .= self::$templateContextText;
}
}
$template .= self::$templateContextEnd;
// Build out the navigation.
$menu = '';
foreach ($contexts as $context) {
// Don't display an entry in the menu if the user doesn't have permission
// to view it (unless the permission doesn't exist).
$viewPermission = 'Site.' . ucfirst($context) . '.View';
if (self::$ci->auth->has_permission($viewPermission) || !self::$ci->auth->permission_exists($viewPermission)) {
// The text/image displayed in the top-level context menu.
$title = self::$ci->lang->line("bf_context_{$context}");
$navTitle = str_replace(array('{title}', '{image}'), array($title, $mode == 'text' ? '' : Template::theme_url("images/context_{$context}.png")), $template);
// Build the menu for this context.
$menu .= str_replace(array('{parent_class}', '{url}', '{id}', '{current_class}', '{title}', '{extra}', '{text}', '{content}'), array(self::$parent_class . ' ' . check_class($context, true), site_url(self::$site_area . "/{$context}"), "tb_{$context}", $top_level_only ? '' : self::$templateContextMenuAnchorClass, $title, str_replace('{dataId}', $context, self::$templateContextMenuExtra), $navTitle, $top_level_only ? '' : self::context_nav($context)), self::$templateContextMenu);
}
}
// Put the generated menu into the context nav template.
$nav = str_replace(array('{class}', '{extra}', '{menu}'), array(self::$outer_class, trim(self::$outer_id) == '' ? '' : ' id="' . self::$outer_id . '"', $menu), self::$templateContextNav);
if ($benchmark) {
self::$ci->benchmark->mark('render_menu_end');
}
return $nav;
}
示例15: anchor
</div> <!-- /users-list -->
<!-- User Editor -->
<div id="content" class="view">
<div class="scrollable" id="ajax-content">
<div class="padded">
<div class="row" style="margin-bottom: 2.5em">
<div class="column size1of2">
<img src="<?php echo Template::theme_url('images/user.png') ?>" style="vertical-align: bottom; position: relative; top: -5px; margin-right: 1em;" />
<span class="big-text"><b><?php echo $user_count ?></b></span> users
</div>
<div class="column size1of2">
<img src="<?php echo Template::theme_url('images/user.png') ?>" style="vertical-align: bottom; position: relative; top: -5px; margin-right: 1em;" />
<span class="big-text"><b><?php echo $deleted_users ?></b></span> <?php echo anchor('admin/settings/users/deleted', 'deleted users', 'class="ajaxify"') ?>
</div>
</div>
<div class="box create rounded">
<a class="button good ajaxify" href="<?php echo site_url('admin/settings/users/create'); ?>">Create New User</a>
<h3>Create A New User</h3>
<p>Create new accounts for other users in your circle.</p>
</div>
<div class="row" style="margin-top: 3em">