@@ -2,85 +2,85 @@ |
||
2 | 2 | |
3 | 3 | class SocialSettings extends CiiSettingsModel |
4 | 4 | { |
5 | - protected $ha_twitter_enabled = false; |
|
6 | - protected $ha_twitter_key = NULL; |
|
7 | - protected $ha_twitter_secret = NULL; |
|
8 | - protected $ha_twitter_accessToken = NULL; |
|
9 | - protected $ha_twitter_accessTokenSecret = NULL; |
|
5 | + protected $ha_twitter_enabled = false; |
|
6 | + protected $ha_twitter_key = NULL; |
|
7 | + protected $ha_twitter_secret = NULL; |
|
8 | + protected $ha_twitter_accessToken = NULL; |
|
9 | + protected $ha_twitter_accessTokenSecret = NULL; |
|
10 | 10 | |
11 | - protected $ha_facebook_enabled = false; |
|
12 | - protected $ha_facebook_id = NULL; |
|
13 | - protected $ha_facebook_secret = NULL; |
|
14 | - protected $ha_facebook_scope = NULL; |
|
11 | + protected $ha_facebook_enabled = false; |
|
12 | + protected $ha_facebook_id = NULL; |
|
13 | + protected $ha_facebook_secret = NULL; |
|
14 | + protected $ha_facebook_scope = NULL; |
|
15 | 15 | |
16 | - protected $ha_google_enabled = false; |
|
17 | - protected $ha_google_id = NULL; |
|
18 | - protected $ha_google_secret = NULL; |
|
19 | - protected $ha_google_scope = NULL; |
|
20 | - protected $google_plus_public_server_key = NULL; |
|
16 | + protected $ha_google_enabled = false; |
|
17 | + protected $ha_google_id = NULL; |
|
18 | + protected $ha_google_secret = NULL; |
|
19 | + protected $ha_google_scope = NULL; |
|
20 | + protected $google_plus_public_server_key = NULL; |
|
21 | 21 | |
22 | - protected $ha_linkedin_enabled = false; |
|
23 | - protected $ha_linkedin_key = NULL; |
|
24 | - protected $ha_linkedin_secret = NULL; |
|
22 | + protected $ha_linkedin_enabled = false; |
|
23 | + protected $ha_linkedin_key = NULL; |
|
24 | + protected $ha_linkedin_secret = NULL; |
|
25 | 25 | |
26 | - protected $addThisPublisherID = null; |
|
26 | + protected $addThisPublisherID = null; |
|
27 | 27 | |
28 | - public function groups() |
|
29 | - { |
|
30 | - return array( |
|
31 | - Yii::t('ciims.models.social', 'Twitter') => array('ha_twitter_enabled', 'ha_twitter_key', 'ha_twitter_secret', 'ha_twitter_accessToken', 'ha_twitter_accessTokenSecret'), |
|
32 | - Yii::t('ciims.models.social', 'Facebook') => array('ha_facebook_enabled', 'ha_facebook_id', 'ha_facebook_secret', 'ha_facebook_scope'), |
|
33 | - Yii::t('ciims.models.social', 'Google+') => array('ha_google_enabled', 'ha_google_id', 'ha_google_secret', 'ha_google_scope', 'google_plus_public_server_key'), |
|
34 | - Yii::t('ciims.models.social', 'LinkedIn') => array('ha_linkedin_enabled', 'ha_linkedin_key', 'ha_linkedin_secret'), |
|
35 | - Yii::t('ciims.models.social', 'AddThis') => array('addThisPublisherID') |
|
36 | - ); |
|
37 | - } |
|
28 | + public function groups() |
|
29 | + { |
|
30 | + return array( |
|
31 | + Yii::t('ciims.models.social', 'Twitter') => array('ha_twitter_enabled', 'ha_twitter_key', 'ha_twitter_secret', 'ha_twitter_accessToken', 'ha_twitter_accessTokenSecret'), |
|
32 | + Yii::t('ciims.models.social', 'Facebook') => array('ha_facebook_enabled', 'ha_facebook_id', 'ha_facebook_secret', 'ha_facebook_scope'), |
|
33 | + Yii::t('ciims.models.social', 'Google+') => array('ha_google_enabled', 'ha_google_id', 'ha_google_secret', 'ha_google_scope', 'google_plus_public_server_key'), |
|
34 | + Yii::t('ciims.models.social', 'LinkedIn') => array('ha_linkedin_enabled', 'ha_linkedin_key', 'ha_linkedin_secret'), |
|
35 | + Yii::t('ciims.models.social', 'AddThis') => array('addThisPublisherID') |
|
36 | + ); |
|
37 | + } |
|
38 | 38 | |
39 | - public function rules() |
|
40 | - { |
|
41 | - return array( |
|
42 | - array('ha_twitter_key, ha_twitter_secret, ha_twitter_accessToken, ha_twitter_accessToken, ha_twitter_accessTokenSecret', 'length', 'max' => 255), |
|
43 | - array('ha_facebook_id, ha_facebook_secret', 'length', 'max' => 255), |
|
44 | - array('ha_google_id, ha_google_secret, google_plus_public_server_key', 'length', 'max' => 255), |
|
45 | - array('ha_linkedin_key, ha_linkedin_secret', 'length', 'max' => 255), |
|
46 | - array('ha_twitter_enabled, ha_facebook_enabled, ha_google_enabled, ha_linkedin_enabled', 'boolean'), |
|
47 | - array('addThisPublisherID', 'length', 'max' => 255) |
|
48 | - ); |
|
49 | - } |
|
39 | + public function rules() |
|
40 | + { |
|
41 | + return array( |
|
42 | + array('ha_twitter_key, ha_twitter_secret, ha_twitter_accessToken, ha_twitter_accessToken, ha_twitter_accessTokenSecret', 'length', 'max' => 255), |
|
43 | + array('ha_facebook_id, ha_facebook_secret', 'length', 'max' => 255), |
|
44 | + array('ha_google_id, ha_google_secret, google_plus_public_server_key', 'length', 'max' => 255), |
|
45 | + array('ha_linkedin_key, ha_linkedin_secret', 'length', 'max' => 255), |
|
46 | + array('ha_twitter_enabled, ha_facebook_enabled, ha_google_enabled, ha_linkedin_enabled', 'boolean'), |
|
47 | + array('addThisPublisherID', 'length', 'max' => 255) |
|
48 | + ); |
|
49 | + } |
|
50 | 50 | |
51 | - public function attributeLabels() |
|
52 | - { |
|
53 | - return array( |
|
54 | - 'ha_twitter_enabled' => Yii::t('ciims.models.social', 'Social Auth'), |
|
55 | - 'ha_twitter_key' => Yii::t('ciims.models.social', 'Consumer Key'), |
|
56 | - 'ha_twitter_secret' => Yii::t('ciims.models.social', 'Consumer Secret'), |
|
57 | - 'ha_twitter_accessToken' => Yii::t('ciims.models.social', 'Access Token'), |
|
58 | - 'ha_twitter_accessTokenSecret' => Yii::t('ciims.models.social', 'Access Token Secret'), |
|
51 | + public function attributeLabels() |
|
52 | + { |
|
53 | + return array( |
|
54 | + 'ha_twitter_enabled' => Yii::t('ciims.models.social', 'Social Auth'), |
|
55 | + 'ha_twitter_key' => Yii::t('ciims.models.social', 'Consumer Key'), |
|
56 | + 'ha_twitter_secret' => Yii::t('ciims.models.social', 'Consumer Secret'), |
|
57 | + 'ha_twitter_accessToken' => Yii::t('ciims.models.social', 'Access Token'), |
|
58 | + 'ha_twitter_accessTokenSecret' => Yii::t('ciims.models.social', 'Access Token Secret'), |
|
59 | 59 | |
60 | - 'ha_facebook_enabled' => Yii::t('ciims.models.social', 'Social Auth'), |
|
61 | - 'ha_facebook_id' => Yii::t('ciims.models.social', 'App ID'), |
|
62 | - 'ha_facebook_secret' => Yii::t('ciims.models.social', 'App Secret'), |
|
63 | - 'ha_facebook_scope' => Yii::t('ciims.models.social', 'Scope'), |
|
60 | + 'ha_facebook_enabled' => Yii::t('ciims.models.social', 'Social Auth'), |
|
61 | + 'ha_facebook_id' => Yii::t('ciims.models.social', 'App ID'), |
|
62 | + 'ha_facebook_secret' => Yii::t('ciims.models.social', 'App Secret'), |
|
63 | + 'ha_facebook_scope' => Yii::t('ciims.models.social', 'Scope'), |
|
64 | 64 | |
65 | - 'ha_google_enabled' => Yii::t('ciims.models.social', 'Social Auth'), |
|
66 | - 'ha_google_id' => Yii::t('ciims.models.social', 'Client ID'), |
|
67 | - 'ha_google_secret' => Yii::t('ciims.models.social', 'Client Secret'), |
|
68 | - 'ha_google_scope' => Yii::t('ciims.models.social', 'Scope'), |
|
69 | - 'google_plus_public_server_key' => Yii::t('ciims.models.social', 'Public Server API Key'), |
|
65 | + 'ha_google_enabled' => Yii::t('ciims.models.social', 'Social Auth'), |
|
66 | + 'ha_google_id' => Yii::t('ciims.models.social', 'Client ID'), |
|
67 | + 'ha_google_secret' => Yii::t('ciims.models.social', 'Client Secret'), |
|
68 | + 'ha_google_scope' => Yii::t('ciims.models.social', 'Scope'), |
|
69 | + 'google_plus_public_server_key' => Yii::t('ciims.models.social', 'Public Server API Key'), |
|
70 | 70 | |
71 | - 'ha_linkedin_enabled' => Yii::t('ciims.models.social', 'Social Auth'), |
|
72 | - 'ha_linkedin_key' => Yii::t('ciims.models.social', 'Consumer Key'), |
|
73 | - 'ha_linkedin_secret' => Yii::t('ciims.models.social', 'Consumer Secret'), |
|
71 | + 'ha_linkedin_enabled' => Yii::t('ciims.models.social', 'Social Auth'), |
|
72 | + 'ha_linkedin_key' => Yii::t('ciims.models.social', 'Consumer Key'), |
|
73 | + 'ha_linkedin_secret' => Yii::t('ciims.models.social', 'Consumer Secret'), |
|
74 | 74 | |
75 | - 'addThisPublisherID' => Yii::t('ciims.models.social', 'AddThis Publisher ID') |
|
76 | - ); |
|
77 | - } |
|
75 | + 'addThisPublisherID' => Yii::t('ciims.models.social', 'AddThis Publisher ID') |
|
76 | + ); |
|
77 | + } |
|
78 | 78 | |
79 | - public function afterSave() |
|
80 | - { |
|
81 | - Yii::app()->cache->set('hybridauth_providers', false); |
|
82 | - Cii::getHybridAuthProviders(); |
|
79 | + public function afterSave() |
|
80 | + { |
|
81 | + Yii::app()->cache->set('hybridauth_providers', false); |
|
82 | + Cii::getHybridAuthProviders(); |
|
83 | 83 | |
84 | - return parent::afterSave(); |
|
85 | - } |
|
84 | + return parent::afterSave(); |
|
85 | + } |
|
86 | 86 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | protected $ha_facebook_enabled = false; |
12 | 12 | protected $ha_facebook_id = NULL; |
13 | 13 | protected $ha_facebook_secret = NULL; |
14 | - protected $ha_facebook_scope = NULL; |
|
14 | + protected $ha_facebook_scope = NULL; |
|
15 | 15 | |
16 | 16 | protected $ha_google_enabled = false; |
17 | 17 | protected $ha_google_id = NULL; |
@@ -25,18 +25,18 @@ discard block |
||
25 | 25 | |
26 | 26 | protected $addThisPublisherID = null; |
27 | 27 | |
28 | - public function groups() |
|
28 | + public function groups () |
|
29 | 29 | { |
30 | 30 | return array( |
31 | - Yii::t('ciims.models.social', 'Twitter') => array('ha_twitter_enabled', 'ha_twitter_key', 'ha_twitter_secret', 'ha_twitter_accessToken', 'ha_twitter_accessTokenSecret'), |
|
32 | - Yii::t('ciims.models.social', 'Facebook') => array('ha_facebook_enabled', 'ha_facebook_id', 'ha_facebook_secret', 'ha_facebook_scope'), |
|
33 | - Yii::t('ciims.models.social', 'Google+') => array('ha_google_enabled', 'ha_google_id', 'ha_google_secret', 'ha_google_scope', 'google_plus_public_server_key'), |
|
34 | - Yii::t('ciims.models.social', 'LinkedIn') => array('ha_linkedin_enabled', 'ha_linkedin_key', 'ha_linkedin_secret'), |
|
35 | - Yii::t('ciims.models.social', 'AddThis') => array('addThisPublisherID') |
|
31 | + Yii::t ('ciims.models.social', 'Twitter') => array('ha_twitter_enabled', 'ha_twitter_key', 'ha_twitter_secret', 'ha_twitter_accessToken', 'ha_twitter_accessTokenSecret'), |
|
32 | + Yii::t ('ciims.models.social', 'Facebook') => array('ha_facebook_enabled', 'ha_facebook_id', 'ha_facebook_secret', 'ha_facebook_scope'), |
|
33 | + Yii::t ('ciims.models.social', 'Google+') => array('ha_google_enabled', 'ha_google_id', 'ha_google_secret', 'ha_google_scope', 'google_plus_public_server_key'), |
|
34 | + Yii::t ('ciims.models.social', 'LinkedIn') => array('ha_linkedin_enabled', 'ha_linkedin_key', 'ha_linkedin_secret'), |
|
35 | + Yii::t ('ciims.models.social', 'AddThis') => array('addThisPublisherID') |
|
36 | 36 | ); |
37 | 37 | } |
38 | 38 | |
39 | - public function rules() |
|
39 | + public function rules () |
|
40 | 40 | { |
41 | 41 | return array( |
42 | 42 | array('ha_twitter_key, ha_twitter_secret, ha_twitter_accessToken, ha_twitter_accessToken, ha_twitter_accessTokenSecret', 'length', 'max' => 255), |
@@ -48,39 +48,39 @@ discard block |
||
48 | 48 | ); |
49 | 49 | } |
50 | 50 | |
51 | - public function attributeLabels() |
|
51 | + public function attributeLabels () |
|
52 | 52 | { |
53 | 53 | return array( |
54 | - 'ha_twitter_enabled' => Yii::t('ciims.models.social', 'Social Auth'), |
|
55 | - 'ha_twitter_key' => Yii::t('ciims.models.social', 'Consumer Key'), |
|
56 | - 'ha_twitter_secret' => Yii::t('ciims.models.social', 'Consumer Secret'), |
|
57 | - 'ha_twitter_accessToken' => Yii::t('ciims.models.social', 'Access Token'), |
|
58 | - 'ha_twitter_accessTokenSecret' => Yii::t('ciims.models.social', 'Access Token Secret'), |
|
54 | + 'ha_twitter_enabled' => Yii::t ('ciims.models.social', 'Social Auth'), |
|
55 | + 'ha_twitter_key' => Yii::t ('ciims.models.social', 'Consumer Key'), |
|
56 | + 'ha_twitter_secret' => Yii::t ('ciims.models.social', 'Consumer Secret'), |
|
57 | + 'ha_twitter_accessToken' => Yii::t ('ciims.models.social', 'Access Token'), |
|
58 | + 'ha_twitter_accessTokenSecret' => Yii::t ('ciims.models.social', 'Access Token Secret'), |
|
59 | 59 | |
60 | - 'ha_facebook_enabled' => Yii::t('ciims.models.social', 'Social Auth'), |
|
61 | - 'ha_facebook_id' => Yii::t('ciims.models.social', 'App ID'), |
|
62 | - 'ha_facebook_secret' => Yii::t('ciims.models.social', 'App Secret'), |
|
63 | - 'ha_facebook_scope' => Yii::t('ciims.models.social', 'Scope'), |
|
60 | + 'ha_facebook_enabled' => Yii::t ('ciims.models.social', 'Social Auth'), |
|
61 | + 'ha_facebook_id' => Yii::t ('ciims.models.social', 'App ID'), |
|
62 | + 'ha_facebook_secret' => Yii::t ('ciims.models.social', 'App Secret'), |
|
63 | + 'ha_facebook_scope' => Yii::t ('ciims.models.social', 'Scope'), |
|
64 | 64 | |
65 | - 'ha_google_enabled' => Yii::t('ciims.models.social', 'Social Auth'), |
|
66 | - 'ha_google_id' => Yii::t('ciims.models.social', 'Client ID'), |
|
67 | - 'ha_google_secret' => Yii::t('ciims.models.social', 'Client Secret'), |
|
68 | - 'ha_google_scope' => Yii::t('ciims.models.social', 'Scope'), |
|
69 | - 'google_plus_public_server_key' => Yii::t('ciims.models.social', 'Public Server API Key'), |
|
65 | + 'ha_google_enabled' => Yii::t ('ciims.models.social', 'Social Auth'), |
|
66 | + 'ha_google_id' => Yii::t ('ciims.models.social', 'Client ID'), |
|
67 | + 'ha_google_secret' => Yii::t ('ciims.models.social', 'Client Secret'), |
|
68 | + 'ha_google_scope' => Yii::t ('ciims.models.social', 'Scope'), |
|
69 | + 'google_plus_public_server_key' => Yii::t ('ciims.models.social', 'Public Server API Key'), |
|
70 | 70 | |
71 | - 'ha_linkedin_enabled' => Yii::t('ciims.models.social', 'Social Auth'), |
|
72 | - 'ha_linkedin_key' => Yii::t('ciims.models.social', 'Consumer Key'), |
|
73 | - 'ha_linkedin_secret' => Yii::t('ciims.models.social', 'Consumer Secret'), |
|
71 | + 'ha_linkedin_enabled' => Yii::t ('ciims.models.social', 'Social Auth'), |
|
72 | + 'ha_linkedin_key' => Yii::t ('ciims.models.social', 'Consumer Key'), |
|
73 | + 'ha_linkedin_secret' => Yii::t ('ciims.models.social', 'Consumer Secret'), |
|
74 | 74 | |
75 | - 'addThisPublisherID' => Yii::t('ciims.models.social', 'AddThis Publisher ID') |
|
75 | + 'addThisPublisherID' => Yii::t ('ciims.models.social', 'AddThis Publisher ID') |
|
76 | 76 | ); |
77 | 77 | } |
78 | 78 | |
79 | - public function afterSave() |
|
79 | + public function afterSave () |
|
80 | 80 | { |
81 | - Yii::app()->cache->set('hybridauth_providers', false); |
|
82 | - Cii::getHybridAuthProviders(); |
|
81 | + Yii::app ()->cache->set ('hybridauth_providers', false); |
|
82 | + Cii::getHybridAuthProviders (); |
|
83 | 83 | |
84 | - return parent::afterSave(); |
|
84 | + return parent::afterSave (); |
|
85 | 85 | } |
86 | 86 | } |
@@ -2,92 +2,92 @@ |
||
2 | 2 | |
3 | 3 | class ThemeSettings extends CiiSettingsModel |
4 | 4 | { |
5 | - /** |
|
6 | - * The active theme |
|
7 | - * @var string |
|
8 | - */ |
|
9 | - public $theme = 'default'; |
|
5 | + /** |
|
6 | + * The active theme |
|
7 | + * @var string |
|
8 | + */ |
|
9 | + public $theme = 'default'; |
|
10 | 10 | |
11 | - /** |
|
12 | - * Validation rules for the theme |
|
13 | - * @return array |
|
14 | - */ |
|
15 | - public function rules() |
|
16 | - { |
|
17 | - return array( |
|
18 | - array('theme', 'required'), |
|
19 | - array('theme', 'length', 'max' => 255) |
|
20 | - ); |
|
21 | - } |
|
11 | + /** |
|
12 | + * Validation rules for the theme |
|
13 | + * @return array |
|
14 | + */ |
|
15 | + public function rules() |
|
16 | + { |
|
17 | + return array( |
|
18 | + array('theme', 'required'), |
|
19 | + array('theme', 'length', 'max' => 255) |
|
20 | + ); |
|
21 | + } |
|
22 | 22 | |
23 | - /** |
|
24 | - * Attribute labels for themes |
|
25 | - * @return array |
|
26 | - */ |
|
27 | - public function attributeLabels() |
|
28 | - { |
|
29 | - return array( |
|
30 | - 'theme' => Yii::t('ciims.models.theme', 'Theme'), |
|
31 | - ); |
|
32 | - } |
|
23 | + /** |
|
24 | + * Attribute labels for themes |
|
25 | + * @return array |
|
26 | + */ |
|
27 | + public function attributeLabels() |
|
28 | + { |
|
29 | + return array( |
|
30 | + 'theme' => Yii::t('ciims.models.theme', 'Theme'), |
|
31 | + ); |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * Returns the active theme name |
|
36 | - * @return string |
|
37 | - */ |
|
38 | - public function getTheme() |
|
39 | - { |
|
40 | - return $this->theme; |
|
41 | - } |
|
34 | + /** |
|
35 | + * Returns the active theme name |
|
36 | + * @return string |
|
37 | + */ |
|
38 | + public function getTheme() |
|
39 | + { |
|
40 | + return $this->theme; |
|
41 | + } |
|
42 | 42 | |
43 | - /** |
|
44 | - * Retrieves all of the themes from webroot.themes and returns them in an array group by type, each containing |
|
45 | - * the contents of theme.json. |
|
46 | - * |
|
47 | - * The themes are then cached for easy retrieval later. (I really hate unecessary DiskIO if something isn't changing...) |
|
48 | - * |
|
49 | - * @return array |
|
50 | - */ |
|
51 | - public function getThemes() |
|
52 | - { |
|
53 | - $themes = Yii::app()->cache->get('settings_themes'); |
|
43 | + /** |
|
44 | + * Retrieves all of the themes from webroot.themes and returns them in an array group by type, each containing |
|
45 | + * the contents of theme.json. |
|
46 | + * |
|
47 | + * The themes are then cached for easy retrieval later. (I really hate unecessary DiskIO if something isn't changing...) |
|
48 | + * |
|
49 | + * @return array |
|
50 | + */ |
|
51 | + public function getThemes() |
|
52 | + { |
|
53 | + $themes = Yii::app()->cache->get('settings_themes'); |
|
54 | 54 | |
55 | - if ($themes == false) |
|
56 | - { |
|
57 | - $themes = array(); |
|
58 | - $currentTheme = Cii::getConfig('theme'); |
|
59 | - $themePath = Yii::getPathOfAlias('base.themes') . DS; |
|
60 | - $directories = glob($themePath . "*", GLOB_ONLYDIR); |
|
55 | + if ($themes == false) |
|
56 | + { |
|
57 | + $themes = array(); |
|
58 | + $currentTheme = Cii::getConfig('theme'); |
|
59 | + $themePath = Yii::getPathOfAlias('base.themes') . DS; |
|
60 | + $directories = glob($themePath . "*", GLOB_ONLYDIR); |
|
61 | 61 | |
62 | - // Pushes the current theme onto the top of the list |
|
63 | - foreach ($directories as $k=>$dir) |
|
64 | - { |
|
65 | - if ($dir == Yii::getPathOfAlias('base.themes').DS.$currentTheme) |
|
66 | - { |
|
67 | - unset($directories[$k]); |
|
68 | - break; |
|
69 | - } |
|
70 | - } |
|
62 | + // Pushes the current theme onto the top of the list |
|
63 | + foreach ($directories as $k=>$dir) |
|
64 | + { |
|
65 | + if ($dir == Yii::getPathOfAlias('base.themes').DS.$currentTheme) |
|
66 | + { |
|
67 | + unset($directories[$k]); |
|
68 | + break; |
|
69 | + } |
|
70 | + } |
|
71 | 71 | |
72 | - array_unshift($directories, $themePath.$currentTheme); |
|
72 | + array_unshift($directories, $themePath.$currentTheme); |
|
73 | 73 | |
74 | - foreach($directories as $dir) |
|
75 | - { |
|
76 | - $json = CJSON::decode(file_get_contents($dir . DIRECTORY_SEPARATOR . 'composer.json')); |
|
77 | - $name = $json['name']; |
|
78 | - $key = str_replace('ciims-themes/', '', $name); |
|
74 | + foreach($directories as $dir) |
|
75 | + { |
|
76 | + $json = CJSON::decode(file_get_contents($dir . DIRECTORY_SEPARATOR . 'composer.json')); |
|
77 | + $name = $json['name']; |
|
78 | + $key = str_replace('ciims-themes/', '', $name); |
|
79 | 79 | |
80 | - $themes[$key] = array( |
|
81 | - 'path' => $dir, |
|
82 | - 'name' => $name, |
|
83 | - 'hidden' => isset($json['hidden']) ? $json['hidden'] : false |
|
84 | - ); |
|
85 | - } |
|
80 | + $themes[$key] = array( |
|
81 | + 'path' => $dir, |
|
82 | + 'name' => $name, |
|
83 | + 'hidden' => isset($json['hidden']) ? $json['hidden'] : false |
|
84 | + ); |
|
85 | + } |
|
86 | 86 | |
87 | - Yii::app()->cache->set('settings_themes', $themes); |
|
88 | - return $themes; |
|
89 | - } |
|
87 | + Yii::app()->cache->set('settings_themes', $themes); |
|
88 | + return $themes; |
|
89 | + } |
|
90 | 90 | |
91 | - return $themes; |
|
92 | - } |
|
91 | + return $themes; |
|
92 | + } |
|
93 | 93 | } |
94 | 94 | \ No newline at end of file |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * Validation rules for the theme |
13 | 13 | * @return array |
14 | 14 | */ |
15 | - public function rules() |
|
15 | + public function rules () |
|
16 | 16 | { |
17 | 17 | return array( |
18 | 18 | array('theme', 'required'), |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | * Attribute labels for themes |
25 | 25 | * @return array |
26 | 26 | */ |
27 | - public function attributeLabels() |
|
27 | + public function attributeLabels () |
|
28 | 28 | { |
29 | 29 | return array( |
30 | - 'theme' => Yii::t('ciims.models.theme', 'Theme'), |
|
30 | + 'theme' => Yii::t ('ciims.models.theme', 'Theme'), |
|
31 | 31 | ); |
32 | 32 | } |
33 | 33 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * Returns the active theme name |
36 | 36 | * @return string |
37 | 37 | */ |
38 | - public function getTheme() |
|
38 | + public function getTheme () |
|
39 | 39 | { |
40 | 40 | return $this->theme; |
41 | 41 | } |
@@ -48,34 +48,34 @@ discard block |
||
48 | 48 | * |
49 | 49 | * @return array |
50 | 50 | */ |
51 | - public function getThemes() |
|
51 | + public function getThemes () |
|
52 | 52 | { |
53 | - $themes = Yii::app()->cache->get('settings_themes'); |
|
53 | + $themes = Yii::app ()->cache->get ('settings_themes'); |
|
54 | 54 | |
55 | 55 | if ($themes == false) |
56 | 56 | { |
57 | 57 | $themes = array(); |
58 | - $currentTheme = Cii::getConfig('theme'); |
|
59 | - $themePath = Yii::getPathOfAlias('base.themes') . DS; |
|
60 | - $directories = glob($themePath . "*", GLOB_ONLYDIR); |
|
58 | + $currentTheme = Cii::getConfig ('theme'); |
|
59 | + $themePath = Yii::getPathOfAlias ('base.themes') . DS; |
|
60 | + $directories = glob ($themePath . "*", GLOB_ONLYDIR); |
|
61 | 61 | |
62 | 62 | // Pushes the current theme onto the top of the list |
63 | 63 | foreach ($directories as $k=>$dir) |
64 | 64 | { |
65 | - if ($dir == Yii::getPathOfAlias('base.themes').DS.$currentTheme) |
|
65 | + if ($dir == Yii::getPathOfAlias ('base.themes') . DS . $currentTheme) |
|
66 | 66 | { |
67 | 67 | unset($directories[$k]); |
68 | 68 | break; |
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | - array_unshift($directories, $themePath.$currentTheme); |
|
72 | + array_unshift ($directories, $themePath . $currentTheme); |
|
73 | 73 | |
74 | - foreach($directories as $dir) |
|
74 | + foreach ($directories as $dir) |
|
75 | 75 | { |
76 | - $json = CJSON::decode(file_get_contents($dir . DIRECTORY_SEPARATOR . 'composer.json')); |
|
76 | + $json = CJSON::decode (file_get_contents ($dir . DIRECTORY_SEPARATOR . 'composer.json')); |
|
77 | 77 | $name = $json['name']; |
78 | - $key = str_replace('ciims-themes/', '', $name); |
|
78 | + $key = str_replace ('ciims-themes/', '', $name); |
|
79 | 79 | |
80 | 80 | $themes[$key] = array( |
81 | 81 | 'path' => $dir, |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | ); |
85 | 85 | } |
86 | 86 | |
87 | - Yii::app()->cache->set('settings_themes', $themes); |
|
87 | + Yii::app ()->cache->set ('settings_themes', $themes); |
|
88 | 88 | return $themes; |
89 | 89 | } |
90 | 90 |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -class ThemeSettings extends CiiSettingsModel |
|
4 | -{ |
|
3 | +class ThemeSettings extends CiiSettingsModel |
|
4 | +{ |
|
5 | 5 | /** |
6 | 6 | * The active theme |
7 | 7 | * @var string |
@@ -12,8 +12,8 @@ discard block |
||
12 | 12 | * Validation rules for the theme |
13 | 13 | * @return array |
14 | 14 | */ |
15 | - public function rules() |
|
16 | - { |
|
15 | + public function rules() |
|
16 | + { |
|
17 | 17 | return array( |
18 | 18 | array('theme', 'required'), |
19 | 19 | array('theme', 'length', 'max' => 255) |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | * Attribute labels for themes |
25 | 25 | * @return array |
26 | 26 | */ |
27 | - public function attributeLabels() |
|
28 | - { |
|
27 | + public function attributeLabels() |
|
28 | + { |
|
29 | 29 | return array( |
30 | 30 | 'theme' => Yii::t('ciims.models.theme', 'Theme'), |
31 | 31 | ); |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | * Returns the active theme name |
36 | 36 | * @return string |
37 | 37 | */ |
38 | - public function getTheme() |
|
39 | - { |
|
38 | + public function getTheme() |
|
39 | + { |
|
40 | 40 | return $this->theme; |
41 | 41 | } |
42 | 42 | |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | * |
49 | 49 | * @return array |
50 | 50 | */ |
51 | - public function getThemes() |
|
52 | - { |
|
51 | + public function getThemes() |
|
52 | + { |
|
53 | 53 | $themes = Yii::app()->cache->get('settings_themes'); |
54 | 54 | |
55 | 55 | if ($themes == false) |
@@ -1,3 +1,3 @@ |
||
1 | -<?php if (Cii::get($meta, 'blog-image', "") != ""): ?> |
|
2 | - <p style="text-align:center;"><?php echo CHtml::image(Yii::app()->baseUrl . $meta['blog-image'], NULL, array('class'=>'image')); ?></p> |
|
1 | +<?php if (Cii::get ($meta, 'blog-image', "") != ""): ?> |
|
2 | + <p style="text-align:center;"><?php echo CHtml::image (Yii::app ()->baseUrl . $meta['blog-image'], NULL, array('class'=>'image')); ?></p> |
|
3 | 3 | <?php endif; ?> |
4 | 4 | \ No newline at end of file |
@@ -1,2 +1,2 @@ |
||
1 | -<h1><?php echo Yii::t('ciims.controllers.Site', 'Error {{code}}', array('{{code}}' => $error['code'])); ?></h1> |
|
1 | +<h1><?php echo Yii::t ('ciims.controllers.Site', 'Error {{code}}', array('{{code}}' => $error['code'])); ?></h1> |
|
2 | 2 | <p><?php echo $error['message']; ?></p> |
@@ -17,9 +17,9 @@ |
||
17 | 17 | <link><?php echo $url.'/'.htmlspecialchars(str_replace('/', '', $v['slug']), ENT_QUOTES, "utf-8"); ?></link> |
18 | 18 | <description> |
19 | 19 | <?php |
20 | - $md = new CMarkdownParser; |
|
21 | - echo htmlspecialchars(strip_tags($md->transform($v['extract'])), ENT_QUOTES, "utf-8"); |
|
22 | - ?> |
|
20 | + $md = new CMarkdownParser; |
|
21 | + echo htmlspecialchars(strip_tags($md->transform($v['extract'])), ENT_QUOTES, "utf-8"); |
|
22 | + ?> |
|
23 | 23 | </description> |
24 | 24 | <category><?php echo htmlspecialchars(Categories::model()->findByPk($v['category_id'])->name, ENT_QUOTES, "utf-8"); ?></category> |
25 | 25 | <author><?php echo Users::model()->findByPk($v['author_id'])->email; ?> (<?php echo Users::model()->findByPk($v['author_id'])->username; ?>)</author> |
@@ -1,32 +1,32 @@ |
||
1 | 1 | <?php echo '<?xml version="1.0" encoding="UTF-8" ?>'; ?> |
2 | 2 | <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> |
3 | 3 | <channel> |
4 | - <atom:link href="<?php echo $url.Yii::app()->request->requestUri; ?>" rel="self" type="application/rss+xml" /> |
|
5 | - <title><?php echo Cii::getConfig('name', Yii::app()->name); ?></title> |
|
4 | + <atom:link href="<?php echo $url . Yii::app ()->request->requestUri; ?>" rel="self" type="application/rss+xml" /> |
|
5 | + <title><?php echo Cii::getConfig ('name', Yii::app ()->name); ?></title> |
|
6 | 6 | <link><?php echo $url; ?></link> |
7 | - <description><?php echo Cii::getConfig('name', Yii::app()->name); ?> Blog</description> |
|
7 | + <description><?php echo Cii::getConfig ('name', Yii::app ()->name); ?> Blog</description> |
|
8 | 8 | <language>en-us</language> |
9 | - <pubDate><?php echo date('D, d M Y H:i:s T'); ?></pubDate> |
|
10 | - <lastBuildDate><?php echo date('D, d M Y H:i:s T'); ?></lastBuildDate> |
|
9 | + <pubDate><?php echo date ('D, d M Y H:i:s T'); ?></pubDate> |
|
10 | + <lastBuildDate><?php echo date ('D, d M Y H:i:s T'); ?></lastBuildDate> |
|
11 | 11 | <docs>http://blogs.law.harvard.edu/tech/rss</docs> |
12 | 12 | |
13 | 13 | <?php foreach ($data as $k=>$v): ?> |
14 | 14 | <?php if ($v->password != '') { continue; } ?> |
15 | 15 | <item> |
16 | - <title><?php echo htmlspecialchars(str_replace('/', '', $v['title']), ENT_QUOTES, "utf-8"); ?></title> |
|
17 | - <link><?php echo $url.'/'.htmlspecialchars(str_replace('/', '', $v['slug']), ENT_QUOTES, "utf-8"); ?></link> |
|
16 | + <title><?php echo htmlspecialchars (str_replace ('/', '', $v['title']), ENT_QUOTES, "utf-8"); ?></title> |
|
17 | + <link><?php echo $url . '/' . htmlspecialchars (str_replace ('/', '', $v['slug']), ENT_QUOTES, "utf-8"); ?></link> |
|
18 | 18 | <description> |
19 | 19 | <?php |
20 | 20 | $md = new CMarkdownParser; |
21 | - echo htmlspecialchars(strip_tags($md->transform($v['extract'])), ENT_QUOTES, "utf-8"); |
|
21 | + echo htmlspecialchars (strip_tags ($md->transform ($v['extract'])), ENT_QUOTES, "utf-8"); |
|
22 | 22 | ?> |
23 | 23 | </description> |
24 | - <category><?php echo htmlspecialchars(Categories::model()->findByPk($v['category_id'])->name, ENT_QUOTES, "utf-8"); ?></category> |
|
25 | - <author><?php echo Users::model()->findByPk($v['author_id'])->email; ?> (<?php echo Users::model()->findByPk($v['author_id'])->username; ?>)</author> |
|
26 | - <pubDate><?php echo date('D, d M Y H:i:s T', strtotime($v['created'])); ?></pubDate> |
|
27 | - <guid><?php echo $url.'/'.htmlspecialchars(str_replace('/', '', $v['slug']), ENT_QUOTES, "utf-8"); ?></guid> |
|
24 | + <category><?php echo htmlspecialchars (Categories::model ()->findByPk ($v['category_id'])->name, ENT_QUOTES, "utf-8"); ?></category> |
|
25 | + <author><?php echo Users::model ()->findByPk ($v['author_id'])->email; ?> (<?php echo Users::model ()->findByPk ($v['author_id'])->username; ?>)</author> |
|
26 | + <pubDate><?php echo date ('D, d M Y H:i:s T', strtotime ($v['created'])); ?></pubDate> |
|
27 | + <guid><?php echo $url . '/' . htmlspecialchars (str_replace ('/', '', $v['slug']), ENT_QUOTES, "utf-8"); ?></guid> |
|
28 | 28 | <?php if ($v['commentable']): ?> |
29 | - <comments><?php echo $url.'/'.htmlspecialchars(str_replace('/', '', $v['slug']), ENT_QUOTES, "utf-8");; ?>#comments</comments> |
|
29 | + <comments><?php echo $url . '/' . htmlspecialchars (str_replace ('/', '', $v['slug']), ENT_QUOTES, "utf-8"); ; ?>#comments</comments> |
|
30 | 30 | <?php endif; ?> |
31 | 31 | </item> |
32 | 32 | <?php endforeach; ?> |
@@ -2,18 +2,18 @@ discard block |
||
2 | 2 | |
3 | 3 | if ($_SERVER['SCRIPT_FILENAME'] == 'protected/yiic.php') |
4 | 4 | { |
5 | - echo "Use of `yiic.php` has been deprecated for CiiMS. Uses `index.php` instead\n"; |
|
6 | - die(); |
|
5 | + echo "Use of `yiic.php` has been deprecated for CiiMS. Uses `index.php` instead\n"; |
|
6 | + die(); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | if (getenv('CIIMS_INSTALL') == "true") |
10 | 10 | { |
11 | - if (!defined('CIIMS_INSTALL')) |
|
12 | - define('CIIMS_INSTALL', true); |
|
11 | + if (!defined('CIIMS_INSTALL')) |
|
12 | + define('CIIMS_INSTALL', true); |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | if (!defined('CIIMS_INSTALL')) |
16 | - define('CIIMS_INSTALL', false); |
|
16 | + define('CIIMS_INSTALL', false); |
|
17 | 17 | |
18 | 18 | error_reporting(-1); |
19 | 19 | ini_set('display_errors', 'true'); |
@@ -29,18 +29,18 @@ discard block |
||
29 | 29 | Yii::setPathOfAlias('vendor', __DIR__.DS.'..'.DS.'vendor'.DS); |
30 | 30 | |
31 | 31 | if (!isset($_SERVER['CIIMS_ENV'])) |
32 | - $_SERVER['CIIMS_ENV'] = 'main'; |
|
32 | + $_SERVER['CIIMS_ENV'] = 'main'; |
|
33 | 33 | |
34 | 34 | $config = __DIR__.DS.'config'.DS.$_SERVER['CIIMS_ENV'].'.php'; |
35 | 35 | $defaultConfig=__DIR__.DS.'config'.DS.'main.default.php'; |
36 | 36 | |
37 | 37 | if (file_exists(__DIR__.DS.'/config/main.php')) |
38 | - $config = require $config; |
|
38 | + $config = require $config; |
|
39 | 39 | else |
40 | - $config = array(); |
|
40 | + $config = array(); |
|
41 | 41 | |
42 | 42 | if (CIIMS_INSTALL) |
43 | - $config = array(); |
|
43 | + $config = array(); |
|
44 | 44 | |
45 | 45 | $defaultConfig = require $defaultConfig; |
46 | 46 | |
@@ -53,14 +53,14 @@ discard block |
||
53 | 53 | $env=@getenv('YII_CONSOLE_COMMANDS'); |
54 | 54 | |
55 | 55 | if(!empty($env)) |
56 | - $app->commandRunner->addCommands($env); |
|
56 | + $app->commandRunner->addCommands($env); |
|
57 | 57 | |
58 | 58 | $modules = array_filter(glob(__DIR__.'/modules/*', GLOB_ONLYDIR)); |
59 | 59 | |
60 | 60 | foreach ($modules as $module) |
61 | 61 | { |
62 | - if (file_exists($module.'/commands')) |
|
63 | - $app->commandRunner->addCommands($module.'/commands'); |
|
62 | + if (file_exists($module.'/commands')) |
|
63 | + $app->commandRunner->addCommands($module.'/commands'); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | return $app->run(); |
@@ -6,35 +6,35 @@ discard block |
||
6 | 6 | die(); |
7 | 7 | } |
8 | 8 | |
9 | -if (getenv('CIIMS_INSTALL') == "true") |
|
9 | +if (getenv ('CIIMS_INSTALL') == "true") |
|
10 | 10 | { |
11 | - if (!defined('CIIMS_INSTALL')) |
|
12 | - define('CIIMS_INSTALL', true); |
|
11 | + if (!defined ('CIIMS_INSTALL')) |
|
12 | + define ('CIIMS_INSTALL', true); |
|
13 | 13 | } |
14 | 14 | |
15 | -if (!defined('CIIMS_INSTALL')) |
|
16 | - define('CIIMS_INSTALL', false); |
|
15 | +if (!defined ('CIIMS_INSTALL')) |
|
16 | + define ('CIIMS_INSTALL', false); |
|
17 | 17 | |
18 | -error_reporting(-1); |
|
19 | -ini_set('display_errors', 'true'); |
|
18 | +error_reporting (-1); |
|
19 | +ini_set ('display_errors', 'true'); |
|
20 | 20 | date_default_timezone_set ('UTC'); |
21 | -defined('DS') or define('DS', DIRECTORY_SEPARATOR); |
|
21 | +defined ('DS') or define ('DS', DIRECTORY_SEPARATOR); |
|
22 | 22 | |
23 | -defined('YII_DEBUG') or define('YII_DEBUG', true); |
|
23 | +defined ('YII_DEBUG') or define ('YII_DEBUG', true); |
|
24 | 24 | |
25 | 25 | // Include the composer dependencies |
26 | -require(__DIR__.DS.'..'.DS.'vendor'.DS.'autoload.php'); |
|
27 | -require(__DIR__.DS.'..'.DS.'vendor'.DS.'yiisoft'.DS.'yii'.DS.'framework'.DS.'yii.php'); |
|
26 | +require(__DIR__ . DS . '..' . DS . 'vendor' . DS . 'autoload.php'); |
|
27 | +require(__DIR__ . DS . '..' . DS . 'vendor' . DS . 'yiisoft' . DS . 'yii' . DS . 'framework' . DS . 'yii.php'); |
|
28 | 28 | |
29 | -Yii::setPathOfAlias('vendor', __DIR__.DS.'..'.DS.'vendor'.DS); |
|
29 | +Yii::setPathOfAlias ('vendor', __DIR__ . DS . '..' . DS . 'vendor' . DS); |
|
30 | 30 | |
31 | 31 | if (!isset($_SERVER['CIIMS_ENV'])) |
32 | 32 | $_SERVER['CIIMS_ENV'] = 'main'; |
33 | 33 | |
34 | -$config = __DIR__.DS.'config'.DS.$_SERVER['CIIMS_ENV'].'.php'; |
|
35 | -$defaultConfig=__DIR__.DS.'config'.DS.'main.default.php'; |
|
34 | +$config = __DIR__ . DS . 'config' . DS . $_SERVER['CIIMS_ENV'] . '.php'; |
|
35 | +$defaultConfig = __DIR__ . DS . 'config' . DS . 'main.default.php'; |
|
36 | 36 | |
37 | -if (file_exists(__DIR__.DS.'/config/main.php')) |
|
37 | +if (file_exists (__DIR__ . DS . '/config/main.php')) |
|
38 | 38 | $config = require $config; |
39 | 39 | else |
40 | 40 | $config = array(); |
@@ -44,23 +44,23 @@ discard block |
||
44 | 44 | |
45 | 45 | $defaultConfig = require $defaultConfig; |
46 | 46 | |
47 | -$config = CMap::mergeArray($defaultConfig, $config); |
|
47 | +$config = CMap::mergeArray ($defaultConfig, $config); |
|
48 | 48 | |
49 | 49 | unset($config['components']['user']); |
50 | 50 | |
51 | -$app=Yii::createConsoleApplication($config); |
|
52 | -$app->commandRunner->addCommands(YII_PATH.'/cli/commands'); |
|
53 | -$env=@getenv('YII_CONSOLE_COMMANDS'); |
|
51 | +$app = Yii::createConsoleApplication ($config); |
|
52 | +$app->commandRunner->addCommands (YII_PATH . '/cli/commands'); |
|
53 | +$env = @getenv ('YII_CONSOLE_COMMANDS'); |
|
54 | 54 | |
55 | -if(!empty($env)) |
|
56 | - $app->commandRunner->addCommands($env); |
|
55 | +if (!empty($env)) |
|
56 | + $app->commandRunner->addCommands ($env); |
|
57 | 57 | |
58 | -$modules = array_filter(glob(__DIR__.'/modules/*', GLOB_ONLYDIR)); |
|
58 | +$modules = array_filter (glob (__DIR__ . '/modules/*', GLOB_ONLYDIR)); |
|
59 | 59 | |
60 | 60 | foreach ($modules as $module) |
61 | 61 | { |
62 | - if (file_exists($module.'/commands')) |
|
63 | - $app->commandRunner->addCommands($module.'/commands'); |
|
62 | + if (file_exists ($module . '/commands')) |
|
63 | + $app->commandRunner->addCommands ($module . '/commands'); |
|
64 | 64 | } |
65 | 65 | |
66 | -return $app->run(); |
|
66 | +return $app->run (); |
@@ -8,12 +8,14 @@ discard block |
||
8 | 8 | |
9 | 9 | if (getenv('CIIMS_INSTALL') == "true") |
10 | 10 | { |
11 | - if (!defined('CIIMS_INSTALL')) |
|
12 | - define('CIIMS_INSTALL', true); |
|
13 | -} |
|
11 | + if (!defined('CIIMS_INSTALL')) { |
|
12 | + define('CIIMS_INSTALL', true); |
|
13 | + } |
|
14 | + } |
|
14 | 15 | |
15 | -if (!defined('CIIMS_INSTALL')) |
|
16 | +if (!defined('CIIMS_INSTALL')) { |
|
16 | 17 | define('CIIMS_INSTALL', false); |
18 | +} |
|
17 | 19 | |
18 | 20 | error_reporting(-1); |
19 | 21 | ini_set('display_errors', 'true'); |
@@ -28,19 +30,22 @@ discard block |
||
28 | 30 | |
29 | 31 | Yii::setPathOfAlias('vendor', __DIR__.DS.'..'.DS.'vendor'.DS); |
30 | 32 | |
31 | -if (!isset($_SERVER['CIIMS_ENV'])) |
|
33 | +if (!isset($_SERVER['CIIMS_ENV'])) { |
|
32 | 34 | $_SERVER['CIIMS_ENV'] = 'main'; |
35 | +} |
|
33 | 36 | |
34 | 37 | $config = __DIR__.DS.'config'.DS.$_SERVER['CIIMS_ENV'].'.php'; |
35 | 38 | $defaultConfig=__DIR__.DS.'config'.DS.'main.default.php'; |
36 | 39 | |
37 | -if (file_exists(__DIR__.DS.'/config/main.php')) |
|
40 | +if (file_exists(__DIR__.DS.'/config/main.php')) { |
|
38 | 41 | $config = require $config; |
39 | -else |
|
42 | +} else { |
|
40 | 43 | $config = array(); |
44 | +} |
|
41 | 45 | |
42 | -if (CIIMS_INSTALL) |
|
46 | +if (CIIMS_INSTALL) { |
|
43 | 47 | $config = array(); |
48 | +} |
|
44 | 49 | |
45 | 50 | $defaultConfig = require $defaultConfig; |
46 | 51 | |
@@ -52,15 +57,17 @@ discard block |
||
52 | 57 | $app->commandRunner->addCommands(YII_PATH.'/cli/commands'); |
53 | 58 | $env=@getenv('YII_CONSOLE_COMMANDS'); |
54 | 59 | |
55 | -if(!empty($env)) |
|
60 | +if(!empty($env)) { |
|
56 | 61 | $app->commandRunner->addCommands($env); |
62 | +} |
|
57 | 63 | |
58 | 64 | $modules = array_filter(glob(__DIR__.'/modules/*', GLOB_ONLYDIR)); |
59 | 65 | |
60 | 66 | foreach ($modules as $module) |
61 | 67 | { |
62 | - if (file_exists($module.'/commands')) |
|
63 | - $app->commandRunner->addCommands($module.'/commands'); |
|
64 | -} |
|
68 | + if (file_exists($module.'/commands')) { |
|
69 | + $app->commandRunner->addCommands($module.'/commands'); |
|
70 | + } |
|
71 | + } |
|
65 | 72 | |
66 | 73 | return $app->run(); |
@@ -7,54 +7,54 @@ discard block |
||
7 | 7 | * You should _never_ have to change _anything_ in this file _ever_ |
8 | 8 | */ |
9 | 9 | |
10 | -defined('DS') or define('DS', DIRECTORY_SEPARATOR); |
|
11 | -defined('BASEDIR') or define('BASEDIR', __DIR__ . DS . '..' . DS); |
|
10 | +defined ('DS') or define ('DS', DIRECTORY_SEPARATOR); |
|
11 | +defined ('BASEDIR') or define ('BASEDIR', __DIR__ . DS . '..' . DS); |
|
12 | 12 | |
13 | 13 | // Bypass Yiic entirely and use this instead as the cli bootstrapper |
14 | -if (php_sapi_name() === 'cli') |
|
15 | - return require BASEDIR.'protected'.DS.'yiic.php'; |
|
14 | +if (php_sapi_name () === 'cli') |
|
15 | + return require BASEDIR . 'protected' . DS . 'yiic.php'; |
|
16 | 16 | |
17 | 17 | // Disable Error Reporting and set some constants |
18 | -error_reporting(0); |
|
19 | -ini_set('display_errors', 'false'); |
|
20 | -date_default_timezone_set('UTC'); |
|
18 | +error_reporting (0); |
|
19 | +ini_set ('display_errors', 'false'); |
|
20 | +date_default_timezone_set ('UTC'); |
|
21 | 21 | |
22 | 22 | |
23 | 23 | // This is the configuration file |
24 | 24 | if (!isset($_SERVER['CIIMS_ENV'])) |
25 | 25 | $_SERVER['CIIMS_ENV'] = 'main'; |
26 | 26 | |
27 | -$config = BASEDIR.'protected'.DS.'config'.DS.$_SERVER['CIIMS_ENV'].'.php'; |
|
28 | -$defaultConfig = BASEDIR.'protected'.DS.'config'.DS.'main.default.php'; |
|
27 | +$config = BASEDIR . 'protected' . DS . 'config' . DS . $_SERVER['CIIMS_ENV'] . '.php'; |
|
28 | +$defaultConfig = BASEDIR . 'protected' . DS . 'config' . DS . 'main.default.php'; |
|
29 | 29 | |
30 | 30 | // If we don't have a configuration file, run the installer. |
31 | -if (!file_exists($config) && file_exists('install.php')) |
|
31 | +if (!file_exists ($config) && file_exists ('install.php')) |
|
32 | 32 | { |
33 | 33 | require('install.php'); |
34 | 34 | exit(); |
35 | 35 | } |
36 | 36 | |
37 | 37 | $config = require($config); |
38 | -defined('YII_DEBUG') or define('YII_DEBUG',isset($config['params']['debug']) ? $config['params']['debug'] : false); |
|
39 | -defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',isset($config['params']['trace']) ? $config['params']['trace'] : 0); |
|
38 | +defined ('YII_DEBUG') or define ('YII_DEBUG', isset($config['params']['debug']) ? $config['params']['debug'] : false); |
|
39 | +defined ('YII_TRACE_LEVEL') or define ('YII_TRACE_LEVEL', isset($config['params']['trace']) ? $config['params']['trace'] : 0); |
|
40 | 40 | |
41 | 41 | // Load the config file |
42 | 42 | $defaultConfig = require($defaultConfig); |
43 | 43 | |
44 | 44 | // Include the composer dependencies |
45 | -require_once BASEDIR.'vendor'.DS.'autoload.php'; |
|
46 | -require_once BASEDIR.'vendor'.DS.'yiisoft'.DS.'yii'.DS.'framework'.DS.(YII_DEBUG ? 'yii.php' : 'yiilite.php'); |
|
45 | +require_once BASEDIR . 'vendor' . DS . 'autoload.php'; |
|
46 | +require_once BASEDIR . 'vendor' . DS . 'yiisoft' . DS . 'yii' . DS . 'framework' . DS . (YII_DEBUG ? 'yii.php' : 'yiilite.php'); |
|
47 | 47 | |
48 | -Yii::setPathOfAlias('vendor', BASEDIR.'vendor'); |
|
49 | -Yii::setPathOfAlias('base', BASEDIR); |
|
50 | -Yii::setPathOfAlias('ext.yiinfinite-scroll.YiinfiniteScroller', Yii::getPathOfAlias('vendor.charlesportwoodii.ciinfinite-scroll.YiinfiniteScroller')); |
|
48 | +Yii::setPathOfAlias ('vendor', BASEDIR . 'vendor'); |
|
49 | +Yii::setPathOfAlias ('base', BASEDIR); |
|
50 | +Yii::setPathOfAlias ('ext.yiinfinite-scroll.YiinfiniteScroller', Yii::getPathOfAlias ('vendor.charlesportwoodii.ciinfinite-scroll.YiinfiniteScroller')); |
|
51 | 51 | |
52 | 52 | // Merge it with our default config file |
53 | -$config = CMap::mergeArray($defaultConfig, $config); |
|
53 | +$config = CMap::mergeArray ($defaultConfig, $config); |
|
54 | 54 | |
55 | 55 | // Include the ClassMap for enhanced performance if we're not in debug mode |
56 | 56 | if (!YII_DEBUG) |
57 | - require_once BASEDIR.'protected'.DS.'config'.DS.'classmap.php'; |
|
57 | + require_once BASEDIR . 'protected' . DS . 'config' . DS . 'classmap.php'; |
|
58 | 58 | |
59 | 59 | $config['components']['db']['enableProfiling'] = YII_DEBUG; |
60 | 60 | $config['components']['db']['enableParamLogging'] = YII_DEBUG; |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | // If debug mode is enabled, show us every possible error anywhere. |
63 | 63 | if (YII_DEBUG && YII_TRACE_LEVEL == 3) |
64 | 64 | { |
65 | - error_reporting(-1); |
|
66 | - ini_set('display_errors', 'true'); |
|
65 | + error_reporting (-1); |
|
66 | + ini_set ('display_errors', 'true'); |
|
67 | 67 | |
68 | 68 | // Enable WebLogRouteLogging |
69 | 69 | $config['preload'][] = 'log'; |
@@ -74,4 +74,4 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | // Run the Yii application instance |
77 | -Yii::createWebApplication($config)->run(); |
|
77 | +Yii::createWebApplication ($config)->run (); |
@@ -11,8 +11,9 @@ discard block |
||
11 | 11 | defined('BASEDIR') or define('BASEDIR', __DIR__ . DS . '..' . DS); |
12 | 12 | |
13 | 13 | // Bypass Yiic entirely and use this instead as the cli bootstrapper |
14 | -if (php_sapi_name() === 'cli') |
|
14 | +if (php_sapi_name() === 'cli') { |
|
15 | 15 | return require BASEDIR.'protected'.DS.'yiic.php'; |
16 | +} |
|
16 | 17 | |
17 | 18 | // Disable Error Reporting and set some constants |
18 | 19 | error_reporting(0); |
@@ -21,8 +22,9 @@ discard block |
||
21 | 22 | |
22 | 23 | |
23 | 24 | // This is the configuration file |
24 | -if (!isset($_SERVER['CIIMS_ENV'])) |
|
25 | +if (!isset($_SERVER['CIIMS_ENV'])) { |
|
25 | 26 | $_SERVER['CIIMS_ENV'] = 'main'; |
27 | +} |
|
26 | 28 | |
27 | 29 | $config = BASEDIR.'protected'.DS.'config'.DS.$_SERVER['CIIMS_ENV'].'.php'; |
28 | 30 | $defaultConfig = BASEDIR.'protected'.DS.'config'.DS.'main.default.php'; |
@@ -53,8 +55,9 @@ discard block |
||
53 | 55 | $config = CMap::mergeArray($defaultConfig, $config); |
54 | 56 | |
55 | 57 | // Include the ClassMap for enhanced performance if we're not in debug mode |
56 | -if (!YII_DEBUG) |
|
58 | +if (!YII_DEBUG) { |
|
57 | 59 | require_once BASEDIR.'protected'.DS.'config'.DS.'classmap.php'; |
60 | +} |
|
58 | 61 | |
59 | 62 | $config['components']['db']['enableProfiling'] = YII_DEBUG; |
60 | 63 | $config['components']['db']['enableParamLogging'] = YII_DEBUG; |
@@ -69,9 +72,10 @@ discard block |
||
69 | 72 | $config['preload'][] = 'log'; |
70 | 73 | |
71 | 74 | // Enable all the logging routes |
72 | - foreach ($config['components']['log']['routes'] as $k=>$v) |
|
73 | - $config['components']['log']['routes'][$k]['enabled'] = YII_DEBUG; |
|
74 | -} |
|
75 | + foreach ($config['components']['log']['routes'] as $k=>$v) { |
|
76 | + $config['components']['log']['routes'][$k]['enabled'] = YII_DEBUG; |
|
77 | + } |
|
78 | + } |
|
75 | 79 | |
76 | 80 | // Run the Yii application instance |
77 | 81 | Yii::createWebApplication($config)->run(); |
@@ -1,18 +1,18 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This is the primary bootstrapper for CiiMS. Almost every option is derived from the |
|
4 | - * configuration file or the default configuration file. This bootstrapper also disables error |
|
5 | - * reporting so that E_NOTICES and non-fatal errors don't crash it. |
|
6 | - * |
|
7 | - * You should _never_ have to change _anything_ in this file _ever_ |
|
8 | - */ |
|
3 | + * This is the primary bootstrapper for CiiMS. Almost every option is derived from the |
|
4 | + * configuration file or the default configuration file. This bootstrapper also disables error |
|
5 | + * reporting so that E_NOTICES and non-fatal errors don't crash it. |
|
6 | + * |
|
7 | + * You should _never_ have to change _anything_ in this file _ever_ |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | defined('DS') or define('DS', DIRECTORY_SEPARATOR); |
11 | 11 | defined('BASEDIR') or define('BASEDIR', __DIR__ . DS . '..' . DS); |
12 | 12 | |
13 | 13 | // Bypass Yiic entirely and use this instead as the cli bootstrapper |
14 | 14 | if (php_sapi_name() === 'cli') |
15 | - return require BASEDIR.'protected'.DS.'yiic.php'; |
|
15 | + return require BASEDIR.'protected'.DS.'yiic.php'; |
|
16 | 16 | |
17 | 17 | // Disable Error Reporting and set some constants |
18 | 18 | error_reporting(0); |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | // This is the configuration file |
24 | 24 | if (!isset($_SERVER['CIIMS_ENV'])) |
25 | - $_SERVER['CIIMS_ENV'] = 'main'; |
|
25 | + $_SERVER['CIIMS_ENV'] = 'main'; |
|
26 | 26 | |
27 | 27 | $config = BASEDIR.'protected'.DS.'config'.DS.$_SERVER['CIIMS_ENV'].'.php'; |
28 | 28 | $defaultConfig = BASEDIR.'protected'.DS.'config'.DS.'main.default.php'; |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | // If we don't have a configuration file, run the installer. |
31 | 31 | if (!file_exists($config) && file_exists('install.php')) |
32 | 32 | { |
33 | - require('install.php'); |
|
34 | - exit(); |
|
33 | + require('install.php'); |
|
34 | + exit(); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | $config = require($config); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | // Include the ClassMap for enhanced performance if we're not in debug mode |
56 | 56 | if (!YII_DEBUG) |
57 | - require_once BASEDIR.'protected'.DS.'config'.DS.'classmap.php'; |
|
57 | + require_once BASEDIR.'protected'.DS.'config'.DS.'classmap.php'; |
|
58 | 58 | |
59 | 59 | $config['components']['db']['enableProfiling'] = YII_DEBUG; |
60 | 60 | $config['components']['db']['enableParamLogging'] = YII_DEBUG; |
@@ -62,15 +62,15 @@ discard block |
||
62 | 62 | // If debug mode is enabled, show us every possible error anywhere. |
63 | 63 | if (YII_DEBUG && YII_TRACE_LEVEL == 3) |
64 | 64 | { |
65 | - error_reporting(-1); |
|
66 | - ini_set('display_errors', 'true'); |
|
65 | + error_reporting(-1); |
|
66 | + ini_set('display_errors', 'true'); |
|
67 | 67 | |
68 | - // Enable WebLogRouteLogging |
|
69 | - $config['preload'][] = 'log'; |
|
68 | + // Enable WebLogRouteLogging |
|
69 | + $config['preload'][] = 'log'; |
|
70 | 70 | |
71 | - // Enable all the logging routes |
|
72 | - foreach ($config['components']['log']['routes'] as $k=>$v) |
|
73 | - $config['components']['log']['routes'][$k]['enabled'] = YII_DEBUG; |
|
71 | + // Enable all the logging routes |
|
72 | + foreach ($config['components']['log']['routes'] as $k=>$v) |
|
73 | + $config['components']['log']['routes'][$k]['enabled'] = YII_DEBUG; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | // Run the Yii application instance |
@@ -26,8 +26,8 @@ |
||
26 | 26 | defined('CIIMS_INSTALL') or define('CIIMS_INSTALL', true); |
27 | 27 | if (!file_exists($mainConfig) && !file_exists($yiiPath)) |
28 | 28 | { |
29 | - require(dirname(__FILE__).'/protected/modules/install/init.php'); |
|
30 | - exit(); |
|
29 | + require(dirname(__FILE__).'/protected/modules/install/init.php'); |
|
30 | + exit(); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | require_once($yiiPath); |
@@ -9,30 +9,30 @@ |
||
9 | 9 | * Otherwise, this is a basic Yii App running only the install module |
10 | 10 | */ |
11 | 11 | |
12 | -defined('DS') or define('DS', DIRECTORY_SEPARATOR); |
|
13 | -defined('BASEDIR') or define('BASEDIR', __DIR__ . DS . '..' . DS); |
|
14 | -error_reporting(-1); |
|
15 | -ini_set('display_errors', 'true'); |
|
12 | +defined ('DS') or define ('DS', DIRECTORY_SEPARATOR); |
|
13 | +defined ('BASEDIR') or define ('BASEDIR', __DIR__ . DS . '..' . DS); |
|
14 | +error_reporting (-1); |
|
15 | +ini_set ('display_errors', 'true'); |
|
16 | 16 | |
17 | -$yiiPath = BASEDIR.'vendor'.DS.'yiisoft'.DS.'yii'.DS.'framework'.DS.'yiilite.php'; |
|
18 | -require_once BASEDIR.'vendor'.DS.'autoload.php'; |
|
17 | +$yiiPath = BASEDIR . 'vendor' . DS . 'yiisoft' . DS . 'yii' . DS . 'framework' . DS . 'yiilite.php'; |
|
18 | +require_once BASEDIR . 'vendor' . DS . 'autoload.php'; |
|
19 | 19 | |
20 | -$config = BASEDIR.'protected'.DS.'config'.DS.'install.php'; |
|
21 | -$mainConfig = BASEDIR.'protected'.DS.'config'.DS.'main.php'; |
|
20 | +$config = BASEDIR . 'protected' . DS . 'config' . DS . 'install.php'; |
|
21 | +$mainConfig = BASEDIR . 'protected' . DS . 'config' . DS . 'main.php'; |
|
22 | 22 | $ciimsConfig = require($config); |
23 | 23 | |
24 | -defined('YII_DEBUG') or define('YII_DEBUG',true); |
|
25 | -defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3); |
|
26 | -defined('CIIMS_INSTALL') or define('CIIMS_INSTALL', true); |
|
27 | -if (!file_exists($mainConfig) && !file_exists($yiiPath)) |
|
24 | +defined ('YII_DEBUG') or define ('YII_DEBUG', true); |
|
25 | +defined ('YII_TRACE_LEVEL') or define ('YII_TRACE_LEVEL', 3); |
|
26 | +defined ('CIIMS_INSTALL') or define ('CIIMS_INSTALL', true); |
|
27 | +if (!file_exists ($mainConfig) && !file_exists ($yiiPath)) |
|
28 | 28 | { |
29 | - require(dirname(__FILE__).'/protected/modules/install/init.php'); |
|
29 | + require(dirname (__FILE__) . '/protected/modules/install/init.php'); |
|
30 | 30 | exit(); |
31 | 31 | } |
32 | 32 | |
33 | 33 | require_once($yiiPath); |
34 | -Yii::setPathOfAlias('vendor', BASEDIR.'vendor'); |
|
35 | -Yii::setPathOfAlias('base', BASEDIR); |
|
34 | +Yii::setPathOfAlias ('vendor', BASEDIR . 'vendor'); |
|
35 | +Yii::setPathOfAlias ('base', BASEDIR); |
|
36 | 36 | |
37 | -$app = Yii::createWebApplication($config); |
|
38 | -$app->run(); |
|
37 | +$app = Yii::createWebApplication ($config); |
|
38 | +$app->run (); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3); |
13 | 13 | |
14 | 14 | if (!isset($_SERVER['CIIMS_ENV'])) |
15 | - $_SERVER['CIIMS_ENV'] = 'main'; |
|
15 | + $_SERVER['CIIMS_ENV'] = 'main'; |
|
16 | 16 | |
17 | 17 | $config = require BASEDIR.'protected'.DS.'config'.DS.$_SERVER['CIIMS_ENV'].'.php'; |
18 | 18 | $defaultConfig = require BASEDIR.'protected'.DS.'config'.DS.'main.default.php'; |
@@ -31,11 +31,11 @@ discard block |
||
31 | 31 | |
32 | 32 | // Set the request component in the test script |
33 | 33 | $config['components']['request'] = array( |
34 | - 'class' => 'vendor.codeception.YiiBridge.web.CodeceptionHttpRequest' |
|
34 | + 'class' => 'vendor.codeception.YiiBridge.web.CodeceptionHttpRequest' |
|
35 | 35 | ); |
36 | 36 | |
37 | 37 | // Return for Codeception |
38 | 38 | return array( |
39 | - 'class' => 'CWebApplication', |
|
40 | - 'config' => $config |
|
39 | + 'class' => 'CWebApplication', |
|
40 | + 'config' => $config |
|
41 | 41 | ); |
@@ -1,31 +1,31 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Set Error Reporting Levels |
4 | -error_reporting(-1); |
|
5 | -ini_set('display_errors', 'true'); |
|
6 | -date_default_timezone_set('UTC'); |
|
4 | +error_reporting (-1); |
|
5 | +ini_set ('display_errors', 'true'); |
|
6 | +date_default_timezone_set ('UTC'); |
|
7 | 7 | |
8 | 8 | // Definitions |
9 | -defined('DS') or define('DS', DIRECTORY_SEPARATOR); |
|
10 | -defined('BASEDIR') or define('BASEDIR', __DIR__ . DS . '..' . DS); |
|
11 | -defined('YII_DEBUG') or define('YII_DEBUG',true); |
|
12 | -defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3); |
|
9 | +defined ('DS') or define ('DS', DIRECTORY_SEPARATOR); |
|
10 | +defined ('BASEDIR') or define ('BASEDIR', __DIR__ . DS . '..' . DS); |
|
11 | +defined ('YII_DEBUG') or define ('YII_DEBUG', true); |
|
12 | +defined ('YII_TRACE_LEVEL') or define ('YII_TRACE_LEVEL', 3); |
|
13 | 13 | |
14 | 14 | if (!isset($_SERVER['CIIMS_ENV'])) |
15 | 15 | $_SERVER['CIIMS_ENV'] = 'main'; |
16 | 16 | |
17 | -$config = require BASEDIR.'protected'.DS.'config'.DS.$_SERVER['CIIMS_ENV'].'.php'; |
|
18 | -$defaultConfig = require BASEDIR.'protected'.DS.'config'.DS.'main.default.php'; |
|
17 | +$config = require BASEDIR . 'protected' . DS . 'config' . DS . $_SERVER['CIIMS_ENV'] . '.php'; |
|
18 | +$defaultConfig = require BASEDIR . 'protected' . DS . 'config' . DS . 'main.default.php'; |
|
19 | 19 | |
20 | 20 | // Load Yii and Composer extensions |
21 | -require_once BASEDIR.'vendor'.DS.'yiisoft'.DS.'yii'.DS.'framework'.DS.'yii.php'; |
|
22 | -require_once BASEDIR.'vendor'.DS.'autoload.php'; |
|
21 | +require_once BASEDIR . 'vendor' . DS . 'yiisoft' . DS . 'yii' . DS . 'framework' . DS . 'yii.php'; |
|
22 | +require_once BASEDIR . 'vendor' . DS . 'autoload.php'; |
|
23 | 23 | |
24 | -Yii::setPathOfAlias('vendor', BASEDIR.'vendor'); |
|
25 | -Yii::setPathOfAlias('base', BASEDIR); |
|
26 | -Yii::setPathOfAlias('ext.yiinfinite-scroll.YiinfiniteScroller', Yii::getPathOfAlias('vendor.charlesportwoodii.ciinfinite-scroll.YiinfiniteScroller')); |
|
24 | +Yii::setPathOfAlias ('vendor', BASEDIR . 'vendor'); |
|
25 | +Yii::setPathOfAlias ('base', BASEDIR); |
|
26 | +Yii::setPathOfAlias ('ext.yiinfinite-scroll.YiinfiniteScroller', Yii::getPathOfAlias ('vendor.charlesportwoodii.ciinfinite-scroll.YiinfiniteScroller')); |
|
27 | 27 | |
28 | -$config = CMap::mergeArray($defaultConfig, $config); |
|
28 | +$config = CMap::mergeArray ($defaultConfig, $config); |
|
29 | 29 | |
30 | 30 | $_SERVER['SERVER_NAME'] = 'localhost'; |
31 | 31 |
@@ -11,8 +11,9 @@ |
||
11 | 11 | defined('YII_DEBUG') or define('YII_DEBUG',true); |
12 | 12 | defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3); |
13 | 13 | |
14 | -if (!isset($_SERVER['CIIMS_ENV'])) |
|
14 | +if (!isset($_SERVER['CIIMS_ENV'])) { |
|
15 | 15 | $_SERVER['CIIMS_ENV'] = 'main'; |
16 | +} |
|
16 | 17 | |
17 | 18 | $config = require BASEDIR.'protected'.DS.'config'.DS.$_SERVER['CIIMS_ENV'].'.php'; |
18 | 19 | $defaultConfig = require BASEDIR.'protected'.DS.'config'.DS.'main.default.php'; |