Completed
Push — master ( 6b0cd2...000ea2 )
by Nazar
09:14 queued 04:22
created
components/modules/Plupload/events/uninstalled.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package		Plupload
4
- * @category	modules
5
- * @author		Moxiecode Systems AB
6
- * @author		Nazar Mokrynskyi <[email protected]> (integration with CleverStyle CMS)
7
- * @copyright	Moxiecode Systems AB
8
- * @license		GNU GPL v2, see license.txt
9
- */
3
+	 * @package		Plupload
4
+	 * @category	modules
5
+	 * @author		Moxiecode Systems AB
6
+	 * @author		Nazar Mokrynskyi <[email protected]> (integration with CleverStyle CMS)
7
+	 * @copyright	Moxiecode Systems AB
8
+	 * @license		GNU GPL v2, see license.txt
9
+	 */
10 10
 namespace	cs;
11 11
 Event::instance()->on(
12 12
 	'admin/System/components/modules/install/after',
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@
 block discarded – undo
12 12
 	'admin/System/components/modules/install/after',
13 13
 	function ($data) {
14 14
 		if ($data['name'] == 'Plupload') {
15
-			$Config											= Config::instance();
16
-			$Config->module('Plupload')->max_file_size		= '5mb';
17
-			$Config->module('Plupload')->confirmation_time	= '900';
15
+			$Config = Config::instance();
16
+			$Config->module('Plupload')->max_file_size = '5mb';
17
+			$Config->module('Plupload')->confirmation_time = '900';
18 18
 		}
19 19
 	}
20 20
 );
Please login to merge, or discard this patch.
components/modules/Plupload/index.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package		Plupload
4
- * @category	modules
5
- * @author		Moxiecode Systems AB
6
- * @author		Nazar Mokrynskyi <[email protected]> (integration with CleverStyle CMS)
7
- * @copyright	Moxiecode Systems AB
8
- * @license		GNU GPL v2, see license.txt
9
- */
3
+	 * @package		Plupload
4
+	 * @category	modules
5
+	 * @author		Moxiecode Systems AB
6
+	 * @author		Nazar Mokrynskyi <[email protected]> (integration with CleverStyle CMS)
7
+	 * @copyright	Moxiecode Systems AB
8
+	 * @license		GNU GPL v2, see license.txt
9
+	 */
10 10
 namespace	cs;
11 11
 use Karwana\Mime\Mime;
12 12
 $Page				= Page::instance();
13 13
 $User				= User::instance();
14 14
 interface_off();
15 15
 /**
16
- * Only registered users allowed
17
- */
16
+	 * Only registered users allowed
17
+	 */
18 18
 if (!isset($_FILES['file'])) {
19 19
 	$Page->json([
20 20
 		'jsonrpc'	=> '2.0',
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
 	return;
28 28
 }
29 29
 /**
30
- * Getting Plupload module configuration
31
- */
30
+	 * Getting Plupload module configuration
31
+	 */
32 32
 $module_data		= Config::instance()->module('Plupload');
33 33
 $max_file_size		= trim(strtolower($module_data->max_file_size), 'b');
34 34
 switch (substr($max_file_size, -1)) {
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 	return;
69 69
 }
70 70
 /**
71
- * Only registered users allowed
72
- */
71
+	 * Only registered users allowed
72
+	 */
73 73
 if (!$User->user()) {
74 74
 	$Page->json([
75 75
 		'jsonrpc'	=> '2.0',
@@ -82,12 +82,12 @@  discard block
 block discarded – undo
82 82
 	return;
83 83
 }
84 84
 /**
85
- * Getting instances of storage and database
86
- */
85
+	 * Getting instances of storage and database
86
+	 */
87 87
 $storage			= Storage::instance()->{$module_data->storage('files')};
88 88
 /**
89
- * @var DB\_Abstract $cdb
90
- */
89
+	 * @var DB\_Abstract $cdb
90
+	 */
91 91
 $cdb				= DB::instance()->db_prime($module_data->db('files'));
92 92
 if (!$storage || !$cdb) {
93 93
 	$Page->json([
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
 	return;
102 102
 }
103 103
 /**
104
- * Moving file into storage
105
- */
104
+	 * Moving file into storage
105
+	 */
106 106
 if (!$module_data->directory_created) {
107 107
 	$storage->mkdir('Plupload');
108 108
 	$module_data->directory_created	= 1;
@@ -130,8 +130,8 @@  discard block
 block discarded – undo
130 130
 	return;
131 131
 }
132 132
 /**
133
- * Registering file in database
134
- */
133
+	 * Registering file in database
134
+	 */
135 135
 if (!$cdb->q(
136 136
 	"INSERT INTO `[prefix]plupload_files`
137 137
 		(`user`, `uploaded`, `source`, `url`)
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
 /**
30 30
  * Getting Plupload module configuration
31 31
  */
32
-$module_data		= Config::instance()->module('Plupload');
33
-$max_file_size		= trim(strtolower($module_data->max_file_size), 'b');
32
+$module_data = Config::instance()->module('Plupload');
33
+$max_file_size = trim(strtolower($module_data->max_file_size), 'b');
34 34
 switch (substr($max_file_size, -1)) {
35 35
 	case 'k':
36 36
 		$max_file_size	= substr($max_file_size, 0, -1) * 1024;
@@ -84,11 +84,11 @@  discard block
 block discarded – undo
84 84
 /**
85 85
  * Getting instances of storage and database
86 86
  */
87
-$storage			= Storage::instance()->{$module_data->storage('files')};
87
+$storage = Storage::instance()->{$module_data->storage('files')};
88 88
 /**
89 89
  * @var DB\_Abstract $cdb
90 90
  */
91
-$cdb				= DB::instance()->db_prime($module_data->db('files'));
91
+$cdb = DB::instance()->db_prime($module_data->db('files'));
92 92
 if (!$storage || !$cdb) {
93 93
 	$Page->json([
94 94
 		'jsonrpc'	=> '2.0',
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
  */
106 106
 if (!$module_data->directory_created) {
107 107
 	$storage->mkdir('Plupload');
108
-	$module_data->directory_created	= 1;
108
+	$module_data->directory_created = 1;
109 109
 }
110
-$destination_file	= 'Plupload/'.date('Y-m-d');
110
+$destination_file = 'Plupload/'.date('Y-m-d');
111 111
 if (!$storage->file_exists($destination_file)) {
112 112
 	$storage->mkdir($destination_file);
113 113
 }
114
-$destination_file	.= date('/H');
114
+$destination_file .= date('/H');
115 115
 if (!$storage->file_exists($destination_file)) {
116 116
 	$storage->mkdir($destination_file);
117 117
 }
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 	return;
155 155
 }
156 156
 if ($cdb->id() % 100 === 0) {
157
-	$files_for_deletion	= $cdb->qfa([
157
+	$files_for_deletion = $cdb->qfa([
158 158
 		"SELECT `f`.`id`, `f`.`source`
159 159
 		FROM `[prefix]plupload_files` AS `f`
160 160
 		LEFT JOIN `[prefix]plupload_files_tags` AS `t`
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 		time() - $module_data->confirmation_time
168 168
 	]);
169 169
 	if ($files_for_deletion) {
170
-		$ids	= implode(',', array_column($files_for_deletion, 'id'));
170
+		$ids = implode(',', array_column($files_for_deletion, 'id'));
171 171
 		$cdb->q([
172 172
 			"DELETE FROM `[prefix]plupload_files`
173 173
 			WHERE `id` IN($ids)",
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 		]);
177 177
 		unset($ids);
178 178
 	}
179
-	$files_for_deletion	= array_column($files_for_deletion, 'source');
179
+	$files_for_deletion = array_column($files_for_deletion, 'source');
180 180
 	foreach ($files_for_deletion as $source) {
181 181
 		if ($storage->file_exists($source)) {
182 182
 			$storage->unlink($source);
Please login to merge, or discard this patch.
components/modules/Polls/Answers.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		'option' => 'int',
28 28
 		'user'   => 'int'
29 29
 	];
30
-	protected $table      = '[prefix]polls_options_answers';
30
+	protected $table = '[prefix]polls_options_answers';
31 31
 
32 32
 	protected function cdb () {
33 33
 		return Config::instance()->module('Polls')->db('polls');
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	function get ($poll) {
63 63
 		if (is_array($poll)) {
64 64
 			foreach ($poll as &$i) {
65
-				$i = $this->get($i);;
65
+				$i = $this->get($i); ;
66 66
 			}
67 67
 			return $poll;
68 68
 		}
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   Polls
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   Polls
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
 
11 11
 Event::instance()->on(
Please login to merge, or discard this patch.
components/modules/Polls/Common_actions.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   Polls
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   Polls
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\Polls;
10 10
 
11 11
 /**
Please login to merge, or discard this patch.
components/modules/Polls/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   Polls
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   Polls
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
 
11 11
 Event::instance()->on(
Please login to merge, or discard this patch.
components/modules/Polls/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        Polls
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        Polls
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\modules\Polls;
10 10
 
11 11
 use
Please login to merge, or discard this patch.
components/modules/Shop/Common_actions.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   Shop
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   Shop
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\Shop;
10 10
 use
11 11
 	cs\CRUD,
12 12
 	cs\Language;
13 13
 /**
14
- * @property \cs\Cache\Prefix $cache
15
- * @property string           $table
16
- */
14
+	 * @property \cs\Cache\Prefix $cache
15
+	 * @property string           $table
16
+	 */
17 17
 trait Common_actions {
18 18
 	use
19 19
 		CRUD;
Please login to merge, or discard this patch.
components/modules/Shop/Items.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
 	const DEFAULT_IMAGE = 'components/modules/Shop/includes/img/no-image.svg';
57 57
 
58
-	protected $data_model                  = [
58
+	protected $data_model = [
59 59
 		'id'         => 'int',
60 60
 		'date'       => 'int',
61 61
 		'category'   => 'int',
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 				'string'  => '',
444 444
 				'text'    => ''
445 445
 			];
446
-			$lang       = '';
446
+			$lang = '';
447 447
 			switch ($this->attribute_type_to_value_field($attribute_data['type'])) {
448 448
 				case 'numeric_value':
449 449
 					$value_type['numeric'] = $value;
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -286,17 +286,20 @@
 block discarded – undo
286 286
 		$where        = [];
287 287
 		$where_params = [];
288 288
 		foreach ($search_parameters as $key => $details) {
289
-			if (isset($this->data_model[$key])) { // Property
289
+			if (isset($this->data_model[$key])) {
290
+// Property
290 291
 				$where[]        = "`i`.`$key` = '%s'";
291 292
 				$where_params[] = $details;
292
-			} elseif (is_numeric($key)) { // Tag
293
+			} elseif (is_numeric($key)) {
294
+// Tag
293 295
 				$joins .=
294 296
 					"INNER JOIN `{$this->table}_tags` AS `t`
295 297
 					ON
296 298
 						`i`.`id`	= `t`.`id` AND
297 299
 						`t`.`tag`	= '%s'";
298 300
 				$where_params[] = $details;
299
-			} else { // Attribute
301
+			} else {
302
+// Attribute
300 303
 				$field = @$this->attribute_type_to_value_field($Attributes->get($key)['type']);
301 304
 				if (!$field || empty($details)) {
302 305
 					continue;
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   Shop
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   Shop
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\modules\Shop;
10 10
 use
11 11
 	cs\Config,
Please login to merge, or discard this patch.
components/modules/Shop/Orders.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
 
68 68
 	const PAYMENT_METHOD_CASH = 'shop:cash';
69 69
 
70
-	protected $data_model            = [
70
+	protected $data_model = [
71 71
 		'id'                => 'int',
72 72
 		'user'              => 'int',
73 73
 		'date'              => 'int',
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   Shop
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   Shop
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\modules\Shop;
10 10
 use
11 11
 	cs\Config,
Please login to merge, or discard this patch.