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


PHP Issue::setTitle方法代码示例

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


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

示例1: importIssue

 function importIssue(&$journal, &$issueNode, &$issue, &$errors, &$user, $isCommandLine, &$dependentItems, $cleanupErrors = true)
 {
     $errors = array();
     $issue = null;
     $hasErrors = false;
     $issueDao =& DAORegistry::getDAO('IssueDAO');
     $issue = new Issue();
     $issue->setJournalId($journal->getId());
     $journalSupportedLocales = array_keys($journal->getSupportedLocaleNames());
     // => journal locales must be set up before
     $journalPrimaryLocale = $journal->getPrimaryLocale();
     /* --- Set title, description, volume, number, and year --- */
     $titleExists = false;
     for ($index = 0; $node = $issueNode->getChildByName('title', $index); $index++) {
         $locale = $node->getAttribute('locale');
         if ($locale == '') {
             $locale = $journalPrimaryLocale;
         } elseif (!in_array($locale, $journalSupportedLocales)) {
             $errors[] = array('plugins.importexport.native.import.error.issueTitleLocaleUnsupported', array('issueTitle' => $node->getValue(), 'locale' => $locale));
             $hasErrors = true;
             continue;
         }
         $issue->setTitle($node->getValue(), $locale);
         $titleExists = true;
     }
     for ($index = 0; $node = $issueNode->getChildByName('description', $index); $index++) {
         $locale = $node->getAttribute('locale');
         if ($locale == '') {
             $locale = $journalPrimaryLocale;
         } elseif (!in_array($locale, $journalSupportedLocales)) {
             $errors[] = array('plugins.importexport.native.import.error.issueDescriptionLocaleUnsupported', array('issueTitle' => $issue->getLocalizedTitle(), 'locale' => $locale));
             $hasErrors = true;
             continue;
         }
         $issue->setDescription($node->getValue(), $locale);
     }
     if ($node = $issueNode->getChildByName('volume')) {
         $issue->setVolume($node->getValue());
     }
     if ($node = $issueNode->getChildByName('number')) {
         $issue->setNumber($node->getValue());
     }
     if ($node = $issueNode->getChildByName('year')) {
         $issue->setYear($node->getValue());
     }
     /* --- Set date published --- */
     if ($node = $issueNode->getChildByName('date_published')) {
         $publishedDate = strtotime($node->getValue());
         if ($publishedDate === -1) {
             $errors[] = array('plugins.importexport.native.import.error.invalidDate', array('value' => $node->getValue()));
             if ($cleanupErrors) {
                 NativeImportDom::cleanupFailure($dependentItems);
             }
             return false;
         } else {
             $issue->setDatePublished($publishedDate);
         }
     }
     /* --- Set attributes: Identification type, published, current, public ID --- */
     switch ($value = $issueNode->getAttribute('identification')) {
         case 'num_vol_year':
             $issue->setShowVolume(1);
             $issue->setShowNumber(1);
             $issue->setShowYear(1);
             $issue->setShowTitle(0);
             break;
         case 'vol_year':
             $issue->setShowVolume(1);
             $issue->setShowNumber(0);
             $issue->setShowYear(1);
             $issue->setShowTitle(0);
             break;
         case 'vol':
             $issue->setShowVolume(1);
             $issue->setShowNumber(0);
             $issue->setShowYear(0);
             $issue->setShowTitle(0);
             break;
         case 'year':
             $issue->setShowVolume(0);
             $issue->setShowNumber(0);
             $issue->setShowYear(1);
             $issue->setShowTitle(0);
             break;
         case 'title':
         case '':
         case null:
             $issue->setShowVolume(0);
             $issue->setShowNumber(0);
             $issue->setShowYear(0);
             $issue->setShowTitle(1);
             break;
         default:
             $errors[] = array('plugins.importexport.native.import.error.unknownIdentificationType', array('identificationType' => $value, 'issueTitle' => $issue->getLocalizedTitle()));
             $hasErrors = true;
             break;
     }
     if (($issueNode->getAttribute('identification') == 'title' || $issueNode->getAttribute('identification') == '') && !$titleExists) {
         $errors[] = array('plugins.importexport.native.import.error.titleMissing', array());
         // Set a placeholder title so that further errors are
//.........这里部分代码省略.........
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:101,代码来源:NativeImportDom.inc.php

示例2: sprintf

    if ($open_cmd == 'a') {
        $permission = 7;
        if ($open_id == $SessSemName[1]) {
            $titel=_("Allgemeiner Dateiordner");
            $description= sprintf(_("Ablage für allgemeine Ordner und Dokumente der %s"), $SessSemName["art_generic"]);
        } else if ($open_id == md5('new_top_folder')){
            $titel = Request::get('top_folder_name') ? Request::get('top_folder_name') : _("Neuer Ordner");
            $open_id = md5($SessSemName[1] . 'top_folder');
        } elseif($titel = GetStatusgruppeName($open_id)) {
            $titel = _("Dateiordner der Gruppe:") . ' ' . $titel;
            $description = _("Ablage für Ordner und Dokumente dieser Gruppe");
            $permission = 15;
        } else if ($data = SingleDateDB::restoreSingleDate($open_id)) {
            // If we create a folder which has not yet an issue, we just create one
            $issue = new Issue(array('seminar_id' => $SessSemName[1]));
            $issue->setTitle(_("Ohne Titel"));
            $termin = new SingleDate($open_id);
            $termin->addIssueID($issue->getIssueID());
            $issue->store();
            $termin->store();

            $open_id = $issue->getIssueID();
            $titel = $issue->getTitle();
            $description= _("Themenbezogener Dateiordner");
        } else {
            $query = "SELECT title FROM themen WHERE issue_id = ?";
            $statement = DBManager::get()->prepare($query);
            $statement->execute(array($open_id));
            if ($result = $statement->fetch()) {
                $titel = $result["title"];
                $description= _("Themenbezogener Dateiordner");
开发者ID:ratbird,项目名称:hope,代码行数:31,代码来源:folder.php

示例3: execute

 /**
  * Save issue settings.
  */
 function execute($issueId = 0)
 {
     $journal =& Request::getJournal();
     $issueDao =& DAORegistry::getDAO('IssueDAO');
     if ($issueId) {
         $issue = $issueDao->getIssueById($issueId);
         $isNewIssue = false;
     } else {
         $issue = new Issue();
         $isNewIssue = true;
     }
     $volume = $this->getData('volume');
     $number = $this->getData('number');
     $year = $this->getData('year');
     $showVolume = $this->getData('showVolume');
     $showNumber = $this->getData('showNumber');
     $showYear = $this->getData('showYear');
     $showTitle = $this->getData('showTitle');
     $issue->setJournalId($journal->getId());
     $issue->setTitle($this->getData('title'), null);
     // Localized
     $issue->setVolume(empty($volume) ? 0 : $volume);
     $issue->setNumber(empty($number) ? 0 : $number);
     $issue->setYear(empty($year) ? 0 : $year);
     if (!$isNewIssue) {
         $issue->setDatePublished($this->getData('datePublished'));
     }
     $issue->setDescription($this->getData('description'), null);
     // Localized
     $issue->setPublicIssueId($this->getData('publicIssueId'));
     $issue->setShowVolume(empty($showVolume) ? 0 : $showVolume);
     $issue->setShowNumber(empty($showNumber) ? 0 : $showNumber);
     $issue->setShowYear(empty($showYear) ? 0 : $showYear);
     $issue->setShowTitle(empty($showTitle) ? 0 : $showTitle);
     $issue->setCoverPageDescription($this->getData('coverPageDescription'), null);
     // Localized
     $issue->setCoverPageAltText($this->getData('coverPageAltText'), null);
     // Localized
     $showCoverPage = array_map(create_function('$arrayElement', 'return (int)$arrayElement;'), (array) $this->getData('showCoverPage'));
     foreach (array_keys($this->getData('coverPageDescription')) as $locale) {
         if (!array_key_exists($locale, $showCoverPage)) {
             $showCoverPage[$locale] = 0;
         }
     }
     $issue->setShowCoverPage($showCoverPage, null);
     // Localized
     $hideCoverPageArchives = array_map(create_function('$arrayElement', 'return (int)$arrayElement;'), (array) $this->getData('hideCoverPageArchives'));
     foreach (array_keys($this->getData('coverPageDescription')) as $locale) {
         if (!array_key_exists($locale, $hideCoverPageArchives)) {
             $hideCoverPageArchives[$locale] = 0;
         }
     }
     $issue->setHideCoverPageArchives($hideCoverPageArchives, null);
     // Localized
     $hideCoverPageCover = array_map(create_function('$arrayElement', 'return (int)$arrayElement;'), (array) $this->getData('hideCoverPageCover'));
     foreach (array_keys($this->getData('coverPageDescription')) as $locale) {
         if (!array_key_exists($locale, $hideCoverPageCover)) {
             $hideCoverPageCover[$locale] = 0;
         }
     }
     $issue->setHideCoverPageCover($hideCoverPageCover, null);
     // Localized
     $issue->setAccessStatus($this->getData('accessStatus'));
     if ($this->getData('enableOpenAccessDate')) {
         $issue->setOpenAccessDate($this->getData('openAccessDate'));
     } else {
         $issue->setOpenAccessDate(null);
     }
     // if issueId is supplied, then update issue otherwise insert a new one
     if ($issueId) {
         $issue->setIssueId($issueId);
         $issueDao->updateIssue($issue);
     } else {
         $issue->setPublished(0);
         $issue->setCurrent(0);
         $issueId = $issueDao->insertIssue($issue);
         $issue->setIssueId($issueId);
     }
     import('classes.file.PublicFileManager');
     $publicFileManager = new PublicFileManager();
     if ($publicFileManager->uploadedFileExists('coverPage')) {
         $journal = Request::getJournal();
         $originalFileName = $publicFileManager->getUploadedFileName('coverPage');
         $newFileName = 'cover_issue_' . $issueId . '_' . $this->getFormLocale() . '.' . $publicFileManager->getExtension($originalFileName);
         $publicFileManager->uploadJournalFile($journal->getId(), 'coverPage', $newFileName);
         $issue->setOriginalFileName($publicFileManager->truncateFileName($originalFileName, 127), $this->getFormLocale());
         $issue->setFileName($newFileName, $this->getFormLocale());
         // Store the image dimensions.
         list($width, $height) = getimagesize($publicFileManager->getJournalFilesPath($journal->getId()) . '/' . $newFileName);
         $issue->setWidth($width, $this->getFormLocale());
         $issue->setHeight($height, $this->getFormLocale());
         $issueDao->updateIssue($issue);
     }
     if ($publicFileManager->uploadedFileExists('styleFile')) {
         $journal = Request::getJournal();
         $originalFileName = $publicFileManager->getUploadedFileName('styleFile');
         $newFileName = 'style_' . $issueId . '.css';
//.........这里部分代码省略.........
开发者ID:JovanyJeff,项目名称:hrp,代码行数:101,代码来源:IssueForm.inc.php

示例4: execute

 /**
  * Save issue settings.
  */
 function execute($issueId = 0)
 {
     $journal =& Request::getJournal();
     $issueDao =& DAORegistry::getDAO('IssueDAO');
     if ($issueId) {
         $issue = $issueDao->getIssueById($issueId);
         $isNewIssue = false;
     } else {
         $issue = new Issue();
         $isNewIssue = true;
     }
     $volume = $this->getData('volume');
     $number = $this->getData('number');
     $year = $this->getData('year');
     $showVolume = $this->getData('showVolume');
     $showNumber = $this->getData('showNumber');
     $showYear = $this->getData('showYear');
     $showTitle = $this->getData('showTitle');
     $issue->setJournalId($journal->getId());
     $issue->setTitle($this->getData('title'), null);
     // Localized
     $issue->setVolume(empty($volume) ? 0 : $volume);
     $issue->setNumber(empty($number) ? 0 : $number);
     $issue->setYear(empty($year) ? 0 : $year);
     if (!$isNewIssue) {
         $issue->setDatePublished($this->getData('datePublished'));
         // If the Editor has asked to reset article publication dates for content
         // in this issue, set them all to the specified issue publication date.
         if ($this->getData('resetArticlePublicationDates')) {
             $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
             $publishedArticles =& $publishedArticleDao->getPublishedArticles($issue->getId());
             foreach ($publishedArticles as $publishedArticle) {
                 $publishedArticle->setDatePublished($this->getData('datePublished'));
                 $publishedArticleDao->updatePublishedArticle($publishedArticle);
             }
         }
     }
     $issue->setDescription($this->getData('description'), null);
     // Localized
     $issue->setStoredPubId('publisher-id', $this->getData('publicIssueId'));
     $issue->setShowVolume(empty($showVolume) ? 0 : $showVolume);
     $issue->setShowNumber(empty($showNumber) ? 0 : $showNumber);
     $issue->setShowYear(empty($showYear) ? 0 : $showYear);
     $issue->setShowTitle(empty($showTitle) ? 0 : $showTitle);
     $issue->setCoverPageDescription($this->getData('coverPageDescription'), null);
     // Localized
     $issue->setCoverPageAltText($this->getData('coverPageAltText'), null);
     // Localized
     $showCoverPage = array_map(create_function('$arrayElement', 'return (int)$arrayElement;'), (array) $this->getData('showCoverPage'));
     foreach (array_keys($this->getData('coverPageDescription')) as $locale) {
         if (!array_key_exists($locale, $showCoverPage)) {
             $showCoverPage[$locale] = 0;
         }
     }
     $issue->setShowCoverPage($showCoverPage, null);
     // Localized
     $hideCoverPageArchives = array_map(create_function('$arrayElement', 'return (int)$arrayElement;'), (array) $this->getData('hideCoverPageArchives'));
     foreach (array_keys($this->getData('coverPageDescription')) as $locale) {
         if (!array_key_exists($locale, $hideCoverPageArchives)) {
             $hideCoverPageArchives[$locale] = 0;
         }
     }
     $issue->setHideCoverPageArchives($hideCoverPageArchives, null);
     // Localized
     $hideCoverPageCover = array_map(create_function('$arrayElement', 'return (int)$arrayElement;'), (array) $this->getData('hideCoverPageCover'));
     foreach (array_keys($this->getData('coverPageDescription')) as $locale) {
         if (!array_key_exists($locale, $hideCoverPageCover)) {
             $hideCoverPageCover[$locale] = 0;
         }
     }
     $issue->setHideCoverPageCover($hideCoverPageCover, null);
     // Localized
     $issue->setAccessStatus($this->getData('accessStatus') ? $this->getData('accessStatus') : ISSUE_ACCESS_OPEN);
     // See bug #6324
     if ($this->getData('enableOpenAccessDate')) {
         $issue->setOpenAccessDate($this->getData('openAccessDate'));
     } else {
         $issue->setOpenAccessDate(null);
     }
     // consider the additional field names from the public identifer plugins
     import('classes.plugins.PubIdPluginHelper');
     $pubIdPluginHelper = new PubIdPluginHelper();
     $pubIdPluginHelper->execute($this, $issue);
     // if issueId is supplied, then update issue otherwise insert a new one
     if ($issueId) {
         $issue->setId($issueId);
         $this->issue =& $issue;
         parent::execute();
         $issueDao->updateIssue($issue);
     } else {
         $issue->setPublished(0);
         $issue->setCurrent(0);
         $issueId = $issueDao->insertIssue($issue);
         $issue->setId($issueId);
     }
     import('classes.file.PublicFileManager');
     $publicFileManager = new PublicFileManager();
//.........这里部分代码省略.........
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:101,代码来源:IssueForm.inc.php


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