本文整理汇总了PHP中TemplateManager::getManager方法的典型用法代码示例。如果您正苦于以下问题:PHP TemplateManager::getManager方法的具体用法?PHP TemplateManager::getManager怎么用?PHP TemplateManager::getManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TemplateManager
的用法示例。
在下文中一共展示了TemplateManager::getManager方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例2: 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');
}
示例3: display
/**
* Display the form.
*/
function display()
{
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('conferenceId', $this->conferenceId);
$templateMgr->assign('helpTopicId', 'site.siteManagement');
parent::display();
}
示例4: documentLibrary
/**
* Display a list of the review form elements within a review form.
* @param $args array
* @param $request PKPRequest
* @return JSONMessage JSON object
*/
function documentLibrary($args, $request)
{
$templateMgr = TemplateManager::getManager($request);
$dispatcher = $request->getDispatcher();
$submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);
return $templateMgr->fetchAjax('submissionLibraryContainer', $dispatcher->url($request, ROUTE_COMPONENT, null, 'grid.files.submissionDocuments.SubmissionDocumentsFilesGridHandler', 'fetchGrid', null, array('submissionId' => $submission->getId())));
}
示例5: display
/**
* Display the form.
*/
function display()
{
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign_by_ref('group', $this->group);
$templateMgr->assign('helpTopicId', 'conference.currentConferences.organizingTeam');
parent::display();
}
示例6: 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();
}
示例7: 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();
}
}
示例8: 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);
}
示例9: 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();
}
}
示例10: 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);
}
示例11: display
/**
* Display the form.
*/
function display()
{
$templateMgr =& TemplateManager::getManager();
$site =& Request::getSite();
$templateMgr->assign('minPasswordLength', $site->getMinPasswordLength());
parent::display();
}
示例12: 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');
}
示例13: display
/**
* Display the form.
*/
function display()
{
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('buildingId', $this->buildingId);
$templateMgr->assign('helpTopicId', 'conference.currentConferences.buildings');
parent::display();
}
示例14: 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);
}
示例15: fetch
function fetch(&$request)
{
$monograph =& $this->getMonograph();
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign_by_ref('monograph', $this->getMonograph());
return parent::fetch($request);
}