Completed
Branch master (0964ce)
by Nazar
04:13
created
components/modules/Blogs/admin/delete_post.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,13 +13,13 @@
 block discarded – undo
13 13
 	cs\Language,
14 14
 	cs\Page,
15 15
 	cs\Route;
16
-$post						= Posts::instance()->get(Route::instance()->route[1]);
17
-$Index						= Index::instance();
18
-$L							= Language::instance();
16
+$post = Posts::instance()->get(Route::instance()->route[1]);
17
+$Index = Index::instance();
18
+$L = Language::instance();
19 19
 Page::instance()->title($L->deletion_of_post($post['title']));
20
-$Index->buttons				= false;
21
-$Index->cancel_button_back	= true;
22
-$Index->action				= 'admin/Blogs/browse_posts';
20
+$Index->buttons = false;
21
+$Index->cancel_button_back = true;
22
+$Index->action = 'admin/Blogs/browse_posts';
23 23
 $Index->content(
24 24
 	h::{'h2.cs-text-center'}(
25 25
 		$L->sure_to_delete_post($post['title'])
Please login to merge, or discard this 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-2015, 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-2015, 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.
components/modules/Blogs/admin/delete_section.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,13 +13,13 @@
 block discarded – undo
13 13
 	cs\Language,
14 14
 	cs\Page,
15 15
 	cs\Route;
16
-$section					= Sections::instance()->get(Route::instance()->route[1]);
17
-$Index						= Index::instance();
18
-$L							= Language::instance();
16
+$section = Sections::instance()->get(Route::instance()->route[1]);
17
+$Index = Index::instance();
18
+$L = Language::instance();
19 19
 Page::instance()->title($L->deletion_of_posts_section($section['title']));
20
-$Index->buttons				= false;
21
-$Index->cancel_button_back	= true;
22
-$Index->action				= 'admin/Blogs/browse_sections';
20
+$Index->buttons = false;
21
+$Index->cancel_button_back = true;
22
+$Index->action = 'admin/Blogs/browse_sections';
23 23
 $Index->content(
24 24
 	h::{'h2.cs-text-center'}(
25 25
 		$L->sure_to_delete_posts_section($section['title'])
Please login to merge, or discard this 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-2015, 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-2015, Nazar Mokrynskyi
7
+		 * @license		MIT License, see license.txt
8
+		 */
9 9
 namespace	cs\modules\Blogs;
10 10
 use
11 11
 	h,
Please login to merge, or discard this patch.
components/modules/Blogs/admin/edit_section.php 2 patches
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,8 +39,7 @@
 block discarded – undo
39 39
 			'value' => $section['title']
40 40
 		]
41 41
 	).
42
-	($Config->core['simple_admin_mode'] ? false :
43
-		h::{'label info'}('section_path').
42
+	($Config->core['simple_admin_mode'] ? false : h::{'label info'}('section_path').
44 43
 		h::{'input[is=cs-input-text][name=path]'}(
45 44
 			[
46 45
 				'value' => $section['path']
Please login to merge, or discard this 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-2015, 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-2015, 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/admin/prepare.php 2 patches
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -14,16 +14,16 @@  discard block
 block discarded – undo
14 14
 	cs\Language,
15 15
 	cs\User;
16 16
 function get_sections_rows ($structure = null, $level = 0) {
17
-	$L			= Language::instance();
18
-	$root		= false;
19
-	$module		= path($L->Blogs);
17
+	$L = Language::instance();
18
+	$root = false;
19
+	$module = path($L->Blogs);
20 20
 	if ($structure === null) {
21
-		$structure			= Sections::instance()->get_structure();
22
-		$structure['title']	= $L->root_section;
23
-		$root				= true;
21
+		$structure = Sections::instance()->get_structure();
22
+		$structure['title'] = $L->root_section;
23
+		$root = true;
24 24
 	}
25
-	$content	= [];
26
-	$content[]	= [
25
+	$content = [];
26
+	$content[] = [
27 27
 		[
28 28
 			h::a(
29 29
 				$structure['title'].
@@ -71,35 +71,35 @@  discard block
 block discarded – undo
71 71
 	return $content;
72 72
 }
73 73
 function get_sections_select_section ($current = null, $structure = null, $level = 0) {
74
-	$list	= [
74
+	$list = [
75 75
 		'in'	=> [],
76 76
 		'value'	=> []
77 77
 	];
78 78
 	if ($structure === null) {
79
-		$structure			= Sections::instance()->get_structure();
80
-		$list['in'][]		= Language::instance()->root_section;
81
-		$list['value'][]	= 0;
79
+		$structure = Sections::instance()->get_structure();
80
+		$list['in'][] = Language::instance()->root_section;
81
+		$list['value'][] = 0;
82 82
 	} else {
83 83
 		if ($structure['id'] == $current) {
84 84
 			return $list;
85 85
 		}
86
-		$list['in'][]		= str_repeat('&nbsp;', $level).$structure['title'];
87
-		$list['value'][]	= $structure['id'];
86
+		$list['in'][] = str_repeat('&nbsp;', $level).$structure['title'];
87
+		$list['value'][] = $structure['id'];
88 88
 	}
89 89
 	if (!empty($structure['sections'])) {
90 90
 		foreach ($structure['sections'] as $section) {
91
-			$tmp			= get_sections_select_section($current, $section, $level+1);
92
-			$list['in']		= array_merge($list['in'], $tmp['in']);
93
-			$list['value']	= array_merge($list['value'], $tmp['value']);
91
+			$tmp = get_sections_select_section($current, $section, $level + 1);
92
+			$list['in'] = array_merge($list['in'], $tmp['in']);
93
+			$list['value'] = array_merge($list['value'], $tmp['value']);
94 94
 		}
95 95
 	}
96 96
 	return $list;
97 97
 }
98 98
 function get_posts_rows ($page = 1) {
99
-	$Posts		= Posts::instance();
100
-	$Sections	= Sections::instance();
99
+	$Posts = Posts::instance();
100
+	$Sections = Sections::instance();
101 101
 	$Config		= Config::instance();
102
-	$L			= Language::instance();
102
+	$L = Language::instance();
103 103
 	$User		= User::instance();
104 104
 	$module		= path($L->Blogs);
105 105
 	$page		= (int)$page ?: 1;
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	$num		= $Config->module('Blogs')->posts_per_page;
108 108
 	$from		= ($page - 1) * $num;
109 109
 	$cdb		= DB::instance()->{$Config->module('Blogs')->db('posts')};
110
-	$posts		= $cdb->qfas(
110
+	$posts = $cdb->qfas(
111 111
 		"SELECT `id`
112 112
 		FROM `[prefix]blogs_posts`
113 113
 		ORDER BY `id` DESC
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 				);
130 130
 			}
131 131
 			unset($section);
132
-			$content[]	= [
132
+			$content[] = [
133 133
 				h::a(
134 134
 					$post['title'],
135 135
 					[
Please login to merge, or discard this 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-2015, 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-2015, 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.
components/modules/Blogs/atom.xml.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) 2015, 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) 2015, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Blogs;
10 10
 use
11 11
 	h,
Please login to merge, or discard this patch.
components/modules/Blogs/drafts.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 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-2015, 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-2015, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Blogs;
10 10
 use
11 11
 	cs\Config,
@@ -26,31 +26,31 @@  discard block
 block discarded – undo
26 26
 $User   = User::instance();
27 27
 $Page->title($L->drafts);
28 28
 /**
29
- * Determine current page
30
- */
29
+	 * Determine current page
30
+	 */
31 31
 $page = max(
32 32
 	isset($Route->ids[0]) ? array_slice($Route->ids, -1)[0] : 1,
33 33
 	1
34 34
 );
35 35
 /**
36
- * If this is not first page - show that in page title
37
- */
36
+	 * If this is not first page - show that in page title
37
+	 */
38 38
 if ($page > 1) {
39 39
 	$Page->title($L->blogs_nav_page($page));
40 40
 }
41 41
 /**
42
- * Get posts for current page in JSON-LD structure format
43
- */
42
+	 * Get posts for current page in JSON-LD structure format
43
+	 */
44 44
 $posts_per_page = $Config->module('Blogs')->posts_per_page;
45 45
 $posts          = $Posts->get_drafts($User->id, $page, $posts_per_page);
46 46
 $posts_count    = $Posts->get_drafts_count($User->id);
47 47
 /**
48
- * Base url (without page number)
49
- */
48
+	 * Base url (without page number)
49
+	 */
50 50
 $base_url = $Config->base_url().'/'.path($L->Blogs).'/'.path($L->drafts);
51 51
 /**
52
- * Render posts page
53
- */
52
+	 * Render posts page
53
+	 */
54 54
 Helpers::show_posts_list(
55 55
 	$posts,
56 56
 	$posts_count,
Please login to merge, or discard this patch.
components/modules/Blogs/events/enabled.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-2015, 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-2015, Nazar Mokrynskyi
7
+	 * @license        MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Blogs;
10 10
 
11 11
 use
Please login to merge, or discard this patch.
components/modules/Blogs/events/enabled/admin.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-2015, 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-2015, 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/events/uninstalled.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-2015, 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-2015, 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.