forked from NetCommons3/NetCommons
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSiteSetting.php
More file actions
50 lines (45 loc) · 1.21 KB
/
SiteSetting.php
File metadata and controls
50 lines (45 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* SiteSetting Model
*
* @property CreatedUser $CreatedUser
* @property ModifiedUser $ModifiedUser
*
* @author Jun Nishikawa <topaz2@m0n0m0n0.com>
* @link http://www.netcommons.org NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
*/
App::uses('AppModel', 'Model');
App::uses('Current', 'NetCommons.Utility');
/**
* Summary for SiteSetting Model
*/
class SiteSetting extends AppModel {
/**
* サイトに設定されているテーマを返す
*
* @author Takako Miyagawa <nekoget@gmail.com>
* @return string or null
*/
public function getSiteTheme() {
$row = $this->find('first', array(
'conditions' => array('SiteSetting.key' => 'theme'),
));
if ($row && isset($row['SiteSetting'])
&& isset($row['SiteSetting']['value'])) {
return $row['SiteSetting']['value'];
}
return null;
}
/**
* サイトのデフォルトタイムゾーン(未ログインのゲスト用)を返す
*
* @return string timezone
*/
public function getSiteTimezone() {
$languageId = Current::read('Language.id');
$setting = $this->findByLanguageIdAndKey($languageId, 'site_timezone');
$timezone = $setting['SiteSetting']['value'];
return $timezone;
}
}