本文整理匯總了PHP中type::assign方法的典型用法代碼示例。如果您正苦於以下問題:PHP type::assign方法的具體用法?PHP type::assign怎麽用?PHP type::assign使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類type
的用法示例。
在下文中一共展示了type::assign方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
/**
*
*/
protected function init()
{
$userName = "";
$userEmails = array();
if (isset($_SESSION['user'])) {
try {
$userName = $_SESSION['user']->getName();
$userEmails = $_SESSION['user']->getEmail();
} catch (Exception $e) {
}
}
$this->tpl->assign("userName", $userName);
$this->tpl->assign("userEmails", $userEmails);
}
示例2: show
/**
* Displays smarty template to show test project info to users.
*
* @param type $smarty [ref] smarty object
* @param type $id test project
* @param type $sqlResult [default = '']
* @param type $action [default = 'update']
* @param type $modded_item_id [default = 0]
*
* @todo havlatm (20100214): smarty should not be in this class - move code to appropariate page
**/
function show(&$smarty, $guiObj, $template_dir, $id, $sqlResult = '', $action = 'update', $modded_item_id = 0)
{
$gui = $guiObj;
$gui->modify_tc_rights = has_rights($this->db, "mgt_modify_tc");
$gui->mgt_modify_product = has_rights($this->db, "mgt_modify_product");
$gui->sqlResult = '';
$gui->sqlAction = '';
if ($sqlResult) {
$gui->sqlResult = $sqlResult;
}
$gui->container_data = $this->get_by_id($id);
$gui->moddedItem = $gui->container_data;
$gui->level = 'testproject';
$gui->page_title = lang_get('testproject');
$gui->refreshTree = property_exists($gui, 'refreshTree') ? $gui->refreshTree : false;
$gui->attachmentInfos = getAttachmentInfosFrom($this, $id);
if ($modded_item_id) {
$gui->moddedItem = $this->get_by_id($modded_item_id);
}
$smarty->assign('gui', $gui);
$smarty->display($template_dir . 'containerView.tpl');
}
示例3: setWeekTaskDetails
/**
* set smarty variables needed to display the WeekTaskDetails table
*
* @param type $smartyHelper
* @param type $weekid
* @param type $year
* @param type $managed_userid
* @param type $teamid
*/
function setWeekTaskDetails($smartyHelper, $weekid, $year, $managed_userid, $teamid)
{
$weekDates = Tools::week_dates($weekid, $year);
$startTimestamp = $weekDates[1];
$endTimestamp = mktime(23, 59, 59, date('m', $weekDates[7]), date('d', $weekDates[7]), date('Y', $weekDates[7]));
$timeTracking = new TimeTracking($startTimestamp, $endTimestamp, $teamid);
$incompleteDays = array_keys($timeTracking->checkCompleteDays($managed_userid, TRUE));
$missingDays = $timeTracking->checkMissingDays($managed_userid);
$errorDays = array_merge($incompleteDays, $missingDays);
$smartyWeekDates = TimeTrackingTools::getSmartyWeekDates($weekDates, $errorDays);
// UTF8 problems in smarty, date encoding needs to be done in PHP
$smartyHelper->assign('weekDates', array($smartyWeekDates[1], $smartyWeekDates[2], $smartyWeekDates[3], $smartyWeekDates[4], $smartyWeekDates[5]));
$smartyHelper->assign('weekEndDates', array($smartyWeekDates[6], $smartyWeekDates[7]));
$weekTasks = TimeTrackingTools::getWeekTask($weekDates, $teamid, $managed_userid, $timeTracking, $errorDays);
$smartyHelper->assign('weekTasks', $weekTasks["weekTasks"]);
$smartyHelper->assign('dayTotalElapsed', $weekTasks["totalElapsed"]);
// weekTaskDetails.html includes edit_issueNote.html & update_issueBacklog.html
// these files need userid,weekid,year to be set.
$smartyHelper->assign('userid', $managed_userid);
$smartyHelper->assign('weekid', $weekid);
$smartyHelper->assign('year', $year);
}
示例4: show
/**
* Displays smarty template to show test project info to users.
*
* @param type $smarty [ref] smarty object
* @param type $id test project
* @param type $sqlResult [default = '']
* @param type $action [default = 'update']
* @param type $modded_item_id [default = 0]
*
* @internal revisions
*
**/
function show(&$smarty, $guiObj, $template_dir, $id, $sqlResult = '', $action = 'update', $modded_item_id = 0)
{
$gui = $guiObj;
$gui->modify_tc_rights = has_rights($this->db, "mgt_modify_tc");
$gui->mgt_modify_product = has_rights($this->db, "mgt_modify_product");
$gui->sqlResult = '';
$gui->sqlAction = '';
if ($sqlResult) {
$gui->sqlResult = $sqlResult;
}
$p2ow = array('refreshTree' => false, 'user_feedback' => '');
foreach ($p2ow as $prop => $value) {
if (!property_exists($gui, $prop)) {
$gui->{$prop} = $value;
}
}
$safeID = intval($id);
$gui->container_data = $this->get_by_id($safeID);
$gui->moddedItem = $gui->container_data;
$gui->level = 'testproject';
$gui->page_title = lang_get('testproject');
$gui->refreshTree = property_exists($gui, 'refreshTree') ? $gui->refreshTree : false;
$gui->attachmentInfos = getAttachmentInfosFrom($this, $safeID);
// attachments management on page
$gui->fileUploadURL = $_SESSION['basehref'] . $this->getFileUploadRelativeURL($safeID);
$gui->delAttachmentURL = $_SESSION['basehref'] . $this->getDeleteAttachmentRelativeURL($safeID);
$gui->import_limit = TL_REPOSITORY_MAXFILESIZE;
$gui->fileUploadMsg = '';
$exclusion = array('testcase', 'me', 'testplan' => 'me', 'requirement_spec' => 'me');
$gui->canDoExport = count($this->tree_manager->get_children($safeID, $exclusion)) > 0;
if ($modded_item_id) {
$gui->moddedItem = $this->get_by_id(intval($modded_item_id));
}
$smarty->assign('gui', $gui);
$smarty->display($template_dir . 'containerView.tpl');
}
示例5: onError
/**
* Handle error (print msg, die)
*
* @param type $smarty
* @param type $response
*/
function onError($smarty, $response)
{
$smarty->assign('STATUS_ERROR', $response['error']);
$smarty->display('../templates/problem.edit.tpl');
die;
}