@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package CleverStyle CMS |
|
4 | - * @author Nazar Mokrynskyi <[email protected]> |
|
5 | - * @copyright Copyright (c) 2015, Nazar Mokrynskyi |
|
6 | - * @license MIT License, see license.txt |
|
7 | - */ |
|
3 | + * @package CleverStyle CMS |
|
4 | + * @author Nazar Mokrynskyi <[email protected]> |
|
5 | + * @copyright Copyright (c) 2015, Nazar Mokrynskyi |
|
6 | + * @license MIT License, see license.txt |
|
7 | + */ |
|
8 | 8 | namespace cs; |
9 | 9 | use |
10 | 10 | ArrayAccess, |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package CleverStyle CMS |
|
4 | - * @author Nazar Mokrynskyi <[email protected]> |
|
5 | - * @copyright Copyright (c) 2011-2015, 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-2015, Nazar Mokrynskyi |
|
6 | + * @license MIT License, see license.txt |
|
7 | + */ |
|
8 | 8 | /** |
9 | - * Class for HTML code rendering in accordance with the standards of HTML5, and with useful syntax extensions for simpler usage |
|
10 | - */ |
|
9 | + * Class for HTML code rendering in accordance with the standards of HTML5, and with useful syntax extensions for simpler usage |
|
10 | + */ |
|
11 | 11 | use cs\h\Base; |
12 | 12 | class h extends Base {} |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package CleverStyle CMS |
|
4 | - * @author Nazar Mokrynskyi <[email protected]> |
|
5 | - * @copyright Copyright (c) 2011-2015, 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-2015, Nazar Mokrynskyi |
|
6 | + * @license MIT License, see license.txt |
|
7 | + */ |
|
8 | 8 | namespace cs\h; |
9 | 9 | use |
10 | 10 | nazarpc\BananaHTML, |
@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | cs\Page, |
14 | 14 | cs\Session; |
15 | 15 | /** |
16 | - * Class for HTML code rendering in accordance with the standards of HTML5, and with useful syntax extensions for simpler usage |
|
17 | - */ |
|
16 | + * Class for HTML code rendering in accordance with the standards of HTML5, and with useful syntax extensions for simpler usage |
|
17 | + */ |
|
18 | 18 | abstract class Base extends BananaHTML { |
19 | 19 | /** |
20 | 20 | * Special processing for URLs with hash |
@@ -1,14 +1,14 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package CleverStyle CMS |
|
4 | - * @author Nazar Mokrynskyi <[email protected]> |
|
5 | - * @copyright Copyright (c) 2011-2015, 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-2015, Nazar Mokrynskyi |
|
6 | + * @license MIT License, see license.txt |
|
7 | + */ |
|
8 | 8 | namespace cs\Cache; |
9 | 9 | /** |
10 | - * It works like black hole - i.e. does nothing. May be suitable for debugging purposes, when cache saving should be disabled, but debug mode is disabled too |
|
11 | - */ |
|
10 | + * It works like black hole - i.e. does nothing. May be suitable for debugging purposes, when cache saving should be disabled, but debug mode is disabled too |
|
11 | + */ |
|
12 | 12 | class BlackHole extends _Abstract { |
13 | 13 | /** |
14 | 14 | * @inheritdoc |
@@ -1,14 +1,14 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package CleverStyle CMS |
|
4 | - * @author Nazar Mokrynskyi <[email protected]> |
|
5 | - * @copyright Copyright (c) 2011-2015, 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-2015, 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 |
@@ -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,16 +1,16 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package CleverStyle CMS |
|
4 | - * @author Nazar Mokrynskyi <[email protected]> |
|
5 | - * @copyright Copyright (c) 2011-2015, 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-2015, Nazar Mokrynskyi |
|
6 | + * @license MIT License, see license.txt |
|
7 | + */ |
|
8 | 8 | namespace cs\Cache; |
9 | 9 | use cs\Core; |
10 | 10 | /** |
11 | - * Provides cache functionality based on Memcached. |
|
12 | - * Support optionally base configuration option Core::instance()->memcached_host and Core::instance()->memcached_port |
|
13 | - */ |
|
11 | + * Provides cache functionality based on Memcached. |
|
12 | + * Support optionally base configuration option Core::instance()->memcached_host and Core::instance()->memcached_port |
|
13 | + */ |
|
14 | 14 | class Memcached extends _Abstract { |
15 | 15 | /** |
16 | 16 | * @var \Memcached |
@@ -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-2015, 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-2015, 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) { |
@@ -28,21 +28,21 @@ discard block |
||
28 | 28 | if (isset($cache[$class])) { |
29 | 29 | return require_once $cache[$class]; |
30 | 30 | } |
31 | - $prepared_class_name = ltrim($class, '\\'); |
|
31 | + $prepared_class_name = ltrim($class, '\\'); |
|
32 | 32 | if (substr($prepared_class_name, 0, 3) == 'cs\\') { |
33 | - $prepared_class_name = substr($prepared_class_name, 3); |
|
33 | + $prepared_class_name = substr($prepared_class_name, 3); |
|
34 | 34 | } |
35 | - $prepared_class_name = explode('\\', $prepared_class_name); |
|
36 | - $namespace = count($prepared_class_name) > 1 ? implode('/', array_slice($prepared_class_name, 0, -1)) : ''; |
|
37 | - $class_name = array_pop($prepared_class_name); |
|
35 | + $prepared_class_name = explode('\\', $prepared_class_name); |
|
36 | + $namespace = count($prepared_class_name) > 1 ? implode('/', array_slice($prepared_class_name, 0, -1)) : ''; |
|
37 | + $class_name = array_pop($prepared_class_name); |
|
38 | 38 | /** |
39 | 39 | * Try to load classes from different places. If not found in one place - try in another. |
40 | 40 | */ |
41 | 41 | if ( |
42 | - _require_once($file = DIR."/core/classes/$namespace/$class_name.php", false) || //Core classes |
|
43 | - _require_once($file = DIR."/core/thirdparty/$namespace/$class_name.php", false) || //Third party classes |
|
44 | - _require_once($file = DIR."/core/traits/$namespace/$class_name.php", false) || //Core traits |
|
45 | - _require_once($file = ENGINES."/$namespace/$class_name.php", false) || //Core engines |
|
42 | + _require_once($file = DIR."/core/classes/$namespace/$class_name.php", false) || //Core classes |
|
43 | + _require_once($file = DIR."/core/thirdparty/$namespace/$class_name.php", false) || //Third party classes |
|
44 | + _require_once($file = DIR."/core/traits/$namespace/$class_name.php", false) || //Core traits |
|
45 | + _require_once($file = ENGINES."/$namespace/$class_name.php", false) || //Core engines |
|
46 | 46 | _require_once($file = MODULES."/../$namespace/$class_name.php", false) //Classes in modules and plugins |
47 | 47 | ) { |
48 | 48 | $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'); |
@@ -253,12 +253,12 @@ discard block |
||
253 | 253 | if (!is_numeric($size)) { |
254 | 254 | return $size; |
255 | 255 | } |
256 | - $L = Language::instance(); |
|
257 | - $unit = ''; |
|
258 | - if($size >= 1099511627776) { |
|
256 | + $L = Language::instance(); |
|
257 | + $unit = ''; |
|
258 | + if ($size >= 1099511627776) { |
|
259 | 259 | $size /= 1099511627776; |
260 | 260 | $unit = " $L->TB"; |
261 | - } elseif($size >= 1073741824) { |
|
261 | + } elseif ($size >= 1073741824) { |
|
262 | 262 | $size /= 1073741824; |
263 | 263 | $unit = " $L->GB"; |
264 | 264 | } elseif ($size >= 1048576) { |
@@ -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 | } |
@@ -349,7 +349,7 @@ discard block |
||
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'; |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | ] |
461 | 461 | ); |
462 | 462 | }; |
463 | - $render_page_item = function ($i) use ($page, $url, $head_links, $render_head_links) { |
|
463 | + $render_page_item = function ($i) use ($page, $url, $head_links, $render_head_links) { |
|
464 | 464 | if ($head_links) { |
465 | 465 | $render_head_links($i); |
466 | 466 | } |
@@ -553,14 +553,14 @@ discard block |
||
553 | 553 | } |
554 | 554 | $output = []; |
555 | 555 | if (!is_callable($url)) { |
556 | - $original_url = $url; |
|
556 | + $original_url = $url; |
|
557 | 557 | $url = function ($page) use ($original_url) { |
558 | 558 | return sprintf($original_url, $page); |
559 | 559 | }; |
560 | 560 | } |
561 | 561 | if ($total <= 11) { |
562 | 562 | for ($i = 1; $i <= $total; ++$i) { |
563 | - $output[] = [ |
|
563 | + $output[] = [ |
|
564 | 564 | $i, |
565 | 565 | [ |
566 | 566 | 'is' => 'cs-button', |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | } else { |
575 | 575 | if ($page <= 6) { |
576 | 576 | for ($i = 1; $i <= 7; ++$i) { |
577 | - $output[] = [ |
|
577 | + $output[] = [ |
|
578 | 578 | $i, |
579 | 579 | [ |
580 | 580 | 'is' => 'cs-button', |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | ] |
586 | 586 | ]; |
587 | 587 | } |
588 | - $output[] = [ |
|
588 | + $output[] = [ |
|
589 | 589 | '...', |
590 | 590 | [ |
591 | 591 | 'is' => 'cs-button', |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | ] |
595 | 595 | ]; |
596 | 596 | for ($i = $total - 2; $i <= $total; ++$i) { |
597 | - $output[] = [ |
|
597 | + $output[] = [ |
|
598 | 598 | $i, |
599 | 599 | [ |
600 | 600 | 'is' => 'cs-button', |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | } |
607 | 607 | } elseif ($page >= $total - 5) { |
608 | 608 | for ($i = 1; $i <= 3; ++$i) { |
609 | - $output[] = [ |
|
609 | + $output[] = [ |
|
610 | 610 | $i, |
611 | 611 | [ |
612 | 612 | 'is' => 'cs-button', |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | ] |
617 | 617 | ]; |
618 | 618 | } |
619 | - $output[] = [ |
|
619 | + $output[] = [ |
|
620 | 620 | '...', |
621 | 621 | [ |
622 | 622 | 'is' => 'cs-button', |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | ] |
626 | 626 | ]; |
627 | 627 | for ($i = $total - 6; $i <= $total; ++$i) { |
628 | - $output[] = [ |
|
628 | + $output[] = [ |
|
629 | 629 | $i, |
630 | 630 | [ |
631 | 631 | 'is' => 'cs-button', |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | } |
639 | 639 | } else { |
640 | 640 | for ($i = 1; $i <= 2; ++$i) { |
641 | - $output[] = [ |
|
641 | + $output[] = [ |
|
642 | 642 | $i, |
643 | 643 | [ |
644 | 644 | 'is' => 'cs-button', |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | ] |
649 | 649 | ]; |
650 | 650 | } |
651 | - $output[] = [ |
|
651 | + $output[] = [ |
|
652 | 652 | '...', |
653 | 653 | [ |
654 | 654 | 'is' => 'cs-button', |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | ] |
658 | 658 | ]; |
659 | 659 | for ($i = $page - 2; $i <= $page + 2; ++$i) { |
660 | - $output[] = [ |
|
660 | + $output[] = [ |
|
661 | 661 | $i, |
662 | 662 | [ |
663 | 663 | 'is' => 'cs-button', |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | ] |
669 | 669 | ]; |
670 | 670 | } |
671 | - $output[] = [ |
|
671 | + $output[] = [ |
|
672 | 672 | '...', |
673 | 673 | [ |
674 | 674 | 'is' => 'cs-button', |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | ] |
678 | 678 | ]; |
679 | 679 | for ($i = $total - 1; $i <= $total; ++$i) { |
680 | - $output[] = [ |
|
680 | + $output[] = [ |
|
681 | 681 | $i, |
682 | 682 | [ |
683 | 683 | 'is' => 'cs-button', |
@@ -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,30 +1,30 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package CleverStyle CMS |
|
4 | - * @author Nazar Mokrynskyi <[email protected]> |
|
5 | - * @copyright Copyright (c) 2015, Nazar Mokrynskyi |
|
6 | - * @license MIT License, see license.txt |
|
7 | - */ |
|
3 | + * @package CleverStyle CMS |
|
4 | + * @author Nazar Mokrynskyi <[email protected]> |
|
5 | + * @copyright Copyright (c) 2015, 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 | - * |
|
12 | - * This particular file contains functions that work with global state (cookies, headers, status codes, etc.) |
|
13 | - */ |
|
9 | + * Base system functions, do not edit this file, or make it very carefully |
|
10 | + * otherwise system workability may be broken |
|
11 | + * |
|
12 | + * This particular file contains functions that work with global state (cookies, headers, status codes, etc.) |
|
13 | + */ |
|
14 | 14 | use |
15 | 15 | cs\Config, |
16 | 16 | cs\Route; |
17 | 17 | /** |
18 | - * Function for setting cookies on all mirrors and taking into account cookies prefix. Parameters like in system function, but $path, $domain and $secure |
|
19 | - * are skipped, they are detected automatically, and $api parameter added in the end. |
|
20 | - * |
|
21 | - * @param string $name |
|
22 | - * @param string $value |
|
23 | - * @param int $expire |
|
24 | - * @param bool $httponly |
|
25 | - * |
|
26 | - * @return bool |
|
27 | - */ |
|
18 | + * Function for setting cookies on all mirrors and taking into account cookies prefix. Parameters like in system function, but $path, $domain and $secure |
|
19 | + * are skipped, they are detected automatically, and $api parameter added in the end. |
|
20 | + * |
|
21 | + * @param string $name |
|
22 | + * @param string $value |
|
23 | + * @param int $expire |
|
24 | + * @param bool $httponly |
|
25 | + * |
|
26 | + * @return bool |
|
27 | + */ |
|
28 | 28 | function _setcookie ($name, $value, $expire = 0, $httponly = false) { |
29 | 29 | static $domain, $prefix, $secure; |
30 | 30 | if (!isset($prefix)) { |
@@ -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 |