Completed
Push — master ( 5d29b3...11effe )
by Nazar
04:11
created
components/modules/Blogs/Posts.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Blogs
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Blogs
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Blogs;
10 10
 use
11 11
 	cs\Language;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 	use
26 26
 		CRUD,
27 27
 		Singleton;
28
-	protected $data_model                  = [
28
+	protected $data_model = [
29 29
 		'id'       => 'int:0',
30 30
 		'user'     => 'int:0',
31 31
 		'date'     => 'int:0',
Please login to merge, or discard this patch.
components/modules/Blogs/Sections.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Blogs
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Blogs
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Blogs;
10 10
 use
11 11
 	cs\Language;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 		CRUD,
26 26
 		Singleton;
27 27
 
28
-	protected $data_model          = [
28
+	protected $data_model = [
29 29
 		'id'     => 'int:0',
30 30
 		'parent' => 'int:0',
31 31
 		'title'  => 'ml:text',
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 			$structure['title'] = $L->root_section;
106 106
 			$structure['posts'] = Posts::instance()->get_for_section_count($structure['id']);
107 107
 		}
108
-		$sections              = $this->db()->qfa(
108
+		$sections = $this->db()->qfa(
109 109
 			[
110 110
 				"SELECT
111 111
 					`id`,
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 				$section['parent']
266 266
 			]
267 267
 		) ?: $section['parent'];
268
-		$update            = $this->db_prime()->q(
268
+		$update = $this->db_prime()->q(
269 269
 			[
270 270
 				"UPDATE `[prefix]blogs_sections`
271 271
 				SET `parent` = '%2\$d'
Please login to merge, or discard this patch.
components/modules/Blogs/admin/add_section.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Blogs
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Blogs
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Blogs;
10 10
 use
11 11
 	cs\Language;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,8 +37,7 @@
 block discarded – undo
37 37
 				'value' => $section['title']
38 38
 			]
39 39
 		).
40
-		($Config->core['simple_admin_mode'] ? false :
41
-			h::{'label info'}('blogs_section_path').
40
+		($Config->core['simple_admin_mode'] ? false : h::{'label info'}('blogs_section_path').
42 41
 			h::{'input[is=cs-input-text][name=path]'}(
43 42
 				[
44 43
 					'value' => $section['path']
Please login to merge, or discard this patch.
components/modules/Blogs/admin/edit_section.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Blogs
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Blogs
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Blogs;
10 10
 use
11 11
 	cs\Language;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,8 +37,7 @@
 block discarded – undo
37 37
 				'value' => $section['title']
38 38
 			]
39 39
 		).
40
-		($Config->core['simple_admin_mode'] ? false :
41
-			h::{'label info'}('blogs_section_path').
40
+		($Config->core['simple_admin_mode'] ? false : h::{'label info'}('blogs_section_path').
42 41
 			h::{'input[is=cs-input-text][name=path]'}(
43 42
 				[
44 43
 					'value' => $section['path']
Please login to merge, or discard this patch.
components/modules/Blogs/admin/index.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Blogs
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2014-2016, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Blogs
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2014-2016, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs;
10 10
 Event::instance()->on(
11 11
 	'admin/System/Menu',
Please login to merge, or discard this patch.
components/modules/Blogs/admin/prepare.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package		Blogs
4
- * @category	modules
5
- * @author		Nazar Mokrynskyi <[email protected]>
6
- * @copyright	Copyright (c) 2011-2016, Nazar Mokrynskyi
7
- * @license		MIT License, see license.txt
8
- */
3
+	 * @package		Blogs
4
+	 * @category	modules
5
+	 * @author		Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright	Copyright (c) 2011-2016, Nazar Mokrynskyi
7
+	 * @license		MIT License, see license.txt
8
+	 */
9 9
 namespace	cs;
10 10
 Event::instance()->on(
11 11
 	'admin/System/components/modules/install/after',
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -15,16 +15,16 @@  discard block
 block discarded – undo
15 15
 	cs\User;
16 16
 
17 17
 function get_sections_rows ($structure = null, $level = 0) {
18
-	$L			= new Prefix('blogs_');
19
-	$root		= false;
20
-	$module		= path($L->Blogs);
18
+	$L = new Prefix('blogs_');
19
+	$root = false;
20
+	$module = path($L->Blogs);
21 21
 	if ($structure === null) {
22
-		$structure			= Sections::instance()->get_structure();
23
-		$structure['title']	= $L->root_section;
24
-		$root				= true;
22
+		$structure = Sections::instance()->get_structure();
23
+		$structure['title'] = $L->root_section;
24
+		$root = true;
25 25
 	}
26
-	$content	= [];
27
-	$content[]	= [
26
+	$content = [];
27
+	$content[] = [
28 28
 		[
29 29
 			h::a(
30 30
 				$structure['title'].
@@ -72,36 +72,36 @@  discard block
 block discarded – undo
72 72
 	return $content;
73 73
 }
74 74
 function get_sections_select_section ($current = null, $structure = null, $level = 0) {
75
-	$list	= [
75
+	$list = [
76 76
 		'in'	=> [],
77 77
 		'value'	=> []
78 78
 	];
79 79
 	if ($structure === null) {
80
-		$structure			= Sections::instance()->get_structure();
81
-		$L					= new Prefix('blogs_');
82
-		$list['in'][]		= $L->root_section;
83
-		$list['value'][]	= 0;
80
+		$structure = Sections::instance()->get_structure();
81
+		$L = new Prefix('blogs_');
82
+		$list['in'][] = $L->root_section;
83
+		$list['value'][] = 0;
84 84
 	} else {
85 85
 		if ($structure['id'] == $current) {
86 86
 			return $list;
87 87
 		}
88
-		$list['in'][]		= str_repeat('&nbsp;', $level).$structure['title'];
89
-		$list['value'][]	= $structure['id'];
88
+		$list['in'][] = str_repeat('&nbsp;', $level).$structure['title'];
89
+		$list['value'][] = $structure['id'];
90 90
 	}
91 91
 	if (!empty($structure['sections'])) {
92 92
 		foreach ($structure['sections'] as $section) {
93
-			$tmp			= get_sections_select_section($current, $section, $level+1);
94
-			$list['in']		= array_merge($list['in'], $tmp['in']);
95
-			$list['value']	= array_merge($list['value'], $tmp['value']);
93
+			$tmp = get_sections_select_section($current, $section, $level + 1);
94
+			$list['in'] = array_merge($list['in'], $tmp['in']);
95
+			$list['value'] = array_merge($list['value'], $tmp['value']);
96 96
 		}
97 97
 	}
98 98
 	return $list;
99 99
 }
100 100
 function get_posts_rows ($page = 1) {
101
-	$Posts		= Posts::instance();
102
-	$Sections	= Sections::instance();
101
+	$Posts = Posts::instance();
102
+	$Sections = Sections::instance();
103 103
 	$Config		= Config::instance();
104
-	$L			= new Prefix('blogs_');
104
+	$L = new Prefix('blogs_');
105 105
 	$User		= User::instance();
106 106
 	$module		= path($L->Blogs);
107 107
 	$page		= (int)$page ?: 1;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	$num		= $Config->module('Blogs')->posts_per_page;
110 110
 	$from		= ($page - 1) * $num;
111 111
 	$cdb		= DB::instance()->{$Config->module('Blogs')->db('posts')};
112
-	$posts		= $cdb->qfas(
112
+	$posts = $cdb->qfas(
113 113
 		"SELECT `id`
114 114
 		FROM `[prefix]blogs_posts`
115 115
 		ORDER BY `id` DESC
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 				);
132 132
 			}
133 133
 			unset($section);
134
-			$content[]	= [
134
+			$content[] = [
135 135
 				h::a(
136 136
 					$post['title'],
137 137
 					[
Please login to merge, or discard this patch.
components/modules/Blogs/admin/save.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Blogs
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Blogs
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Blogs;
10 10
 use
11 11
 	cs\Language;
Please login to merge, or discard this patch.
components/modules/Blogs/events.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Blogs
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Blogs
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Blogs;
10 10
 use
11 11
 	cs\Language;
Please login to merge, or discard this patch.
components/modules/Blogs/events/installed.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Blogs
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Blogs
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Blogs;
10 10
 use
11 11
 	cs\Language;
Please login to merge, or discard this patch.