本文整理汇总了PHP中TemplateManager类的典型用法代码示例。如果您正苦于以下问题:PHP TemplateManager类的具体用法?PHP TemplateManager怎么用?PHP TemplateManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TemplateManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* Perform installation.
*/
function execute()
{
define('RUNNING_UPGRADE', 1);
$templateMgr = TemplateManager::getManager($this->_request);
$installer = new Upgrade($this->_data);
// FIXME Use logger?
// FIXME Mostly common with InstallForm
if ($installer->execute()) {
if (!$installer->wroteConfig()) {
// Display config file contents for manual replacement
$templateMgr->assign(array('writeConfigFailed' => true, 'configFileContents' => $installer->getConfigContents()));
}
$templateMgr->assign('notes', $installer->getNotes());
$templateMgr->assign('newVersion', $installer->getNewVersion());
$templateMgr->display('install/upgradeComplete.tpl');
} else {
switch ($installer->getErrorType()) {
case INSTALLER_ERROR_DB:
$this->dbInstallError($installer->getErrorMsg());
break;
default:
$this->installError($installer->getErrorMsg());
break;
}
}
$installer->destroy();
}
开发者ID:jprk,项目名称:pkp-lib,代码行数:30,代码来源:UpgradeForm.inc.php
示例2: evaluate
public function evaluate(TemplateManager $manager, $context, $value)
{
$filter = $manager->filter($this->m_name);
if (!$filter) {
throw new \Exception("Unknown filter `{$this->m_name}`");
}
return $filter($this->m_options, $context, $value);
}
开发者ID:jdauie,项目名称:skhema,代码行数:8,代码来源:Filter.php
示例3: setupTemplate
/**
* @see PKPHandler::setupTemplate()
* @param $request PKPKRequest
*/
function setupTemplate($request)
{
$templateMgr = TemplateManager::getManager($request);
$templateMgr->assign('oldUserId', (int) $request->getUserVar('oldUserId'));
// for merging users.
parent::setupTemplate($request);
}
开发者ID:PublishingWithoutWalls,项目名称:pkp-lib,代码行数:11,代码来源:AccessSettingsTabHandler.inc.php
示例4: fetchReviewRoundInfo
/**
* Fetch information for the author on the specified review round
* @param $args array
* @param $request Request
* @return JSONMessage JSON object
*/
function fetchReviewRoundInfo($args, $request)
{
$this->setupTemplate($request);
$templateMgr = TemplateManager::getManager($request);
$stageId = $this->getAuthorizedContextObject(ASSOC_TYPE_WORKFLOW_STAGE);
if ($stageId !== WORKFLOW_STAGE_ID_INTERNAL_REVIEW && $stageId !== WORKFLOW_STAGE_ID_EXTERNAL_REVIEW) {
fatalError('Invalid Stage Id');
}
$templateMgr->assign('stageId', $stageId);
$reviewRound = $this->getAuthorizedContextObject(ASSOC_TYPE_REVIEW_ROUND);
$templateMgr->assign('reviewRoundId', $reviewRound->getId());
$submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);
$templateMgr->assign('submission', $submission);
// Review round request notification options.
$notificationRequestOptions = array(NOTIFICATION_LEVEL_NORMAL => array(NOTIFICATION_TYPE_REVIEW_ROUND_STATUS => array(ASSOC_TYPE_REVIEW_ROUND, $reviewRound->getId())), NOTIFICATION_LEVEL_TRIVIAL => array());
$templateMgr->assign('reviewRoundNotificationRequestOptions', $notificationRequestOptions);
// Editor has taken an action and sent an email; Display the email
import('classes.workflow.EditorDecisionActionsManager');
if (EditorDecisionActionsManager::getEditorTakenActionInReviewRound($reviewRound)) {
$submissionEmailLogDao = DAORegistry::getDAO('SubmissionEmailLogDAO');
$user = $request->getUser();
$submissionEmailFactory = $submissionEmailLogDao->getByEventType($submission->getId(), SUBMISSION_EMAIL_EDITOR_NOTIFY_AUTHOR, $user->getId());
$templateMgr->assign('submissionEmails', $submissionEmailFactory);
$templateMgr->assign('showReviewAttachments', true);
}
return $templateMgr->fetchJson('authorDashboard/reviewRoundInfo.tpl');
}
开发者ID:selwyntcy,项目名称:pkp-lib,代码行数:33,代码来源:AuthorDashboardReviewRoundTabHandler.inc.php
示例5: display
/**
* Display the form.
*/
function display()
{
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('paperId', $this->paperId);
$templateMgr->assign('submitStep', $this->step);
switch ($this->step) {
case 3:
$helpTopicId = 'submission.indexingMetadata';
break;
case 4:
$helpTopicId = 'submission.supplementaryFiles';
break;
default:
$helpTopicId = 'submission.index';
}
$templateMgr->assign('helpTopicId', $helpTopicId);
$schedConf =& Request::getSchedConf();
$settingsDao =& DAORegistry::getDAO('SchedConfSettingsDAO');
// Determine which submission steps should be shown
$progress = isset($this->paper) ? $this->paper->getCurrentStage() : REVIEW_STAGE_ABSTRACT;
$reviewMode = isset($this->paper) ? $this->paper->getReviewMode() : $schedConf->getSetting('reviewMode');
$showAbstractSteps = $progress == REVIEW_STAGE_ABSTRACT || $reviewMode != REVIEW_MODE_BOTH_SEQUENTIAL;
$showPaperSteps = $progress == REVIEW_STAGE_PRESENTATION || $reviewMode == REVIEW_MODE_BOTH_SIMULTANEOUS || $reviewMode == REVIEW_MODE_PRESENTATIONS_ALONE;
$templateMgr->assign('showAbstractSteps', $showAbstractSteps);
$templateMgr->assign('showPaperSteps', $showPaperSteps);
$templateMgr->assign('addSuppFileMessage', $schedConf->getLocalizedSetting("addSuppFileMessage"));
$templateMgr->assign('stepFinalMessage', $schedConf->getLocalizedSetting("stepFinalMessage"));
$templateMgr->assign('uploadInstructions', $schedConf->getLocalizedSetting("uploadInstructions"));
if (isset($this->paper)) {
$templateMgr->assign('submissionProgress', $this->paper->getSubmissionProgress());
}
parent::display();
}
开发者ID:pulipulichen,项目名称:ocs,代码行数:36,代码来源:AuthorSubmitForm.inc.php
示例6: display
/**
* Display the form.
*/
function display()
{
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign_by_ref('group', $this->group);
$templateMgr->assign('helpTopicId', 'conference.currentConferences.organizingTeam');
parent::display();
}
开发者ID:ramonsodoma,项目名称:ocs,代码行数:10,代码来源:GroupForm.inc.php
示例7: fetch
/**
* @copydoc Form::fetch()
*/
function fetch($request)
{
$urnNamespaces = array('' => '', 'urn:nbn:de' => 'urn:nbn:de', 'urn:nbn:at' => 'urn:nbn:at', 'urn:nbn:ch' => 'urn:nbn:ch', 'urn:nbn' => 'urn:nbn', 'urn' => 'urn');
$templateMgr = TemplateManager::getManager($request);
$templateMgr->assign('urnNamespaces', $urnNamespaces);
return parent::fetch($request);
}
开发者ID:NateWr,项目名称:omp,代码行数:10,代码来源:URNSettingsForm.inc.php
示例8: updateReferral
/**
* Save changes to an announcement type.
*/
function updateReferral()
{
$referralId = (int) Request::getUserVar('referralId');
if ($referralId === 0) {
$referralId = null;
}
list($plugin, $referral, $article) = $this->validate($referralId);
// If it's an insert, ensure that it's allowed for this article
if (!isset($referral)) {
$publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
$journal =& Request::getJournal();
$article =& $publishedArticleDao->getPublishedArticleByArticleId((int) Request::getUserVar('articleId'));
if (!$article || $article->getUserId() != $user->getId() && !Validation::isSectionEditor($journal->getId()) && !Validation::isEditor($journal->getId())) {
Request::redirect(null, 'author');
}
}
$this->setupTemplate();
$plugin->import('ReferralForm');
$referralForm = new ReferralForm($plugin, $article, $referralId);
$referralForm->readInputData();
if ($referralForm->validate()) {
$referralForm->execute();
Request::redirect(null, 'author');
} else {
$templateMgr =& TemplateManager::getManager();
if ($referralId == null) {
$templateMgr->assign('referralTitle', 'plugins.generic.referral.createReferral');
} else {
$templateMgr->assign('referralTitle', 'plugins.generic.referral.editReferral');
}
$referralForm->display();
}
}
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:36,代码来源:ReferralHandler.inc.php
示例9: display
/**
* Display the form.
*/
function display()
{
$conference =& Request::getConference();
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('enablePublicSuppFileId', $conference->getSetting('enablePublicSuppFileId'));
$templateMgr->assign('rolePath', Request::getRequestedPage());
$templateMgr->assign('paperId', $this->paper->getPaperId());
$templateMgr->assign('suppFileId', $this->suppFileId);
$typeOptionsOutput = array('author.submit.suppFile.researchInstrument', 'author.submit.suppFile.researchMaterials', 'author.submit.suppFile.researchResults', 'author.submit.suppFile.transcripts', 'author.submit.suppFile.dataAnalysis', 'author.submit.suppFile.dataSet', 'author.submit.suppFile.sourceText');
$typeOptionsValues = $typeOptionsOutput;
array_push($typeOptionsOutput, 'common.other');
array_push($typeOptionsValues, '');
$templateMgr->assign('typeOptionsOutput', $typeOptionsOutput);
$templateMgr->assign('typeOptionsValues', $typeOptionsValues);
// Sometimes it's necessary to track the page we came from in
// order to redirect back to the right place
$templateMgr->assign('from', Request::getUserVar('from'));
if (isset($this->paper)) {
$templateMgr->assign('submissionProgress', $this->paper->getSubmissionProgress());
}
if (isset($this->suppFile)) {
$templateMgr->assign_by_ref('suppFile', $this->suppFile);
}
$templateMgr->assign('helpTopicId', 'submission.supplementaryFiles');
parent::display();
}
开发者ID:sedici,项目名称:ocs,代码行数:29,代码来源:SuppFileForm.inc.php
示例10: fetch
/**
* Fetch the form
* @param $request Request
*/
function fetch($request)
{
$templateMgr = TemplateManager::getManager($request);
$baseUrl = $templateMgr->_request->getBaseUrl();
// Add extra java script required for ajax components
// FIXME: Must be removed after OMP->OJS backporting
// NOTE: I believe this needs attention. jquery.validate.min.js is
// loaded with our minifiedScripts.tpl list and includes some i18n
// features.
$templateMgr->addJavaScript('citation', $baseUrl . '/lib/pkp/js/functions/citation.js', array('contexts' => 'backend'));
$templateMgr->addJavaScript('jqueryValidate', $baseUrl . '/lib/pkp/js/lib/jquery/plugins/validate/jquery.validate.min.js', array('contexts' => 'backend'));
$templateMgr->addJavaScript('jqueryValidatorI18n', $baseUrl . '/lib/pkp/js/functions/jqueryValidatorI18n.js', array('contexts' => 'backend'));
//
// Citation editor filter configuration
//
// 1) Add the filter grid URLs
$dispatcher = $request->getDispatcher();
$parserFilterGridUrl = $dispatcher->url($request, ROUTE_COMPONENT, null, 'grid.filter.ParserFilterGridHandler', 'fetchGrid');
$templateMgr->assign('parserFilterGridUrl', $parserFilterGridUrl);
$lookupFilterGridUrl = $dispatcher->url($request, ROUTE_COMPONENT, null, 'grid.filter.LookupFilterGridHandler', 'fetchGrid');
$templateMgr->assign('lookupFilterGridUrl', $lookupFilterGridUrl);
// 2) Create a list of all available citation output filters.
$router = $request->getRouter();
$journal = $router->getContext($request);
$filterDao = DAORegistry::getDAO('FilterDAO');
/* @var $filterDao FilterDAO */
$metaCitationOutputFilterObjects = $filterDao->getObjectsByGroup('nlm30-element-citation=>plaintext', $journal->getId());
foreach ($metaCitationOutputFilterObjects as $metaCitationOutputFilterObject) {
$metaCitationOutputFilters[$metaCitationOutputFilterObject->getId()] = $metaCitationOutputFilterObject->getDisplayName();
}
$templateMgr->assign_by_ref('metaCitationOutputFilters', $metaCitationOutputFilters);
return parent::fetch($request);
}
开发者ID:bkroll,项目名称:ojs,代码行数:37,代码来源:CitationsForm.inc.php
示例11: display
function display()
{
$templateMgr = TemplateManager::getManager();
$templateMgr->assign('depositPointId', $this->depositPointId);
$templateMgr->assign('depositPointTypes', $this->plugin->getTypeMap());
parent::display();
}
开发者ID:laelnasan,项目名称:UTFPR-ojs,代码行数:7,代码来源:DepositPointForm.inc.php
示例12: addTinyMCE
/**
* Add the tinyMCE script for editing sidebar blocks with a WYSIWYG editor
*/
function addTinyMCE()
{
$journalId = $this->journalId;
$plugin =& $this->plugin;
$templateMgr =& TemplateManager::getManager();
// Enable TinyMCE with specific params
$additionalHeadData = $templateMgr->get_template_vars('additionalHeadData');
import('classes.file.JournalFileManager');
$publicFileManager = new PublicFileManager();
$tinyMCE_script = '
<script language="javascript" type="text/javascript" src="' . Request::getBaseUrl() . '/' . TINYMCE_JS_PATH . '/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
plugins : "style,paste",
theme : "advanced",
theme_advanced_buttons1 : "formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink",
theme_advanced_buttons3 : "cut,copy,paste,pastetext,pasteword,|,cleanup,help,code,",
theme_advanced_toolbar_location : "bottom",
theme_advanced_toolbar_align : "left",
content_css : "' . Request::getBaseUrl() . '/styles/common.css",
relative_urls : false,
document_base_url : "' . Request::getBaseUrl() . '/' . $publicFileManager->getJournalFilesPath($journalId) . '/",
extended_valid_elements : "span[*], div[*]"
});
</script>';
$templateMgr->assign('additionalHeadData', $additionalHeadData . "\n" . $tinyMCE_script);
}
开发者ID:reconciler,项目名称:ojs,代码行数:32,代码来源:CustomBlockEditForm.inc.php
示例13: saveProgramSettings
/**
* Save changes to program settings.
*/
function saveProgramSettings()
{
$this->validate();
$this->setupTemplate(true);
$schedConf =& Request::getSchedConf();
if (!$schedConf) {
Request::redirect(null, null, 'index');
}
import('classes.manager.form.ProgramSettingsForm');
$settingsForm = new ProgramSettingsForm();
$settingsForm->readInputData();
$formLocale = $settingsForm->getFormLocale();
$programTitle = Request::getUserVar('programFileTitle');
$editData = false;
if (Request::getUserVar('uploadProgramFile')) {
if (!$settingsForm->uploadProgram('programFile', $formLocale)) {
$settingsForm->addError('programFile', Locale::translate('common.uploadFailed'));
}
$editData = true;
} elseif (Request::getUserVar('deleteProgramFile')) {
$settingsForm->deleteProgram('programFile', $formLocale);
$editData = true;
}
if (!$editData && $settingsForm->validate()) {
$settingsForm->execute();
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign(array('currentUrl' => Request::url(null, null, null, 'program'), 'pageTitle' => 'schedConf.program', 'message' => 'common.changesSaved', 'backLink' => Request::url(null, null, Request::getRequestedPage()), 'backLinkLabel' => 'manager.conferenceSiteManagement'));
$templateMgr->display('common/message.tpl');
} else {
$settingsForm->display();
}
}
开发者ID:ramonsodoma,项目名称:ocs,代码行数:35,代码来源:ManagerProgramHandler.inc.php
示例14: display
/**
* Display the form.
*/
function display()
{
$templateMgr =& TemplateManager::getManager();
$site =& Request::getSite();
$templateMgr->assign('minPasswordLength', $site->getMinPasswordLength());
parent::display();
}
开发者ID:yuricampos,项目名称:ojs,代码行数:10,代码来源:LoginChangePasswordForm.inc.php
示例15: index
/**
* Displays the issue listings in a tabbed interface.
* @param $args array
* @param $request PKPRequest
*/
function index($args, $request)
{
$this->setupTemplate($request);
AppLocale::requireComponents(LOCALE_COMPONENT_APP_EDITOR);
$templateMgr = TemplateManager::getManager($request);
$templateMgr->display('manageIssues/issues.tpl');
}
开发者ID:jalperin,项目名称:ojs,代码行数:12,代码来源:ManageIssuesHandler.inc.php
示例16: display
/**
* Display the form.
*/
function display()
{
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('buildingId', $this->buildingId);
$templateMgr->assign('helpTopicId', 'conference.currentConferences.buildings');
parent::display();
}
开发者ID:ramonsodoma,项目名称:ocs,代码行数:10,代码来源:BuildingForm.inc.php
示例17: fetch
/**
* Fetch
* @param $request PKPRequest
* @see Form::fetch()
*/
function fetch($request)
{
$templateMgr = TemplateManager::getManager($request);
$templateMgr->assign('submissionFileCategories', array(GENRE_CATEGORY_DOCUMENT => __('submission.document'), GENRE_CATEGORY_ARTWORK => __('submission.art'), GENRE_CATEGORY_SUPPLEMENTARY => __('submission.supplementary')));
AppLocale::requireComponents(LOCALE_COMPONENT_APP_MANAGER);
return parent::fetch($request);
}
开发者ID:selwyntcy,项目名称:pkp-lib,代码行数:12,代码来源:GenreForm.inc.php
示例18: display
/**
* Display the form.
*/
function display()
{
$journal = Request::getJournal();
$templateMgr = TemplateManager::getManager();
if (isset($this->comment)) {
$templateMgr->assign('comment', $this->comment);
$templateMgr->assign('commentId', $this->commentId);
}
$user = Request::getUser();
if ($user) {
$templateMgr->assign('userName', $user->getFullName());
$templateMgr->assign('userEmail', $user->getEmail());
}
if ($this->captchaEnabled) {
$templateMgr->assign('captchaEnabled', true);
import('lib.pkp.lib.recaptcha.recaptchalib');
$publicKey = Config::getVar('captcha', 'recaptcha_public_key');
$useSSL = Config::getVar('security', 'force_ssl') ? true : false;
$reCaptchaHtml = recaptcha_get_html($publicKey, null, $useSSL);
$templateMgr->assign('reCaptchaHtml', $reCaptchaHtml);
}
$templateMgr->assign('parentId', $this->parentId);
$templateMgr->assign('articleId', $this->articleId);
$templateMgr->assign('galleyId', $this->galleyId);
$templateMgr->assign('enableComments', $journal->getSetting('enableComments'));
parent::display();
}
开发者ID:laelnasan,项目名称:UTFPR-ojs,代码行数:30,代码来源:CommentForm.inc.php
示例19: startWizard
/**
* Displays the context settings wizard.
* @param $args array
* @param $request Request
* @return JSONMessage JSON object
*/
function startWizard($args, $request)
{
$templateMgr = TemplateManager::getManager($request);
AppLocale::requireComponents(LOCALE_COMPONENT_APP_MANAGER, LOCALE_COMPONENT_PKP_MANAGER);
$this->setupTemplate($request);
return $templateMgr->fetchJson('controllers/wizard/settings/settingsWizard.tpl');
}
开发者ID:jprk,项目名称:pkp-lib,代码行数:13,代码来源:ContextSettingsWizardHandler.inc.php
示例20: signInAsUser
/**
* Sign in as another user.
* @param $args array ($userId)
*/
function signInAsUser($args)
{
$this->addCheck(new HandlerValidatorConference($this));
$this->addCheck(new HandlerValidatorRoles($this, true, null, null, array(ROLE_ID_SITE_ADMIN, ROLE_ID_CONFERENCE_MANAGER)));
$this->validate();
if (isset($args[0]) && !empty($args[0])) {
$userId = (int) $args[0];
$conference =& Request::getConference();
if (!Validation::canAdminister($conference->getId(), $userId)) {
$this->setupTemplate();
// We don't have administrative rights
// over this user. Display an error.
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('pageTitle', 'manager.people');
$templateMgr->assign('errorMsg', 'manager.people.noAdministrativeRights');
$templateMgr->assign('backLink', Request::url(null, null, null, 'people', 'all'));
$templateMgr->assign('backLinkLabel', 'manager.people.allUsers');
return $templateMgr->display('common/error.tpl');
}
$userDao =& DAORegistry::getDAO('UserDAO');
$newUser =& $userDao->getUser($userId);
$session =& Request::getSession();
// FIXME Support "stack" of signed-in-as user IDs?
if (isset($newUser) && $session->getUserId() != $newUser->getId()) {
$session->setSessionVar('signedInAs', $session->getUserId());
$session->setSessionVar('userId', $userId);
$session->setUserId($userId);
$session->setSessionVar('username', $newUser->getUsername());
Request::redirect(null, null, 'user');
}
}
Request::redirect(null, null, Request::getRequestedPage());
}
开发者ID:sedici,项目名称:ocs,代码行数:37,代码来源:LoginHandler.inc.php
注:本文中的TemplateManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论