Open Journal Systems  3.3.0
IssueGalley.inc.php
1 <?php
22 import('classes.issue.IssueFile');
23 
24 class IssueGalley extends IssueFile {
26  var $_issueFile;
27 
28 
33  function isPdfGalley() {
34  switch ($this->getFileType()) {
35  case 'application/pdf':
36  case 'application/x-pdf':
37  case 'text/pdf':
38  case 'text/x-pdf':
39  return true;
40  default: return false;
41  }
42  }
43 
44  //
45  // Get/set methods
46  //
47 
52  function getViews() {
54  return $application->getPrimaryMetricByAssoc(ASSOC_TYPE_ISSUE_GALLEY, $this->getId());
55  }
56 
61  function getGalleyLabel() {
62  $label = $this->getLabel();
63  if ($this->getLocale() != AppLocale::getLocale()) {
65  $label .= ' (' . $locales[$this->getLocale()] . ')';
66  }
67  return $label;
68  }
69 
74  function getLabel() {
75  return $this->getData('label');
76  }
77 
82  function setLabel($label) {
83  return $this->setData('label', $label);
84  }
85 
90  function getLocale() {
91  return $this->getData('locale');
92  }
93 
98  function setLocale($locale) {
99  return $this->setData('locale', $locale);
100  }
101 
106  function getSequence() {
107  return $this->getData('sequence');
108  }
109 
114  function setSequence($sequence) {
115  return $this->setData('sequence', $sequence);
116  }
117 
122  function getFileId() {
123  return $this->getData('fileId');
124  }
125 
130  function setFileId($fileId) {
131  return $this->setData('fileId', $fileId);
132  }
133 
141  function getStoredPubId($pubIdType) {
142  return $this->getData('pub-id::'.$pubIdType);
143  }
144 
152  function setStoredPubId($pubIdType, $pubId) {
153  return $this->setData('pub-id::'.$pubIdType, $pubId);
154  }
155 
161  function getBestGalleyId() {
162  return $this->getData('urlPath')
163  ? $this->getData('urlPath')
164  : $this->getId();
165  }
166 
171  function getFile() {
172  if (!isset($this->_issueFile)) {
173  $issueFileDao = DAORegistry::getDAO('IssueFileDAO'); /* @var $issueFileDao IssueFileDAO */
174  $this->_issueFile = $issueFileDao->getById($this->getFileId());
175  }
176  return $this->_issueFile;
177  }
178 
179 }
180 
181 
IssueGalley\getBestGalleyId
getBestGalleyId()
Definition: IssueGalley.inc.php:164
PKPFile\getFileType
getFileType()
Definition: PKPFile.inc.php:57
DataObject\getData
& getData($key, $locale=null)
Definition: DataObject.inc.php:100
PKPLocale\getAllLocales
static & getAllLocales()
Definition: PKPLocale.inc.php:537
$application
$application
Definition: index.php:65
IssueGalley\setFileId
setFileId($fileId)
Definition: IssueGalley.inc.php:133
IssueGalley\getLabel
getLabel()
Definition: IssueGalley.inc.php:77
DAORegistry\getDAO
static & getDAO($name, $dbconn=null)
Definition: DAORegistry.inc.php:57
IssueGalley\isPdfGalley
isPdfGalley()
Definition: IssueGalley.inc.php:36
IssueGalley\setLocale
setLocale($locale)
Definition: IssueGalley.inc.php:101
IssueGalley\getLocale
getLocale()
Definition: IssueGalley.inc.php:93
IssueGalley\setSequence
setSequence($sequence)
Definition: IssueGalley.inc.php:117
IssueGalley\getFileId
getFileId()
Definition: IssueGalley.inc.php:125
IssueGalley\$_issueFile
$_issueFile
Definition: IssueGalley.inc.php:29
IssueGalley\getGalleyLabel
getGalleyLabel()
Definition: IssueGalley.inc.php:64
IssueGalley\getStoredPubId
getStoredPubId($pubIdType)
Definition: IssueGalley.inc.php:144
PKPApplication\getApplication
static getApplication()
Definition: PKPApplication.inc.php:227
IssueGalley
A galley is a final presentation version of the full-text of an issue.
Definition: IssueGalley.inc.php:24
IssueGalley\getViews
getViews()
Definition: IssueGalley.inc.php:55
IssueGalley\getFile
getFile()
Definition: IssueGalley.inc.php:174
DataObject\getId
getId()
Definition: DataObject.inc.php:206
IssueFile
Issue file class.
Definition: IssueFile.inc.php:22
IssueGalley\setLabel
setLabel($label)
Definition: IssueGalley.inc.php:85
IssueGalley\getSequence
getSequence()
Definition: IssueGalley.inc.php:109
AppLocale\getLocale
static getLocale()
Definition: env1/MockAppLocale.inc.php:40
IssueGalley\setStoredPubId
setStoredPubId($pubIdType, $pubId)
Definition: IssueGalley.inc.php:155
DataObject\setData
setData($key, $value, $locale=null)
Definition: DataObject.inc.php:132