本文整理汇总了PHP中TemplateManager::assign方法的典型用法代码示例。如果您正苦于以下问题:PHP TemplateManager::assign方法的具体用法?PHP TemplateManager::assign怎么用?PHP TemplateManager::assign使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TemplateManager
的用法示例。
在下文中一共展示了TemplateManager::assign方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: TemplateManager
/**
* Return an instance of the template manager.
* @param $request PKPRequest FIXME: is optional for backwards compatibility only - make mandatory
* @return TemplateManager the template manager object
*/
function &getManager($request = null)
{
$instance =& Registry::get('templateManager', true, null);
if ($instance === null) {
$instance = new TemplateManager($request);
}
$supportedLocales = AppLocale::getSupportedLocales();
$instance->assign('supportedLocales', $supportedLocales);
$instance->assign('localePrecedence', AppLocale::getLocalePrecedence());
$instance->assign('requestedPage', Request::getRequestedPage());
$instance->assign('requestedOp', Request::getRequestedOp());
$conference =& Request::getConference();
if (isset($conference)) {
$instance->assign('conferenceId', $conference->getId());
$instance->assign('isConferenceManager', Validation::isConferenceManager($conference->getId()));
$instance->assign('analyticsTrackingID', $conference->getSetting('analyticsTrackingID'));
$schedConf =& Request::getSchedConf();
if (isset($schedConf)) {
$instance->assign('isDirector', Validation::isDirector($conference->getId(), $schedConf->getId()));
$instance->assign('isTrackDirector', Validation::isTrackDirector($conference->getId(), $schedConf->getId()));
$instance->assign('isAuthor', Validation::isAuthor($conference->getId(), $schedConf->getId()));
$registrationDao =& DAORegistry::getDAO('RegistrationDAO');
$user = Request::getUser();
if (isset($user)) {
$instance->assign('isRegistrationUser', $registrationDao->isValidRegistrationByUser($user->getUserId(), $schedConf->getId()));
}
}
}
AppLocale::requireComponents(array(LOCALE_COMPONENT_OCS_MANAGER, LOCALE_COMPONENT_OCS_ADMIN, LOCALE_COMPONENT_OCS_DIRECTOR, LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_PKP_SUBMISSION));
// FIXME: For timeline constants
return $instance;
}