Completed
Push — master ( 3fd218...c8dde1 )
by Nazar
06:43
created
components/modules/Plupload/admin/save.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@
 block discarded – undo
9 9
  */
10 10
 namespace	cs;
11 11
 if (isset($_POST['save'])) {
12
-	$module_data					= Config::instance()->module('Plupload');
13
-	$module_data->max_file_size		= xap($_POST['max_file_size']);
14
-	$module_data->confirmation_time	= (int)$_POST['confirmation_time'];
12
+	$module_data = Config::instance()->module('Plupload');
13
+	$module_data->max_file_size = xap($_POST['max_file_size']);
14
+	$module_data->confirmation_time = (int)$_POST['confirmation_time'];
15 15
 	Index::instance()->save(true);
16 16
 }
Please login to merge, or discard this patch.
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.
components/modules/Plupload/events.php 1 patch
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()
12 12
 	->on(
Please login to merge, or discard this patch.
components/modules/Plupload/events/enabled.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@
 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
 /**
11
- * Supports next events:
12
- *  System/upload_files/add_tag
13
- *  [
14
- *   'url'		=> url	//Required
15
- *   'tag'		=> tag	//Required
16
- *  ]
17
- *
18
- *  System/upload_files/del_tag
19
- *  [
20
- *   'url'		=> url	//Optional
21
- *   'tag'		=> tag	//Optional ("%" symbol may be used at the end of string to delete all files, that starts from specified string)
22
- *  ]
23
- */
11
+	 * Supports next events:
12
+	 *  System/upload_files/add_tag
13
+	 *  [
14
+	 *   'url'		=> url	//Required
15
+	 *   'tag'		=> tag	//Required
16
+	 *  ]
17
+	 *
18
+	 *  System/upload_files/del_tag
19
+	 *  [
20
+	 *   'url'		=> url	//Optional
21
+	 *   'tag'		=> tag	//Optional ("%" symbol may be used at the end of string to delete all files, that starts from specified string)
22
+	 *  ]
23
+	 */
24 24
 namespace	cs\modules\Plupload;
25 25
 use
26 26
 	cs\Config,
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
 	->on(
33 33
 		'System/Page/display/before',
34 34
 		function () {
35
-			$Config	= Config::instance();
36
-			$Page	= Page::instance();
35
+			$Config = Config::instance();
36
+			$Page = Page::instance();
37 37
 			$Page->config([
38 38
 				'max_file_size'	=> $Config->module('Plupload')->max_file_size
39 39
 			], 'cs.plupload');
@@ -45,13 +45,13 @@  discard block
 block discarded – undo
45 45
 			if (!isset($data['url'], $data['tag'])) {
46 46
 				return false;
47 47
 			}
48
-			$module_data		= Config::instance()->module('Plupload');
49
-			$storage			= Storage::instance()->{$module_data->storage('files')};
48
+			$module_data = Config::instance()->module('Plupload');
49
+			$storage = Storage::instance()->{$module_data->storage('files')};
50 50
 			if (mb_strpos($data['url'], $storage->base_url()) !== 0) {
51 51
 				return false;
52 52
 			}
53
-			$cdb				= DB::instance()->{$module_data->db('files')}();
54
-			$id		= $cdb->qfs([
53
+			$cdb = DB::instance()->{$module_data->db('files')}();
54
+			$id = $cdb->qfs([
55 55
 				"SELECT `id`
56 56
 				FROM `[prefix]plupload_files`
57 57
 				WHERE `url` = '%s'
@@ -77,12 +77,12 @@  discard block
 block discarded – undo
77 77
 			if (!isset($data['url']) && !isset($data['tag'])) {
78 78
 				return false;
79 79
 			}
80
-			$module_data		= Config::instance()->module('Plupload');
81
-			$storage			= Storage::instance()->{$module_data->storage('files')};
80
+			$module_data = Config::instance()->module('Plupload');
81
+			$storage = Storage::instance()->{$module_data->storage('files')};
82 82
 			if (isset($data['url']) && mb_strpos($data['url'], $storage->base_url()) !== 0) {
83 83
 				return false;
84 84
 			}
85
-			$cdb				= DB::instance()->{$module_data->db('files')}();
85
+			$cdb = DB::instance()->{$module_data->db('files')}();
86 86
 			if (isset($data['url']) && !isset($data['tag'])) {
87 87
 				return $cdb->q(
88 88
 					"DELETE FROM `[prefix]plupload_files_tags`
Please login to merge, or discard this patch.
components/modules/Plupload/events/installed.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,14 +19,14 @@
 block discarded – undo
19 19
 		if ($data['name'] != 'Plupload') {
20 20
 			return;
21 21
 		}
22
-		$module_data	= Config::instance()->module('Plupload');
23
-		$storage		= Storage::instance()->{$module_data->storage('files')};
24
-		$cdb			= DB::instance()->{$module_data->db('files')};
22
+		$module_data = Config::instance()->module('Plupload');
23
+		$storage = Storage::instance()->{$module_data->storage('files')};
24
+		$cdb = DB::instance()->{$module_data->db('files')};
25 25
 		unset($module_data);
26 26
 		if (!$storage || !$cdb) {
27 27
 			return;
28 28
 		}
29
-		$files			= $cdb->q(
29
+		$files = $cdb->q(
30 30
 			"SELECT `source`
31 31
 			FROM `[prefix]plupload_files`"
32 32
 		);
Please login to merge, or discard this patch.
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.
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.