@@ -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\Config; |
| 9 | 9 | use |
| 10 | 10 | cs\Config; |
| 11 | 11 | /** |
| 12 | - * Class for getting of db and storage configuration of module |
|
| 13 | - */ |
|
| 12 | + * Class for getting of db and storage configuration of module |
|
| 13 | + */ |
|
| 14 | 14 | class Module_Properties { |
| 15 | 15 | const ENABLED = 1; |
| 16 | 16 | const DISABLED = 0; |
@@ -1,18 +1,18 @@ |
||
| 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; |
| 9 | 9 | use h; |
| 10 | 10 | /** |
| 11 | - * Core class. |
|
| 12 | - * Provides loading of base system configuration |
|
| 13 | - * |
|
| 14 | - * @method static Core instance($check = false) |
|
| 15 | - */ |
|
| 11 | + * Core class. |
|
| 12 | + * Provides loading of base system configuration |
|
| 13 | + * |
|
| 14 | + * @method static Core instance($check = false) |
|
| 15 | + */ |
|
| 16 | 16 | class Core { |
| 17 | 17 | use Singleton; |
| 18 | 18 | /** |
@@ -1,18 +1,18 @@ |
||
| 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 | /** |
| 10 | - * Event class |
|
| 11 | - * |
|
| 12 | - * Provides events subscribing and dispatching |
|
| 13 | - * |
|
| 14 | - * @method static Event instance($check = false) |
|
| 15 | - */ |
|
| 10 | + * Event class |
|
| 11 | + * |
|
| 12 | + * Provides events subscribing and dispatching |
|
| 13 | + * |
|
| 14 | + * @method static Event instance($check = false) |
|
| 15 | + */ |
|
| 16 | 16 | class Event { |
| 17 | 17 | use Singleton; |
| 18 | 18 | /** |
@@ -1,25 +1,25 @@ |
||
| 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; |
| 9 | 9 | use |
| 10 | 10 | ArrayAccess, |
| 11 | 11 | SimpleXMLElement; |
| 12 | 12 | /** |
| 13 | - * False_class is used for chained calling, when some method may return false. |
|
| 14 | - * |
|
| 15 | - * Usage of class is simple, just return his instance instead of real boolean <i>false</i>. |
|
| 16 | - * On every call of any method or getting of any property or getting any element of array instance of the this class will be returned. |
|
| 17 | - * Access to anything of this class instance will be casted to boolean <i>false</i> |
|
| 18 | - * |
|
| 19 | - * Inherits SimpleXMLElement in order to be casted from object to boolean as <i>false</i> |
|
| 20 | - * |
|
| 21 | - * @property string $error |
|
| 22 | - */ |
|
| 13 | + * False_class is used for chained calling, when some method may return false. |
|
| 14 | + * |
|
| 15 | + * Usage of class is simple, just return his instance instead of real boolean <i>false</i>. |
|
| 16 | + * On every call of any method or getting of any property or getting any element of array instance of the this class will be returned. |
|
| 17 | + * Access to anything of this class instance will be casted to boolean <i>false</i> |
|
| 18 | + * |
|
| 19 | + * Inherits SimpleXMLElement in order to be casted from object to boolean as <i>false</i> |
|
| 20 | + * |
|
| 21 | + * @property string $error |
|
| 22 | + */ |
|
| 23 | 23 | class False_class extends SimpleXMLElement implements ArrayAccess { |
| 24 | 24 | /** |
| 25 | 25 | * Use this method to obtain correct instance |
@@ -1,32 +1,32 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package CleverStyle CMS |
|
| 4 | - * @author Nazar Mokrynskyi <[email protected]> |
|
| 5 | - * @copyright Copyright (c) 2013-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) 2013-2015, 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, |
@@ -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) 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; |
| 9 | 9 | use |
| 10 | 10 | h; |
| 11 | 11 | /** |
| 12 | - * Provides next events: |
|
| 13 | - * System/Index/block_render |
|
| 14 | - * [ |
|
| 15 | - * 'index' => $index, //Block index |
|
| 16 | - * 'blocks_array' => &$blocks_array //Reference to array in form ['top' => '', 'left' => '', 'right' => '', 'bottom' => ''] |
|
| 17 | - * ] |
|
| 18 | - * |
|
| 19 | - * System/Index/construct |
|
| 20 | - * |
|
| 21 | - * System/Index/preload |
|
| 22 | - * |
|
| 23 | - * System/Index/postload |
|
| 24 | - * |
|
| 25 | - * @method static Index instance($check = false) |
|
| 26 | - * |
|
| 27 | - * @property string $action Form action |
|
| 28 | - * @property string[] $controller_path Path that will be used by controller to render page |
|
| 29 | - */ |
|
| 12 | + * Provides next events: |
|
| 13 | + * System/Index/block_render |
|
| 14 | + * [ |
|
| 15 | + * 'index' => $index, //Block index |
|
| 16 | + * 'blocks_array' => &$blocks_array //Reference to array in form ['top' => '', 'left' => '', 'right' => '', 'bottom' => ''] |
|
| 17 | + * ] |
|
| 18 | + * |
|
| 19 | + * System/Index/construct |
|
| 20 | + * |
|
| 21 | + * System/Index/preload |
|
| 22 | + * |
|
| 23 | + * System/Index/postload |
|
| 24 | + * |
|
| 25 | + * @method static Index instance($check = false) |
|
| 26 | + * |
|
| 27 | + * @property string $action Form action |
|
| 28 | + * @property string[] $controller_path Path that will be used by controller to render page |
|
| 29 | + */ |
|
| 30 | 30 | class Index { |
| 31 | 31 | use |
| 32 | 32 | Singleton, |
@@ -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\Language; |
| 9 | 9 | use |
| 10 | 10 | cs\Language; |
| 11 | 11 | /** |
| 12 | - * Class for simplified work with languages, when using common prefix |
|
| 13 | - */ |
|
| 12 | + * Class for simplified work with languages, when using common prefix |
|
| 13 | + */ |
|
| 14 | 14 | class Prefix { |
| 15 | 15 | /** |
| 16 | 16 | * @var string |
@@ -1,21 +1,21 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package CleverStyle CMS |
|
| 4 | - * @author Nazar Mokrynskyi <[email protected]> |
|
| 5 | - * @copyright Copyright (c) 2014-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) 2014-2015, Nazar Mokrynskyi |
|
| 6 | + * @license MIT License, see license.txt |
|
| 7 | + */ |
|
| 8 | 8 | namespace cs; |
| 9 | 9 | use |
| 10 | 10 | h; |
| 11 | 11 | /** |
| 12 | - * Menu class is used in administration for generating second and third level of menu |
|
| 13 | - * |
|
| 14 | - * Provides next events:<br> |
|
| 15 | - * admin/System/Menu |
|
| 16 | - * |
|
| 17 | - * @method static Menu instance($check = false) |
|
| 18 | - */ |
|
| 12 | + * Menu class is used in administration for generating second and third level of menu |
|
| 13 | + * |
|
| 14 | + * Provides next events:<br> |
|
| 15 | + * admin/System/Menu |
|
| 16 | + * |
|
| 17 | + * @method static Menu instance($check = false) |
|
| 18 | + */ |
|
| 19 | 19 | class Menu { |
| 20 | 20 | use |
| 21 | 21 | Singleton; |
@@ -1,10 +1,10 @@ |
||
| 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; |
| 9 | 9 | use |
| 10 | 10 | h, |
@@ -19,10 +19,10 @@ discard block |
||
| 19 | 19 | Singleton, |
| 20 | 20 | Includes; |
| 21 | 21 | public $Content; |
| 22 | - public $interface = true; |
|
| 23 | - public $pre_Html = ''; |
|
| 24 | - public $Html = ''; |
|
| 25 | - public $Description = ''; |
|
| 22 | + public $interface = true; |
|
| 23 | + public $pre_Html = ''; |
|
| 24 | + public $Html = ''; |
|
| 25 | + public $Description = ''; |
|
| 26 | 26 | /** |
| 27 | 27 | * @var string|string[] |
| 28 | 28 | */ |
@@ -30,9 +30,9 @@ discard block |
||
| 30 | 30 | public $Head = ''; |
| 31 | 31 | public $pre_Body = ''; |
| 32 | 32 | public $Left = ''; |
| 33 | - public $Top = ''; |
|
| 34 | - public $Right = ''; |
|
| 35 | - public $Bottom = ''; |
|
| 33 | + public $Top = ''; |
|
| 34 | + public $Right = ''; |
|
| 35 | + public $Bottom = ''; |
|
| 36 | 36 | public $post_Body = ''; |
| 37 | 37 | public $post_Html = ''; |
| 38 | 38 | /** |
@@ -50,13 +50,13 @@ discard block |
||
| 50 | 50 | 'Right' => 3, |
| 51 | 51 | 'post_Body' => 1 |
| 52 | 52 | ]; |
| 53 | - public $link = []; |
|
| 53 | + public $link = []; |
|
| 54 | 54 | public $Search = []; |
| 55 | 55 | public $Replace = []; |
| 56 | - public $canonical_url = false; |
|
| 56 | + public $canonical_url = false; |
|
| 57 | 57 | protected $theme; |
| 58 | - protected $error_showed = false; |
|
| 59 | - protected $finish_called_once = false; |
|
| 58 | + protected $error_showed = false; |
|
| 59 | + protected $finish_called_once = false; |
|
| 60 | 60 | /** |
| 61 | 61 | * Initialization: setting of title and theme according to specified parameters |
| 62 | 62 | * |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | function json ($add) { |
| 108 | 108 | _header('Content-Type: application/json; charset=utf-8', true); |
| 109 | 109 | interface_off(); |
| 110 | - $this->Content = _json_encode($add); |
|
| 110 | + $this->Content = _json_encode($add); |
|
| 111 | 111 | return $this; |
| 112 | 112 | } |
| 113 | 113 | /** |
@@ -120,9 +120,9 @@ discard block |
||
| 120 | 120 | * Theme is fixed for administration, and may vary for other pages |
| 121 | 121 | */ |
| 122 | 122 | if (admin_path()) { |
| 123 | - $this->theme = 'CleverStyle'; |
|
| 123 | + $this->theme = 'CleverStyle'; |
|
| 124 | 124 | } |
| 125 | - $theme_dir = THEMES."/$this->theme"; |
|
| 125 | + $theme_dir = THEMES."/$this->theme"; |
|
| 126 | 126 | _include("$theme_dir/prepare.php", false, false); |
| 127 | 127 | ob_start(); |
| 128 | 128 | /** |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | */ |
| 305 | 305 | function link ($data) { |
| 306 | 306 | if ($data !== false) { |
| 307 | - $this->link[] = [$data]; |
|
| 307 | + $this->link[] = [$data]; |
|
| 308 | 308 | } |
| 309 | 309 | return $this; |
| 310 | 310 | } |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | * @return Page |
| 349 | 349 | */ |
| 350 | 350 | function canonical_url ($url) { |
| 351 | - $this->canonical_url = $url; |
|
| 351 | + $this->canonical_url = $url; |
|
| 352 | 352 | return $this->link([ |
| 353 | 353 | 'href' => $this->canonical_url, |
| 354 | 354 | 'rel' => 'canonical' |
@@ -363,11 +363,11 @@ discard block |
||
| 363 | 363 | * @return Page |
| 364 | 364 | */ |
| 365 | 365 | function title ($title, $replace = false) { |
| 366 | - $title = htmlentities($title, ENT_COMPAT, 'utf-8'); |
|
| 366 | + $title = htmlentities($title, ENT_COMPAT, 'utf-8'); |
|
| 367 | 367 | if ($replace) { |
| 368 | - $this->Title = [$title]; |
|
| 368 | + $this->Title = [$title]; |
|
| 369 | 369 | } else { |
| 370 | - $this->Title[] = $title; |
|
| 370 | + $this->Title[] = $title; |
|
| 371 | 371 | } |
| 372 | 372 | return $this; |
| 373 | 373 | } |
@@ -431,21 +431,21 @@ discard block |
||
| 431 | 431 | if ($this->error_showed) { |
| 432 | 432 | return; |
| 433 | 433 | } |
| 434 | - $this->error_showed = true; |
|
| 434 | + $this->error_showed = true; |
|
| 435 | 435 | /** |
| 436 | 436 | * Hack for 403 after sign out in administration |
| 437 | 437 | */ |
| 438 | 438 | if ($error_code == 403 && !api_path() && _getcookie('sign_out')) { |
| 439 | 439 | _header('Location: /', true, 302); |
| 440 | - $this->Content = ''; |
|
| 440 | + $this->Content = ''; |
|
| 441 | 441 | throw new ExitException; |
| 442 | 442 | } |
| 443 | 443 | interface_off(); |
| 444 | - $error_description = status_code($error_code); |
|
| 444 | + $error_description = status_code($error_code); |
|
| 445 | 445 | if (is_array($custom_text)) { |
| 446 | - list($error_code, $error_description) = $custom_text; |
|
| 446 | + list($error_code, $error_description) = $custom_text; |
|
| 447 | 447 | } elseif ($custom_text) { |
| 448 | - $error_description = $custom_text; |
|
| 448 | + $error_description = $custom_text; |
|
| 449 | 449 | } |
| 450 | 450 | if ($json || api_path()) { |
| 451 | 451 | if ($json) { |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | h::title($error_code). |
| 467 | 467 | ($error_description ?: $error_code); |
| 468 | 468 | } |
| 469 | - $this->Content = ob_get_clean(); |
|
| 469 | + $this->Content = ob_get_clean(); |
|
| 470 | 470 | } |
| 471 | 471 | $this->__finish(); |
| 472 | 472 | throw new ExitException; |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | if ($this->finish_called_once) { |
| 487 | 487 | return; |
| 488 | 488 | } |
| 489 | - $this->finish_called_once = true; |
|
| 489 | + $this->finish_called_once = true; |
|
| 490 | 490 | /** |
| 491 | 491 | * For AJAX and API requests only content without page template |
| 492 | 492 | */ |