@@ -10,8 +10,8 @@ |
||
| 10 | 10 | namespace cs\plugins\SimpleImage; |
| 11 | 11 | require_once __DIR__.'/abeautifulsite/SimpleImage.php'; |
| 12 | 12 | /** |
| 13 | - * Class SimpleImage |
|
| 14 | - * This class makes image manipulation in PHP as simple as possible. |
|
| 15 | - * @package SimpleImage |
|
| 16 | - */ |
|
| 13 | + * Class SimpleImage |
|
| 14 | + * This class makes image manipulation in PHP as simple as possible. |
|
| 15 | + * @package SimpleImage |
|
| 16 | + */ |
|
| 17 | 17 | class SimpleImage extends \abeautifulsite\SimpleImage {} |
@@ -5,5 +5,5 @@ |
||
| 5 | 5 | * @copyright Copyright (c) 2011-2015, Nazar Mokrynskyi |
| 6 | 6 | * @license MIT License, see license.txt |
| 7 | 7 | */ |
| 8 | -define('DEBUG', false); |
|
| 9 | -define('XHTML_TAGS_STYLE', false); |
|
| 8 | +define('DEBUG', false); |
|
| 9 | +define('XHTML_TAGS_STYLE', false); |
|
@@ -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; |
| 9 | 9 | use |
| 10 | 10 | h, |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | 'title' => 'html', |
| 38 | 38 | 'description' => 'html' |
| 39 | 39 | ]; |
| 40 | - protected $table = '[prefix]groups'; |
|
| 40 | + protected $table = '[prefix]groups'; |
|
| 41 | 41 | /** |
| 42 | 42 | * @var Prefix |
| 43 | 43 | */ |
@@ -1,32 +1,32 @@ |
||
| 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 | /** |
| 9 | - * Provides next events:<br> |
|
| 10 | - * |
|
| 11 | - * System/User/Group/add |
|
| 12 | - * ['id' => <i>group_id</i>] |
|
| 13 | - * |
|
| 14 | - * System/User/Group/del/before |
|
| 15 | - * ['id' => <i>group_id</i>] |
|
| 16 | - * |
|
| 17 | - * System/User/Group/del/after |
|
| 18 | - * ['id' => <i>group_id</i>] |
|
| 19 | - * |
|
| 20 | - */ |
|
| 9 | + * Provides next events:<br> |
|
| 10 | + * |
|
| 11 | + * System/User/Group/add |
|
| 12 | + * ['id' => <i>group_id</i>] |
|
| 13 | + * |
|
| 14 | + * System/User/Group/del/before |
|
| 15 | + * ['id' => <i>group_id</i>] |
|
| 16 | + * |
|
| 17 | + * System/User/Group/del/after |
|
| 18 | + * ['id' => <i>group_id</i>] |
|
| 19 | + * |
|
| 20 | + */ |
|
| 21 | 21 | namespace cs; |
| 22 | 22 | use |
| 23 | 23 | cs\Cache\Prefix, |
| 24 | 24 | cs\Permission\Any; |
| 25 | 25 | /** |
| 26 | - * Class for groups manipulating |
|
| 27 | - * |
|
| 28 | - * @method static Group instance($check = false) |
|
| 29 | - */ |
|
| 26 | + * Class for groups manipulating |
|
| 27 | + * |
|
| 28 | + * @method static Group instance($check = false) |
|
| 29 | + */ |
|
| 30 | 30 | class Group { |
| 31 | 31 | use |
| 32 | 32 | CRUD_helpers, |
@@ -281,7 +281,7 @@ |
||
| 281 | 281 | $module_data['active'] == Config\Module_Properties::ENABLED; |
| 282 | 282 | } |
| 283 | 283 | ); |
| 284 | - $L = Language::instance(); |
|
| 284 | + $L = Language::instance(); |
|
| 285 | 285 | foreach ($modules as $module => &$localized_name) { |
| 286 | 286 | $localized_name = path($L->$module); |
| 287 | 287 | } |
@@ -1,18 +1,18 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package CleverStyle CMS |
|
| 4 | - * @author Nazar Mokrynskyi <[email protected]> |
|
| 5 | - * @copyright Copyright (c) 2015-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) 2015-2016, Nazar Mokrynskyi |
|
| 6 | + * @license MIT License, see license.txt |
|
| 7 | + */ |
|
| 8 | 8 | namespace cs; |
| 9 | 9 | /** |
| 10 | - * Provides next events: |
|
| 11 | - * System/Route/routing_replace |
|
| 12 | - * ['rc' => &$rc] //Reference to string with current route, this string can be changed |
|
| 13 | - * |
|
| 14 | - * @method static Route instance($check = false) |
|
| 15 | - */ |
|
| 10 | + * Provides next events: |
|
| 11 | + * System/Route/routing_replace |
|
| 12 | + * ['rc' => &$rc] //Reference to string with current route, this string can be changed |
|
| 13 | + * |
|
| 14 | + * @method static Route instance($check = false) |
|
| 15 | + */ |
|
| 16 | 16 | class Route { |
| 17 | 17 | use |
| 18 | 18 | Singleton; |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | * If match was not found - mirror is not allowed! |
| 87 | 87 | */ |
| 88 | 88 | if ($this->mirror_index === -1) { |
| 89 | - throw new ExitException("Mirror $_SERVER->host not allowed", 400); |
|
| 89 | + throw new ExitException("mirror $_SERVER->host not allowed", 400); |
|
| 90 | 90 | } |
| 91 | 91 | /** |
| 92 | 92 | * Remove trailing slashes |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | 'ip' => 'text', |
| 75 | 75 | 'data' => 'json' |
| 76 | 76 | ]; |
| 77 | - protected $table = '[prefix]sessions'; |
|
| 77 | + protected $table = '[prefix]sessions'; |
|
| 78 | 78 | protected function construct () { |
| 79 | 79 | $this->cache = new Prefix('sessions'); |
| 80 | 80 | $this->users_cache = new Prefix('users'); |
@@ -1,32 +1,32 @@ |
||
| 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 | - * Provides next events: |
|
| 10 | - * |
|
| 11 | - * System/Session/init/before |
|
| 12 | - * |
|
| 13 | - * System/Session/init/after |
|
| 14 | - * |
|
| 15 | - * System/Session/load |
|
| 16 | - * ['session_data' => $session_data] |
|
| 17 | - * |
|
| 18 | - * System/Session/add |
|
| 19 | - * ['session_data' => $session_data] |
|
| 20 | - * |
|
| 21 | - * System/Session/del/before |
|
| 22 | - * ['id' => $session_id] |
|
| 23 | - * |
|
| 24 | - * System/Session/del/after |
|
| 25 | - * ['id' => $session_id] |
|
| 26 | - * |
|
| 27 | - * System/Session/del_all |
|
| 28 | - * ['id' => $user_id] |
|
| 29 | - */ |
|
| 9 | + * Provides next events: |
|
| 10 | + * |
|
| 11 | + * System/Session/init/before |
|
| 12 | + * |
|
| 13 | + * System/Session/init/after |
|
| 14 | + * |
|
| 15 | + * System/Session/load |
|
| 16 | + * ['session_data' => $session_data] |
|
| 17 | + * |
|
| 18 | + * System/Session/add |
|
| 19 | + * ['session_data' => $session_data] |
|
| 20 | + * |
|
| 21 | + * System/Session/del/before |
|
| 22 | + * ['id' => $session_id] |
|
| 23 | + * |
|
| 24 | + * System/Session/del/after |
|
| 25 | + * ['id' => $session_id] |
|
| 26 | + * |
|
| 27 | + * System/Session/del_all |
|
| 28 | + * ['id' => $user_id] |
|
| 29 | + */ |
|
| 30 | 30 | namespace cs; |
| 31 | 31 | use |
| 32 | 32 | cs\Cache\Prefix; |
@@ -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 |
@@ -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,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) { |
@@ -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 |