forked from NetCommons3/NetCommons
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssetComponent.php
More file actions
49 lines (45 loc) · 1.14 KB
/
AssetComponent.php
File metadata and controls
49 lines (45 loc) · 1.14 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
<?php
/**
* AssetComponent Component
*
* @author Takako Miyagawa <nekoget@gmail.com>
* @link http://www.netcommons.org NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
*/
/**
* Summary for AssetComponent Component
*/
class AssetComponent extends Component {
/**
* cssの存在チェック
*
* @param Controller $controller controller object
* @return bool
*/
public function isThemeBootstrapMinCss(Controller $controller) {
$filePath = App::themePath($controller->theme) . 'webroot/css/bootstrap.min.css';
if (is_file(realpath($filePath))) {
return true;
}
return false;
}
/**
* サイトテーマの取得
*
* @param Controller $controller controller object
* @return mix null or array
*/
public function getSiteTheme(Controller $controller) {
$theme = null;
if (empty($controller->request->params['requested'])) {
if (Current::read('Page.theme')) {
$theme = Current::read('Page.theme');
} elseif (Current::read('Room.theme')) {
$theme = Current::read('Room.theme');
} else {
$theme = $controller->SiteSetting->getSiteTheme();
}
}
return $theme;
}
}