Open Journal Systems  3.3.0
Site.inc.php
1 <?php
2 
23 class Site extends DataObject {
24 
31  $supportedLocales =& Registry::get('siteSupportedLocales', true, null);
32 
33  if ($supportedLocales === null) {
34  $supportedLocales = array();
35  $localeNames =& AppLocale::getAllLocales();
36 
37  $locales = $this->getSupportedLocales();
38  foreach ($locales as $localeKey) {
39  $supportedLocales[$localeKey] = $localeNames[$localeKey];
40  }
41 
42  asort($supportedLocales);
43  }
44 
45  return $supportedLocales;
46  }
47 
48  //
49  // Get/set methods
50  //
51 
56  function getTitle($locale = null) {
57  return $this->getData('title', $locale);
58  }
59 
63  function getLocalizedTitle() {
64  return $this->getLocalizedData('title');
65  }
66 
72  if ($this->getLocalizedData('pageHeaderTitleImage')) {
73  return $this->getLocalizedData('pageHeaderTitleImage');
74  }
75  if ($this->getData('pageHeaderTitleImage', AppLocale::getPrimaryLocale())) {
76  return $this->getData('pageHeaderTitleImage', AppLocale::getPrimaryLocale());
77  }
78  if ($this->getLocalizedData('title')) {
79  return $this->getLocalizedData('title');
80  }
81  if ($this->getData('title', AppLocale::getPrimaryLocale())) {
82  return $this->getData('title', AppLocale::getPrimaryLocale());
83  }
84  return '';
85  }
86 
91  function getRedirect() {
92  return $this->getData('redirect');
93  }
94 
99  function setRedirect($redirect) {
100  $this->setData('redirect', (int)$redirect);
101  }
102 
106  function getLocalizedAbout() {
107  return $this->getLocalizedData('about');
108  }
109 
114  return $this->getLocalizedData('contactName');
115  }
116 
121  return $this->getLocalizedData('contactEmail');
122  }
123 
128  function getMinPasswordLength() {
129  return $this->getData('minPasswordLength');
130  }
131 
136  function setMinPasswordLength($minPasswordLength) {
137  $this->setData('minPasswordLength', $minPasswordLength);
138  }
139 
144  function getPrimaryLocale() {
145  return $this->getData('primaryLocale');
146  }
147 
152  function setPrimaryLocale($primaryLocale) {
153  $this->setData('primaryLocale', $primaryLocale);
154  }
155 
160  function getInstalledLocales() {
161  $locales = $this->getData('installedLocales');
162  return isset($locales) ? $locales : array();
163  }
164 
169  function setInstalledLocales($installedLocales) {
170  $this->setData('installedLocales', $installedLocales);
171  }
172 
177  function getSupportedLocales() {
178  $locales = $this->getData('supportedLocales');
179  return isset($locales) ? $locales : array();
180  }
181 
186  function setSupportedLocales($supportedLocales) {
187  $this->setData('supportedLocales', $supportedLocales);
188  }
189 }
190 
191 
DataObject\getData
& getData($key, $locale=null)
Definition: DataObject.inc.php:100
PKPLocale\getAllLocales
static & getAllLocales()
Definition: PKPLocale.inc.php:537
DataObject\getLocalizedData
getLocalizedData($key, $preferredLocale=null)
Definition: DataObject.inc.php:71
DataObject
Any class with an associated DAO should extend this class.
Definition: DataObject.inc.php:18
Site\getInstalledLocales
getInstalledLocales()
Definition: Site.inc.php:160
Site\setSupportedLocales
setSupportedLocales($supportedLocales)
Definition: Site.inc.php:186
Site\getLocalizedContactEmail
getLocalizedContactEmail()
Definition: Site.inc.php:120
Site\setInstalledLocales
setInstalledLocales($installedLocales)
Definition: Site.inc.php:169
AppLocale\getPrimaryLocale
static getPrimaryLocale()
Definition: env1/MockAppLocale.inc.php:95
Site\getRedirect
getRedirect()
Definition: Site.inc.php:91
Site\getLocalizedAbout
getLocalizedAbout()
Definition: Site.inc.php:106
Site\setPrimaryLocale
setPrimaryLocale($primaryLocale)
Definition: Site.inc.php:152
Site\getLocalizedTitle
getLocalizedTitle()
Definition: Site.inc.php:63
Registry\get
static & get($key, $createIfEmpty=false, $createWithDefault=null)
Definition: Registry.inc.php:35
Site
Describes system-wide site properties.
Definition: Site.inc.php:23
Site\getLocalizedContactName
getLocalizedContactName()
Definition: Site.inc.php:113
Site\getMinPasswordLength
getMinPasswordLength()
Definition: Site.inc.php:128
Site\getSupportedLocales
getSupportedLocales()
Definition: Site.inc.php:177
Site\getPrimaryLocale
getPrimaryLocale()
Definition: Site.inc.php:144
Site\getLocalizedPageHeaderTitle
getLocalizedPageHeaderTitle()
Definition: Site.inc.php:71
Site\setRedirect
setRedirect($redirect)
Definition: Site.inc.php:99
Site\getSupportedLocaleNames
& getSupportedLocaleNames()
Definition: Site.inc.php:30
Site\setMinPasswordLength
setMinPasswordLength($minPasswordLength)
Definition: Site.inc.php:136
DataObject\setData
setData($key, $value, $locale=null)
Definition: DataObject.inc.php:132
Site\getTitle
getTitle($locale=null)
Definition: Site.inc.php:56