本文整理汇总了PHP中get_template_path函数的典型用法代码示例。如果您正苦于以下问题:PHP get_template_path函数的具体用法?PHP get_template_path怎么用?PHP get_template_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_template_path函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: kleeja_admin_err
/**
* Print admin area errors
*
* @param string $msg The message of error
* @param bool $navigation [optional] Show the side mneu or not
* @param string $title [optional] The title of the error
* @param bool $exit [optional] halt after showing the error
* @param bool|string $redirect [optional] if link given it will redirected to it after $rs seconds
* @param int $rs [optional] if $redirected is given and not false, this will be the time in seconds
* @param string $style [optional] this is just here to use it inside kleeja_admin_info to use admin_info
*/
function kleeja_admin_err($msg, $navigation = true, $title = '', $exit = true, $redirect = false, $rs = 5, $style = 'error.php')
{
global $text, $tpl, $SHOW_LIST, $adm_extensions, $adm_extensions_menu;
global $STYLE_PATH_ADMIN, $lang, $plugin, $SQL, $MINI_MENU;
($hook = $plugin->run_hook('kleeja_admin_err_func')) ? eval($hook) : null;
//run hook
#Exception for ajax
if (isset($_GET['_ajax_'])) {
$text = $msg . ($redirect ? "\n" . '<script type="text/javascript"> setTimeout("location.href=\'' . str_replace('&', '&', $redirect) . '\';", ' . $rs * 1000 . ');</script>' : '');
echo_ajax(1, $tpl->display($style));
$SQL->close();
exit;
}
#assign {text} in err template
$text = $msg . ($redirect != false ? redirect($redirect, false, false, $rs, true) : '');
$SHOW_LIST = $navigation;
#header
include get_template_path('header.php');
#show tpl
include get_template_path($style);
#footer
include get_template_path('footer.php');
#show tpl
//echo $tpl->display($style);
#footer
//echo $tpl->display("admin_footer");
#if exit, clean it
if ($exit) {
garbage_collection();
exit;
}
}
开发者ID:omtim,项目名称:kleeja,代码行数:43,代码来源:functions_adm.php
示例2: smarty_function_mobile_access_paginator
/**
* Render pagination block
*
* Parameters:
*
* - page - current_page
* - total_pages - total pages
* - route - route for URL assembly
*
* @param array $params
* @param Smarty $smarty
* @return string
*/
function smarty_function_mobile_access_paginator($params, &$smarty)
{
$url_params = '';
if (is_foreachable($params)) {
foreach ($params as $k => $v) {
if (strpos($k, 'url_param_') !== false && $v) {
$url_params .= '&' . substr($k, 10) . '=' . $v;
}
// if
}
// foreach
}
// if
$paginator = array_var($params, 'paginator', new Pager());
$paginator_url = array_var($params, 'url', ROOT_URL);
$paginator_anchor = array_var($params, 'anchor', '');
$smarty->assign(array("_mobile_access_paginator_url" => $paginator_url, "_mobile_access_paginator" => $paginator, '_mobile_access_paginator_anchor' => $paginator_anchor, "_mobile_access_paginator_url_params" => $url_params));
$paginator_url = strpos($paginator_url, '?') === false ? $paginator_url . '?' : $paginator_url . '&';
if (!$paginator->isFirst()) {
$smarty->assign('_mobile_access_paginator_prev_url', $paginator_url . 'page=' . ($paginator->getCurrentPage() - 1) . $url_params . $paginator_anchor);
}
// if
if (!$paginator->isLast()) {
$smarty->assign('_mobile_access_paginator_next_url', $paginator_url . 'page=' . ($paginator->getCurrentPage() + 1) . $url_params . $paginator_anchor);
}
// if
return $smarty->fetch(get_template_path('_paginator', null, MOBILE_ACCESS_MODULE));
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:41,代码来源:function.mobile_access_paginator.php
示例3: update_category
/**
* Show and process config category form
*
* @param void
* @return null
*/
function update_category()
{
$category = ConfigCategories::findById(get_id());
if (!$category instanceof ConfigCategory) {
flash_error(lang('config category dnx'));
$this->redirectToReferer(get_url('administration'));
}
// if
if ($category->isEmpty()) {
flash_error(lang('config category is empty'));
$this->redirectToReferer(get_url('administration'));
}
// if
$options = $category->getOptions(false);
$categories = ConfigCategories::getAll(false);
tpl_assign('category', $category);
tpl_assign('options', $options);
tpl_assign('config_categories', $categories);
$submitted_values = array_var($_POST, 'options');
if (is_array($submitted_values)) {
foreach ($options as $option) {
$new_value = array_var($submitted_values, $option->getName());
if (is_null($new_value) || $new_value == $option->getValue()) {
continue;
}
$option->setValue($new_value);
$option->save();
}
// foreach
flash_success(lang('success update config category', $category->getDisplayName()));
$this->redirectTo('administration', 'configuration');
}
// if
$this->setSidebar(get_template_path('update_category_sidebar', 'config'));
}
开发者ID:469306621,项目名称:Languages,代码行数:41,代码来源:ConfigController.class.php
示例4: advanced_pagination
/**
* Advanced pagination. Differenced between simple and advanced paginations is that
* advanced pagination uses template so its output can be changed in a great number of ways.
*
* All variables are just passed to the template, nothing is done inside the function!
*
* @access public
* @param DataPagination $pagination Pagination object
* @param string $url_base Base URL in witch we will insert current page number
* @param string $template Template that will be used. It can be absolute path to existing file
* or template name that used with get_template_path will return real template path
* @param string $page_placeholder Short string inside of $url_base that will be replaced with
* current page numer
* @return null
*/
function advanced_pagination(DataPagination $pagination, $url_base, $template = 'advanced_pagination', $page_placeholder = '#PAGE#')
{
tpl_assign(array('advanced_pagination_object' => $pagination, 'advanced_pagination_url_base' => $url_base, 'advanced_pagination_page_placeholder' => urlencode($page_placeholder)));
// tpl_assign
$template_path = is_file($template) ? $template : get_template_path($template);
return tpl_fetch($template_path);
}
开发者ID:469306621,项目名称:Languages,代码行数:22,代码来源:pagination.php
示例5: smarty_function_mobile_access_object_comments
/**
* Render comments
*
* Parameters:
*
* - comments - comments that needs to be rendered
* - page - current_page
* - total_pages - total pages
* - counter - counter for comment #
* - url - base URL for link assembly
* - parent - parent object
*
* @param array $params
* @param Smarty $smarty
* @return string
*/
function smarty_function_mobile_access_object_comments($params, &$smarty)
{
$url_params = '';
if (is_foreachable($params)) {
foreach ($params as $k => $v) {
if (strpos($k, 'url_param_') !== false && $v) {
$url_params .= '&' . substr($k, 10) . '=' . $v;
}
// if
}
// foreach
}
// if
$object = array_var($params, 'object');
if (!instance_of($object, 'ProjectObject')) {
return new InvalidParamError('object', $object, '$object is expected to be an instance of ProjectObject class', true);
}
// if
$user = array_var($params, 'user');
if (!instance_of($user, 'User')) {
return new InvalidParamError('object', $user, '$user is expected to be an instance of User class', true);
}
// if
$page = array_var($params, 'page', 1);
$page = (int) array_var($_GET, 'page');
if ($page < 1) {
$page = 1;
}
// if
$counter = array_var($params, 'counter', 1);
$counter = ($page - 1) * $object->comments_per_page + $counter;
list($comments, $pagination) = $object->paginateComments($page, $object->comments_per_page, $user->getVisibility());
$smarty->assign(array("_mobile_access_comments_comments" => $comments, "_mobile_access_comments_paginator" => $pagination, "_mobile_access_comments_url" => mobile_access_module_get_view_url($object), "_mobile_access_comments_url_params" => $url_params, "_mobile_access_comments_counter" => $counter, "_mobile_access_comments_show_counter" => array_var($params, 'show_counter', true)));
return $smarty->fetch(get_template_path('_object_comments', null, MOBILE_ACCESS_MODULE));
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:51,代码来源:function.mobile_access_object_comments.php
示例6: smarty_function_object_subscriptions
/**
* Render object subscribers
*
* @param array $params
* @param Smarty $smarty
* @return string
*/
function smarty_function_object_subscriptions($params, &$smarty)
{
$object = array_var($params, 'object');
if (!instance_of($object, 'ProjectObject')) {
return new InvalidParamError('object', $object, '$object is expected to be an instance of ProjectObject class', true);
}
// if
js_assign('max_subscribers_count', MAX_SUBSCRIBERS_COUNT);
require_once SYSTEM_MODULE_PATH . '/helpers/function.user_link.php';
$subscribers = $object->getSubscribers();
if (count($subscribers) > MAX_SUBSCRIBERS_COUNT) {
$smarty->assign(array('_object_subscriptions_list_subscribers' => false, '_object_subscriptions_object' => $object, '_object_subscriptions_subscribers_count' => count($subscribers), '_object_subscription_brief' => array_var($params, 'brief', false), '_object_subscriptions_popup_url' => assemble_url('object_subscribers_widget', array('object_id' => $object->getId()))));
} else {
$links = null;
if (is_foreachable($subscribers)) {
$links = array();
foreach ($subscribers as $subscriber) {
$links[] = smarty_function_user_link(array('user' => $subscriber), $smarty);
}
// foreach
}
// if
$smarty->assign(array('_object_subscriptions_list_subscribers' => true, '_object_subscriptions' => $subscribers, '_object_subscriptions_object' => $object, '_object_subscription_links' => $links, '_object_subscription_brief' => array_var($params, 'brief', false), '_object_subscriptions_popup_url' => assemble_url('object_subscribers_widget', array('object_id' => $object->getId()))));
}
// if
return $smarty->fetch(get_template_path('_object_subscriptions', 'subscriptions', RESOURCES_MODULE));
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:34,代码来源:function.object_subscriptions.php
示例7: smarty_function_object_tasks
/**
* Render object tasks section
*
* Parameters:
*
* - object - Selected project object
*
* @param array $params
* @param Smarty $smarty
* @return string
*/
function smarty_function_object_tasks($params, &$smarty)
{
$object = array_var($params, 'object');
if (!instance_of($object, 'ProjectObject')) {
return new InvalidParamError('object', $object, '$object is expected to be an instance of ProjectObject class', true);
}
// if
$open_tasks = $object->getOpenTasks();
if (is_foreachable($open_tasks)) {
foreach ($open_tasks as $open_task) {
ProjectObjectViews::log($open_task, $smarty->get_template_vars('logged_user'));
}
// foreach
}
// if
$completed_tasks = $object->getCompletedTasks(COMPLETED_TASKS_PER_OBJECT);
if (is_foreachable($completed_tasks)) {
foreach ($completed_tasks as $completed_task) {
ProjectObjectViews::log($completed_task, $smarty->get_template_vars('logged_user'));
}
// foreach
}
// if
$smarty->assign(array('_object_tasks_object' => $object, '_object_tasks_open' => $open_tasks, '_object_tasks_can_reorder' => (int) $object->canEdit($smarty->get_template_vars('logged_user')), '_object_tasks_completed' => $completed_tasks, '_object_tasks_completed_remaining' => $object->countCompletedTasks() - COMPLETED_TASKS_PER_OBJECT, '_object_tasks_skip_wrapper' => array_var($params, 'skip_wrapper', false), '_object_tasks_skip_head' => array_var($params, 'skip_head', false), '_object_tasks_force_show' => array_var($params, 'force_show', true)));
return $smarty->fetch(get_template_path('_object_tasks', 'tasks', RESOURCES_MODULE));
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:37,代码来源:function.object_tasks.php
示例8: execute
/**
* Execute the script
*
* @param void
* @return boolean
*/
function execute()
{
// ---------------------------------------------------
// Check MySQL version
// ---------------------------------------------------
$mysql_version = mysql_get_server_info($this->database_connection);
if ($mysql_version && version_compare($mysql_version, '4.1', '>=')) {
$constants['DB_CHARSET'] = 'utf8';
@mysql_query("SET NAMES 'utf8'", $this->database_connection);
tpl_assign('default_collation', $default_collation = 'collate utf8_unicode_ci');
tpl_assign('default_charset', $default_charset = 'DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci');
} else {
tpl_assign('default_collation', $default_collation = '');
tpl_assign('default_charset', $default_charset = '');
}
// if
tpl_assign('table_prefix', TABLE_PREFIX);
// ---------------------------------------------------
// Execute migration
// ---------------------------------------------------
$total_queries = 0;
$executed_queries = 0;
$upgrade_script = tpl_fetch(get_template_path('db_migration/1_0_milanga'));
if ($this->executeMultipleQueries($upgrade_script, $total_queries, $executed_queries, $this->database_connection)) {
$this->printMessage("Database schema transformations executed (total queries: {$total_queries})");
} else {
$this->printMessage('Failed to execute DB schema transformations. MySQL said: ' . mysql_error(), true);
return false;
}
// if
$this->printMessage('Feng Office has been upgraded. You are now running Feng Office ' . $this->getVersionTo() . ' Enjoy!');
}
开发者ID:abhinay100,项目名称:fengoffice_app,代码行数:38,代码来源:MilangaUpgradeScript.class.php
示例9: smarty_function_object_comments_all
/**
* List object comments
*
* Parameters:
*
* - object - Parent object. It needs to be an instance of ProjectObject class
* - comments - List of comments. It is optional. If it is missing comments
* will be loaded by calling getCommetns() method of parent object
*
* @param array $params
* @param Smarty $smarty
* @return string
*/
function smarty_function_object_comments_all($params, &$smarty)
{
$object = array_var($params, 'object');
if (!instance_of($object, 'ProjectObject')) {
return new InvalidParamError('object', $object, '$object is expected to be an instance of ProjectObject class', true);
}
// if
$logged_user = $smarty->get_template_vars('logged_user');
if (!instance_of($logged_user, 'User')) {
return '';
}
// if
$visiblity = $logged_user->getVisibility();
// if ($object->canView($logged_user) && $object->getVisibility() == VISIBILITY_PRIVATE) {
if ($object->canView($logged_user)) {
$visiblity = VISIBILITY_PRIVATE;
}
$comments = $object->getComments($visiblity);
if (is_foreachable($comments)) {
foreach ($comments as $comment) {
ProjectObjectViews::log($comment, $logged_user);
//BOF:task_1260
$comment->set_action_request_n_fyi_flag($logged_user);
//EOF:task_1260
}
// foreach
}
// if
$count_from = 0;
$smarty->assign(array('_object_comments_object' => $object, '_object_comments_count_from' => $count_from, '_object_comments_comments' => $comments, '_total_comments' => sizeof($comments)));
return $smarty->fetch(get_template_path('_object_comments_all', 'comments', RESOURCES_MODULE));
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:45,代码来源:function.object_comments_all.php
示例10: tickets_dashboard_content
function tickets_dashboard_content($context)
{
$tickets = ProjectTickets::getOpenTicketsByUser(logged_user());
$context->assign('ticketsheader', lang('open tickets'));
$context->assign('tickets', $tickets);
$context->includeTemplate(get_template_path('dashboard', 'tickets'));
}
开发者ID:bahmany,项目名称:PythonPurePaperless,代码行数:7,代码来源:init.php
示例11: minify
function minify()
{
$this->setTemplate(get_template_path("empty"));
if (!logged_user()->isAdministrator()) {
die("You must be an administrator to run this tool.");
}
// include libraries
include_once LIBRARY_PATH . '/jsmin/JSMin.class.php';
include_once LIBRARY_PATH . '/cssmin/CSSMin.class.php';
// process arguments
$minify = isset($_GET['minify']);
// process javascripts
echo "Concatenating javascripts ... \n";
$files = (include "application/layouts/javascripts.php");
$jsmin = "";
foreach ($files as $file) {
$jsmin .= file_get_contents("public/assets/javascript/{$file}") . "\n";
}
echo "Done!<br>\n";
if ($minify) {
echo "Minifying javascript ... \n";
$jsmin = JSMin::minify($jsmin);
echo "Done!<br>\n";
}
echo "Writing to file 'ogmin.js' ... ";
file_put_contents("public/assets/javascript/ogmin.js", $jsmin);
echo "Done!<br>";
echo "<br>";
// process CSS
function changeUrls($css, $base)
{
return preg_replace("/url\\s*\\(\\s*['\"]?([^\\)'\"]*)['\"]?\\s*\\)/i", "url(" . $base . "/\$1)", $css);
}
function parseCSS($filename, $filebase, $imgbase)
{
$css = file_get_contents($filebase . $filename);
$imports = explode("@import", $css);
$cssmin = changeUrls($imports[0], $imgbase);
for ($i = 1; $i < count($imports); $i++) {
$split = explode(";", $imports[$i], 2);
$import = trim($split[0], " \t\n\r\v'\"");
$cssmin .= parseCSS($import, $filebase, $imgbase . "/" . dirname($import));
$cssmin .= changeUrls($split[1], $imgbase);
}
return $cssmin;
}
echo "Concatenating CSS ... ";
$cssmin = parseCSS("website.css", "public/assets/themes/default/stylesheets/", ".");
echo "Done!<br>";
if ($minify) {
echo "Minifying CSS ... ";
$cssmin = CSSMin::minify($cssmin);
echo "Done!<br>";
}
echo "Writing to file 'ogmin.css' ... ";
file_put_contents("public/assets/themes/default/stylesheets/ogmin.css", $cssmin);
echo "Done!<br>";
die;
}
开发者ID:abhinay100,项目名称:feng_app,代码行数:59,代码来源:ToolController.class.php
示例12: displayPWchanger
function displayPWchanger()
{
global $smarty;
$smarty->assign("logo", image(get_template_path("images/logo.png")));
$smarty->assign("date", date("l, dS F Y H:i:s O"));
$smarty->display(get_template_path('password.tpl'));
exit;
}
开发者ID:chrlutz,项目名称:limux-gosa,代码行数:8,代码来源:password.php
示例13: render
/**
* render a template file, using the vars supplied
*
* @param string $template template file can be withouth the extension and should be relative to the templates dir
* @param array $vars
* @return string
*/
function render($template, array $vars = array())
{
$file = get_template_path($template);
extract($vars);
ob_start();
include $file;
return ob_get_clean();
}
开发者ID:rubensayshi,项目名称:portfolio,代码行数:15,代码来源:templates.inc.php
示例14: smarty_function_mobile_access_project_breadcrumbs
/**
* Render project breadcrumbs block
*
* Parameters:
*
* - breadcrumbs - array of breadcrumbs
*
* @param array $params
* @param Smarty $smarty
* @return string
*/
function smarty_function_mobile_access_project_breadcrumbs($params, &$smarty)
{
if (!is_foreachable($breadcrumbs = array_var($params, 'breadcrumbs', null))) {
return null;
}
$smarty->assign(array("mobile_access_project_breadcrumbs_breadcrumbs" => $breadcrumbs));
return $smarty->fetch(get_template_path('_project_breadcrumbs', null, MOBILE_ACCESS_MODULE));
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:19,代码来源:function.mobile_access_project_breadcrumbs.php
示例15: smarty_function_project_card
/**
* Show project card
*
* @param array $params
* @param Smarty $smarty
* @return string
*/
function smarty_function_project_card($params, &$smarty)
{
$project = array_var($params, 'project');
if (!instance_of($project, 'Project')) {
return new InvalidParamError('project', $project, '$project is expected to be an instance of Project class', true);
}
// if
$smarty->assign(array('_card_project' => $project, '_card_project_company' => $project->getCompany()));
return $smarty->fetch(get_template_path('_card', 'project', SYSTEM_MODULE));
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:17,代码来源:function.project_card.php
示例16: smarty_function_activities
/**
* Render activities block
*
* Parameters:
*
* - activities - array of groupped activities
* - project_column - show project column
*
* @param array $params
* @param Smarty $smarty
* @return string
*/
function smarty_function_activities($params, &$smarty)
{
$activities = array_var($params, 'activities');
if (!is_foreachable($activities)) {
return '';
}
// if
$smarty->assign(array('_activities' => $activities, '_activities_project_column' => (bool) array_var($params, 'project_column', true)));
return $smarty->fetch(get_template_path('_activities', null, SYSTEM_MODULE));
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:22,代码来源:function.activities.php
示例17: smarty_function_post_task_form
/**
* Render post tasks form
*
* Parameteres:
*
* - object - Attach task to this object
*
* @param array $params
* @param Smarty $smarty
* @return string
*/
function smarty_function_post_task_form($params, &$smarty)
{
$object = array_var($params, 'object');
if (!instance_of($object, 'ProjectObject')) {
return new InvalidParamError('object', $object, '$object is expected to be an instance of ProjectObject class', true);
}
// if
$smarty->assign(array('_post_task_form_object' => $object));
return $smarty->fetch(get_template_path('_post_task_form', 'tasks', RESOURCES_MODULE));
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:21,代码来源:function.post_task_form.php
示例18: smarty_function_project_progress
/**
* Render project progress bar
*
* @param array $params
* @param Smarty $smarty
* @return string
*/
function smarty_function_project_progress($params, &$smarty)
{
$project = array_var($params, 'project');
if (!instance_of($project, 'Project')) {
return new InvalidParamError('project', $project, '$project is expected to be an instance of Project class', true);
}
// if
$smarty->assign(array('_project_progress' => $project, '_project_progress_info' => (bool) array_var($params, 'info', true)));
return $smarty->fetch(get_template_path('_projects_progress', 'project', SYSTEM_MODULE));
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:17,代码来源:function.project_progress.php
示例19: smarty_function_mobile_access_add_comment_form
/**
* Render add comment form
*
* Parameters:
*
* - parent - comment parent
* - comment_data - POST comment data
*
* @param array $params
* @param Smarty $smarty
* @return string
*/
function smarty_function_mobile_access_add_comment_form($params, &$smarty)
{
$parent = array_var($params, 'parent');
if (!instance_of($parent, 'ProjectObject')) {
return new InvalidParamError('object', $parent, '$object is expected to be an instance of ProjectObject class', true);
}
// if
$smarty->assign(array('_mobile_access_add_comment_form_add_comment_url' => mobile_access_module_get_add_comment_url($parent), '_mobile_access_add_comment_form_comment_data' => array_var($params, 'comment_data', array())));
return $smarty->fetch(get_template_path('_add_comment_form', null, MOBILE_ACCESS_MODULE));
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:22,代码来源:function.mobile_access_add_comment_form.php
示例20: smarty_function_recent_activities
/**
* Render block of the recent activities for selected user
*
* - recent_activities - array of groupped recent activities
*
* @param array $params
* @param Smarty $smarty
* @return string
*/
function smarty_function_recent_activities($params, &$smarty)
{
$recents = array_var($params, 'recent_activities');
if (!is_foreachable($recents)) {
return '';
}
// if
$smarty->assign(array('_recents' => $recents));
return $smarty->fetch(get_template_path('_recent_activities_for_selected_user', null, SYSTEM_MODULE));
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:19,代码来源:function.recent_activities.php
注:本文中的get_template_path函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论