本文整理汇总了PHP中CreateSmarty函数的典型用法代码示例。如果您正苦于以下问题:PHP CreateSmarty函数的具体用法?PHP CreateSmarty怎么用?PHP CreateSmarty使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CreateSmarty函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ShowTopic
function ShowTopic($obj)
{
global $dcl_info, $g_oSec;
if (!is_object($obj)) {
trigger_error('[htmlFaqtopics::ShowTopic] ' . STR_FAQ_TOPICOBJECTNOTPASSED);
return;
}
if (!$g_oSec->HasPerm(DCL_ENTITY_FAQ, DCL_PERM_VIEW, $obj->faqid)) {
return PrintPermissionDenied();
}
$objFaq = CreateObject('dcl.dbFaq');
if ($objFaq->Load($obj->faqid) == -1) {
return;
}
$t =& CreateSmarty();
$t->assign('VAL_FAQID', $objFaq->faqid);
$t->assign('VAL_FAQNAME', $objFaq->name);
$t->assign('VAL_DESCRIPTION', $obj->description);
$t->assign('VAL_TOPICID', $obj->f('topicid'));
$t->assign('VAL_TOPICNAME', $obj->name);
$t->assign('PERM_ADDQUESTION', $g_oSec->HasPerm(DCL_ENTITY_FAQQUESTION, DCL_PERM_ADD, $obj->faqid));
$t->assign('PERM_MODIFY', $g_oSec->HasPerm(DCL_ENTITY_FAQTOPIC, DCL_PERM_MODIFY));
$t->assign('PERM_DELETE', $g_oSec->HasPerm(DCL_ENTITY_FAQTOPIC, DCL_PERM_DELETE));
$objF = CreateObject('dcl.dbFaqquestions');
if ($objF->LoadByFaqTopicID($obj->topicid) == -1) {
return;
}
$aRecords = array();
while ($objF->next_record()) {
array_push($aRecords, $objF->Record);
}
$t->assign('VAL_QUESTIONS', $aRecords);
SmartyDisplay($t, 'htmlFaqtopicsDetail.tpl');
}
示例2: renderDCLMenu
function renderDCLMenu()
{
global $dcl_info, $g_oSec, $g_oSession;
$sTemplateSet = GetDefaultTemplateSet();
include DCL_ROOT . 'templates/' . $sTemplateSet . '/navbar.php';
$t =& CreateSmarty();
$t->assign('DIR_IMAGES', 'templates/' . $sTemplateSet . '/img');
$t->assign('DIR_CSS', 'templates/' . $sTemplateSet . '/css');
$t->assign('DIR_JS', 'js');
$t->assign('LNK_LOGOFF', menuLink('logout.php'));
if ($g_oSec->IsPublicUser()) {
$t->assign('LNK_HOME', menuLink('', 'menuAction=htmlPublicMyDCL.show'));
} else {
$t->assign('LNK_HOME', menuLink('', 'menuAction=htmlMyDCL.show'));
}
$t->assign('LNK_PREFERENCES', menuLink('', 'menuAction=htmlPreferences.modify'));
$t->assign('TXT_WORKORDERS', DCL_MENU_WORKORDERS);
$t->assign('TXT_TICKETS', DCL_MENU_TICKETS);
$t->assign('TXT_PROJECTS', DCL_MENU_PROJECTS);
$t->assign('TXT_HOME', DCL_MENU_HOME);
$t->assign('TXT_PREFERENCES', DCL_MENU_PREFERENCES);
$t->assign('TXT_LOGOFF', DCL_MENU_LOGOFF);
$t->assign('PERM_WORKORDERSEARCH', $g_oSec->HasPerm(DCL_ENTITY_WORKORDER, DCL_PERM_SEARCH) || $g_oSec->HasPerm(DCL_ENTITY_WORKORDER, DCL_PERM_VIEW));
$t->assign('PERM_TICKETSEARCH', $g_oSec->HasPerm(DCL_ENTITY_TICKET, DCL_PERM_SEARCH) || $g_oSec->HasPerm(DCL_ENTITY_TICKET, DCL_PERM_VIEW));
$t->assign('PERM_PROJECTSEARCH', $g_oSec->HasPerm(DCL_ENTITY_PROJECT, DCL_PERM_SEARCH) || $g_oSec->HasPerm(DCL_ENTITY_PROJECT, DCL_PERM_VIEW));
$t->assign('PERM_PREFS', $g_oSec->HasPerm(DCL_ENTITY_PREFS, DCL_PERM_MODIFY));
$t->assign('PERM_WORKSPACE', $g_oSec->HasPerm(DCL_ENTITY_WORKSPACE, DCL_PERM_VIEW));
$t->assign('VAL_WORKSPACE', $g_oSession->Value('workspace'));
$t->assign('VAL_DCL_MENU', $GLOBALS['DCL_MENU']);
$oNav = new DCLNavBar();
$t->assign('NAV_BOXEN', $oNav->getHtml());
SmartyDisplay($t, 'menu.tpl');
}
示例3: show
function show()
{
global $dcl_info, $g_oSec;
if (!$g_oSec->HasPerm(DCL_ENTITY_ADMIN, DCL_PERM_MODIFY)) {
return PrintPermissionDenied();
}
$objPersonnel = CreateObject('dcl.htmlPersonnel');
$oDBPersonnel = CreateObject('dcl.dbPersonnel');
if ($oDBPersonnel->Load($GLOBALS['DCLID']) == -1) {
return;
}
$t =& CreateSmarty();
$oSelect = CreateObject('dcl.htmlSelect');
$t->assign('CMB_USERS', $objPersonnel->GetCombo(0, 'responsible', 'lastfirst', 0, false));
$begindate = @DCL_Sanitize::ToDate($_REQUEST['begindate']);
if ($begindate !== null) {
$t->assign('VAL_BEGINDATE', $begindate);
} else {
$t->assign('VAL_BEGINDATE', '');
}
$enddate = @DCL_Sanitize::ToDate($_REQUEST['enddate']);
if ($enddate !== null) {
$t->assign('VAL_ENDDATE', $enddate);
} else {
$t->assign('VAL_ENDDATE', '');
}
SmartyDisplay($t, 'htmlSecAuditBrowse.tpl');
}
示例4: __construct
public function __construct()
{
//创建Smarty实例对象
$this->Smarty = CreateSmarty();
//初始化函数
$this->_init();
}
示例5: modify
function modify()
{
global $dcl_info, $g_oSession, $g_oSec;
commonHeader();
if (!$g_oSec->HasPerm(DCL_ENTITY_PREFS, DCL_PERM_MODIFY)) {
return PrintPermissionDenied();
}
$t =& CreateSmarty();
$t->assign('PERM_MODIFYCONTACT', $g_oSec->HasPerm(DCL_ENTITY_CONTACT, DCL_PERM_MODIFY) || $g_oSec->HasPerm(DCL_ENTITY_GLOBAL, DCL_PERM_ADMIN));
$t->assign('VAL_CONTACTID', $g_oSession->Value('contact_id'));
// Reuse methods from here for lang and template
$o =& CreateObject('dcl.htmlConfig');
$t->assign('CMB_DEFAULTTEMPLATESET', $o->GetTemplatesCombo('DCL_PREF_TEMPLATE_SET', GetDefaultTemplateSet()));
$lang = $dcl_info['DCL_DEFAULT_LANGUAGE'];
$oPrefs =& CreateObject('dcl.dbPreferences');
$oPrefs->preferences_data = $g_oSession->Value('dcl_preferences');
if (isset($oPrefs->preferences_data) && is_array($oPrefs->preferences_data)) {
if ($oPrefs->Value('DCL_PREF_LANGUAGE') != '') {
$lang = $oPrefs->Value('DCL_PREF_LANGUAGE');
}
$t->assign('VAL_NOTIFYDEFAULT', $oPrefs->Value('DCL_PREF_NOTIFY_DEFAULT'));
$iOption = $oPrefs->Value('DCL_PREF_CREATED_WATCH_OPTION');
if ($iOption == '') {
$iOption = 4;
}
$t->assign('VAL_CREATEDWATCHOPTION', $iOption);
}
$t->assign('CMB_DEFAULTLANGUAGE', $o->GetLangCombo('DCL_PREF_LANGUAGE', $lang));
SmartyDisplay($t, 'htmlPreferences.tpl');
}
示例6: ShowAggNav
function ShowAggNav()
{
global $dcl_info;
$t =& CreateSmarty();
$t->assign('TXT_AGGREGATE', 'Aggregate');
$t->assign('TXT_BY', STR_CMMN_BY);
$t->assign('TXT_FORDATES', 'For Dates');
$aGroups = array();
foreach ($this->_aTypeInfo as $key => $val) {
array_push($aGroups, array('key' => $key, 'desc' => $val['__title__']));
}
$t->assign('groups', $aGroups);
$t->assign('group', isset($_REQUEST['group']) ? $_REQUEST['group'] : '');
$aSubGroups = array();
foreach ($this->_aTypeInfo['workorders'] as $key => $val) {
if ($key == '__title__') {
continue;
}
array_push($aSubGroups, array('key' => $key, 'desc' => $val[1]));
}
$t->assign('subgroups', $aSubGroups);
$t->assign('subgroup', isset($_REQUEST['sub']) ? $_REQUEST['sub'] : '');
if (isset($_REQUEST['chkLimitByDate']) && $_REQUEST['chkLimitByDate'] == 1) {
$t->assign('VAL_DATEFROM', DCL_Sanitize::ToDate($_REQUEST['dateFrom']));
$t->assign('VAL_DATETO', DCL_Sanitize::ToDate($_REQUEST['dateTo']));
$t->assign('VAL_CHKLIMIT', ' checked');
} else {
$aFewDaysAgo = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
$t->assign('VAL_DATEFROM', date($dcl_info['DCL_DATE_FORMAT'], $aFewDaysAgo));
$t->assign('VAL_DATETO', date($dcl_info['DCL_DATE_FORMAT']));
$t->assign('VAL_CHKLIMIT', '');
}
SmartyDisplay($t, 'htmlAggNav.tpl');
}
示例7: ShowEntryForm
function ShowEntryForm($obj = '')
{
global $dcl_info, $g_oSec;
$isEdit = is_object($obj);
if (!$g_oSec->HasPerm(DCL_ENTITY_PERSONNEL, $isEdit ? DCL_PERM_MODIFY : DCL_PERM_ADD)) {
return PrintPermissionDenied();
}
$Template =& CreateSmarty();
$Template->assign('IS_EDIT', $isEdit);
$oUserRole = CreateObject('dcl.dbUserRole');
$oDept = CreateObject('dcl.htmlDepartments');
if ($isEdit) {
$Template->assign('VAL_PERSONNELID', $obj->id);
$Template->assign('VAL_ACTIVE', $obj->active);
$Template->assign('VAL_SHORT', $obj->short);
$Template->assign('VAL_REPORTTO', $obj->reportto);
$Template->assign('VAL_DEPARTMENT', $obj->department);
$Template->assign('Roles', $oUserRole->GetGlobalRoles($obj->id));
$oMeta =& CreateObject('dcl.DCL_MetadataDisplay');
$aContact =& $oMeta->GetContact($obj->contact_id);
$Template->assign('VAL_CONTACTID', $obj->contact_id);
$Template->assign('VAL_CONTACTNAME', $aContact['name']);
} else {
$Template->assign('VAL_ACTIVE', 'Y');
$Template->assign('VAL_REPORTTO', $GLOBALS['DCLID']);
$Template->assign('VAL_DEPARTMENT', 0);
$Template->assign('VAL_SHORT', '');
$Template->assign('Roles', $oUserRole->GetGlobalRoles());
}
SmartyDisplay($Template, 'htmlPersonnelForm.tpl');
}
示例8: htmlPersonnelSelector
function htmlPersonnelSelector()
{
$this->bMultiSelect = false;
$this->oSmarty =& CreateSmarty();
$this->oView =& CreateObject('dcl.boView');
$this->oDB = new dclDB();
}
示例9: DCLNavBar
function DCLNavBar()
{
global $dcl_info;
$this->t = CreateSmarty();
if (isset($_REQUEST['menuAction']) && $_REQUEST['menuAction'] != 'clearScreen') {
list($this->_class, $this->_method) = explode('.', $_REQUEST['menuAction']);
}
}
示例10: htmlProductDetail
function htmlProductDetail()
{
$this->t = CreateSmarty();
$this->id = 0;
$this->sView = 'summary';
$this->iVersion = 0;
$this->oProduct = CreateObject('dcl.dbProducts');
}
示例11: EndPage
function EndPage()
{
if (isset($_REQUEST['bNoHeader'])) {
return;
}
$t =& CreateSmarty();
SmartyDisplay($t, 'footer.tpl');
}
示例12: show
function show()
{
global $g_oSec;
commonHeader();
$t =& CreateSmarty();
$t->assign('PERM_TICKETS', $g_oSec->HasAnyPerm(array(DCL_ENTITY_TICKET => array($g_oSec->PermArray(DCL_PERM_VIEW), $g_oSec->PermArray(DCL_PERM_VIEWACCOUNT), $g_oSec->PermArray(DCL_PERM_VIEWSUBMITTED)))));
$t->assign('PERM_WORKORDERS', $g_oSec->HasAnyPerm(array(DCL_ENTITY_WORKORDER => array($g_oSec->PermArray(DCL_PERM_VIEW), $g_oSec->PermArray(DCL_PERM_VIEWACCOUNT), $g_oSec->PermArray(DCL_PERM_VIEWSUBMITTED)))));
$t->assign('PERM_FAQ', $g_oSec->HasPerm(DCL_ENTITY_FAQ, DCL_PERM_VIEW));
SmartyDisplay($t, 'htmlPublicMyDCL.tpl');
}
示例13: DisplayGraphForm
function DisplayGraphForm()
{
global $dcl_info;
$t =& CreateSmarty();
$t->assign('CMB_DAYS', '<select id="days" name="days"><option value="7">7 ' . STR_WO_DAYS . '</option><option value="14">14 ' . STR_WO_DAYS . '</option></select>');
$t->assign('VAL_TODAY', date($dcl_info['DCL_DATE_FORMAT']));
$o = CreateObject('dcl.htmlProducts');
$t->assign('CMB_PRODUCTS', $o->GetCombo(0, 'product', 'name', 0, 0, false));
SmartyDisplay($t, 'htmlTicketGraph.tpl');
}
示例14: Refresh
function Refresh($toHere = 'index.php', $session_id = '', $domain = 'default')
{
$oSmarty =& CreateSmarty();
if (isset($_REQUEST['refer_to']) && $_REQUEST['refer_to'] != '') {
$toHere .= sprintf('%srefer_to=%s', strpos($toHere, '?') > 0 ? '&' : '?', urlencode(urldecode($_REQUEST['refer_to'])));
}
$oSmarty->assign('URL', $toHere);
SmartyDisplay($oSmarty, 'logout.tpl');
exit;
}
示例15: htmlMessage
function htmlMessage()
{
$this->t =& CreateSmarty();
$this->sTemplate = 'htmlMessageInfo.tpl';
if (!defined('STR_CMMN_INFORMATION')) {
define('STR_CMMN_INFORMATION', 'Information');
}
$this->sTitle = STR_CMMN_INFORMATION;
$this->bIsFirst = !defined('__DCL_MESSAGE__');
}