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


PHP Validation::isLayoutEditor方法代码示例

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


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

示例1: _isVisibleIssue

 /**
  * Given an issue and journal id, return whether the current user can view the issue in the journal
  * @param $issue object The issue to display
  * @param $journalId int The id of the journal
  */
 function _isVisibleIssue($issue, $journalId)
 {
     if (isset($issue) && ($issue->getPublished() || Validation::isEditor($journalId) || Validation::isLayoutEditor($journalId) || Validation::isProofreader($journalId)) && $issue->getJournalId() == $journalId) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:13,代码来源:IssueHandler.inc.php

示例2: validate

 /**
  * Validate that user is an editor in the selected journal and if the issue id is valid
  * Redirects to issue create issue page if not properly authenticated.
  * NOTE: As of OJS 2.2, Layout Editors are allowed if specified in args.
  */
 function validate($issueId = null, $allowLayoutEditor = false)
 {
     $issue = null;
     $journal =& Request::getJournal();
     if (!isset($journal)) {
         Validation::redirectLogin();
     }
     if (isset($issueId)) {
         $issueDao =& DAORegistry::getDAO('IssueDAO');
         $issue = $issueDao->getIssueById($issueId, $journal->getJournalId());
         if (!$issue) {
             Request::redirect(null, null, 'createIssue');
         }
     }
     if (!Validation::isEditor($journal->getJournalId())) {
         if (isset($journal) && $allowLayoutEditor && Validation::isLayoutEditor($journal->getJournalId())) {
             // We're a Layout Editor. If specified, make sure that the issue is not published.
             if ($issue && !$issue->getPublished()) {
                 Validation::redirectLogin();
             }
         } else {
             Validation::redirectLogin();
         }
     }
     return $issue;
 }
开发者ID:LiteratimBi,项目名称:jupitertfn,代码行数:31,代码来源:IssueManagementHandler.inc.php

示例3: validate

 /**
  * Validate that user is a layout editor in the selected journal.
  * Redirects to user index page if not properly authenticated.
  */
 function validate()
 {
     parent::validate();
     $journal =& Request::getJournal();
     if (!isset($journal) || !Validation::isLayoutEditor($journal->getJournalId())) {
         Validation::redirectLogin();
     }
 }
开发者ID:LiteratimBi,项目名称:jupitertfn,代码行数:12,代码来源:LayoutEditorHandler.inc.php

示例4: _setupIssueTemplate

 /**
  * Given an issue, set up the template with all the required variables for
  * issues/view.tpl to function properly (i.e. current issue and view issue).
  * @param $issue object The issue to display
  * @param $showToc boolean iff false and a custom cover page exists,
  * 	the cover page will be displayed. Otherwise table of contents
  * 	will be displayed.
  */
 function _setupIssueTemplate($request, $issue, $showToc = false)
 {
     $journal =& $request->getJournal();
     $journalId = $journal->getId();
     $templateMgr =& TemplateManager::getManager();
     if (isset($issue) && ($issue->getPublished() || Validation::isEditor($journalId) || Validation::isLayoutEditor($journalId) || Validation::isProofreader($journalId)) && $issue->getJournalId() == $journalId) {
         $issueHeadingTitle = $issue->getIssueIdentification(false, true);
         $issueCrumbTitle = $issue->getIssueIdentification(false, true);
         $locale = AppLocale::getLocale();
         import('classes.file.PublicFileManager');
         $publicFileManager = new PublicFileManager();
         $coverPagePath = $request->getBaseUrl() . '/';
         $coverPagePath .= $publicFileManager->getJournalFilesPath($journalId) . '/';
         $templateMgr->assign('coverPagePath', $coverPagePath);
         $templateMgr->assign('locale', $locale);
         if (!$showToc && $issue->getFileName($locale) && $issue->getShowCoverPage($locale) && !$issue->getHideCoverPageCover($locale)) {
             $templateMgr->assign('fileName', $issue->getFileName($locale));
             $templateMgr->assign('width', $issue->getWidth($locale));
             $templateMgr->assign('height', $issue->getHeight($locale));
             $templateMgr->assign('coverPageAltText', $issue->getCoverPageAltText($locale));
             $templateMgr->assign('originalFileName', $issue->getOriginalFileName($locale));
             $showToc = false;
         } else {
             // Issue galleys
             $issueGalleyDao =& DAORegistry::getDAO('IssueGalleyDAO');
             $issueGalleys =& $issueGalleyDao->getGalleysByIssue($issue->getId());
             $templateMgr->assign_by_ref('issueGalleys', $issueGalleys);
             // Published articles
             $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
             $publishedArticles =& $publishedArticleDao->getPublishedArticlesInSections($issue->getId(), true);
             $publicFileManager = new PublicFileManager();
             $templateMgr->assign_by_ref('publishedArticles', $publishedArticles);
             $showToc = true;
         }
         $templateMgr->assign('showToc', $showToc);
         $templateMgr->assign_by_ref('issue', $issue);
         // Subscription Access
         import('classes.issue.IssueAction');
         $subscriptionRequired = IssueAction::subscriptionRequired($issue);
         $subscribedUser = IssueAction::subscribedUser($journal);
         $subscribedDomain = IssueAction::subscribedDomain($journal);
         $subscriptionExpiryPartial = $journal->getSetting('subscriptionExpiryPartial');
         if ($showToc && $subscriptionRequired && !$subscribedUser && !$subscribedDomain && $subscriptionExpiryPartial) {
             $templateMgr->assign('subscriptionExpiryPartial', true);
             // Partial subscription expiry for issue
             $partial = IssueAction::subscribedUser($journal, $issue->getId());
             if (!$partial) {
                 IssueAction::subscribedDomain($journal, $issue->getId());
             }
             $templateMgr->assign('issueExpiryPartial', $partial);
             // Partial subscription expiry for articles
             $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
             $publishedArticlesTemp =& $publishedArticleDao->getPublishedArticles($issue->getId());
             $articleExpiryPartial = array();
             foreach ($publishedArticlesTemp as $publishedArticle) {
                 $partial = IssueAction::subscribedUser($journal, $issue->getId(), $publishedArticle->getId());
                 if (!$partial) {
                     IssueAction::subscribedDomain($journal, $issue->getId(), $publishedArticle->getId());
                 }
                 $articleExpiryPartial[$publishedArticle->getId()] = $partial;
             }
             $templateMgr->assign_by_ref('articleExpiryPartial', $articleExpiryPartial);
         }
         $templateMgr->assign('subscriptionRequired', $subscriptionRequired);
         $templateMgr->assign('subscribedUser', $subscribedUser);
         $templateMgr->assign('subscribedDomain', $subscribedDomain);
         $templateMgr->assign('showGalleyLinks', $journal->getSetting('showGalleyLinks'));
         import('classes.payment.ojs.OJSPaymentManager');
         $paymentManager = new OJSPaymentManager($request);
         if ($paymentManager->onlyPdfEnabled()) {
             $templateMgr->assign('restrictOnlyPdf', true);
         }
         if ($paymentManager->purchaseArticleEnabled()) {
             $templateMgr->assign('purchaseArticleEnabled', true);
         }
     } else {
         $issueCrumbTitle = __('archive.issueUnavailable');
         $issueHeadingTitle = __('archive.issueUnavailable');
     }
     if ($styleFileName = $issue->getStyleFileName()) {
         import('classes.file.PublicFileManager');
         $publicFileManager = new PublicFileManager();
         $templateMgr->addStyleSheet($request->getBaseUrl() . '/' . $publicFileManager->getJournalFilesPath($journalId) . '/' . $styleFileName);
     }
     $templateMgr->assign('pageCrumbTitleTranslated', $issueCrumbTitle);
     $templateMgr->assign('issueHeadingTitle', $issueHeadingTitle);
 }
开发者ID:reconciler,项目名称:ojs,代码行数:95,代码来源:IssueHandler.inc.php

示例5: _getRoleDataForJournal

 /**
  * Gather information about a user's role within a journal.
  * @param $userId int
  * @param $journalId int
  * @param $submissionsCount array reference
  * @param $isValid array reference
  */
 function _getRoleDataForJournal($userId, $journalId, &$submissionsCount, &$isValid)
 {
     if (Validation::isJournalManager($journalId)) {
         $journalDao =& DAORegistry::getDAO('JournalDAO');
         $isValid["JournalManager"][$journalId] = true;
     }
     if (Validation::isSubscriptionManager($journalId)) {
         $isValid["SubscriptionManager"][$journalId] = true;
     }
     if (Validation::isAuthor($journalId)) {
         $authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
         $submissionsCount["Author"][$journalId] = $authorSubmissionDao->getSubmissionsCount($userId, $journalId);
         $isValid["Author"][$journalId] = true;
     }
     if (Validation::isCopyeditor($journalId)) {
         $copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO');
         $submissionsCount["Copyeditor"][$journalId] = $copyeditorSubmissionDao->getSubmissionsCount($userId, $journalId);
         $isValid["Copyeditor"][$journalId] = true;
     }
     if (Validation::isLayoutEditor($journalId)) {
         $layoutEditorSubmissionDao =& DAORegistry::getDAO('LayoutEditorSubmissionDAO');
         $submissionsCount["LayoutEditor"][$journalId] = $layoutEditorSubmissionDao->getSubmissionsCount($userId, $journalId);
         $isValid["LayoutEditor"][$journalId] = true;
     }
     if (Validation::isEditor($journalId)) {
         $editorSubmissionDao =& DAORegistry::getDAO('EditorSubmissionDAO');
         $submissionsCount["Editor"][$journalId] = $editorSubmissionDao->getEditorSubmissionsCount($journalId);
         $isValid["Editor"][$journalId] = true;
     }
     if (Validation::isSectionEditor($journalId)) {
         $sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
         $submissionsCount["SectionEditor"][$journalId] = $sectionEditorSubmissionDao->getSectionEditorSubmissionsCount($userId, $journalId);
         $isValid["SectionEditor"][$journalId] = true;
     }
     if (Validation::isProofreader($journalId)) {
         $proofreaderSubmissionDao =& DAORegistry::getDAO('ProofreaderSubmissionDAO');
         $submissionsCount["Proofreader"][$journalId] = $proofreaderSubmissionDao->getSubmissionsCount($userId, $journalId);
         $isValid["Proofreader"][$journalId] = true;
     }
     if (Validation::isReviewer($journalId)) {
         $reviewerSubmissionDao =& DAORegistry::getDAO('ReviewerSubmissionDAO');
         $submissionsCount["Reviewer"][$journalId] = $reviewerSubmissionDao->getSubmissionsCount($userId, $journalId);
         $isValid["Reviewer"][$journalId] = true;
     }
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:52,代码来源:UserHandler.inc.php

示例6: setupIssueTemplate

 /**
  * Given an issue, set up the template with all the required variables for
  * issues/view.tpl to function properly.
  * @param $issue object The issue to display
  * @param $showToc boolean iff false and a custom cover page exists,
  * 	the cover page will be displayed. Otherwise table of contents
  * 	will be displayed.
  */
 function setupIssueTemplate(&$issue, $showToc = false)
 {
     $journal =& Request::getJournal();
     $journalId = $journal->getId();
     $templateMgr =& TemplateManager::getManager();
     if (isset($issue) && ($issue->getPublished() || Validation::isEditor($journalId) || Validation::isLayoutEditor($journalId) || Validation::isProofreader($journalId)) && $issue->getJournalId() == $journalId) {
         $issueHeadingTitle = $issue->getIssueIdentification(false, true);
         $issueCrumbTitle = $issue->getIssueIdentification(false, true);
         $locale = Locale::getLocale();
         import('classes.file.PublicFileManager');
         $publicFileManager = new PublicFileManager();
         $coverPagePath = Request::getBaseUrl() . '/';
         $coverPagePath .= $publicFileManager->getJournalFilesPath($journalId) . '/';
         $templateMgr->assign('coverPagePath', $coverPagePath);
         $templateMgr->assign('locale', $locale);
         if ($issue->getFileName($locale) && $issue->getShowCoverPage($locale) && !$issue->getHideCoverPageCover($locale)) {
             //%LP% show thumbnail version rather than full-size front cover
             $filename = $issue->getThumbFileName($issue->getFileName($locale));
             $templateMgr->assign('fileName', $filename);
             $templateMgr->assign('coverPageAltText', $issue->getCoverPageAltText($locale));
             $templateMgr->assign('originalFileName', $issue->getOriginalFileName($locale));
             $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
             $publishedArticles =& $publishedArticleDao->getPublishedArticlesInSections($issue->getId(), true);
             $publicFileManager = new PublicFileManager();
             $templateMgr->assign('publishedArticles', $publishedArticles);
         }
         $templateMgr->assign('showToc', $showToc);
         $templateMgr->assign('issueId', $issue->getBestIssueId());
         $templateMgr->assign('issue', $issue);
         // Subscription Access
         import('classes.issue.IssueAction');
         $subscriptionRequired = IssueAction::subscriptionRequired($issue);
         $subscribedUser = IssueAction::subscribedUser($journal);
         $subscribedDomain = IssueAction::subscribedDomain($journal);
         $subscriptionExpiryPartial = $journal->getSetting('subscriptionExpiryPartial');
         if ($showToc && $subscriptionRequired && !$subscribedUser && !$subscribedDomain && $subscriptionExpiryPartial) {
             $templateMgr->assign('subscriptionExpiryPartial', true);
             $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
             $publishedArticlesTemp =& $publishedArticleDao->getPublishedArticles($issue->getId());
             $articleExpiryPartial = array();
             foreach ($publishedArticlesTemp as $publishedArticle) {
                 $partial = IssueAction::subscribedUser($journal, $issue->getId(), $publishedArticle->getId());
                 if (!$partial) {
                     IssueAction::subscribedDomain($journal, $issue->getId(), $publishedArticle->getId());
                 }
                 $articleExpiryPartial[$publishedArticle->getId()] = $partial;
             }
             $templateMgr->assign_by_ref('articleExpiryPartial', $articleExpiryPartial);
         }
         $templateMgr->assign('subscriptionRequired', $subscriptionRequired);
         $templateMgr->assign('subscribedUser', $subscribedUser);
         $templateMgr->assign('subscribedDomain', $subscribedDomain);
         $templateMgr->assign('showGalleyLinks', $journal->getSetting('showGalleyLinks'));
         import('classes.payment.ojs.OJSPaymentManager');
         $paymentManager =& OJSPaymentManager::getManager();
         if ($paymentManager->onlyPdfEnabled()) {
             $templateMgr->assign('restrictOnlyPdf', true);
         }
         if ($paymentManager->purchaseArticleEnabled()) {
             $templateMgr->assign('purchaseArticleEnabled', true);
         }
     } else {
         $issueCrumbTitle = Locale::translate('archive.issueUnavailable');
         $issueHeadingTitle = Locale::translate('archive.issueUnavailable');
     }
     if ($styleFileName = $issue->getStyleFileName()) {
         import('classes.file.PublicFileManager');
         $publicFileManager = new PublicFileManager();
         $templateMgr->addStyleSheet(Request::getBaseUrl() . '/' . $publicFileManager->getJournalFilesPath($journalId) . '/' . $styleFileName);
     }
     $articleDao =& DAORegistry::getDAO('ArticleDAO');
     $articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
     //%CBP% get repository object information for download links
     $CBPPlatformDao =& DAORegistry::getDAO('CBPPlatformDAO');
     $issueObject = $CBPPlatformDao->getFedoraIssueObjectInformation($issue->getIssueId());
     $objectPid = $issueObject['fedora_namespace'] . ":" . $issueObject['fedora_pid'];
     $objectDsid = $issueObject['fedora_dsid'];
     $templateMgr->assign_by_ref('repositoryObjectPid', $objectPid);
     $templateMgr->assign_by_ref('repositoryObjectDsid', $objectDsid);
     $locale = Config::getVar('i18n', 'locale');
     //%LP% show associated artefacts (supplementary files) related to the submission
     foreach ($publishedArticles as $section) {
         foreach ($section['articles'] as $article) {
             $supplementaryFilesTemp[] = $article->getSuppFiles();
         }
     }
     foreach ($supplementaryFilesTemp as $supplementaryFile) {
         if ($supplementaryFile[0]) {
             $suppFile = $supplementaryFile[0];
             $article = $articleDao->getArticle($suppFile->getArticleId());
             $title = $suppFile->getTitle();
             if (stristr($title['en_US'], "Author Biography") == false) {
//.........这里部分代码省略.........
开发者ID:master3395,项目名称:CBPPlatform,代码行数:101,代码来源:IssueHandler.inc.php


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