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
51 lines (46 loc) · 1.23 KB
/
SiteSetting.php
File metadata and controls
51 lines (46 loc) · 1.23 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
50
<?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');
/**
* Summary for SiteSetting Model
*/
class SiteSetting extends AppModel {
/**
* construct
*
* @param int|string|array $id Set this ID for this model on startup, can also be an array of options, see above.
* @param string $table Name of database table to use.
* @param string $ds DataSource connection name.
* @return void
* @since v 3.0.0.0
* @SuppressWarnings(PHPMD)
*/
public function __construct($id = false, $table = null, $ds = null) {
parent::__construct($id, $table, $ds);
}
/**
* サイトに設定されているテーマを返す
*
* @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;
}
}