本文整理汇总了PHP中Issue::setCoverPageDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP Issue::setCoverPageDescription方法的具体用法?PHP Issue::setCoverPageDescription怎么用?PHP Issue::setCoverPageDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Issue
的用法示例。
在下文中一共展示了Issue::setCoverPageDescription方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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';
//.........这里部分代码省略.........
示例2: parseIssueCover
/**
* Parse out the issue cover and store it in an issue.
* @param DOMElement $node
* @param Issue $issue
*/
function parseIssueCover($node, $issue)
{
for ($n = $node->firstChild; $n !== null; $n = $n->nextSibling) {
if (is_a($n, 'DOMElement')) {
list($locale, $value) = $this->parseLocalizedContent($n);
switch ($n->tagName) {
case 'file_name':
$issue->setFileName($value, $locale);
break;
case 'original_file_name':
$issue->setOriginalFileName($value, $locale);
break;
case 'hide_cover_page_archives':
$issue->setHideCoverPageArchives($value, $locale);
break;
case 'hide_cover_page_cover':
$issue->setHideCoverPageCover($value, $locale);
break;
case 'show_cover_page':
$issue->setShowCoverPage($value, $locale);
break;
case 'cover_page_description':
$issue->setCoverPageDescription($value, $locale);
break;
case 'cover_page_alt_text':
$issue->setCoverPageAltText($value, $locale);
break;
case 'embed':
import('classes.file.PublicFileManager');
$publicFileManager = new PublicFileManager();
$filePath = $publicFileManager->getContextFilesPath(ASSOC_TYPE_JOURNAL, $issue->getJournalId()) . '/' . $issue->getLocalizedFileName();
file_put_contents($filePath, base64_decode($n->textContent));
break;
}
}
}
}
示例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'));
// 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();
//.........这里部分代码省略.........