当前位置: 首页>>代码示例>>PHP>>正文


PHP MailTemplate::isEnabled方法代码示例

本文整理汇总了PHP中MailTemplate::isEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP MailTemplate::isEnabled方法的具体用法?PHP MailTemplate::isEnabled怎么用?PHP MailTemplate::isEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MailTemplate的用法示例。


在下文中一共展示了MailTemplate::isEnabled方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: display

 /**
  * Display the form
  * @param $request Request
  * @param $dispatcher Dispatcher
  */
 function display($request, $dispatcher)
 {
     $templateMgr =& TemplateManager::getManager($request);
     // Add extra style sheets required for ajax components
     // FIXME: Must be removed after OMP->OJS backporting
     $templateMgr->addStyleSheet($request->getBaseUrl() . '/styles/ojs.css');
     // Add extra java script required for ajax components
     // FIXME: Must be removed after OMP->OJS backporting
     $templateMgr->addJavaScript('lib/pkp/js/grid-clickhandler.js');
     $templateMgr->addJavaScript('lib/pkp/js/modal.js');
     $templateMgr->addJavaScript('lib/pkp/js/lib/jquery/plugins/validate/jquery.validate.min.js');
     $templateMgr->addJavaScript('lib/pkp/js/jqueryValidatorI18n.js');
     import('classes.mail.MailTemplate');
     $mail = new MailTemplate('SUBMISSION_ACK');
     if ($mail->isEnabled()) {
         $templateMgr->assign('submissionAckEnabled', true);
     }
     // Citation editor filter configuration
     //
     // 1) Check whether PHP5 is available.
     if (!checkPhpVersion('5.0.0')) {
         Locale::requireComponents(array(LOCALE_COMPONENT_PKP_SUBMISSION));
         $citationEditorError = 'submission.citations.editor.php5Required';
     } else {
         $citationEditorError = null;
     }
     $templateMgr->assign('citationEditorError', $citationEditorError);
     if (!$citationEditorError) {
         // 2) Add the filter grid URLs
         $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);
         // 3) Create a list of all available citation output filters.
         $router =& $request->getRouter();
         $journal =& $router->getContext($request);
         import('lib.pkp.classes.metadata.MetadataDescription');
         $inputSample = new MetadataDescription('lib.pkp.classes.metadata.nlm.NlmCitationSchema', ASSOC_TYPE_CITATION);
         $outputSample = 'any string';
         $filterDao =& DAORegistry::getDAO('FilterDAO');
         $metaCitationOutputFilterObjects =& $filterDao->getCompatibleObjects($inputSample, $outputSample, $journal->getId());
         foreach ($metaCitationOutputFilterObjects as $metaCitationOutputFilterObject) {
             $metaCitationOutputFilters[$metaCitationOutputFilterObject->getId()] = $metaCitationOutputFilterObject->getDisplayName();
         }
         $templateMgr->assign_by_ref('metaCitationOutputFilters', $metaCitationOutputFilters);
     }
     $currencyDao =& DAORegistry::getDAO('CurrencyDAO');
     $currencies =& $currencyDao->getCurrencies();
     $currenciesArray = array();
     foreach ($currencies as $currency) {
         $currenciesArray[$currency->getCodeAlpha()] = $currency->getName() . ' (' . $currency->getCodeAlpha() . ')';
     }
     $templateMgr->assign('currencies', $currenciesArray);
     $originalSourceCurrencyAlpha = $journal->getSetting('sourceCurrency');
     $originalSourceCurrency = $currencyDao->getCurrencyByAlphaCode($originalSourceCurrencyAlpha);
     $templateMgr->assign('originalSourceCurrency', $originalSourceCurrency->getName() . ' (' . $originalSourceCurrencyAlpha . ')');
     $proposalSourceDao =& DAORegistry::getDAO('ProposalSourceDAO');
     $templateMgr->assign('countSources', $proposalSourceDao->countSources());
     parent::display($request, $dispatcher);
 }
开发者ID:JovanyJeff,项目名称:hrp,代码行数:65,代码来源:JournalSetupStep3Form.inc.php

示例2: fetch

 /**
  * @copydoc Form::fetch()
  */
 function fetch($request, $params = null)
 {
     $templateMgr = TemplateManager::getManager($request);
     import('lib.pkp.classes.mail.MailTemplate');
     $mail = new MailTemplate('SUBMISSION_ACK');
     $templateMgr->assign('submissionAckDisabled', !$mail->isEnabled());
     return parent::fetch($request, $params);
 }
开发者ID:mczirfusz,项目名称:pkp-lib,代码行数:11,代码来源:SubmissionStageForm.inc.php

示例3: display

 /**
  * Display the form
  */
 function display()
 {
     import('mail.MailTemplate');
     $mail = new MailTemplate('SUBMISSION_ACK');
     if ($mail->isEnabled()) {
         $templateMgr =& TemplateManager::getManager();
         $templateMgr->assign('submissionAckEnabled', true);
     }
     parent::display();
 }
开发者ID:philschatz,项目名称:ojs,代码行数:13,代码来源:JournalSetupStep3Form.inc.php

示例4: display

 /**
  * Display the form
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     import('mail.MailTemplate');
     $mail = new MailTemplate('SUBMISSION_ACK');
     if ($mail->isEnabled()) {
         $templateMgr->assign('submissionAckEnabled', true);
     }
     if ($this->_data['reviewDeadlineType'] == REVIEW_DEADLINE_TYPE_ABSOLUTE) {
         $templateMgr->assign('absoluteReviewDate', $this->_data['numWeeksPerReviewAbsolute']);
     }
     if (Config::getVar('general', 'scheduled_tasks')) {
         $templateMgr->assign('scheduledTasksEnabled', true);
     }
     parent::display();
 }
开发者ID:jalperin,项目名称:ocs,代码行数:19,代码来源:SchedConfSetupStep3Form.inc.php

示例5: display

 /**
  * Display the form
  * @param $request Request
  * @param $dispatcher Dispatcher
  */
 function display($request, $dispatcher)
 {
     $templateMgr =& TemplateManager::getManager($request);
     // Add extra style sheets required for ajax components
     // FIXME: Must be removed after OMP->OJS backporting
     $templateMgr->addStyleSheet($request->getBaseUrl() . '/styles/ojs.css');
     // Add extra java script required for ajax components
     // FIXME: Must be removed after OMP->OJS backporting
     $templateMgr->addJavaScript('lib/pkp/js/functions/grid-clickhandler.js');
     $templateMgr->addJavaScript('lib/pkp/js/functions/modal.js');
     $templateMgr->addJavaScript('lib/pkp/js/lib/jquery/plugins/validate/jquery.validate.min.js');
     $templateMgr->addJavaScript('lib/pkp/js/functions/jqueryValidatorI18n.js');
     import('classes.mail.MailTemplate');
     $mail = new MailTemplate('SUBMISSION_ACK');
     if ($mail->isEnabled()) {
         $templateMgr->assign('submissionAckEnabled', true);
     }
     // Citation editor filter configuration
     //
     // 1) Check whether PHP5 is available.
     if (!checkPhpVersion('5.0.0')) {
         Locale::requireComponents(array(LOCALE_COMPONENT_PKP_SUBMISSION));
         $citationEditorError = 'submission.citations.editor.php5Required';
     } else {
         $citationEditorError = null;
     }
     $templateMgr->assign('citationEditorError', $citationEditorError);
     if (!$citationEditorError) {
         // 2) Add the filter grid URLs
         $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);
         // 3) 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);
     }
     parent::display($request, $dispatcher);
 }
开发者ID:ramonsodoma,项目名称:ojs,代码行数:51,代码来源:JournalSetupStep3Form.inc.php

示例6: display

 /**
  * Display the form
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     import('mail.MailTemplate');
     $mail = new MailTemplate('SUBMISSION_ACK');
     if ($mail->isEnabled()) {
         $templateMgr->assign('submissionAckEnabled', true);
     }
     if ($this->_data['reviewDeadlineType'] == REVIEW_DEADLINE_TYPE_ABSOLUTE) {
         $templateMgr->assign('absoluteReviewDate', $this->_data['numWeeksPerReviewAbsolute']);
     }
     if (Config::getVar('general', 'scheduled_tasks')) {
         $templateMgr->assign('scheduledTasksEnabled', true);
     }
     import('manager.form.TimelineForm');
     $schedConf =& Request::getSchedConf();
     list($earliestDate, $latestDate) = TimelineForm::getOutsideDates($schedConf);
     $templateMgr->assign('firstYear', strftime('%Y', $earliestDate));
     $templateMgr->assign('lastYear', strftime('%Y', $latestDate));
     parent::display();
 }
开发者ID:sedici,项目名称:ocs,代码行数:24,代码来源:SchedConfSetupStep3Form.inc.php

示例7: execute

 /**
  * Save review assignment
  * @param $args array
  * @param $request PKPRequest
  */
 function execute($args, $request)
 {
     $userDao = DAORegistry::getDAO('UserDAO');
     $user = $userDao->newDataObject();
     $user->setFirstName($this->getData('firstName'));
     $user->setMiddleName($this->getData('middleName'));
     $user->setLastName($this->getData('lastName'));
     $user->setEmail($this->getData('email'));
     $authDao = DAORegistry::getDAO('AuthSourceDAO');
     $auth = $authDao->getDefaultPlugin();
     $user->setAuthId($auth ? $auth->getAuthId() : 0);
     $user->setInlineHelp(1);
     // default new reviewers to having inline help visible
     $user->setUsername($this->getData('username'));
     $password = Validation::generatePassword();
     if (isset($auth)) {
         $user->setPassword($password);
         // FIXME Check result and handle failures
         $auth->doCreateUser($user);
         $user->setAuthId($auth->authId);
         $user->setPassword(Validation::encryptCredentials($user->getId(), Validation::generatePassword()));
         // Used for PW reset hash only
     } else {
         $user->setPassword(Validation::encryptCredentials($this->getData('username'), $password));
     }
     $user->setDateRegistered(Core::getCurrentDate());
     $reviewerId = $userDao->insertObject($user);
     // Set the reviewerId in the Form for the parent class to use
     $this->setData('reviewerId', $reviewerId);
     // Insert the user interests
     import('lib.pkp.classes.user.InterestManager');
     $interestManager = new InterestManager();
     $interestManager->setInterestsForUser($user, $this->getData('interests'));
     // Assign the selected user group ID to the user
     $userGroupDao = DAORegistry::getDAO('UserGroupDAO');
     /* @var $userGroupDao UserGroupDAO */
     $userGroupId = (int) $this->getData('userGroupId');
     $userGroupDao->assignUserToGroup($reviewerId, $userGroupId);
     if (!$this->getData('skipEmail')) {
         // Send welcome email to user
         import('lib.pkp.classes.mail.MailTemplate');
         $mail = new MailTemplate('REVIEWER_REGISTER');
         if ($mail->isEnabled()) {
             $context = $request->getContext();
             $mail->setReplyTo($context->getSetting('contactEmail'), $context->getSetting('contactName'));
             $mail->assignParams(array('username' => $this->getData('username'), 'password' => $password, 'userFullName' => $user->getFullName()));
             $mail->addRecipient($user->getEmail(), $user->getFullName());
             $mail->send($request);
         }
     }
     return parent::execute($args, $request);
 }
开发者ID:relaciones-internacionales-journal,项目名称:pkp-lib,代码行数:57,代码来源:CreateReviewerForm.inc.php

示例8: execute

 /**
  * Save archive settings.
  */
 function execute()
 {
     $archiveDao =& DAORegistry::getDAO('ArchiveDAO');
     if (!isset($this->archive)) {
         $this->archive = new Archive();
         $user =& Request::getUser();
         $this->archive->setUserId($user->getId());
     }
     $this->harvesterPluginName = Request::getUserVar('harvesterPluginName');
     $this->archive->setHarvesterPluginName($this->harvesterPluginName);
     $this->archive->setUrl($this->getData('url'));
     $this->archive->setTitle($this->getData('title'));
     if (Validation::isSiteAdmin()) {
         $this->archive->setPublicArchiveId($this->getData('publicArchiveId'));
         $this->archive->setEnabled($this->getData('enabled'));
     } else {
         $site =& Request::getSite();
         $this->archive->setEnabled($site->getSetting('disableSubmissions') ? 1 : 0);
     }
     if ($this->archive->getArchiveId() != null) {
         $archiveDao->updateArchive($this->archive);
     } else {
         $archiveId = $archiveDao->insertArchive($this->archive);
         // Include the current default set of reading tools.
         import('classes.rt.harvester2.HarvesterRTAdmin');
         $rtAdmin = new HarvesterRTADmin($archiveId);
         $rtAdmin->restoreVersions(false);
     }
     $this->archive->updateSetting('description', $this->getData('description'));
     HookRegistry::call('ArchiveForm::execute', array(&$this, &$this->archive, $this->harvesterPluginName));
     if (!Validation::isSiteAdmin()) {
         // Send an email notifying the administrator of the new archive.
         import('classes.mail.MailTemplate');
         $email = new MailTemplate('NEW_ARCHIVE_NOTIFY');
         if ($email->isEnabled()) {
             $email->assignParams(array('archiveTitle' => $this->getData('title'), 'siteTitle' => $site->getLocalizedTitle(), 'loginUrl' => Request::url('admin', 'manage', $this->archive->getArchiveId())));
             $email->addRecipient($site->getLocalizedSetting('contactEmail'), $site->getLocalizedSetting('contactName'));
             $email->send();
         }
     }
 }
开发者ID:ramonsodoma,项目名称:harvester,代码行数:44,代码来源:ArchiveForm.inc.php


注:本文中的MailTemplate::isEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。