本文整理汇总了PHP中Smarty_Internal_Template::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP Smarty_Internal_Template::fetch方法的具体用法?PHP Smarty_Internal_Template::fetch怎么用?PHP Smarty_Internal_Template::fetch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Smarty_Internal_Template
的用法示例。
在下文中一共展示了Smarty_Internal_Template::fetch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: theliaModule
/**
* Process theliaModule template inclusion function
*
* This function accepts two parameters:
*
* - location : this is the location in the admin template. Example: folder-edit'. The function will search for
* AdminIncludes/<location>.html file, and fetch it as a Smarty template.
* - countvar : this is the name of a template variable where the number of found modules includes will be assigned.
*
* @param array $params
* @param \Smarty_Internal_Template $template
* @internal param \Thelia\Core\Template\Smarty\Plugins\unknown $smarty
*
* @return string
*/
public function theliaModule($params, \Smarty_Internal_Template $template)
{
$content = null;
$count = 0;
if (false !== ($location = $this->getParam($params, 'location', false))) {
if ($this->debug === true && $this->request->get('SHOW_INCLUDE')) {
echo sprintf('<div style="background-color: #C82D26; color: #fff; border-color: #000000; border: solid;">%s</div>', $location);
}
$moduleLimit = $this->getParam($params, 'module', null);
$modules = ModuleQuery::getActivated();
/** @var \Thelia\Model\Module $module */
foreach ($modules as $module) {
if (null !== $moduleLimit && $moduleLimit != $module->getCode()) {
continue;
}
$file = $module->getAbsoluteAdminIncludesPath() . DS . $location . '.html';
if (file_exists($file)) {
$output = trim(file_get_contents($file));
if (!empty($output)) {
$content .= $output;
$count++;
}
}
}
}
if (false !== ($countvarname = $this->getParam($params, 'countvar', false))) {
$template->assign($countvarname, $count);
}
if (!empty($content)) {
return $template->fetch(sprintf("string:%s", $content));
}
return "";
}
示例2: smarty_function_widget_template
/**
* Plugin for Smarty
*
* @param array $aParams
* @param Smarty_Internal_Template $oSmartyTemplate
*
* @return string|null
*/
function smarty_function_widget_template($aParams, $oSmartyTemplate)
{
if (!isset($aParams['name'])) {
trigger_error('Parameter "name" does not define in {widget ...} function', E_USER_WARNING);
return null;
}
$sWidgetName = $aParams['name'];
$aWidgetParams = isset($aParams['params']) ? $aParams['params'] : array();
$oEngine = Engine::getInstance();
// Проверяем делигирование
$sTemplate = E::ModulePlugin()->GetDelegate('template', $sWidgetName);
if ($sTemplate) {
if ($aWidgetParams) {
foreach ($aWidgetParams as $sKey => $sVal) {
$oSmartyTemplate->assign($sKey, $sVal);
}
if (!isset($aWidgetParams['params'])) {
/* LS-compatible */
$oSmartyTemplate->assign('params', $aWidgetParams);
}
$oSmartyTemplate->assign('aWidgetParams', $aWidgetParams);
}
$sResult = $oSmartyTemplate->fetch($sTemplate);
} else {
$sResult = null;
}
return $sResult;
}
示例3: displayListFooter
/**
* Close list table and submit button
*/
public function displayListFooter()
{
if (!isset($this->list_id)) {
$this->list_id = $this->table;
}
$this->footer_tpl->assign(array_merge($this->tpl_vars, array('current' => $this->currentIndex, 'list_id' => $this->list_id)));
return $this->footer_tpl->fetch();
}
示例4: fetch
public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null, $display = false, $merge_tpl_vars = true, $no_output_filter = false)
{
if ($this->source->type == 'extends') {
$templates = explode('|', $this->source->name);
// foreach($templates as $thisTemplate)
// echo "\nexternal template = {$thisTemplate}<br>\n";
}
return parent::fetch($template, $cache_id, $compile_id, $parent, $display, $merge_tpl_vars, $no_output_filter);
}
示例5: fetch
public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null, $display = false, $merge_tpl_vars = true, $no_output_filter = false)
{
if (!is_null($template)) {
$tpl = $template->template_resource;
} else {
$tpl = $this->template_resource;
}
return "\n<!-- begin {$tpl} -->\n" . parent::fetch($template, $cache_id, $compile_id, $parent, $display, $merge_tpl_vars, $no_output_filter) . "\n<!-- end {$tpl} -->\n";
}
示例6: smarty_block_language
/**
* Language forms
*
* @package application.helper.smarty
* @author Integry Systems
*
* @package application.helper.smarty
*/
function smarty_block_language($params, $content, Smarty_Internal_Template $smarty, &$repeat)
{
//$smarty = $smarty->smarty;
$app = $smarty->smarty->getApplication();
if (!$app->getLanguageSetArray()) {
return false;
}
if ($repeat) {
$app->languageBlock = $app->getLanguageSetArray();
$smarty->assign('languageBlock', $app->languageBlock);
$smarty->assign('lang', array_shift($app->languageBlock));
$app->langHeadDisplayed = false;
$user = SessionUser::getUser();
foreach ($app->getLanguageSetArray() as $lang) {
$userPref = $user->getPreference('tab_lang_' . $lang['ID']);
$isHidden = is_null($userPref) ? !empty($params['hidden']) : $userPref == 'false';
$classNames[$lang['ID']] = $isHidden ? 'hidden' : '';
}
$app->langClassNames = $classNames;
} else {
if (!trim($content)) {
$repeat = false;
return false;
}
if ($app->languageBlock) {
$repeat = true;
}
$contentLang = $smarty->getTemplateVars('lang');
$content = '<tab class="lang_' . $contentLang['ID'] . '" heading="' . $contentLang['originalName'] . '">' . $content . '</tab>';
if (!$app->langHeadDisplayed) {
$smarty->assign('classNames', $app->langClassNames);
$content = $smarty->fetch('block/backend/langFormHead.tpl') . $content;
$app->langHeadDisplayed = true;
}
$smarty->assign('lang', array_shift($app->languageBlock));
// form footer
if (!$repeat) {
$content .= $smarty->fetch('block/backend/langFormFoot.tpl');
}
return $content;
}
}
示例7: smarty_function_pagination
/**
* Paginate layout printing function.
*
* @param array $params Specified params.
* @param Smarty_Internal_Template $template Instance of Smarty template class.
*
* @uses Core\Config()
*
* @return string Rendered pagination template.
*/
function smarty_function_pagination(array $params, Smarty_Internal_Template $template)
{
$viewsPaths = Core\Config()->paths('views');
$params['range'] = isset($params['range']) ? abs($params['range']) : 2;
$_path_to_templates = $viewsPaths['templates'] . '_shared' . DIRECTORY_SEPARATOR;
$_template = isset($params['template']) ? $_path_to_templates . $params['template'] . '.html.tpl' : null;
$params['template'] = file_exists($_template) ? $_template : $_path_to_templates . 'pagination' . DIRECTORY_SEPARATOR . 'default.html.tpl';
$paginator = $params['paginator'];
$pages_range = $paginator->range($params['range']);
$range = array();
$range['start'] = isset($pages_range['first']->pageNumber) ? $pages_range['first']->pageNumber : 0;
$range['end'] = isset($pages_range['last']->pageNumber) ? $pages_range['last']->pageNumber : 0;
$template->assign('pagination', array('current' => $paginator->current(), 'first' => $paginator->first(), 'last' => $paginator->last(), 'prev' => $paginator->prev(), 'next' => $paginator->next(), 'boundaries' => isset($params['boundaries']) ? !!$params['boundaries'] : false, 'range' => $params['range'], 'pages' => range($range['start'], $range['end'])));
return $template->fetch($params['template']);
}
示例8:
function content_52ccccc197c241_31222556($_smarty_tpl)
{
?>
<table class="ow_automargin ow_std_margin">
<tr>
<td style="text-align: right;">
<span style="font-size: 9px;line-height:9px;">advertisement</span>
<div style="text-align: center;"><?php
$_template = new Smarty_Internal_Template('eval:' . $_smarty_tpl->tpl_vars['code']->value, $_smarty_tpl->smarty, $_smarty_tpl);
echo $_template->fetch();
?>
</div>
</td>
</tr>
</table>
<?php
}
示例9: smarty_function_paginate
/**
* Generates pagination block
*
* @param array $params
* @param Smarty $smarty
* @return string
*
* @package application.helper.smarty
* @author Integry Systems
*/
function smarty_function_paginate($params, Smarty_Internal_Template $smarty)
{
$interval = 2;
if (isset($params['interval'])) {
$interval = $params['interval'];
}
// determine which page numbers will be displayed
$count = ceil($params['count'] / $params['perPage']);
$pages = range(max(1, $params['current'] - $interval), min($count, $params['current'] + $interval));
if (array_search(1, $pages) === false) {
array_unshift($pages, 1);
}
if (array_search($count, $pages) === false) {
$pages[] = $count;
}
// check for any 1-page sized interval breaks
$pr = 0;
foreach ($pages as $k) {
if ($k - 2 == $pr) {
$pages[] = $k - 1;
}
$pr = $k;
}
sort($pages);
// generate output
$out = array();
$application = $smarty->getApplication();
// get variable to replace - _page_ if defined, otherwise 0
$replace = strpos($params['url'], '_000_') ? '_000_' : 0;
$render = array();
if ($params['current'] > 1) {
$urls['previous'] = str_replace($replace, $params['current'] - 1, $params['url']);
}
foreach ($pages as $k) {
$urls[$k] = str_replace($replace, $k, $params['url']);
}
if ($params['current'] < $count) {
$urls['next'] = str_replace($replace, $params['current'] + 1, $params['url']);
}
$smarty->assign('urls', $urls);
$smarty->assign('pages', $pages);
$smarty->assign('current', $params['current']);
return $smarty->fetch($smarty->getApplication()->getRenderer()->getTemplatePath('block/box/paginate.tpl'));
return implode(' ', $out);
}
示例10: settype
//.........这里部分代码省略.........
echo $_smarty_tpl->tpl_vars['entry']->value->required_symbol;
}
?>
</label><br /><?php
}
if ($_smarty_tpl->tpl_vars['entry']->value->multiple_parts == 1) {
if (isset($_smarty_tpl->tpl_vars['smarty']->value['section']['numloop'])) {
unset($_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']);
}
$_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['name'] = 'numloop';
$_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['loop'] = is_array($_loop = $_smarty_tpl->tpl_vars['entry']->value->input) ? count($_loop) : max(0, (int) $_loop);
unset($_loop);
$_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['show'] = true;
$_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['max'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['loop'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['step'] = 1;
$_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['start'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['step'] > 0 ? 0 : $_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['loop'] - 1;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['show']) {
$_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['total'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['loop'];
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['total'] == 0) {
$_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['show'] = false;
}
} else {
$_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['total'] = 0;
}
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['show']) {
for ($_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['index'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['iteration'] = 1; $_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['iteration'] <= $_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['total']; $_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['index'] += $_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['step'], $_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['iteration']++) {
$_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['rownum'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['iteration'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['index_prev'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['index'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['index_next'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['index'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['first'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['iteration'] == 1;
$_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['last'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['iteration'] == $_smarty_tpl->tpl_vars['smarty']->value['section']['numloop']['total'];
if ($_smarty_tpl->tpl_vars['entry']->value->label_parts == 1) {
?>
<div><?php
echo $_smarty_tpl->tpl_vars['entry']->value->input[$_smarty_tpl->getVariable('smarty')->value['section']['numloop']['index']]->input;
?>
<?php
echo $_smarty_tpl->tpl_vars['entry']->value->input[$_smarty_tpl->getVariable('smarty')->value['section']['numloop']['index']]->name;
?>
</div><?php
} else {
echo $_smarty_tpl->tpl_vars['entry']->value->input[$_smarty_tpl->getVariable('smarty')->value['section']['numloop']['index']]->input;
}
if (isset($_smarty_tpl->tpl_vars['entry']->value->input[$_smarty_tpl->getVariable('smarty', null, true, false)->value['section']['numloop']['index']]->op) && $_smarty_tpl->tpl_vars['entry']->value->input[$_smarty_tpl->getVariable('smarty')->value['section']['numloop']['index']]->op) {
echo $_smarty_tpl->tpl_vars['entry']->value->input[$_smarty_tpl->getVariable('smarty')->value['section']['numloop']['index']]->op;
}
}
}
} else {
if ($_smarty_tpl->tpl_vars['entry']->value->smarty_eval == '1') {
$_template = new Smarty_Internal_Template('eval:' . $_smarty_tpl->tpl_vars['entry']->value->input, $_smarty_tpl->smarty, $_smarty_tpl);
echo $_template->fetch();
} else {
echo $_smarty_tpl->tpl_vars['entry']->value->input;
}
}
if ($_smarty_tpl->tpl_vars['entry']->value->valid == 0) {
?>
<--- <?php
echo $_smarty_tpl->tpl_vars['entry']->value->error;
}
if ($_smarty_tpl->tpl_vars['entry']->value->needs_div == 1) {
?>
</div><?php
}
?>
<?php
}
?>
<?php
}
?>
<?php
if ($_smarty_tpl->tpl_vars['has_captcha']->value == 1) {
?>
<div class="captcha"><?php
echo $_smarty_tpl->tpl_vars['graphic_captcha']->value;
echo $_smarty_tpl->tpl_vars['title_captcha']->value;
?>
<br /><?php
echo $_smarty_tpl->tpl_vars['input_captcha']->value;
?>
</div>
<?php
}
?>
<div class="submit"><?php
echo $_smarty_tpl->tpl_vars['prev']->value;
echo $_smarty_tpl->tpl_vars['submit']->value;
?>
</div>
</div>
<?php
echo $_smarty_tpl->tpl_vars['fb_form_end']->value;
?>
<?php
}
echo $_smarty_tpl->tpl_vars['fb_form_footer']->value;
}
开发者ID:Alexkuva,项目名称:Beaupotager,代码行数:101,代码来源:FormBuilder^b0659d02ad1b203aa3e41d342af5160056429a53.module_db_tpl.FormBuilder;fb_4.php
示例11: smarty_function_draw_pager
/**
* Draw Pager
*
* @param $id
* @param $visualPagesCount
* @param $exclude
* @param $additionalParams
* @param $linkClass
* @return string
*/
function smarty_function_draw_pager($params, Smarty_Internal_Template &$smarty)
{
$id = null;
$visualPagesCount = null;
$excludedGetsArray = array();
extract($params);
if (empty($visualPagesCount)) {
$visualPagesCount = ConfigManager::getConfig("Pager", "Pager")->AuxConfig->defaultVisualPagesCount;
}
if (empty($id)) {
$id = null;
}
if (isset($exclude) and !empty($exclude)) {
$excludedGetsArray = explode(",", str_replace(" ", "", $exclude));
}
$pager = Pager::getPager($id);
if ($pager instanceof Pager) {
if (isset($baseLink) and !empty($baseLink)) {
// Remove heading slash if present
$link = ltrim($baseLink, "/");
$link = Reg::get(ConfigManager::getConfig("RewriteURL")->Objects->rewriteURL)->glink($link);
} else {
$link = getCurrentUrl(array_merge(array($pager->getUrlParam()), $excludedGetsArray));
}
if (isset($additionalParams) and !empty($additionalParams)) {
RewriteURL::ensureLastSlash($additionalParams);
$urlParam = $additionalParams . $pager->getUrlParam();
} else {
$urlParam = $pager->getUrlParam();
}
$currentPageNumber = $pager->getCurrentPageNumber();
$pagesCount = $pager->getTotalPagesCount();
if ($pagesCount > 1) {
$pageNumStart = $currentPageNumber - floor($visualPagesCount / 2);
if ($pageNumStart < 1) {
$pageNumStart = 1;
}
$pageNumEnd = $pageNumStart + $visualPagesCount - 1;
if ($pageNumEnd > $pagesCount) {
$pageNumEnd = $pagesCount;
$pageNumStart = $pageNumEnd - $visualPagesCount + 1;
if ($pageNumStart < 1) {
$pageNumStart = 1;
}
}
if ($pageNumStart > 1) {
$pagerFirstPageLink = $link . $urlParam . ':1';
$smarty->assign('pagerFirstPageLink', $pagerFirstPageLink);
}
if ($pageNumEnd < $pagesCount) {
$pagerLastPageLink = $link . $urlParam . ':' . $pagesCount;
$smarty->assign('pagerLastPageLink', $pagerLastPageLink);
}
if ($currentPageNumber > 1) {
$prevPageLink = $link . $urlParam . ':' . ($currentPageNumber - 1);
$smarty->assign('pagerPreviousPageLink', $prevPageLink);
}
$pagerNumbersArray = array();
for ($pgNum = $pageNumStart; $pgNum <= $pageNumEnd; $pgNum++) {
$isCurrent = false;
if ($pgNum == $currentPageNumber) {
$isCurrent = true;
}
$pageLink = $link . $urlParam . ':' . $pgNum;
array_push($pagerNumbersArray, array("pageNum" => $pgNum, "pageLink" => $pageLink, "isCurrent" => $isCurrent));
}
if ($currentPageNumber < $pagesCount) {
$nextPageLink = $link . $urlParam . ':' . ($currentPageNumber + 1);
$smarty->assign('pagerNextPageLink', $nextPageLink);
}
if (isset($linkClass) and !empty($linkClass)) {
$smarty->assign("linkClass", $linkClass);
}
$smarty->assign("pagerPageNumStart", $pageNumStart);
$smarty->assign("pagerPageNumEnd", $pageNumEnd);
$smarty->assign("pagerCurrentPageNumber", $currentPageNumber);
$smarty->assign("pagerTotalPagesCount", $pagesCount);
$smarty->assign("pagerNumbersArray", $pagerNumbersArray);
}
if (isset($tplChunkFile)) {
$pagerChunkFileName = $tplChunkFile;
} else {
$pagerChunkFileName = ConfigManager::getConfig("Pager", "Pager")->AuxConfig->pagerChunkFileName;
}
return $smarty->fetch($smarty->getChunkPath($pagerChunkFileName));
}
}
示例12: settype
function content_51f3ccbeb469c8_36382916($_smarty_tpl)
{
if (!is_callable('smarty_modifier_cms_escape')) {
include '/homepages/26/d480780604/htdocs/plugins/modifier.cms_escape.php';
}
if (!is_callable('smarty_cms_modifier_cms_date_format')) {
include '/homepages/26/d480780604/htdocs/plugins/modifier.cms_date_format.php';
}
if (isset($_smarty_tpl->tpl_vars['entry']->value->canonical)) {
?>
<?php
if (isset($_smarty_tpl->tpl_vars['canonical'])) {
$_smarty_tpl->tpl_vars['canonical'] = clone $_smarty_tpl->tpl_vars['canonical'];
$_smarty_tpl->tpl_vars['canonical']->value = $_smarty_tpl->tpl_vars['entry']->value->canonical;
$_smarty_tpl->tpl_vars['canonical']->nocache = null;
$_smarty_tpl->tpl_vars['canonical']->scope = 0;
} else {
$_smarty_tpl->tpl_vars['canonical'] = new Smarty_variable($_smarty_tpl->tpl_vars['entry']->value->canonical, null, 0);
}
}
?>
<h2><?php
echo smarty_modifier_cms_escape($_smarty_tpl->tpl_vars['entry']->value->title, 'htmlall');
?>
</h2>
<?php
if ($_smarty_tpl->tpl_vars['entry']->value->summary) {
?>
<?php
$_template = new Smarty_Internal_Template('eval:' . $_smarty_tpl->tpl_vars['entry']->value->summary, $_smarty_tpl->smarty, $_smarty_tpl);
echo $_template->fetch();
}
?>
<?php
$_template = new Smarty_Internal_Template('eval:' . $_smarty_tpl->tpl_vars['entry']->value->content, $_smarty_tpl->smarty, $_smarty_tpl);
echo $_template->fetch();
if ($_smarty_tpl->tpl_vars['entry']->value->extra) {
?>
<?php
echo $_smarty_tpl->tpl_vars['extra_label']->value;
?>
<?php
echo $_smarty_tpl->tpl_vars['entry']->value->extra;
?>
<?php
}
if ($_smarty_tpl->tpl_vars['return_url']->value != '') {
?>
<br />
<span class='back'>← <?php
echo $_smarty_tpl->tpl_vars['return_url']->value;
if ($_smarty_tpl->tpl_vars['category_name']->value != '') {
?>
- <?php
echo $_smarty_tpl->tpl_vars['category_link']->value;
}
?>
</span>
<?php
}
?>
<?php
if (isset($_smarty_tpl->tpl_vars['entry']->value->fields)) {
?>
<?php
$_smarty_tpl->tpl_vars['field'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['field']->_loop = false;
$_from = $_smarty_tpl->tpl_vars['entry']->value->fields;
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
foreach ($_from as $_smarty_tpl->tpl_vars['field']->key => $_smarty_tpl->tpl_vars['field']->value) {
$_smarty_tpl->tpl_vars['field']->_loop = true;
?>
<div>
<?php
if ($_smarty_tpl->tpl_vars['field']->value->type == 'file') {
?>
<img src='<?php
echo $_smarty_tpl->tpl_vars['entry']->value->file_location;
?>
/<?php
echo $_smarty_tpl->tpl_vars['field']->value->value;
?>
' alt='' />
<?php
} else {
?>
<?php
echo $_smarty_tpl->tpl_vars['field']->value->name;
?>
: <?php
$_template = new Smarty_Internal_Template('eval:' . $_smarty_tpl->tpl_vars['field']->value->value, $_smarty_tpl->smarty, $_smarty_tpl);
echo $_template->fetch();
?>
<?php
//.........这里部分代码省略.........
开发者ID:Alexkuva,项目名称:Beaupotager,代码行数:101,代码来源:nd2^9686dd5bd72314919894b2edbe33b69c6a7d6776.module_db_tpl.News;detailSimplex_Detail.php
示例13: settype
//.........这里部分代码省略.........
<div class="NewsSummaryCategory">
<?php
echo $_smarty_tpl->tpl_vars['category_label']->value;
?>
<?php
echo $_smarty_tpl->tpl_vars['entry']->value->category;
?>
</div>
<?php
if ($_smarty_tpl->tpl_vars['entry']->value->author) {
?>
<div class="NewsSummaryAuthor">
<?php
echo $_smarty_tpl->tpl_vars['author_label']->value;
?>
<?php
echo $_smarty_tpl->tpl_vars['entry']->value->author;
?>
</div>
<?php
}
?>
<?php
if ($_smarty_tpl->tpl_vars['entry']->value->summary) {
?>
<div class="NewsSummarySummary">
<?php
$_template = new Smarty_Internal_Template('eval:' . $_smarty_tpl->tpl_vars['entry']->value->summary, $_smarty_tpl->smarty, $_smarty_tpl);
echo $_template->fetch();
?>
</div>
<div class="NewsSummaryMorelink">
[<?php
echo $_smarty_tpl->tpl_vars['entry']->value->morelink;
?>
]
</div>
<?php
} elseif ($_smarty_tpl->tpl_vars['entry']->value->content) {
?>
<div class="NewsSummaryContent">
<?php
$_template = new Smarty_Internal_Template('eval:' . $_smarty_tpl->tpl_vars['entry']->value->content, $_smarty_tpl->smarty, $_smarty_tpl);
echo $_template->fetch();
?>
</div>
<?php
}
?>
<?php
if (isset($_smarty_tpl->tpl_vars['entry']->value->extra)) {
?>
<div class="NewsSummaryExtra">
<?php
$_template = new Smarty_Internal_Template('eval:' . $_smarty_tpl->tpl_vars['entry']->value->extra, $_smarty_tpl->smarty, $_smarty_tpl);
echo $_template->fetch();
?>
开发者ID:RTR-ITF,项目名称:usse-cms,代码行数:67,代码来源:^3429b5e87061af5a86eaa09f48bd93b023121ee5.module_db_tpl.News;summarySample.php
示例14: ia_blocks
public static function ia_blocks(array $params, Smarty_Internal_Template &$smarty)
{
if (!isset($params['block'])) {
return '';
}
$directCall = isset($params[self::DIRECT_CALL_MARKER]);
$position = $params['block'];
// return immediately if position's content is already rendered
if (!$directCall && isset(self::$_positionsContent[$position])) {
// NULL will be an empty content marker
return is_null(self::$_positionsContent[$position]) ? '' : self::$_positionsContent[$position];
}
// mark that we were here
self::$_positionsContent[$position] = null;
$iaView = iaCore::instance()->iaView;
$blocks = $iaView->blocks;
$blocks = isset($blocks[$position]) ? $blocks[$position] : null;
if ($blocks || $iaView->manageMode) {
// define if this position should be movable in visual mode
$smarty->assign('position', $position);
$smarty->assign('blocks', $blocks);
$output = $smarty->fetch('render-blocks' . iaView::TEMPLATE_FILENAME_EXT, $position . mt_rand(1000, 9999));
if (trim($output)) {
self::$_positionsContent[$position] = $output;
}
}
return $directCall ? null : self::$_positionsContent[$position];
}
示例15: display_debug
/**
* Opens a window for the Smarty Debugging Console and display the data
*
* @param Smarty_Internal_Template|Smarty $obj object to debug
* @param bool $full
*/
public static function display_debug($obj, $full = false)
{
if (!$full) {
self::$offset++;
$savedIndex = self::$index;
self::$index = 9999;
}
// prepare information of assigned variables
$ptr = self::get_debug_vars($obj);
if ($obj instanceof Smarty) {
$smarty = clone $obj;
} else {
$smarty = clone $obj->smarty;
}
$debugging = $smarty->debugging;
$_assigned_vars = $ptr->tpl_vars;
ksort($_assigned_vars);
$_config_vars = $ptr->config_vars;
ksort($_config_vars);
$smarty->registered_filters = array();
$smarty->autoload_filters = array();
$smarty->default_modifiers = array();
$smarty->force_compile = false;
$smarty->left_delimiter = '{';
$smarty->right_delimiter = '}';
$smarty->debugging = false;
$smarty->debugging_ctrl = 'NONE';
$smarty->force_compile = false;
$_template = new Smarty_Internal_Template($smarty->debug_tpl, $smarty);
$_template->caching = false;
$_template->smarty->disableSecurity();
$_template->cache_id = null;
$_template->compile_id = null;
if ($obj instanceof Smarty_Internal_Template) {
$_template->assign('template_name', $obj->source->type . ':' . $obj->source->name);
}
if ($obj instanceof Smarty || $full) {
$_template->assign('template_data', self::$template_data[self::$index]);
} else {
$_template->assign('template_data', null);
}
$_template->assign('assigned_vars', $_assigned_vars);
$_template->assign('config_vars', $_config_vars);
$_template->assign('execution_time', microtime(true) - $smarty->start_time);
$_template->assign('display_mode', $debugging == 2 || !$full);
$_template->assign('offset', self::$offset * 50);
echo $_template->fetch();
if (isset($full)) {
self::$index--;
}
if (!$full) {
self::$index = $savedIndex;
}
}