本文整理汇总了PHP中Issue::setStyleFileName方法的典型用法代码示例。如果您正苦于以下问题:PHP Issue::setStyleFileName方法的具体用法?PHP Issue::setStyleFileName怎么用?PHP Issue::setStyleFileName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Issue
的用法示例。
在下文中一共展示了Issue::setStyleFileName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Issue
/**
* creates and returns an issue object from a row
* @param $row array
* @return Issue object
*/
function &_returnIssueFromRow($row)
{
$issue = new Issue();
$issue->setId($row['issue_id']);
$issue->setJournalId($row['journal_id']);
$issue->setVolume($row['volume']);
$issue->setNumber($row['number']);
$issue->setYear($row['year']);
$issue->setPublished($row['published']);
$issue->setCurrent($row['current']);
$issue->setDatePublished($this->datetimeFromDB($row['date_published']));
$issue->setDateNotified($this->datetimeFromDB($row['date_notified']));
$issue->setAccessStatus($row['access_status']);
$issue->setOpenAccessDate($this->datetimeFromDB($row['open_access_date']));
$issue->setPublicIssueId($row['public_issue_id']);
$issue->setShowVolume($row['show_volume']);
$issue->setShowNumber($row['show_number']);
$issue->setShowYear($row['show_year']);
$issue->setShowTitle($row['show_title']);
$issue->setStyleFileName($row['style_file_name']);
$issue->setOriginalStyleFileName($row['original_style_file_name']);
$this->getDataObjectSettings('issue_settings', 'issue_id', $row['issue_id'], $issue);
HookRegistry::call('IssueDAO::_returnIssueFromRow', array(&$issue, &$row));
return $issue;
}
示例2: parseIssueStyle
/**
* Parse out the issue style sheet and store it in an issue.
* @param DOMElement $node
* @param Issue $issue
*/
function parseIssueStyle($node, $issue)
{
for ($n = $node->firstChild; $n !== null; $n = $n->nextSibling) {
if (is_a($n, 'DOMElement')) {
switch ($n->tagName) {
case 'style_file_name':
$issue->setStyleFileName($n->textContent);
break;
case 'original_style_file_name':
$issue->setOriginalStyleFileName($n->textContent);
break;
case 'embed':
import('classes.file.PublicFileManager');
$publicFileManager = new PublicFileManager();
$filePath = $publicFileManager->getContextFilesPath(ASSOC_TYPE_JOURNAL, $issue->getJournalId()) . '/' . $issue->getStyleFileName();
file_put_contents($filePath, base64_decode($n->textContent));
break;
}
}
}
}
示例3: importIssues
function importIssues()
{
assert($this->xml->name == 'issues');
$issueDAO =& DAORegistry::getDAO('IssueDAO');
$issueFileDAO =& DAORegistry::getDAO('IssueFileDAO');
$issueGalleyDAO =& DAORegistry::getDAO('IssueGalleyDAO');
$sectionDAO =& DAORegistry::getDAO('SectionDAO');
$issues = $issueDAO->getIssues($this->journal->getId());
$publicFileManager =& new PublicFileManager();
$this->nextElement();
while ($this->xml->name == 'issue') {
$issueXML = $this->getCurrentElementAsDom();
$issue = new Issue();
$issue->setJournalId($this->journal->getId());
$issue->setVolume((int) $issueXML->volume);
$issue->setNumber((string) $issueXML->number);
$issue->setYear((int) $issueXML->year);
$issue->setPublished((int) $issueXML->published);
$issue->setCurrent((int) $issueXML->current);
$issue->setDatePublished((string) $issueXML->datePublished);
$issue->setDateNotified((string) $issueXML->dateNotified);
$issue->setLastModified((string) $issueXML->lastModified);
$issue->setAccessStatus((int) $issueXML->accessStatus);
$issue->setOpenAccessDate((string) $issueXML->openAccessDate);
$issue->setShowVolume((int) $issueXML->showVolume);
$issue->setShowNumber((int) $issueXML->showNumber);
$issue->setShowYear((int) $issueXML->showYear);
$issue->setShowTitle((int) $issueXML->showTitle);
$issue->setStyleFileName((string) $issueXML->styleFileName);
$issue->setOriginalStyleFileName((string) $issueXML->originalStyleFileName);
$oldIssueId = (int) $issueXML->oldId;
$issueDAO->insertIssue($issue);
//$issueDAO->insertCustomIssueOrder($this->journal->getId(), $issue->getId(), (int)$issueXML->customOrder);
$this->idTranslationTable->register(INTERNAL_TRANSFER_OBJECT_ISSUE, $oldIssueId, $issue->getId());
$this->restoreDataObjectSettings($issueDAO, $issueXML->settings, 'issue_settings', 'issue_id', $issue->getId());
$issue =& $issueDAO->getIssueById($issue->getId());
// Reload issue to get restored settings
$covers = $issue->getFileName(null);
if ($covers) {
foreach ($covers as $locale => $oldCoverFileName) {
$sourceFile = $this->publicFolderPath . '/' . $oldCoverFileName;
$extension = $publicFileManager->getExtension($oldCoverFileName);
$destFile = 'cover_issue_' . $issue->getId() . "_{$locale}.{$extension}";
$publicFileManager->copyJournalFile($this->journal->getId(), $sourceFile, $destFile);
unlink($sourceFile);
$issue->setFileName($destFile, $locale);
$issueDAO->updateIssue($issue);
}
}
if ($issue->getStyleFileName()) {
$oldStyleFileName = $issue->getStyleFileName();
$sourceFile = $this->publicFolderPath . '/' . $oldStyleFileName;
$destFile = 'style_' . $issue->getId() . '.css';
$publicFileManager->copyJournalFile($this->journal->getId(), $sourceFile, $destFile);
unlink($sourceFile);
$issue->setStyleFileName($destFile);
$issueDAO->updateIssue($issue);
}
$issueFileManager = new IssueFileManager($issue->getId());
foreach ($issueXML->issueFile as $issueFileXML) {
$issueFile = new IssueFile();
$issueFile->setIssueId($issue->getId());
$issueFile->setFileName((string) $issueFileXML->fileName);
$issueFile->setFileType((string) $issueFileXML->fileType);
$issueFile->setFileSize((int) $issueFileXML->fileSize);
$issueFile->setContentType((string) $issueFileXML->contentType);
$issueFile->setOriginalFileName((string) $issueFileXML->originalFileName);
$issueFile->setDateUploaded((string) $issueFileXML->dateUploaded);
$issueFile->setDateModified((string) $issueFileXML->dateModified);
$issueFileDAO->insertIssueFile($issueFile);
$oldFileName = $issueFile->getFileName();
$extension = $issueFileManager->parseFileExtension($oldFileName);
$contentPath = $issueFileManager->contentTypeToPath($issueFile->getContentType());
$contentAbbrev = $issueFileManager->contentTypeToAbbrev($issueFile->getContentType());
$fileInTransferPackage = $this->journalFolderPath . "/issues/{$oldIssueId}/{$contentPath}/{$oldFileName}";
$newFileName = $issue->getId() . '-' . $issueFile->getId() . '-' . $contentAbbrev . '.' . $extension;
$newFilePath = "{$contentPath}/{$newFileName}";
$issueFileManager->copyFile($fileInTransferPackage, $issueFileManager->getFilesDir() . $newFilePath);
unlink($fileInTransferPackage);
$issueFile->setFileName($newFileName);
$issueFileDAO->updateIssueFile($issueFile);
$this->idTranslationTable->register(INTERNAL_TRANSFER_OBJECT_ISSUE_FILE, (int) $issueFileXML->oldId, $issueFile->getId());
}
foreach ($issueXML->issueGalley as $issueGalleyXML) {
$issueGalley = new issueGalley();
$issueGalley->setIssueId($issue->getId());
$issueGalley->setLocale((string) $issueGalleyXML->locale);
$issueGalley->setFileId($this->idTranslationTable->resolve(INTERNAL_TRANSFER_OBJECT_ISSUE_FILE, (int) $issueGalleyXML->fileId));
$issueGalley->setLabel((string) $issueGalleyXML->label);
$issueGalley->setSequence((int) $issueGalleyXML->sequence);
$issueGalleyDAO->insertGalley($issueGalley);
$this->idTranslationTable->register(INTERNAL_TRANSFER_OBJECT_ISSUE_GALLEY, (int) $issueGalleyXML->oldId, $issueGalley->getId());
$this->restoreDataObjectSettings($issueGalleyDAO, $issueGalleyXML->settings, 'issue_galley_settings', 'galley_id', $issueGalley->getId());
}
if (isset($issueXML->customSectionOrder)) {
foreach ($issueXML->customSectionOrder->sectionOrder as $sectionOrderXML) {
try {
$sectionId = $this->idTranslationTable->resolve(INTERNAL_TRANSFER_OBJECT_SECTION, (int) $sectionOrderXML['sectionId']);
$seq = (int) $sectionOrderXML['seq'];
$sectionDAO->insertCustomSectionOrder($issue->getId(), $sectionId, $seq);
//.........这里部分代码省略.........