Completed
Branch master (0964ce)
by Nazar
04:13
created
core/classes/Language/Prefix.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
core/classes/Menu.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
core/classes/Page.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
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,
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 		 */
Please login to merge, or discard this patch.
core/classes/Page/Meta.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
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\Page;
9 9
 use
10 10
 	cs\Config,
Please login to merge, or discard this patch.
core/classes/Permission.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@
 block discarded – undo
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
 namespace cs;
9 9
 use
10 10
 	cs\Cache\Prefix,
11 11
 	cs\DB\Accessor;
12 12
 /**
13
- * Class for permissions manipulating
14
- *
15
- * @method static Permission instance($check = false)
16
- */
13
+	 * Class for permissions manipulating
14
+	 *
15
+	 * @method static Permission instance($check = false)
16
+	 */
17 17
 class Permission {
18 18
 	use
19 19
 		Accessor,
Please login to merge, or discard this patch.
core/classes/Route.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -281,7 +281,7 @@
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
 		 * If match was not found - mirror is not allowed!
90 90
 		 */
91 91
 		if ($this->mirror_index === -1) {
92
-			trigger_error("Mirror $_SERVER->host not allowed", E_USER_ERROR);
92
+			trigger_error("mirror $_SERVER->host not allowed", E_USER_ERROR);
93 93
 			throw new ExitException(400);
94 94
 		}
95 95
 		/**
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@
 block discarded – undo
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
- * 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;
Please login to merge, or discard this patch.
core/classes/Session.php 2 patches
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -1,40 +1,40 @@
 block discarded – undo
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
- * 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;
33 33
 /**
34
- * Class responsible for current user session
35
- *
36
- * @method static Session instance($check = false)
37
- */
34
+	 * Class responsible for current user session
35
+	 *
36
+	 * @method static Session instance($check = false)
37
+	 */
38 38
 class Session {
39 39
 	use
40 40
 		CRUD,
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
core/classes/Storage.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
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
 
10 10
 /**
Please login to merge, or discard this patch.
core/classes/User.php 1 patch
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -1,43 +1,43 @@  discard block
 block discarded – undo
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
- * Provides next events:
10
- *  System/User/construct/before
11
- *
12
- *  System/User/construct/after
13
- *
14
- *  System/User/registration/before
15
- *  ['email' => <i>email</i>]
16
- *
17
- *  System/User/registration/after
18
- *  ['id' => <i>user_id</i>]
19
- *
20
- *  System/User/registration/confirmation/before
21
- *  ['reg_key' => <i>reg_key</i>]
22
- *
23
- *  System/User/registration/confirmation/after
24
- *  ['id' => <i>user_id</i>]
25
- *
26
- *  System/User/del/before
27
- *  ['id' => <i>user_id</i>]
28
- *
29
- *  System/User/del/after
30
- *  ['id' => <i>user_id</i>]
31
- *
32
- *  System/User/add_bot
33
- *  ['id' => <i>bot_id</i>]
34
- *
35
- *  System/User/get_contacts
36
- *  [
37
- *    'id'       => <i>user_id</i>,
38
- *    'contacts' => <i>&$contacts</i> //Array of user id
39
- *  ]
40
- */
9
+	 * Provides next events:
10
+	 *  System/User/construct/before
11
+	 *
12
+	 *  System/User/construct/after
13
+	 *
14
+	 *  System/User/registration/before
15
+	 *  ['email' => <i>email</i>]
16
+	 *
17
+	 *  System/User/registration/after
18
+	 *  ['id' => <i>user_id</i>]
19
+	 *
20
+	 *  System/User/registration/confirmation/before
21
+	 *  ['reg_key' => <i>reg_key</i>]
22
+	 *
23
+	 *  System/User/registration/confirmation/after
24
+	 *  ['id' => <i>user_id</i>]
25
+	 *
26
+	 *  System/User/del/before
27
+	 *  ['id' => <i>user_id</i>]
28
+	 *
29
+	 *  System/User/del/after
30
+	 *  ['id' => <i>user_id</i>]
31
+	 *
32
+	 *  System/User/add_bot
33
+	 *  ['id' => <i>bot_id</i>]
34
+	 *
35
+	 *  System/User/get_contacts
36
+	 *  [
37
+	 *    'id'       => <i>user_id</i>,
38
+	 *    'contacts' => <i>&$contacts</i> //Array of user id
39
+	 *  ]
40
+	 */
41 41
 namespace cs;
42 42
 use
43 43
 	cs\Cache\Prefix,
@@ -47,26 +47,26 @@  discard block
 block discarded – undo
47 47
 	cs\User\Management as User_management,
48 48
 	cs\User\Permission as User_permission;
49 49
 /**
50
- * Class for users manipulating
51
- *
52
- * @property int    $id
53
- * @property string $login
54
- * @property string $login_hash    sha224 hash
55
- * @property string $username
56
- * @property string $password_hash sha512 hash
57
- * @property string $email
58
- * @property string $email_hash    sha224 hash
59
- * @property string $language
60
- * @property string $timezone
61
- * @property int    $reg_date      unix timestamp
62
- * @property string $reg_ip        hex value, obtained by function ip2hex()
63
- * @property string $reg_key       random md5 hash, generated during registration
64
- * @property int    $status        '-1' - not activated (for example after registration), 0 - inactive, 1 - active
65
- * @property int    $block_until   unix timestamp
66
- * @property string $avatar
67
- *
68
- * @method static User instance($check = false)
69
- */
50
+	 * Class for users manipulating
51
+	 *
52
+	 * @property int    $id
53
+	 * @property string $login
54
+	 * @property string $login_hash    sha224 hash
55
+	 * @property string $username
56
+	 * @property string $password_hash sha512 hash
57
+	 * @property string $email
58
+	 * @property string $email_hash    sha224 hash
59
+	 * @property string $language
60
+	 * @property string $timezone
61
+	 * @property int    $reg_date      unix timestamp
62
+	 * @property string $reg_ip        hex value, obtained by function ip2hex()
63
+	 * @property string $reg_key       random md5 hash, generated during registration
64
+	 * @property int    $status        '-1' - not activated (for example after registration), 0 - inactive, 1 - active
65
+	 * @property int    $block_until   unix timestamp
66
+	 * @property string $avatar
67
+	 *
68
+	 * @method static User instance($check = false)
69
+	 */
70 70
 class User {
71 71
 	use
72 72
 		Accessor,
Please login to merge, or discard this patch.