Completed
Push — master ( d9fcc5...35afbd )
by Nazar
04:10
created
components/modules/Blogs/admin/prepare.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -15,36 +15,36 @@  discard block
 block discarded – undo
15 15
 	cs\User;
16 16
 
17 17
 function get_sections_select_section ($current = null, $structure = null, $level = 0) {
18
-	$list	= [
18
+	$list = [
19 19
 		'in'	=> [],
20 20
 		'value'	=> []
21 21
 	];
22 22
 	if ($structure === null) {
23
-		$structure			= Sections::instance()->get_structure();
24
-		$L					= new Prefix('blogs_');
25
-		$list['in'][]		= $L->root_section;
26
-		$list['value'][]	= 0;
23
+		$structure = Sections::instance()->get_structure();
24
+		$L = new Prefix('blogs_');
25
+		$list['in'][] = $L->root_section;
26
+		$list['value'][] = 0;
27 27
 	} else {
28 28
 		if ($structure['id'] == $current) {
29 29
 			return $list;
30 30
 		}
31
-		$list['in'][]		= str_repeat(' ', $level).$structure['title'];
32
-		$list['value'][]	= $structure['id'];
31
+		$list['in'][] = str_repeat(' ', $level).$structure['title'];
32
+		$list['value'][] = $structure['id'];
33 33
 	}
34 34
 	if (!empty($structure['sections'])) {
35 35
 		foreach ($structure['sections'] as $section) {
36
-			$tmp			= get_sections_select_section($current, $section, $level+1);
37
-			$list['in']		= array_merge($list['in'], $tmp['in']);
38
-			$list['value']	= array_merge($list['value'], $tmp['value']);
36
+			$tmp = get_sections_select_section($current, $section, $level + 1);
37
+			$list['in'] = array_merge($list['in'], $tmp['in']);
38
+			$list['value'] = array_merge($list['value'], $tmp['value']);
39 39
 		}
40 40
 	}
41 41
 	return $list;
42 42
 }
43 43
 function get_posts_rows ($page = 1) {
44
-	$Posts		= Posts::instance();
45
-	$Sections	= Sections::instance();
44
+	$Posts = Posts::instance();
45
+	$Sections = Sections::instance();
46 46
 	$Config		= Config::instance();
47
-	$L			= new Prefix('blogs_');
47
+	$L = new Prefix('blogs_');
48 48
 	$User		= User::instance();
49 49
 	$module		= path($L->Blogs);
50 50
 	$page		= (int)$page ?: 1;
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	$num		= $Config->module('Blogs')->posts_per_page;
53 53
 	$from		= ($page - 1) * $num;
54 54
 	$cdb		= DB::instance()->{$Config->module('Blogs')->db('posts')};
55
-	$posts		= $cdb->qfas(
55
+	$posts = $cdb->qfas(
56 56
 		"SELECT `id`
57 57
 		FROM `[prefix]blogs_posts`
58 58
 		ORDER BY `id` DESC
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 				);
75 75
 			}
76 76
 			unset($section);
77
-			$content[]	= [
77
+			$content[] = [
78 78
 				h::a(
79 79
 					$post['title'],
80 80
 					[
Please login to merge, or discard this patch.