@@ -37,7 +37,7 @@ |
||
37 | 37 | * @param int $user |
38 | 38 | */ |
39 | 39 | function __construct ($user) { |
40 | - $this->id = $user; |
|
40 | + $this->id = $user; |
|
41 | 41 | } |
42 | 42 | /** |
43 | 43 | * Get data item of user |
@@ -1,31 +1,31 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package CleverStyle CMS |
|
4 | - * @author Nazar Mokrynskyi <[email protected]> |
|
5 | - * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
6 | - * @license MIT License, see license.txt |
|
7 | - */ |
|
3 | + * @package CleverStyle CMS |
|
4 | + * @author Nazar Mokrynskyi <[email protected]> |
|
5 | + * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
6 | + * @license MIT License, see license.txt |
|
7 | + */ |
|
8 | 8 | namespace cs\User; |
9 | 9 | use cs\User; |
10 | 10 | /** |
11 | - * Class for getting of user information |
|
12 | - * |
|
13 | - * @property int $id |
|
14 | - * @property string $login |
|
15 | - * @property string $login_hash sha224 hash |
|
16 | - * @property string $username |
|
17 | - * @property string $password_hash sha512 hash |
|
18 | - * @property string $email |
|
19 | - * @property string $email_hash sha224 hash |
|
20 | - * @property string $language |
|
21 | - * @property string $timezone |
|
22 | - * @property int $reg_date unix timestamp |
|
23 | - * @property string $reg_ip hex value, obtained by function ip2hex() |
|
24 | - * @property string $reg_key random md5 hash, generated during registration |
|
25 | - * @property int $status '-1' - not activated (for example after registration), 0 - inactive, 1 - active |
|
26 | - * @property int $block_until unix timestamp |
|
27 | - * @property string $avatar |
|
28 | - */ |
|
11 | + * Class for getting of user information |
|
12 | + * |
|
13 | + * @property int $id |
|
14 | + * @property string $login |
|
15 | + * @property string $login_hash sha224 hash |
|
16 | + * @property string $username |
|
17 | + * @property string $password_hash sha512 hash |
|
18 | + * @property string $email |
|
19 | + * @property string $email_hash sha224 hash |
|
20 | + * @property string $language |
|
21 | + * @property string $timezone |
|
22 | + * @property int $reg_date unix timestamp |
|
23 | + * @property string $reg_ip hex value, obtained by function ip2hex() |
|
24 | + * @property string $reg_key random md5 hash, generated during registration |
|
25 | + * @property int $status '-1' - not activated (for example after registration), 0 - inactive, 1 - active |
|
26 | + * @property int $block_until unix timestamp |
|
27 | + * @property string $avatar |
|
28 | + */ |
|
29 | 29 | class Properties { |
30 | 30 | /** |
31 | 31 | * @var int |
@@ -71,7 +71,7 @@ |
||
71 | 71 | if (!file_exists($path_in_filesystem) || is_writable($path_in_filesystem)) { |
72 | 72 | return file_put_contents($path_in_filesystem, $data, LOCK_EX | FILE_BINARY); |
73 | 73 | } |
74 | - trigger_error("File $path_in_filesystem not available for writing", E_USER_WARNING); |
|
74 | + trigger_error("file $path_in_filesystem not available for writing", E_USER_WARNING); |
|
75 | 75 | return false; |
76 | 76 | } |
77 | 77 | /** |
@@ -1,14 +1,14 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package CleverStyle CMS |
|
4 | - * @author Nazar Mokrynskyi <[email protected]> |
|
5 | - * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
6 | - * @license MIT License, see license.txt |
|
7 | - */ |
|
3 | + * @package CleverStyle CMS |
|
4 | + * @author Nazar Mokrynskyi <[email protected]> |
|
5 | + * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
6 | + * @license MIT License, see license.txt |
|
7 | + */ |
|
8 | 8 | namespace cs\Cache; |
9 | 9 | /** |
10 | - * Provides cache functionality based on file system structure. |
|
11 | - */ |
|
10 | + * Provides cache functionality based on file system structure. |
|
11 | + */ |
|
12 | 12 | class FileSystem extends _Abstract { |
13 | 13 | /** |
14 | 14 | * Like realpath() but works even if files does not exists |
@@ -349,7 +349,7 @@ |
||
349 | 349 | * |
350 | 350 | * @return null|string |
351 | 351 | */ |
352 | -function status_code_string ($code){ |
|
352 | +function status_code_string ($code) { |
|
353 | 353 | switch ($code) { |
354 | 354 | case 201: |
355 | 355 | $string_code = '201 Created'; |
@@ -1,14 +1,14 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package CleverStyle CMS |
|
4 | - * @author Nazar Mokrynskyi <[email protected]> |
|
5 | - * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
6 | - * @license MIT License, see license.txt |
|
7 | - */ |
|
3 | + * @package CleverStyle CMS |
|
4 | + * @author Nazar Mokrynskyi <[email protected]> |
|
5 | + * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
6 | + * @license MIT License, see license.txt |
|
7 | + */ |
|
8 | 8 | /** |
9 | - * Base system functions, do not edit this file, or make it very carefully |
|
10 | - * otherwise system workability may be broken |
|
11 | - */ |
|
9 | + * Base system functions, do not edit this file, or make it very carefully |
|
10 | + * otherwise system workability may be broken |
|
11 | + */ |
|
12 | 12 | use |
13 | 13 | cs\Cache, |
14 | 14 | cs\Config, |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | cs\Text, |
19 | 19 | cs\User; |
20 | 20 | /** |
21 | - * Auto Loading of classes |
|
22 | - */ |
|
21 | + * Auto Loading of classes |
|
22 | + */ |
|
23 | 23 | spl_autoload_register(function ($class) { |
24 | 24 | static $cache; |
25 | 25 | if (!isset($cache)) { |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | return false; |
56 | 56 | }, true, true); |
57 | 57 | /** |
58 | - * Clean cache of classes autoload and customization |
|
59 | - */ |
|
58 | + * Clean cache of classes autoload and customization |
|
59 | + */ |
|
60 | 60 | function clean_classes_cache () { |
61 | 61 | if (file_exists(CACHE.'/classes/autoload')) { |
62 | 62 | unlink(CACHE.'/classes/autoload'); |
@@ -66,12 +66,12 @@ discard block |
||
66 | 66 | } |
67 | 67 | } |
68 | 68 | /** |
69 | - * Get or set modified classes (used in Singleton trait) |
|
70 | - * |
|
71 | - * @param array|null $updated_modified_classes |
|
72 | - * |
|
73 | - * @return array |
|
74 | - */ |
|
69 | + * Get or set modified classes (used in Singleton trait) |
|
70 | + * |
|
71 | + * @param array|null $updated_modified_classes |
|
72 | + * |
|
73 | + * @return array |
|
74 | + */ |
|
75 | 75 | function modified_classes ($updated_modified_classes = null) { |
76 | 76 | static $modified_classes; |
77 | 77 | if (!isset($modified_classes)) { |
@@ -84,10 +84,10 @@ discard block |
||
84 | 84 | return $modified_classes; |
85 | 85 | } |
86 | 86 | /** |
87 | - * Correct termination |
|
88 | - * |
|
89 | - * @param bool|null $enable Allows to disable shutdown function execution since there is no good way to un-register it |
|
90 | - */ |
|
87 | + * Correct termination |
|
88 | + * |
|
89 | + * @param bool|null $enable Allows to disable shutdown function execution since there is no good way to un-register it |
|
90 | + */ |
|
91 | 91 | function shutdown_function ($enable = null) { |
92 | 92 | static $enable_internal = true; |
93 | 93 | if ($enable !== null) { |
@@ -105,38 +105,38 @@ discard block |
||
105 | 105 | User::instance(true)->__finish(); |
106 | 106 | } |
107 | 107 | /** |
108 | - * Enable of errors processing |
|
109 | - */ |
|
108 | + * Enable of errors processing |
|
109 | + */ |
|
110 | 110 | function errors_on () { |
111 | 111 | error_reporting(defined('DEBUG') && DEBUG ? E_ALL : E_ERROR | E_WARNING | E_PARSE); |
112 | 112 | } |
113 | 113 | /** |
114 | - * Disabling of errors processing |
|
115 | - */ |
|
114 | + * Disabling of errors processing |
|
115 | + */ |
|
116 | 116 | function errors_off () { |
117 | 117 | error_reporting(0); |
118 | 118 | } |
119 | 119 | /** |
120 | - * Enabling of page interface |
|
121 | - */ |
|
120 | + * Enabling of page interface |
|
121 | + */ |
|
122 | 122 | function interface_on () { |
123 | 123 | Page::instance()->interface = true; |
124 | 124 | } |
125 | 125 | /** |
126 | - * Disabling of page interface |
|
127 | - */ |
|
126 | + * Disabling of page interface |
|
127 | + */ |
|
128 | 128 | function interface_off () { |
129 | 129 | Page::instance()->interface = false; |
130 | 130 | } |
131 | 131 | /** |
132 | - * Easy getting of translations |
|
133 | - * |
|
134 | - * @param string $item |
|
135 | - * @param mixed $arguments There can be any necessary number of arguments here |
|
136 | - * @param mixed $_ |
|
137 | - * |
|
138 | - * @return string |
|
139 | - */ |
|
132 | + * Easy getting of translations |
|
133 | + * |
|
134 | + * @param string $item |
|
135 | + * @param mixed $arguments There can be any necessary number of arguments here |
|
136 | + * @param mixed $_ |
|
137 | + * |
|
138 | + * @return string |
|
139 | + */ |
|
140 | 140 | function __ ($item, $arguments = null, $_ = null) { |
141 | 141 | $L = Language::instance(); |
142 | 142 | if (func_num_args() > 1) { |
@@ -146,12 +146,12 @@ discard block |
||
146 | 146 | } |
147 | 147 | } |
148 | 148 | /** |
149 | - * Get file url by it's destination in file system |
|
150 | - * |
|
151 | - * @param string $source |
|
152 | - * |
|
153 | - * @return false|string |
|
154 | - */ |
|
149 | + * Get file url by it's destination in file system |
|
150 | + * |
|
151 | + * @param string $source |
|
152 | + * |
|
153 | + * @return false|string |
|
154 | + */ |
|
155 | 155 | function url_by_source ($source) { |
156 | 156 | $Config = Config::instance(true); |
157 | 157 | if (!$Config) { |
@@ -164,12 +164,12 @@ discard block |
||
164 | 164 | return false; |
165 | 165 | } |
166 | 166 | /** |
167 | - * Get file destination in file system by it's url |
|
168 | - * |
|
169 | - * @param string $url |
|
170 | - * |
|
171 | - * @return false|string |
|
172 | - */ |
|
167 | + * Get file destination in file system by it's url |
|
168 | + * |
|
169 | + * @param string $url |
|
170 | + * |
|
171 | + * @return false|string |
|
172 | + */ |
|
173 | 173 | function source_by_url ($url) { |
174 | 174 | $Config = Config::instance(true); |
175 | 175 | if (!$Config) { |
@@ -181,10 +181,10 @@ discard block |
||
181 | 181 | return false; |
182 | 182 | } |
183 | 183 | /** |
184 | - * Public cache cleaning |
|
185 | - * |
|
186 | - * @return bool |
|
187 | - */ |
|
184 | + * Public cache cleaning |
|
185 | + * |
|
186 | + * @return bool |
|
187 | + */ |
|
188 | 188 | function clean_pcache () { |
189 | 189 | $ok = true; |
190 | 190 | $list = get_files_list(PUBLIC_CACHE, false, 'fd', true, true, 'name|desc'); |
@@ -199,12 +199,12 @@ discard block |
||
199 | 199 | return $ok; |
200 | 200 | } |
201 | 201 | /** |
202 | - * Formatting of time in seconds to human-readable form |
|
203 | - * |
|
204 | - * @param int $time Time in seconds |
|
205 | - * |
|
206 | - * @return string |
|
207 | - */ |
|
202 | + * Formatting of time in seconds to human-readable form |
|
203 | + * |
|
204 | + * @param int $time Time in seconds |
|
205 | + * |
|
206 | + * @return string |
|
207 | + */ |
|
208 | 208 | function format_time ($time) { |
209 | 209 | if (!is_numeric($time)) { |
210 | 210 | return $time; |
@@ -242,13 +242,13 @@ discard block |
||
242 | 242 | return implode(' ', $res); |
243 | 243 | } |
244 | 244 | /** |
245 | - * Formatting of data size in bytes to human-readable form |
|
246 | - * |
|
247 | - * @param int $size |
|
248 | - * @param bool|int $round |
|
249 | - * |
|
250 | - * @return float|string |
|
251 | - */ |
|
245 | + * Formatting of data size in bytes to human-readable form |
|
246 | + * |
|
247 | + * @param int $size |
|
248 | + * @param bool|int $round |
|
249 | + * |
|
250 | + * @return float|string |
|
251 | + */ |
|
252 | 252 | function format_filesize ($size, $round = false) { |
253 | 253 | if (!is_numeric($size)) { |
254 | 254 | return $size; |
@@ -273,10 +273,10 @@ discard block |
||
273 | 273 | return $round ? round($size, $round).$unit : $size.$unit; |
274 | 274 | } |
275 | 275 | /** |
276 | - * Get list of timezones |
|
277 | - * |
|
278 | - * @return array |
|
279 | - */ |
|
276 | + * Get list of timezones |
|
277 | + * |
|
278 | + * @return array |
|
279 | + */ |
|
280 | 280 | function get_timezones_list () { |
281 | 281 | if ( |
282 | 282 | !class_exists('\\cs\\Cache', false) || |
@@ -312,12 +312,12 @@ discard block |
||
312 | 312 | return $timezones; |
313 | 313 | } |
314 | 314 | /** |
315 | - * Get multilingual value from $Config->core array |
|
316 | - * |
|
317 | - * @param string $item |
|
318 | - * |
|
319 | - * @return false|string |
|
320 | - */ |
|
315 | + * Get multilingual value from $Config->core array |
|
316 | + * |
|
317 | + * @param string $item |
|
318 | + * |
|
319 | + * @return false|string |
|
320 | + */ |
|
321 | 321 | function get_core_ml_text ($item) { |
322 | 322 | $Config = Config::instance(true); |
323 | 323 | if (!$Config) { |
@@ -40,10 +40,10 @@ discard block |
||
40 | 40 | * Try to load classes from different places. If not found in one place - try in another. |
41 | 41 | */ |
42 | 42 | if ( |
43 | - _require_once($file = DIR."/core/classes/$namespace/$class_name.php", false) || //Core classes |
|
43 | + _require_once($file = DIR."/core/classes/$namespace/$class_name.php", false) || //Core classes |
|
44 | 44 | _require_once($file = DIR."/core/thirdparty/$namespace/$class_name.php", false) || //Third party classes |
45 | - _require_once($file = DIR."/core/traits/$namespace/$class_name.php", false) || //Core traits |
|
46 | - _require_once($file = ENGINES."/$namespace/$class_name.php", false) || //Core engines |
|
45 | + _require_once($file = DIR."/core/traits/$namespace/$class_name.php", false) || //Core traits |
|
46 | + _require_once($file = ENGINES."/$namespace/$class_name.php", false) || //Core engines |
|
47 | 47 | _require_once($file = MODULES."/../$namespace/$class_name.php", false) //Classes in modules and plugins |
48 | 48 | ) { |
49 | 49 | $cache[$class] = realpath($file); |
@@ -120,13 +120,13 @@ discard block |
||
120 | 120 | * Enabling of page interface |
121 | 121 | */ |
122 | 122 | function interface_on () { |
123 | - Page::instance()->interface = true; |
|
123 | + Page::instance()->interface = true; |
|
124 | 124 | } |
125 | 125 | /** |
126 | 126 | * Disabling of page interface |
127 | 127 | */ |
128 | 128 | function interface_off () { |
129 | - Page::instance()->interface = false; |
|
129 | + Page::instance()->interface = false; |
|
130 | 130 | } |
131 | 131 | /** |
132 | 132 | * Easy getting of translations |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * @return false|string |
154 | 154 | */ |
155 | 155 | function url_by_source ($source) { |
156 | - $Config = Config::instance(true); |
|
156 | + $Config = Config::instance(true); |
|
157 | 157 | if (!$Config) { |
158 | 158 | return false; |
159 | 159 | } |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @return false|string |
172 | 172 | */ |
173 | 173 | function source_by_url ($url) { |
174 | - $Config = Config::instance(true); |
|
174 | + $Config = Config::instance(true); |
|
175 | 175 | if (!$Config) { |
176 | 176 | return false; |
177 | 177 | } |
@@ -209,8 +209,8 @@ discard block |
||
209 | 209 | if (!is_numeric($time)) { |
210 | 210 | return $time; |
211 | 211 | } |
212 | - $L = Language::instance(); |
|
213 | - $res = []; |
|
212 | + $L = Language::instance(); |
|
213 | + $res = []; |
|
214 | 214 | if ($time >= 31536000) { |
215 | 215 | $time_x = round($time / 31536000); |
216 | 216 | $time -= $time_x * 31536000; |
@@ -221,12 +221,12 @@ discard block |
||
221 | 221 | $time -= $time_x * 2592000; |
222 | 222 | $res[] = $L->time($time_x, 'M'); |
223 | 223 | } |
224 | - if($time >= 86400) { |
|
224 | + if ($time >= 86400) { |
|
225 | 225 | $time_x = round($time / 86400); |
226 | 226 | $time -= $time_x * 86400; |
227 | 227 | $res[] = $L->time($time_x, 'd'); |
228 | 228 | } |
229 | - if($time >= 3600) { |
|
229 | + if ($time >= 3600) { |
|
230 | 230 | $time_x = round($time / 3600); |
231 | 231 | $time -= $time_x * 3600; |
232 | 232 | $res[] = $L->time($time_x, 'h'); |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | $timezones_ = $timezones = []; |
288 | 288 | foreach ($tzs as $tz) { |
289 | 289 | $offset = (new DateTimeZone($tz))->getOffset(new DateTime); |
290 | - $offset_ = ($offset < 0 ? '-' : '+'). |
|
290 | + $offset_ = ($offset < 0 ? '-' : '+'). |
|
291 | 291 | str_pad(floor(abs($offset / 3600)), 2, 0, STR_PAD_LEFT).':'. |
292 | 292 | str_pad(abs(($offset % 3600) / 60), 2, 0, STR_PAD_LEFT); |
293 | 293 | $timezones_[(39600 + $offset).$tz] = [ |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | * @return false|string |
320 | 320 | */ |
321 | 321 | function get_core_ml_text ($item) { |
322 | - $Config = Config::instance(true); |
|
322 | + $Config = Config::instance(true); |
|
323 | 323 | if (!$Config) { |
324 | 324 | return false; |
325 | 325 | } |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | * |
366 | 366 | * @return null|string |
367 | 367 | */ |
368 | -function status_code_string ($code){ |
|
368 | +function status_code_string ($code) { |
|
369 | 369 | switch ($code) { |
370 | 370 | case 201: |
371 | 371 | $string_code = '201 Created'; |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | ] |
477 | 477 | ); |
478 | 478 | }; |
479 | - $render_page_item = function ($i) use ($page, $url, $head_links, $render_head_links) { |
|
479 | + $render_page_item = function ($i) use ($page, $url, $head_links, $render_head_links) { |
|
480 | 480 | if ($head_links) { |
481 | 481 | $render_head_links($i); |
482 | 482 | } |
@@ -569,14 +569,14 @@ discard block |
||
569 | 569 | } |
570 | 570 | $output = []; |
571 | 571 | if (!is_callable($url)) { |
572 | - $original_url = $url; |
|
572 | + $original_url = $url; |
|
573 | 573 | $url = function ($page) use ($original_url) { |
574 | 574 | return sprintf($original_url, $page); |
575 | 575 | }; |
576 | 576 | } |
577 | 577 | if ($total <= 11) { |
578 | 578 | for ($i = 1; $i <= $total; ++$i) { |
579 | - $output[] = [ |
|
579 | + $output[] = [ |
|
580 | 580 | $i, |
581 | 581 | [ |
582 | 582 | 'is' => 'cs-button', |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | } else { |
591 | 591 | if ($page <= 6) { |
592 | 592 | for ($i = 1; $i <= 7; ++$i) { |
593 | - $output[] = [ |
|
593 | + $output[] = [ |
|
594 | 594 | $i, |
595 | 595 | [ |
596 | 596 | 'is' => 'cs-button', |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | ] |
602 | 602 | ]; |
603 | 603 | } |
604 | - $output[] = [ |
|
604 | + $output[] = [ |
|
605 | 605 | '...', |
606 | 606 | [ |
607 | 607 | 'is' => 'cs-button', |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | ] |
611 | 611 | ]; |
612 | 612 | for ($i = $total - 2; $i <= $total; ++$i) { |
613 | - $output[] = [ |
|
613 | + $output[] = [ |
|
614 | 614 | $i, |
615 | 615 | [ |
616 | 616 | 'is' => 'cs-button', |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | } |
623 | 623 | } elseif ($page >= $total - 5) { |
624 | 624 | for ($i = 1; $i <= 3; ++$i) { |
625 | - $output[] = [ |
|
625 | + $output[] = [ |
|
626 | 626 | $i, |
627 | 627 | [ |
628 | 628 | 'is' => 'cs-button', |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | ] |
633 | 633 | ]; |
634 | 634 | } |
635 | - $output[] = [ |
|
635 | + $output[] = [ |
|
636 | 636 | '...', |
637 | 637 | [ |
638 | 638 | 'is' => 'cs-button', |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | ] |
642 | 642 | ]; |
643 | 643 | for ($i = $total - 6; $i <= $total; ++$i) { |
644 | - $output[] = [ |
|
644 | + $output[] = [ |
|
645 | 645 | $i, |
646 | 646 | [ |
647 | 647 | 'is' => 'cs-button', |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | } |
655 | 655 | } else { |
656 | 656 | for ($i = 1; $i <= 2; ++$i) { |
657 | - $output[] = [ |
|
657 | + $output[] = [ |
|
658 | 658 | $i, |
659 | 659 | [ |
660 | 660 | 'is' => 'cs-button', |
@@ -664,7 +664,7 @@ discard block |
||
664 | 664 | ] |
665 | 665 | ]; |
666 | 666 | } |
667 | - $output[] = [ |
|
667 | + $output[] = [ |
|
668 | 668 | '...', |
669 | 669 | [ |
670 | 670 | 'is' => 'cs-button', |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | ] |
674 | 674 | ]; |
675 | 675 | for ($i = $page - 2; $i <= $page + 2; ++$i) { |
676 | - $output[] = [ |
|
676 | + $output[] = [ |
|
677 | 677 | $i, |
678 | 678 | [ |
679 | 679 | 'is' => 'cs-button', |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | ] |
685 | 685 | ]; |
686 | 686 | } |
687 | - $output[] = [ |
|
687 | + $output[] = [ |
|
688 | 688 | '...', |
689 | 689 | [ |
690 | 690 | 'is' => 'cs-button', |
@@ -693,7 +693,7 @@ discard block |
||
693 | 693 | ] |
694 | 694 | ]; |
695 | 695 | for ($i = $total - 1; $i <= $total; ++$i) { |
696 | - $output[] = [ |
|
696 | + $output[] = [ |
|
697 | 697 | $i, |
698 | 698 | [ |
699 | 699 | 'is' => 'cs-button', |
@@ -6,7 +6,7 @@ |
||
6 | 6 | * @license MIT License, see license.txt |
7 | 7 | */ |
8 | 8 | namespace cs; |
9 | -require __DIR__.'/loader_base.php'; //Inclusion of loader base |
|
9 | +require __DIR__.'/loader_base.php'; //Inclusion of loader base |
|
10 | 10 | require __DIR__.'/functions_global.php'; //Inclusion of functions that work with global state |
11 | 11 | /** |
12 | 12 | * Wrapper around default `$_SERVER` superglobal |
@@ -1,20 +1,20 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package CleverStyle CMS |
|
4 | - * @author Nazar Mokrynskyi <[email protected]> |
|
5 | - * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
6 | - * @license MIT License, see license.txt |
|
7 | - */ |
|
3 | + * @package CleverStyle CMS |
|
4 | + * @author Nazar Mokrynskyi <[email protected]> |
|
5 | + * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
6 | + * @license MIT License, see license.txt |
|
7 | + */ |
|
8 | 8 | namespace cs; |
9 | 9 | require __DIR__.'/loader_base.php'; //Inclusion of loader base |
10 | 10 | require __DIR__.'/functions_global.php'; //Inclusion of functions that work with global state |
11 | 11 | /** |
12 | - * Wrapper around default `$_SERVER` superglobal |
|
13 | - */ |
|
12 | + * Wrapper around default `$_SERVER` superglobal |
|
13 | + */ |
|
14 | 14 | $_SERVER = new _SERVER($_SERVER); |
15 | 15 | /** |
16 | - * Including of custom files |
|
17 | - */ |
|
16 | + * Including of custom files |
|
17 | + */ |
|
18 | 18 | foreach (glob(CUSTOM.'/*.php') ?: [] as $custom) { |
19 | 19 | include $custom; |
20 | 20 | } |
@@ -5,9 +5,9 @@ |
||
5 | 5 | * @copyright Copyright (c) 2011-2015, Nazar Mokrynskyi |
6 | 6 | * @license MIT License, see license.txt |
7 | 7 | */ |
8 | -require DIR.'/core/thirdparty/upf.php'; //Inclusion of Useful PHP Functions |
|
8 | +require DIR.'/core/thirdparty/upf.php'; //Inclusion of Useful PHP Functions |
|
9 | 9 | _require_once(DIR.'/vendor/autoload.php', false); //Inclusion of composer's autoloader.php with user's dependencies |
10 | -require DIR.'/core/functions.php'; //Inclusion of general system functions and system autoloader |
|
10 | +require DIR.'/core/functions.php'; //Inclusion of general system functions and system autoloader |
|
11 | 11 | |
12 | 12 | error_reporting(E_ALL); |
13 | 13 |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | )", |
59 | 59 | $prepared_arguments |
60 | 60 | ); |
61 | - $id = $insert_id !== false ? $insert_id : $this->db_prime()->id(); |
|
61 | + $id = $insert_id !== false ? $insert_id : $this->db_prime()->id(); |
|
62 | 62 | /** |
63 | 63 | * Id might be 0 if insertion failed or if we insert duplicate entry (which is fine since we use 'INSERT IGNORE' |
64 | 64 | */ |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | } |
156 | 156 | return $id; |
157 | 157 | } |
158 | - $columns = array_filter( |
|
158 | + $columns = array_filter( |
|
159 | 159 | $data_model, |
160 | 160 | function ($column) { |
161 | 161 | return !is_array($column) || !isset($column['data_model']); |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $id |
224 | 224 | ] |
225 | 225 | ) ?: []; |
226 | - $language_field = isset($model['language_field']) ? $model['language_field'] : null; |
|
226 | + $language_field = isset($model['language_field']) ? $model['language_field'] : null; |
|
227 | 227 | /** |
228 | 228 | * If no rows found for current language - find another language that should contain some rows |
229 | 229 | */ |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | $data_before = $this->read_internal($table, $data_model, $id); |
295 | 295 | } |
296 | 296 | list($prepared_arguments, $joined_tables) = self::crud_arguments_preparation(array_slice($data_model, 1), $prepared_arguments, $id); |
297 | - $columns = implode( |
|
297 | + $columns = implode( |
|
298 | 298 | ',', |
299 | 299 | array_map( |
300 | 300 | function ($column) { |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $first_column = array_keys($data_model)[0]; |
166 | 166 | $data = $this->db()->qf( |
167 | 167 | [ |
168 | - "SELECT $columns |
|
168 | + "select $columns |
|
169 | 169 | FROM `$table` |
170 | 170 | WHERE `$first_column` = '%s' |
171 | 171 | LIMIT 1", |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $fields = '`'.implode('`,`', array_keys($model['data_model'])).'`'; |
216 | 216 | $rows = $this->db_prime()->qfa( |
217 | 217 | [ |
218 | - "SELECT $fields |
|
218 | + "select $fields |
|
219 | 219 | FROM `{$this->table}_$table` |
220 | 220 | WHERE |
221 | 221 | `$id_field` = '%s' |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package CleverStyle CMS |
|
4 | - * @author Nazar Mokrynskyi <[email protected]> |
|
5 | - * @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi |
|
6 | - * @license MIT License, see license.txt |
|
7 | - */ |
|
3 | + * @package CleverStyle CMS |
|
4 | + * @author Nazar Mokrynskyi <[email protected]> |
|
5 | + * @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi |
|
6 | + * @license MIT License, see license.txt |
|
7 | + */ |
|
8 | 8 | namespace cs\CRUD; |
9 | 9 | use |
10 | 10 | cs\Event, |
@@ -370,7 +370,7 @@ |
||
370 | 370 | * @return array |
371 | 371 | */ |
372 | 372 | protected function get_includes_prepare ($dependencies, $separator) { |
373 | - $includes = [ |
|
373 | + $includes = [ |
|
374 | 374 | 'css' => [], |
375 | 375 | 'js' => [], |
376 | 376 | 'html' => [] |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package CleverStyle CMS |
|
4 | - * @author Nazar Mokrynskyi <[email protected]> |
|
5 | - * @copyright Copyright (c) 2014-2016, Nazar Mokrynskyi |
|
6 | - * @license MIT License, see license.txt |
|
7 | - */ |
|
3 | + * @package CleverStyle CMS |
|
4 | + * @author Nazar Mokrynskyi <[email protected]> |
|
5 | + * @copyright Copyright (c) 2014-2016, Nazar Mokrynskyi |
|
6 | + * @license MIT License, see license.txt |
|
7 | + */ |
|
8 | 8 | namespace cs\Page; |
9 | 9 | use |
10 | 10 | cs\Core, |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | 'aliases' => &$aliases, |
61 | 61 | 'final_class' => &$next_alias |
62 | 62 | ]; |
63 | - $classes = glob(CUSTOM.'/classes/'.substr($class, 2).'_*.php'); |
|
63 | + $classes = glob(CUSTOM.'/classes/'.substr($class, 2).'_*.php'); |
|
64 | 64 | foreach ($classes as $custom_class) { |
65 | 65 | // Path to file with customized class |
66 | 66 | $custom_class = str_replace(CUSTOM.'/classes/', '', substr($custom_class, 0, -4)); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | 'alias' => "cs\\custom\\$_custom_class", |
74 | 74 | 'path' => $custom_class |
75 | 75 | ]; |
76 | - $next_alias = "cs\\custom\\$custom_class"; |
|
76 | + $next_alias = "cs\\custom\\$custom_class"; |
|
77 | 77 | } |
78 | 78 | if (!is_dir(CACHE.'/classes')) { |
79 | 79 | @mkdir(CACHE.'/classes', 0770, true); |
@@ -439,7 +439,7 @@ |
||
439 | 439 | if (!$user || !$item || $user == User::GUEST_ID) { |
440 | 440 | return false; |
441 | 441 | } |
442 | - $item = implode( |
|
442 | + $item = implode( |
|
443 | 443 | ',', |
444 | 444 | $this->db_prime()->s((array)$item) |
445 | 445 | ); |
@@ -119,7 +119,7 @@ |
||
119 | 119 | */ |
120 | 120 | $new_items = '`'.implode('`, `', $new_items).'`'; |
121 | 121 | $res = $this->db()->qf( |
122 | - "SELECT $new_items |
|
122 | + "select $new_items |
|
123 | 123 | FROM `[prefix]users` |
124 | 124 | WHERE `id` = '$user' |
125 | 125 | LIMIT 1" |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package CleverStyle CMS |
|
4 | - * @author Nazar Mokrynskyi <[email protected]> |
|
5 | - * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
6 | - * @license MIT License, see license.txt |
|
7 | - */ |
|
3 | + * @package CleverStyle CMS |
|
4 | + * @author Nazar Mokrynskyi <[email protected]> |
|
5 | + * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
6 | + * @license MIT License, see license.txt |
|
7 | + */ |
|
8 | 8 | namespace cs\User; |
9 | 9 | use |
10 | 10 | cs\Config, |