本文整理汇总了PHP中tpl_display函数的典型用法代码示例。如果您正苦于以下问题:PHP tpl_display函数的具体用法?PHP tpl_display怎么用?PHP tpl_display使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tpl_display函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: renderLayout
/**
* Assign content and render layout
*
* @param string $layout_path Path to the layout file
* @param string $content Value that will be assigned to the $content_for_layout
* variable
* @return boolean
* @throws FileDnxError
*/
function renderLayout($layout_path, $content = null)
{
tpl_assign('content_for_layout', $content);
return tpl_display($layout_path);
}
开发者ID:469306621,项目名称:Languages,代码行数:14,代码来源:PageController.class.php
示例2: errorpage
// really shouldn't happen
if (empty($user_id)) {
errorpage('Access denied', 'You don\'t have enough permissions to access this ' . 'page. Please <a href="login.php">login</a> first. ' . '(This feature is not available in Single User Mode)');
}
// save data
if ($save) {
// convert languages array back into string
$languageflags = @join('::', $languages);
// insert data
foreach ($SETUP_USER as $opt) {
$SQL = "REPLACE INTO " . TBL_USERCONFIG . " (user_id, opt, value) \n VALUES ('" . addslashes($user_id) . "', '{$opt}', '" . addslashes(${$opt}) . "')";
runSQL($SQL);
}
// update session variables
update_session();
// reload config
load_config(true);
/*
// clear compiled templates for new template
AG: should not be required
$smarty->clear_compiled_tpl(null, $config['cacheid']);
*/
}
// prepare options
$setup = setup_mkOptions(true);
// prepare templates
tpl_page('profile');
$smarty->assign('setup', $setup);
// display templates
tpl_display('profile.tpl');
开发者ID:Boris-de,项目名称:videodb,代码行数:30,代码来源:profile.php
示例3: runSQL
// Check that user entered stuff in username and password boxes
if (!empty($username) && !empty($password)) {
// Lets check the format of username to make sure its ok
if (!preg_match('/[a-z]/i', $username)) {
$error = $lang['msg_invalidchar'];
} else {
$res = runSQL("SELECT passwd, id FROM " . TBL_USERS . " WHERE name='{$username}'");
// if the md5 of the entered password = whats in the database then
// set all the cookies up again
if (md5($password) == $res[0]['passwd']) {
$userid = $res[0]['id'];
login_as($userid, $permanent);
$login = true;
} else {
$error = $lang['msg_loginfailed'];
}
}
}
if ($login) {
if (empty($refer)) {
$refer = 'index.php';
}
redirect(urldecode($refer));
} else {
// prepare templates
tpl_page('multiuser');
$smarty->assign('error', $error);
$smarty->assign('refer', $refer);
// display templates
tpl_display('login.tpl');
}
开发者ID:Boris-de,项目名称:videodb,代码行数:31,代码来源:login.php
示例4: array
<?php
include 'viewer.php';
$data = array('title' => 'hello world', 'h1text' => 'hello smarty');
if (rand(0, 9) < 5) {
$data['debug'] = true;
}
tpl_display('page', $data);
开发者ID:i6ma,项目名称:snp,代码行数:8,代码来源:index.php
示例5: executeAction
/**
* Contruct controller and execute specific action
*
* @access public
* @param string $controller_name
* @param string $action
* @return null
*/
static function executeAction($controller_name, $action) {
$max_users = config_option('max_users');
if ($max_users && Contacts::count() > $max_users) {
echo lang("error").": ".lang("maximum number of users exceeded error");
return;
}
ajx_check_login();
Env::useController($controller_name);
$controller_class = Env::getControllerClass($controller_name);
if(!class_exists($controller_class, false)) {
throw new ControllerDnxError($controller_name);
} // if
$controller = new $controller_class();
if(!instance_of($controller, 'Controller')) {
throw new ControllerDnxError($controller_name);
} // if
if (is_ajax_request()) {
// if request is an ajax request return a json response
// execute the action
$controller->setAutoRender(false);
$controller->execute($action);
// fill the response
$response = AjaxResponse::instance();
if (!$response->hasCurrent()) {
// set the current content
$response->setCurrentContent("html", $controller->getContent(), page_actions(), ajx_get_panel());
}
$response->setEvents(evt_pop());
$error = flash_pop('error');
$success = flash_pop('success');
if (!is_null($error)) {
$response->setError(1, clean($error));
} else if (!is_null($success)) {
$response->setError(0, clean($success));
}
// display the object as json
tpl_assign("object", $response);
$content = tpl_fetch(Env::getTemplatePath("json"));
tpl_assign("content_for_layout", $content);
TimeIt::start("Transfer");
if (is_iframe_request()) {
tpl_display(Env::getLayoutPath("iframe"));
} else {
tpl_display(Env::getLayoutPath("json"));
}
TimeIt::stop();
} else {
return $controller->execute($action);
}
} // executeAction
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:66,代码来源:Env.class.php
示例6: localnet_or_die
localnet_or_die();
// multiuser permission check
permission_or_die(PERM_WRITE, get_owner_id($id));
/*
// remove old cover image from cache
$SQL = 'SELECT imgurl FROM '.TBL_DATA.' WHERE id = '.$id;
$res = runSQL($SQL);
if (count($res))
{
removeCacheFile($res[0]['imgurl']);
}
*/
// remove actual data
runSQL('DELETE FROM ' . TBL_DATA . ' WHERE id = ' . $id);
runSQL('DELETE FROM ' . TBL_VIDEOGENRE . ' WHERE video_id = ' . $id);
//2015-10-6 Alex ADD start
runSQL('DELETE FROM ' . TBL_VIDEOSTUDIO . ' WHERE video_id = ' . $id);
//2015-10-6 Alex ADD end
// clear smarty cache for this item
#!! this does not work- at least not with Smarty3
#$smarty->cache->clear($id);
// goto index instead of delete template
if ($redirect) {
header("Location: index.php?deleteid={$id}");
exit;
}
// prepare templates
tpl_page();
// display templates
tpl_display('delete.tpl');
开发者ID:huya1010,项目名称:videodb,代码行数:30,代码来源:delete.php
示例7: _replace_anchors_callback
/**
* Help Page
*
* Browses the manual
*
* @package videoDB
* @author Andreas Gohr <[email protected]>
* @version $Id: help.php,v 1.10 2004/09/20 15:15:41 andig2 Exp $
*/
require_once './core/functions.php';
function _replace_anchors_callback($matches)
{
if (!preg_match('=^https?://=', $matches[2])) {
$matches[2] = 'help.php?page=' . $matches[2];
}
return $matches[1] . $matches[2] . $matches[3];
}
if (empty($page)) {
$page = 'index.html';
}
$page = 'doc/manual/' . $page;
$html = file_get_contents($page);
$html = preg_replace_callback("/(<a\\s+.*?href\\s*=\\s*\")(.*?)(\".*?>)/is", '_replace_anchors_callback', $html);
preg_match('=<body.*?>(.*)</body>=is', $html, $matches);
$html = $matches[1];
// prepare templates
tpl_page();
$smarty->assign('helptext', $html);
// display templates
tpl_display('help.tpl');
开发者ID:Boris-de,项目名称:videodb,代码行数:30,代码来源:help.php
示例8: executeAction
/**
* Contruct controller and execute specific action
*
* @access public
* @param string $controller_name
* @param string $action
* @return null
*/
static function executeAction($controller_name, $action)
{
$max_users = config_option('max_users');
if ($max_users && Users::count() > $max_users) {
echo lang("error") . ": " . lang("maximum number of users exceeded error");
return;
}
ajx_check_login();
if (isset($_GET['active_project']) && logged_user() instanceof User) {
$dont_update = false;
if (GlobalCache::isAvailable()) {
$option_value = GlobalCache::get('user_config_option_' . logged_user()->getId() . '_lastAccessedWorkspace', $success);
if ($success) {
$dont_update = $option_value == $_GET['active_project'];
}
}
if (!$dont_update) {
set_user_config_option('lastAccessedWorkspace', $_GET['active_project'], logged_user()->getId());
if (GlobalCache::isAvailable()) {
GlobalCache::update('user_config_option_' . logged_user()->getId() . '_lastAccessedWorkspace', $_GET['active_project']);
}
}
}
Env::useController($controller_name);
$controller_class = Env::getControllerClass($controller_name);
if (!class_exists($controller_class, false)) {
throw new ControllerDnxError($controller_name);
}
// if
$controller = new $controller_class();
if (!instance_of($controller, 'Controller')) {
throw new ControllerDnxError($controller_name);
}
// if
if (is_ajax_request()) {
// if request is an ajax request return a json response
// execute the action
$controller->setAutoRender(false);
$controller->execute($action);
// fill the response
$response = AjaxResponse::instance();
if (!$response->hasCurrent()) {
// set the current content
$response->setCurrentContent("html", $controller->getContent(), page_actions(), ajx_get_panel());
}
$response->setEvents(evt_pop());
$error = flash_pop('error');
$success = flash_pop('success');
if (!is_null($error)) {
$response->setError(1, clean($error));
} else {
if (!is_null($success)) {
$response->setError(0, clean($success));
}
}
// display the object as json
tpl_assign("object", $response);
$content = tpl_fetch(Env::getTemplatePath("json"));
tpl_assign("content_for_layout", $content);
TimeIt::start("Transfer");
if (is_iframe_request()) {
tpl_display(Env::getLayoutPath("iframe"));
} else {
tpl_display(Env::getLayoutPath("json"));
}
TimeIt::stop();
} else {
return $controller->execute($action);
}
}
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:78,代码来源:Env.class.php
示例9: executeStep
/**
* Execute specific step
*
* @access public
* @param integer $step_number
* @return null
*/
function executeStep($step_number)
{
$step = $this->getStep($step_number);
if (!$step instanceof ScriptInstallerStep) {
die("Step '{$step_number}' does not exist in the installation process");
}
// if
tpl_assign('installer', $this);
tpl_assign('current_step', $step);
tpl_assign('installation_name', $this->getInstallationName());
tpl_assign('installation_description', $this->getInstallationDescription());
$execution_result = $step->execute();
// If execute() returns true redirect to next step (if exists)
if ($execution_result) {
$this->addExecutedStep($step_number);
$next_step = $step->getNextStep();
if ($next_step instanceof ScriptInstallerStep) {
$this->goToStep($next_step->getStepNumber());
}
// if
} else {
tpl_display(get_template_path('layout.php'));
}
// if
}
开发者ID:469306621,项目名称:Languages,代码行数:32,代码来源:ScriptInstaller.class.php
示例10: renderLayout
/**
* Assign content and render layout
*
* @param string $layout_path Path to the layout file
* @param string $content Value that will be assigned to the $content_for_layout
* variable
* @return boolean
* @throws FileDnxError
*/
function renderLayout($layout_path, $content = null, $die = false)
{
tpl_assign('content_for_layout', $content);
$display = tpl_display($layout_path);
if ($die) {
die;
}
// if
return $display;
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:19,代码来源:PageController.class.php
示例11: trace
<?php
trace(__FILE__, 'begin');
$login_show_options = config_option('login_show_options', false);
if ($login_show_options) {
tpl_display(get_template_path('login1', 'access'));
} else {
tpl_display(get_template_path('login2', 'access'));
}
trace(__FILE__, 'end');
开发者ID:federosky,项目名称:ProjectPier-Core,代码行数:10,代码来源:login.php
示例12: request
* 0: "classic" mode - no use of iframes
* 1: "iframe" mode
* used to display template containing iframe
* 2: "iframe" mode
* used to display iframe contents
*/
if ($iframe == 1) {
// mode 1: display template with url
$url = request(true);
} else {
// mode 0 or 2: fetch data for display
// fetch URL
$fetchtime = time();
$page = request();
$fetchtime = time() - $fetchtime;
// convert HTML for output
$page = fixup_HTML($page);
}
if ($iframe == 2) {
// mode 2: display data into iframe
echo $page;
exit;
}
// mode 0 or 1: prepare templates
tpl_page('imdbbrowser');
$smarty->assign('url', $url);
$smarty->assign('page', $page);
$smarty->assign('fetchtime', $fetchtime);
// display templates
tpl_display('trace.tpl');
开发者ID:Boris-de,项目名称:videodb,代码行数:30,代码来源:trace.php
示例13: redirect
if (empty($config['enginedefault'])) {
$config['enginedefault'] = 'imdb';
}
// check permissions again - they may have changed
if (!check_permission(PERM_ADMIN)) {
redirect('login.php');
}
// destroy cookies if required
if ($_COOKIE['VDBusername'] && !$config['multiuser']) {
setcookie('VDBpassword', '', time() - 7200);
setcookie('VDBusername', '', time() - 7200);
setcookie('VDBuserid', '', time() - 7200);
}
// cache maintenance
if ($cacheempty) {
// clear thumbnail cache
runSQL('DELETE FROM ' . TBL_CACHE);
// clean HTTP cache
cache_prune_folders(CACHE . '/' . CACHE_HTML . '/', 0, true, false, '*', (int) $config['hierarchical']);
// clean Smarty as well
$smarty->clearAllCache();
}
// prepare options
$setup = setup_mkOptions(false);
// prepare templates
tpl_page('configview');
$smarty->assign('setup', $setup);
$smarty->assign('cacheclear', $cacheempty);
// display templates
tpl_display('setup.tpl');
开发者ID:Boris-de,项目名称:videodb,代码行数:30,代码来源:setup.php
示例14: out_owners
// build html select box
$all = $lang['filter_any'];
$smarty->assign('owners', out_owners(array($all => $all), PERM_READ));
$smarty->assign('owner', $owner);
// if we don't have read all permissions, limit visibility using cross-user permissions
if (!check_permission(PERM_READ)) {
$JOINS = ' LEFT JOIN ' . TBL_PERMISSIONS . ' ON ' . TBL_DATA . '.owner_id = ' . TBL_PERMISSIONS . '.to_uid';
$WHERES .= ' AND ' . TBL_PERMISSIONS . '.from_uid = ' . get_current_user_id() . ' AND ' . TBL_PERMISSIONS . '.permissions & ' . PERM_READ . ' != 0';
}
// further limit to single owner
if ($owner != $all) {
$WHERES .= " AND " . TBL_USERS . ".name = '" . addslashes($owner) . "'";
}
}
// overview on lent disks
$SQL = "SELECT who, DATE_FORMAT(dt,'%d.%m.%Y') as dt, " . TBL_LENT . ".diskid,\n CASE WHEN subtitle = '' THEN title ELSE CONCAT(title,' - ',subtitle) END AS title,\n " . TBL_DATA . ".id, COUNT(" . TBL_LENT . ".diskid) AS count, " . TBL_USERS . ".name AS owner\n FROM " . TBL_LENT . ", " . TBL_DATA . "\n LEFT JOIN " . TBL_USERS . " ON owner_id = " . TBL_USERS . ".id\n {$JOINS}\n WHERE " . TBL_LENT . ".diskid = " . TBL_DATA . ".diskid \n {$WHERES}\n GROUP BY " . TBL_LENT . ".diskid\n ORDER BY who, " . TBL_LENT . ".diskid";
$result = runSQL($SQL);
// check permissions
for ($i = 0; $i < count($result); $i++) {
$result[$i]['editable'] = check_permission(PERM_WRITE, get_userid($result[$i]['owner']));
}
// prepare templates
tpl_page();
$smarty->assign('diskid', $diskid);
$smarty->assign('who', $who);
$smarty->assign('dt', $dt);
$smarty->assign('editable', $editable);
$smarty->assign('borrowlist', $result);
// display templates
tpl_display('borrow.tpl');
开发者ID:Boris-de,项目名称:videodb,代码行数:30,代码来源:borrow.php
示例15: get_current_user_id
LEFT JOIN ' . TBL_USERS . ' ON ' . TBL_DATA . '.owner_id = ' . TBL_USERS . '.id
LEFT JOIN ' . TBL_USERSEEN . '
ON ' . TBL_DATA . '.id = ' . TBL_USERSEEN . '.video_id AND ' . TBL_USERSEEN . '.user_id = ' . get_current_user_id() . '
WHERE ' . TBL_DATA . '.id = ' . $id;
$video = runSQL($SELECT);
// diskid to global scope:
$diskid = $video[0]['diskid'];
} else {
$video[0]['language'] = $config['langdefault'];
}
// assign automatic disk id
if ($config['autoid'] && (empty($diskid) || $add_flag) && $mediatype != MEDIA_WISHLIST) {
$video[0]['diskid'] = getDiskId();
// Fix for Bugreport [1122052] Automatic DiskID generation problem
$smarty->assign('autoid', $result[0]['max']);
}
if (empty($video[0]['owner_id']) && !empty($owner_id)) {
$video[0]['owner_id'] = $owner_id;
}
// prepare templates
tpl_page();
tpl_edit($video[0]);
$smarty->assign('lookup_id', $lookup);
$smarty->assign('http_error', $CLIENTERROR);
// allow XML import
if ($config['xml'] && empty($id)) {
$smarty->assign('xmlimport', true);
}
// display templates
tpl_display('edit.tpl');
开发者ID:Boris-de,项目名称:videodb,代码行数:30,代码来源:edit.php
示例16: array
if ($filename == 'index.php') {
continue;
}
$info = array('contrib/' . $filename);
$file = $dirpath . '/' . $filename;
$content = file_get_contents($file);
// title
if (preg_match('/<TITLE.*?>(.+?)</msi', $content, $title)) {
$info[1] = $title[1];
} else {
$info[1] = preg_replace('/\\.php$/', '', $filename);
}
// access
if (preg_match('/^.*?\\*[\\t ]+@meta[\\t ]+ACCESS:(.*?)\\n/i', $content, $access)) {
$info[2] = trim($access[1]);
}
// add to list of access rights are valid
if (empty($info[2]) || check_permission($info[2])) {
$files[] = $info;
}
}
closedir($dh);
}
// sort by title
$files = multidimsort($files, 1);
// prepare templates
tpl_page();
$smarty->assign('files', $files);
// display templates
tpl_display('contrib.tpl');
开发者ID:Boris-de,项目名称:videodb,代码行数:30,代码来源:contrib.php
示例17: tpl_assign
<div class="mail-account-item dataBlock" id="<?php
echo $genid;
?>
sync_folders" style="padding:5px;<?php
?>
">
<div id="<?php
echo $genid;
?>
imap_folders_sync"><?php
tpl_assign('imap_folders_sync', isset($imap_folders_sync) ? $imap_folders_sync : array());
tpl_assign('genid', $genid);
tpl_assign('mail_acc_id', $mail_acc_id);
tpl_display(get_template_path("fetch_imap_folders_sync", "mail"));
?>
</div>
</div>
</div>
<?php
}
?>
<?php
}
?>
开发者ID:abhinay100,项目名称:fengoffice_app,代码行数:30,代码来源:add_account.php
示例18: ajx_check_login
/**
* Checks whether the user is logged in and if not returns an error response.
*
*/
function ajx_check_login() {
if (is_ajax_request() && !logged_user() instanceof Contact && (array_var($_GET, 'c') != 'access' || array_var($_GET, 'a') != 'relogin')) {
// error, user not logged in => return error message
$response = AjaxResponse::instance();
$response->setCurrentContent("empty");
$response->setError(SESSION_EXPIRED_ERROR_CODE, lang("session expired error"));
// display the object as json
tpl_assign("object", $response);
$content = tpl_fetch(Env::getTemplatePath("json"));
tpl_assign("content_for_layout", $content);
tpl_display(Env::getLayoutPath("json"));
exit();
}
}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:19,代码来源:ajax.php
示例19: core_dimensions_quickadd_extra_fields
function core_dimensions_quickadd_extra_fields($dimId)
{
if ($dimId == Dimensions::findByCode("feng_persons")->getId()) {
tpl_display(PLUGIN_PATH . "/core_dimensions/templates/quickadd_extra_fields.php");
}
}
开发者ID:rorteg,项目名称:fengoffice,代码行数:6,代码来源:core_dimensions_hooks.php
示例20: lang
?>
</label>
<input id="first_name" style="width: 292px;" type="text" class="add-person-field"/>
</div>
<div class="field email">
<label><?php
echo lang('email');
?>
</label>
<input id="email" style="width: 292px;" type="email" name="contact[email]"/>
</div>
<div class="clear"></div>
<div id="company">
<?php
tpl_display(get_template_path("add_contact/access_data_company", "contact"));
?>
</div>
<button class="add-person-button add-first-btn">
<img src="public/assets/themes/default/images/16x16/add.png">
<?php
echo lang('add');
?>
</button>
<a href='#' style="float: right;" class='internalLink ContactFormShowAll' ><b><?php
echo lang('View and edit all details');
?>
</b></a>
开发者ID:abhinay100,项目名称:fengoffice_app,代码行数:30,代码来源:template.php
注:本文中的tpl_display函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论