GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — develop (#1947)
by
unknown
17:06 queued 06:02
created
modules/page/page.view.php 3 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -129,6 +129,8 @@  discard block
 block discarded – undo
129 129
 
130 130
 	/**
131 131
 	 * @brief Save the file and return if a file is requested by http
132
+	 * @param integer $caching_interval
133
+	 * @param string $cache_file
132 134
 	 */
133 135
 	function getHtmlPage($path, $caching_interval, $cache_file)
134 136
 	{
@@ -167,6 +169,8 @@  discard block
 block discarded – undo
167 169
 
168 170
 	/**
169 171
 	 * @brief Create a cache file in order to include if it is an internal file
172
+	 * @param integer $caching_interval
173
+	 * @param string $cache_file
170 174
 	 */
171 175
 	function executeFile($target_file, $caching_interval, $cache_file)
172 176
 	{
Please login to merge, or discard this patch.
Braces   +47 added lines, -25 removed lines patch added patch discarded remove patch
@@ -46,12 +46,17 @@  discard block
 block discarded – undo
46 46
 	function dispPageIndex()
47 47
 	{
48 48
 		// Variables used in the template Context:: set()
49
-		if($this->module_srl) Context::set('module_srl',$this->module_srl);
49
+		if($this->module_srl) {
50
+			Context::set('module_srl',$this->module_srl);
51
+		}
50 52
 
51 53
 		$page_type_name = strtolower($this->module_info->page_type);
52 54
 		$method = '_get' . ucfirst($page_type_name) . 'Content';
53
-		if(method_exists($this, $method)) $page_content = $this->{$method}();
54
-		else return new Object(-1, sprintf('%s method is not exists', $method));
55
+		if(method_exists($this, $method)) {
56
+			$page_content = $this->{$method}();
57
+		} else {
58
+			return new Object(-1, sprintf('%s method is not exists', $method));
59
+		}
55 60
 
56 61
 		Context::set('module_info', $this->module_info);
57 62
 		Context::set('page_content', $page_content);
@@ -63,24 +68,27 @@  discard block
 block discarded – undo
63 68
 	{
64 69
 		if($this->interval>0)
65 70
 		{
66
-			if(!file_exists($this->cache_file)) $mtime = 0;
67
-			else $mtime = filemtime($this->cache_file);
71
+			if(!file_exists($this->cache_file)) {
72
+				$mtime = 0;
73
+			} else {
74
+				$mtime = filemtime($this->cache_file);
75
+			}
68 76
 
69 77
 			if($mtime + $this->interval*60 > $_SERVER['REQUEST_TIME'])
70 78
 			{
71 79
 				$page_content = FileHandler::readFile($this->cache_file); 
72 80
 				$page_content = preg_replace('@<\!--#Meta:@', '<!--Meta:', $page_content);
73
-			}
74
-			else
81
+			} else
75 82
 			{
76 83
 				$oWidgetController = getController('widget');
77 84
 				$page_content = $oWidgetController->transWidgetCode($this->module_info->content);
78 85
 				FileHandler::writeFile($this->cache_file, $page_content);
79 86
 			}
80
-		}
81
-		else
87
+		} else
82 88
 		{
83
-			if(file_exists($this->cache_file)) FileHandler::removeFile($this->cache_file);
89
+			if(file_exists($this->cache_file)) {
90
+				FileHandler::removeFile($this->cache_file);
91
+			}
84 92
 			$page_content = $this->module_info->content;
85 93
 		}
86 94
 		return $page_content;
@@ -104,8 +112,7 @@  discard block
 block discarded – undo
104 112
 		if ($this->module_info->skin)
105 113
 		{
106 114
 			$templatePath = (sprintf($this->module_path.'skins/%s', $this->module_info->skin));
107
-		}
108
-		else
115
+		} else
109 116
 		{
110 117
 			$templatePath = ($this->module_path.'skins/default');
111 118
 		}
@@ -120,8 +127,11 @@  discard block
 block discarded – undo
120 127
 		// check if it is http or internal file
121 128
 		if($this->path)
122 129
 		{
123
-			if(preg_match("/^([a-z]+):\/\//i",$this->path)) $content = $this->getHtmlPage($this->path, $this->interval, $this->cache_file);
124
-			else $content = $this->executeFile($this->path, $this->interval, $this->cache_file);
130
+			if(preg_match("/^([a-z]+):\/\//i",$this->path)) {
131
+				$content = $this->getHtmlPage($this->path, $this->interval, $this->cache_file);
132
+			} else {
133
+				$content = $this->executeFile($this->path, $this->interval, $this->cache_file);
134
+			}
125 135
 		}
126 136
 
127 137
 		return $content;
@@ -136,8 +146,7 @@  discard block
 block discarded – undo
136 146
 		if($caching_interval > 0 && file_exists($cache_file) && filemtime($cache_file) + $caching_interval*60 > $_SERVER['REQUEST_TIME'])
137 147
 		{
138 148
 			$content = FileHandler::readFile($cache_file);
139
-		}
140
-		else
149
+		} else
141 150
 		{
142 151
 			FileHandler::getRemoteFile($path, $cache_file);
143 152
 			$content = FileHandler::readFile($cache_file);
@@ -154,13 +163,19 @@  discard block
 block discarded – undo
154 163
 		$content = $buff->content;
155 164
 		// Extract a title
156 165
 		$title = $oPageController->getTitle($content);
157
-		if($title) Context::setBrowserTitle($title);
166
+		if($title) {
167
+			Context::setBrowserTitle($title);
168
+		}
158 169
 		// Extract header script
159 170
 		$head_script = $oPageController->getHeadScript($content);
160
-		if($head_script) Context::addHtmlHeader($head_script);
171
+		if($head_script) {
172
+			Context::addHtmlHeader($head_script);
173
+		}
161 174
 		// Extract content from the body
162 175
 		$body_script = $oPageController->getBodyScript($content);
163
-		if(!$body_script) $body_script = $content;
176
+		if(!$body_script) {
177
+			$body_script = $content;
178
+		}
164 179
 
165 180
 		return $content;
166 181
 	}
@@ -171,7 +186,9 @@  discard block
 block discarded – undo
171 186
 	function executeFile($target_file, $caching_interval, $cache_file)
172 187
 	{
173 188
 		// Cancel if the file doesn't exist
174
-		if(!file_exists(FileHandler::getRealPath($target_file))) return;
189
+		if(!file_exists(FileHandler::getRealPath($target_file))) {
190
+			return;
191
+		}
175 192
 
176 193
 		// Get a path and filename
177 194
 		$tmp_path = explode('/',$cache_file);
@@ -183,7 +200,9 @@  discard block
 block discarded – undo
183 200
 		// Verify cache
184 201
 		if($caching_interval <1 || !file_exists($cache_file) || filemtime($cache_file) + $caching_interval*60 <= $_SERVER['REQUEST_TIME'] || filemtime($cache_file)<filemtime($target_file))
185 202
 		{
186
-			if(file_exists($cache_file)) FileHandler::removeFile($cache_file);
203
+			if(file_exists($cache_file)) {
204
+				FileHandler::removeFile($cache_file);
205
+			}
187 206
 
188 207
 			// Read a target file and get content
189 208
 			ob_start();
@@ -196,7 +215,9 @@  discard block
 block discarded – undo
196 215
 
197 216
 			FileHandler::writeFile($cache_file, $content);
198 217
 			// Include and then Return the result
199
-			if(!file_exists($cache_file)) return;
218
+			if(!file_exists($cache_file)) {
219
+				return;
220
+			}
200 221
 			// Attempt to compile
201 222
 			$oTemplate = &TemplateHandler::getInstance();
202 223
 			$script = $oTemplate->compileDirect($filepath, $filename);
@@ -227,14 +248,15 @@  discard block
 block discarded – undo
227 248
 		{
228 249
 				return $matches[0];
229 250
 			// In case of  .. , get a path
230
-		}
231
-		else if(strncasecmp('..', $val, 2) === 0)
251
+		} else if(strncasecmp('..', $val, 2) === 0)
232 252
 		{
233 253
 			$p = Context::pathToUrl($this->path);
234 254
 			return sprintf("%s%s%s%s",$matches[1],$matches[2],$p.$val,$matches[4]);
235 255
 		}
236 256
 
237
-		if(strncasecmp('..', $val, 2) === 0) $val = substr($val,2);
257
+		if(strncasecmp('..', $val, 2) === 0) {
258
+			$val = substr($val,2);
259
+		}
238 260
 		$p = Context::pathToUrl($this->path);
239 261
 		$path = sprintf("%s%s%s%s",$matches[1],$matches[2],$p.$val,$matches[4]);
240 262
 
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -22,18 +22,18 @@  discard block
 block discarded – undo
22 22
 		// Get a template path (page in the administrative template tpl putting together)
23 23
 		$this->setTemplatePath($this->module_path.'tpl');
24 24
 
25
-		switch($this->module_info->page_type)
25
+		switch ($this->module_info->page_type)
26 26
 		{
27 27
 			case 'WIDGET' :
28 28
 				{
29 29
 					$this->cache_file = sprintf("%sfiles/cache/page/%d.%s.%s.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getLangType(), Context::getSslStatus());
30
-					$this->interval = (int)($this->module_info->page_caching_interval);
30
+					$this->interval = (int) ($this->module_info->page_caching_interval);
31 31
 					break;
32 32
 				}
33 33
 			case 'OUTSIDE' :
34 34
 				{
35 35
 					$this->cache_file = sprintf("%sfiles/cache/opage/%d.%s.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getSslStatus());
36
-					$this->interval = (int)($this->module_info->page_caching_interval);
36
+					$this->interval = (int) ($this->module_info->page_caching_interval);
37 37
 					$this->path = $this->module_info->path;
38 38
 					break;
39 39
 				}
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
 	function dispPageIndex()
47 47
 	{
48 48
 		// Variables used in the template Context:: set()
49
-		if($this->module_srl) Context::set('module_srl',$this->module_srl);
49
+		if ($this->module_srl) Context::set('module_srl', $this->module_srl);
50 50
 
51 51
 		$page_type_name = strtolower($this->module_info->page_type);
52
-		$method = '_get' . ucfirst($page_type_name) . 'Content';
53
-		if(method_exists($this, $method)) $page_content = $this->{$method}();
52
+		$method = '_get'.ucfirst($page_type_name).'Content';
53
+		if (method_exists($this, $method)) $page_content = $this->{$method}();
54 54
 		else return new Object(-1, sprintf('%s method is not exists', $method));
55 55
 
56 56
 		Context::set('module_info', $this->module_info);
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
 
62 62
 	function _getWidgetContent()
63 63
 	{
64
-		if($this->interval>0)
64
+		if ($this->interval > 0)
65 65
 		{
66
-			if(!file_exists($this->cache_file)) $mtime = 0;
66
+			if (!file_exists($this->cache_file)) $mtime = 0;
67 67
 			else $mtime = filemtime($this->cache_file);
68 68
 
69
-			if($mtime + $this->interval*60 > $_SERVER['REQUEST_TIME'])
69
+			if ($mtime + $this->interval * 60 > $_SERVER['REQUEST_TIME'])
70 70
 			{
71 71
 				$page_content = FileHandler::readFile($this->cache_file); 
72 72
 				$page_content = preg_replace('@<\!--#Meta:@', '<!--Meta:', $page_content);
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 		}
81 81
 		else
82 82
 		{
83
-			if(file_exists($this->cache_file)) FileHandler::removeFile($this->cache_file);
83
+			if (file_exists($this->cache_file)) FileHandler::removeFile($this->cache_file);
84 84
 			$page_content = $this->module_info->content;
85 85
 		}
86 86
 		return $page_content;
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 		$oDocumentModel = getModel('document');
94 94
 		$oDocument = $oDocumentModel->getDocument(0, true);
95 95
 
96
-		if($this->module_info->document_srl)
96
+		if ($this->module_info->document_srl)
97 97
 		{
98 98
 			$document_srl = $this->module_info->document_srl;
99 99
 			$oDocument->setDocument($document_srl);
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
 	function _getOutsideContent()
119 119
 	{
120 120
 		// check if it is http or internal file
121
-		if($this->path)
121
+		if ($this->path)
122 122
 		{
123
-			if(preg_match("/^([a-z]+):\/\//i",$this->path)) $content = $this->getHtmlPage($this->path, $this->interval, $this->cache_file);
123
+			if (preg_match("/^([a-z]+):\/\//i", $this->path)) $content = $this->getHtmlPage($this->path, $this->interval, $this->cache_file);
124 124
 			else $content = $this->executeFile($this->path, $this->interval, $this->cache_file);
125 125
 		}
126 126
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	function getHtmlPage($path, $caching_interval, $cache_file)
134 134
 	{
135 135
 		// Verify cache
136
-		if($caching_interval > 0 && file_exists($cache_file) && filemtime($cache_file) + $caching_interval*60 > $_SERVER['REQUEST_TIME'])
136
+		if ($caching_interval > 0 && file_exists($cache_file) && filemtime($cache_file) + $caching_interval * 60 > $_SERVER['REQUEST_TIME'])
137 137
 		{
138 138
 			$content = FileHandler::readFile($cache_file);
139 139
 		}
@@ -154,13 +154,13 @@  discard block
 block discarded – undo
154 154
 		$content = $buff->content;
155 155
 		// Extract a title
156 156
 		$title = $oPageController->getTitle($content);
157
-		if($title) Context::setBrowserTitle($title);
157
+		if ($title) Context::setBrowserTitle($title);
158 158
 		// Extract header script
159 159
 		$head_script = $oPageController->getHeadScript($content);
160
-		if($head_script) Context::addHtmlHeader($head_script);
160
+		if ($head_script) Context::addHtmlHeader($head_script);
161 161
 		// Extract content from the body
162 162
 		$body_script = $oPageController->getBodyScript($content);
163
-		if(!$body_script) $body_script = $content;
163
+		if (!$body_script) $body_script = $content;
164 164
 
165 165
 		return $content;
166 166
 	}
@@ -171,32 +171,32 @@  discard block
 block discarded – undo
171 171
 	function executeFile($target_file, $caching_interval, $cache_file)
172 172
 	{
173 173
 		// Cancel if the file doesn't exist
174
-		if(!file_exists(FileHandler::getRealPath($target_file))) return;
174
+		if (!file_exists(FileHandler::getRealPath($target_file))) return;
175 175
 
176 176
 		// Get a path and filename
177
-		$tmp_path = explode('/',$cache_file);
178
-		$filename = $tmp_path[count($tmp_path)-1];
179
-		$filepath = preg_replace('/'.$filename."$/i","",$cache_file);
177
+		$tmp_path = explode('/', $cache_file);
178
+		$filename = $tmp_path[count($tmp_path) - 1];
179
+		$filepath = preg_replace('/'.$filename."$/i", "", $cache_file);
180 180
 		$cache_file = FileHandler::getRealPath($cache_file);
181 181
 
182 182
 		$level = ob_get_level();
183 183
 		// Verify cache
184
-		if($caching_interval <1 || !file_exists($cache_file) || filemtime($cache_file) + $caching_interval*60 <= $_SERVER['REQUEST_TIME'] || filemtime($cache_file)<filemtime($target_file))
184
+		if ($caching_interval < 1 || !file_exists($cache_file) || filemtime($cache_file) + $caching_interval * 60 <= $_SERVER['REQUEST_TIME'] || filemtime($cache_file) < filemtime($target_file))
185 185
 		{
186
-			if(file_exists($cache_file)) FileHandler::removeFile($cache_file);
186
+			if (file_exists($cache_file)) FileHandler::removeFile($cache_file);
187 187
 
188 188
 			// Read a target file and get content
189 189
 			ob_start();
190 190
 			include(FileHandler::getRealPath($target_file));
191 191
 			$content = ob_get_clean();
192 192
 			// Replace relative path to the absolute path 
193
-			$this->path = str_replace('\\', '/', realpath(dirname($target_file))) . '/';
194
-			$content = preg_replace_callback('/(target=|src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is',array($this,'_replacePath'),$content);
195
-			$content = preg_replace_callback('/(<!--%import\()(\")([^"]+)(\")/is',array($this,'_replacePath'),$content);
193
+			$this->path = str_replace('\\', '/', realpath(dirname($target_file))).'/';
194
+			$content = preg_replace_callback('/(target=|src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is', array($this, '_replacePath'), $content);
195
+			$content = preg_replace_callback('/(<!--%import\()(\")([^"]+)(\")/is', array($this, '_replacePath'), $content);
196 196
 
197 197
 			FileHandler::writeFile($cache_file, $content);
198 198
 			// Include and then Return the result
199
-			if(!file_exists($cache_file)) return;
199
+			if (!file_exists($cache_file)) return;
200 200
 			// Attempt to compile
201 201
 			$oTemplate = &TemplateHandler::getInstance();
202 202
 			$script = $oTemplate->compileDirect($filepath, $filename);
@@ -223,20 +223,20 @@  discard block
 block discarded – undo
223 223
 		$val = trim($matches[3]);
224 224
 		// Pass if the path is external or starts with /, #, { characters
225 225
 		// /=absolute path, #=hash in a page, {=Template syntax
226
-		if(strpos($val, '.') === FALSE || preg_match('@^((?:http|https|ftp|telnet|mms)://|(?:mailto|javascript):|[/#{])@i',$val))
226
+		if (strpos($val, '.') === FALSE || preg_match('@^((?:http|https|ftp|telnet|mms)://|(?:mailto|javascript):|[/#{])@i', $val))
227 227
 		{
228 228
 				return $matches[0];
229 229
 			// In case of  .. , get a path
230 230
 		}
231
-		else if(strncasecmp('..', $val, 2) === 0)
231
+		else if (strncasecmp('..', $val, 2) === 0)
232 232
 		{
233 233
 			$p = Context::pathToUrl($this->path);
234
-			return sprintf("%s%s%s%s",$matches[1],$matches[2],$p.$val,$matches[4]);
234
+			return sprintf("%s%s%s%s", $matches[1], $matches[2], $p.$val, $matches[4]);
235 235
 		}
236 236
 
237
-		if(strncasecmp('..', $val, 2) === 0) $val = substr($val,2);
237
+		if (strncasecmp('..', $val, 2) === 0) $val = substr($val, 2);
238 238
 		$p = Context::pathToUrl($this->path);
239
-		$path = sprintf("%s%s%s%s",$matches[1],$matches[2],$p.$val,$matches[4]);
239
+		$path = sprintf("%s%s%s%s", $matches[1], $matches[2], $p.$val, $matches[4]);
240 240
 
241 241
 		return $path;
242 242
 	}
Please login to merge, or discard this patch.
modules/point/point.controller.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -478,6 +478,7 @@
 block discarded – undo
478 478
 
479 479
 	/**
480 480
 	 * @brief Set points
481
+	 * @param string $mode
481 482
 	 */
482 483
 	function setPoint($member_srl, $point, $mode = null)
483 484
 	{
Please login to merge, or discard this patch.
Braces   +186 added lines, -66 removed lines patch added patch discarded remove patch
@@ -42,9 +42,13 @@  discard block
 block discarded – undo
42 42
 	function triggerAfterLogin(&$obj)
43 43
 	{
44 44
 		$member_srl = $obj->member_srl;
45
-		if(!$member_srl) return new Object();
45
+		if(!$member_srl) {
46
+			return new Object();
47
+		}
46 48
 		// If the last login is not today, give the points
47
-		if(substr($obj->last_login,0,8)==date("Ymd")) return new Object();
49
+		if(substr($obj->last_login,0,8)==date("Ymd")) {
50
+			return new Object();
51
+		}
48 52
 		// Get the point module information
49 53
 		$oModuleModel = getModel('module');
50 54
 		$config = $oModuleModel->getModuleConfig('point');
@@ -70,9 +74,13 @@  discard block
 block discarded – undo
70 74
 		{
71 75
 			$module_srl = $obj->module_srl;
72 76
 			$member_srl = $obj->member_srl;
73
-			if(!$module_srl || !$member_srl) return new Object();
77
+			if(!$module_srl || !$member_srl) {
78
+				return new Object();
79
+			}
74 80
 			// The fix to disable giving points for saving the document temporarily
75
-			if($module_srl == $member_srl) return new Object();
81
+			if($module_srl == $member_srl) {
82
+				return new Object();
83
+			}
76 84
 			// Get the point module information
77 85
 			$oModuleModel = getModel('module');
78 86
 			$config = $oModuleModel->getModuleConfig('point');
@@ -82,12 +90,18 @@  discard block
 block discarded – undo
82 90
 			$cur_point = $oPointModel->getPoint($member_srl, true);
83 91
 
84 92
 			$point = $module_config['insert_document'];
85
-			if(strlen($point) == 0 && !is_int($point)) $point = $config->insert_document;
93
+			if(strlen($point) == 0 && !is_int($point)) {
94
+				$point = $config->insert_document;
95
+			}
86 96
 			$cur_point += $point;
87 97
 			// Add points for attaching a file
88 98
 			$point = $module_config['upload_file'];
89
-			if(strlen($point) == 0 && !is_int($point)) $point = $config->upload_file;
90
-			if($obj->uploaded_count) $cur_point += $point * $obj->uploaded_count;
99
+			if(strlen($point) == 0 && !is_int($point)) {
100
+				$point = $config->upload_file;
101
+			}
102
+			if($obj->uploaded_count) {
103
+				$cur_point += $point * $obj->uploaded_count;
104
+			}
91 105
 			// Increase the point
92 106
 			$this->setPoint($member_srl,$cur_point);
93 107
 		}
@@ -118,12 +132,18 @@  discard block
 block discarded – undo
118 132
 			$cur_point = $oPointModel->getPoint($oDocument->get('member_srl'), true);
119 133
 
120 134
 			$point = $module_config['insert_document'];
121
-			if(strlen($point) == 0 && !is_int($point)) $point = $config->insert_document;
135
+			if(strlen($point) == 0 && !is_int($point)) {
136
+				$point = $config->insert_document;
137
+			}
122 138
 			$cur_point += $point;
123 139
 			// Add points for attaching a file
124 140
 			$point = $module_config['upload_file'];
125
-			if(strlen($point) == 0 && !is_int($point)) $point = $config->upload_file;
126
-			if($obj->uploaded_count) $cur_point += $point * $obj->uploaded_count;
141
+			if(strlen($point) == 0 && !is_int($point)) {
142
+				$point = $config->upload_file;
143
+			}
144
+			if($obj->uploaded_count) {
145
+				$cur_point += $point * $obj->uploaded_count;
146
+			}
127 147
 			// Increase the point
128 148
 			$this->setPoint($oDocument->get('member_srl'), $cur_point);
129 149
 		}
@@ -141,33 +161,47 @@  discard block
 block discarded – undo
141 161
 
142 162
 		$oDocumentModel = getModel('document');
143 163
 		$oDocument = $oDocumentModel->getDocument($document_srl);
144
-		if(!$oDocument->isExists()) return new Object();
164
+		if(!$oDocument->isExists()) {
165
+			return new Object();
166
+		}
145 167
 		// Get the point module information
146 168
 		$oModuleModel = getModel('module');
147 169
 		$config = $oModuleModel->getModuleConfig('point');
148 170
 		$module_config = $oModuleModel->getModulePartConfig('point',$oDocument->get('module_srl'));
149 171
 		// The process related to clearing the post comments
150 172
 		$comment_point = $module_config['insert_comment'];
151
-		if(strlen($comment_point) == 0 && !is_int($comment_point)) $comment_point = $config->insert_comment;
173
+		if(strlen($comment_point) == 0 && !is_int($comment_point)) {
174
+			$comment_point = $config->insert_comment;
175
+		}
152 176
 		// If there are comment points, attempt to deduct
153
-		if($comment_point>0) return new Object();
177
+		if($comment_point>0) {
178
+			return new Object();
179
+		}
154 180
 		// Get all the comments related to this post
155 181
 		$cp_args = new stdClass();
156 182
 		$cp_args->document_srl = $document_srl;
157 183
 		$output = executeQueryArray('point.getCommentUsers', $cp_args);
158 184
 		// Return if there is no object
159
-		if(!$output->data) return new Object();
185
+		if(!$output->data) {
186
+			return new Object();
187
+		}
160 188
 		// Organize the member number
161 189
 		$member_srls = array();
162 190
 		$cnt = count($output->data);
163 191
 		for($i=0;$i<$cnt;$i++)
164 192
 		{
165
-			if($output->data[$i]->member_srl<1) continue;
193
+			if($output->data[$i]->member_srl<1) {
194
+				continue;
195
+			}
166 196
 			$member_srls[abs($output->data[$i]->member_srl)] = $output->data[$i]->count;
167 197
 		}
168 198
 		// Remove the member number who has written the original post
169
-		if($member_srl) unset($member_srls[abs($member_srl)]);
170
-		if(!count($member_srls)) return new Object();
199
+		if($member_srl) {
200
+			unset($member_srls[abs($member_srl)]);
201
+		}
202
+		if(!count($member_srls)) {
203
+			return new Object();
204
+		}
171 205
 		// Remove all the points for each member
172 206
 		$oPointModel = getModel('point');
173 207
 		// Get the points
@@ -190,10 +224,14 @@  discard block
 block discarded – undo
190 224
 		$module_srl = $obj->module_srl;
191 225
 		$member_srl = $obj->member_srl;
192 226
 		// The process related to clearing the post object
193
-		if(!$module_srl || !$member_srl) return new Object();
227
+		if(!$module_srl || !$member_srl) {
228
+			return new Object();
229
+		}
194 230
 		// Run only when logged in
195 231
 		$logged_info = Context::get('logged_info');
196
-		if(!$logged_info->member_srl) return new Object();
232
+		if(!$logged_info->member_srl) {
233
+			return new Object();
234
+		}
197 235
 		// Get the points of the member
198 236
 		$oPointModel = getModel('point');
199 237
 		$cur_point = $oPointModel->getPoint($member_srl, true);
@@ -203,14 +241,22 @@  discard block
 block discarded – undo
203 241
 		$module_config = $oModuleModel->getModulePartConfig('point', $module_srl);
204 242
 
205 243
 		$point = $module_config['insert_document'];
206
-		if(strlen($point) == 0 && !is_int($point)) $point = $config->insert_document;
244
+		if(strlen($point) == 0 && !is_int($point)) {
245
+			$point = $config->insert_document;
246
+		}
207 247
 		// if the point is set to decrease when writing a document, make sure it does not increase the points when deleting an article
208
-		if($point < 0) return new Object();
248
+		if($point < 0) {
249
+			return new Object();
250
+		}
209 251
 		$cur_point -= $point;
210 252
 		// Add points related to deleting an attachment
211 253
 		$point = $module_config['upload_file'];
212
-		if(strlen($point) == 0 && !is_int($point)) $point = $config->upload_file;
213
-		if($obj->uploaded_count) $cur_point -= $point * $obj->uploaded_count;
254
+		if(strlen($point) == 0 && !is_int($point)) {
255
+			$point = $config->upload_file;
256
+		}
257
+		if($obj->uploaded_count) {
258
+			$cur_point -= $point * $obj->uploaded_count;
259
+		}
214 260
 		// Increase the point
215 261
 		$this->setPoint($member_srl,$cur_point);
216 262
 
@@ -224,12 +270,16 @@  discard block
 block discarded – undo
224 270
 	{
225 271
 		$module_srl = $obj->module_srl;
226 272
 		$member_srl = $obj->member_srl;
227
-		if(!$module_srl || !$member_srl) return new Object();
273
+		if(!$module_srl || !$member_srl) {
274
+			return new Object();
275
+		}
228 276
 		// Do not increase the points if the member is the author of the post
229 277
 		$document_srl = $obj->document_srl;
230 278
 		$oDocumentModel = getModel('document');
231 279
 		$oDocument = $oDocumentModel->getDocument($document_srl);
232
-		if(!$oDocument->isExists() || abs($oDocument->get('member_srl'))==abs($member_srl)) return new Object();
280
+		if(!$oDocument->isExists() || abs($oDocument->get('member_srl'))==abs($member_srl)) {
281
+			return new Object();
282
+		}
233 283
 		// Get the point module information
234 284
 		$oModuleModel = getModel('module');
235 285
 		$config = $oModuleModel->getModuleConfig('point');
@@ -239,7 +289,9 @@  discard block
 block discarded – undo
239 289
 		$cur_point = $oPointModel->getPoint($member_srl, true);
240 290
 
241 291
 		$point = $module_config['insert_comment'];
242
-		if(strlen($point) == 0 && !is_int($point)) $point = $config->insert_comment;
292
+		if(strlen($point) == 0 && !is_int($point)) {
293
+			$point = $config->insert_comment;
294
+		}
243 295
 		// Increase the point
244 296
 		$cur_point += $point;
245 297
 		$this->setPoint($member_srl,$cur_point);
@@ -259,11 +311,17 @@  discard block
 block discarded – undo
259 311
 		$module_srl = $obj->module_srl;
260 312
 		$member_srl = abs($obj->member_srl);
261 313
 		$document_srl = $obj->document_srl;
262
-		if(!$module_srl || !$member_srl) return new Object();
314
+		if(!$module_srl || !$member_srl) {
315
+			return new Object();
316
+		}
263 317
 		// Get the original article (if the original article is missing or if the member is its author, do not apply the points)
264 318
 		$oDocument = $oDocumentModel->getDocument($document_srl);
265
-		if(!$oDocument->isExists()) return new Object();
266
-		if($oDocument->get('member_srl')==$member_srl) return new Object();
319
+		if(!$oDocument->isExists()) {
320
+			return new Object();
321
+		}
322
+		if($oDocument->get('member_srl')==$member_srl) {
323
+			return new Object();
324
+		}
267 325
 		// Get the point module information
268 326
 		$config = $oModuleModel->getModuleConfig('point');
269 327
 		$module_config = $oModuleModel->getModulePartConfig('point', $module_srl);
@@ -271,9 +329,13 @@  discard block
 block discarded – undo
271 329
 		$cur_point = $oPointModel->getPoint($member_srl, true);
272 330
 
273 331
 		$point = $module_config['insert_comment'];
274
-		if(strlen($point) == 0 && !is_int($point)) $point = $config->insert_comment;
332
+		if(strlen($point) == 0 && !is_int($point)) {
333
+			$point = $config->insert_comment;
334
+		}
275 335
 		// if the point is set to decrease when writing a comment, make sure it does not increase the points when deleting a comment
276
-		if($point < 0) return new Object();
336
+		if($point < 0) {
337
+			return new Object();
338
+		}
277 339
 		// Increase the point
278 340
 		$cur_point -= $point;
279 341
 		$this->setPoint($member_srl,$cur_point);
@@ -296,11 +358,15 @@  discard block
 block discarded – undo
296 358
 	 */
297 359
 	function triggerDeleteFile(&$obj)
298 360
 	{
299
-		if($obj->isvalid != 'Y') return new Object();
361
+		if($obj->isvalid != 'Y') {
362
+			return new Object();
363
+		}
300 364
 
301 365
 		$module_srl = $obj->module_srl;
302 366
 		$member_srl = $obj->member_srl;
303
-		if(!$module_srl || !$member_srl) return new Object();
367
+		if(!$module_srl || !$member_srl) {
368
+			return new Object();
369
+		}
304 370
 		// Get the point module information
305 371
 		$oModuleModel = getModel('module');
306 372
 		$config = $oModuleModel->getModuleConfig('point');
@@ -310,7 +376,9 @@  discard block
 block discarded – undo
310 376
 		$cur_point = $oPointModel->getPoint($member_srl, true);
311 377
 
312 378
 		$point = $module_config['upload_file'];
313
-		if(strlen($point) == 0 && !is_int($point)) $point = $config->upload_file;
379
+		if(strlen($point) == 0 && !is_int($point)) {
380
+			$point = $config->upload_file;
381
+		}
314 382
 		// Increase the point
315 383
 		$cur_point -= $point;
316 384
 		$this->setPoint($member_srl,$cur_point);
@@ -326,9 +394,13 @@  discard block
 block discarded – undo
326 394
 		$logged_info = Context::get('logged_info');
327 395
 		$member_srl = $logged_info->member_srl;
328 396
 		$module_srl = $obj->module_srl;
329
-		if(!$module_srl) return new Object();
397
+		if(!$module_srl) {
398
+			return new Object();
399
+		}
330 400
 		// Pass if it is your file
331
-		if(abs($obj->member_srl) == abs($member_srl)) return new Object();
401
+		if(abs($obj->member_srl) == abs($member_srl)) {
402
+			return new Object();
403
+		}
332 404
 
333 405
 		$oModuleModel = getModel('module');
334 406
 		$config = $oModuleModel->getModuleConfig('point');
@@ -336,17 +408,24 @@  discard block
 block discarded – undo
336 408
 		// If it is set not to allow downloading for non-logged in users, do not permit
337 409
 		if(!Context::get('is_logged'))
338 410
 		{
339
-			if($config->disable_download == 'Y' && strlen($module_config['download_file']) == 0 && !is_int($module_config['download_file'])) return new Object(-1,'msg_not_permitted_download');
340
-			else return new Object();
411
+			if($config->disable_download == 'Y' && strlen($module_config['download_file']) == 0 && !is_int($module_config['download_file'])) {
412
+				return new Object(-1,'msg_not_permitted_download');
413
+			} else {
414
+				return new Object();
415
+			}
341 416
 		}
342 417
 		// Get the points of the member
343 418
 		$oPointModel = getModel('point');
344 419
 		$cur_point = $oPointModel->getPoint($member_srl, true);
345 420
 		// Get the points
346 421
 		$point = $module_config['download_file'];
347
-		if(strlen($point) == 0 && !is_int($point)) $point = $config->download_file;
422
+		if(strlen($point) == 0 && !is_int($point)) {
423
+			$point = $config->download_file;
424
+		}
348 425
 		// If points are less than 0, and if downloading a file is not allowed in this case, give an errors
349
-		if($cur_point + $point < 0 && $config->disable_download == 'Y') return new Object(-1,'msg_cannot_download');
426
+		if($cur_point + $point < 0 && $config->disable_download == 'Y') {
427
+			return new Object(-1,'msg_cannot_download');
428
+		}
350 429
 
351 430
 		return new Object();
352 431
 	}
@@ -358,12 +437,18 @@  discard block
 block discarded – undo
358 437
 	{
359 438
 		// Run only when logged in
360 439
 		$logged_info = Context::get('logged_info');
361
-		if(!$logged_info->member_srl) return new Object();
440
+		if(!$logged_info->member_srl) {
441
+			return new Object();
442
+		}
362 443
 		$module_srl = $obj->module_srl;
363 444
 		$member_srl = $logged_info->member_srl;
364
-		if(!$module_srl) return new Object();
445
+		if(!$module_srl) {
446
+			return new Object();
447
+		}
365 448
 		// Pass if it is your file
366
-		if(abs($obj->member_srl) == abs($member_srl)) return new Object();
449
+		if(abs($obj->member_srl) == abs($member_srl)) {
450
+			return new Object();
451
+		}
367 452
 		// Get the point module information
368 453
 		$oModuleModel = getModel('module');
369 454
 		$config = $oModuleModel->getModuleConfig('point');
@@ -373,7 +458,9 @@  discard block
 block discarded – undo
373 458
 		$cur_point = $oPointModel->getPoint($member_srl, true);
374 459
 		// Get the points
375 460
 		$point = $module_config['download_file'];
376
-		if(strlen($point) == 0 && !is_int($point)) $point = $config->download_file;
461
+		if(strlen($point) == 0 && !is_int($point)) {
462
+			$point = $config->download_file;
463
+		}
377 464
 		// Increase the point
378 465
 		$cur_point += $point;
379 466
 		$this->setPoint($member_srl,$cur_point);
@@ -395,25 +482,32 @@  discard block
 block discarded – undo
395 482
 		// Get the original author number
396 483
 		$target_member_srl = abs($obj->get('member_srl'));
397 484
 		// Pass without increasing the hits if the viewer is the same as the author
398
-		if($target_member_srl == $member_srl) return new Object();
485
+		if($target_member_srl == $member_srl) {
486
+			return new Object();
487
+		}
399 488
 		// Get the point information for each module
400 489
 		$config = $oModuleModel->getModuleConfig('point');
401 490
 		$module_config = $oModuleModel->getModulePartConfig('point', $obj->get('module_srl'));
402 491
 		// Get hits points
403 492
 		$point = $module_config['read_document'];
404
-		if(strlen($point) == 0 && !is_int($point)) $point = $config->read_document;
493
+		if(strlen($point) == 0 && !is_int($point)) {
494
+			$point = $config->read_document;
495
+		}
405 496
 		// Pass if there are no requested points
406
-		if(!$point) return new Object();
497
+		if(!$point) {
498
+			return new Object();
499
+		}
407 500
 		// In case of a registered member, if it is read but cannot just pass, then get the current points
408 501
 		if($member_srl)
409 502
 		{
410 503
 			$args->member_srl = $member_srl;
411 504
 			$args->document_srl = $obj->document_srl;
412 505
 			$output = executeQuery('document.getDocumentReadedLogInfo', $args);
413
-			if($output->data->count) return new Object();
506
+			if($output->data->count) {
507
+				return new Object();
508
+			}
414 509
 			$cur_point = $oPointModel->getPoint($member_srl, true);
415
-		}
416
-		else
510
+		} else
417 511
 		{
418 512
 			$cur_point = 0;
419 513
 		}
@@ -429,9 +523,13 @@  discard block
 block discarded – undo
429 523
 			return new Object(-1, $message);
430 524
 		}
431 525
 		// If not logged in, pass
432
-		if(!$logged_info->member_srl) return new Object();
526
+		if(!$logged_info->member_srl) {
527
+			return new Object();
528
+		}
433 529
 		// Pass, if there are no requested points
434
-		if(!$point) return new Object();
530
+		if(!$point) {
531
+			return new Object();
532
+		}
435 533
 		// If the read record is missing, leave it
436 534
 		$output = executeQuery('document.insertDocumentReadedLog', $args);
437 535
 		// Increase the point
@@ -448,7 +546,9 @@  discard block
 block discarded – undo
448 546
 	{
449 547
 		$module_srl = $obj->module_srl;
450 548
 		$member_srl = $obj->member_srl;
451
-		if(!$module_srl || !$member_srl) return new Object();
549
+		if(!$module_srl || !$member_srl) {
550
+			return new Object();
551
+		}
452 552
 
453 553
 		$oModuleModel = getModel('module');
454 554
 		$config = $oModuleModel->getModuleConfig('point');
@@ -460,15 +560,20 @@  discard block
 block discarded – undo
460 560
 		if( $obj->point > 0 )
461 561
 		{
462 562
 			$point = $module_config['voted'];
463
-			if(strlen($point) == 0 && !is_int($point)) $point = $config->voted;
464
-		}
465
-		else
563
+			if(strlen($point) == 0 && !is_int($point)) {
564
+				$point = $config->voted;
565
+			}
566
+		} else
466 567
 		{
467 568
 			$point = $module_config['blamed'];
468
-			if(strlen($point) == 0 && !is_int($point)) $point = $config->blamed;
569
+			if(strlen($point) == 0 && !is_int($point)) {
570
+				$point = $config->blamed;
571
+			}
469 572
 		}
470 573
 
471
-		if(!$point) return new Object();
574
+		if(!$point) {
575
+			return new Object();
576
+		}
472 577
 		// Increase the point
473 578
 		$cur_point += $point;
474 579
 		$this->setPoint($member_srl,$cur_point);
@@ -483,7 +588,9 @@  discard block
 block discarded – undo
483 588
 	{
484 589
 		$member_srl = abs($member_srl);
485 590
 		$mode_arr = array('add', 'minus', 'update', 'signup');
486
-		if(!$mode || !in_array($mode,$mode_arr)) $mode = 'update';
591
+		if(!$mode || !in_array($mode,$mode_arr)) {
592
+			$mode = 'update';
593
+		}
487 594
 
488 595
 		// Get configuration information
489 596
 		$oMemberModel = getModel('member');
@@ -513,7 +620,9 @@  discard block
 block discarded – undo
513 620
 				$args->point = $point;
514 621
 				break;
515 622
 		}
516
-		if($args->point < 0) $args->point = 0;
623
+		if($args->point < 0) {
624
+			$args->point = 0;
625
+		}
517 626
 		$point = $args->point;
518 627
 
519 628
 		// Call a trigger (before)
@@ -535,8 +644,11 @@  discard block
 block discarded – undo
535 644
 
536 645
 		// If there are points, update, if no, insert
537 646
 		$oPointModel = getModel('point');
538
-		if($oPointModel->isExistsPoint($member_srl)) executeQuery("point.updatePoint", $args);
539
-		else executeQuery("point.insertPoint", $args);
647
+		if($oPointModel->isExistsPoint($member_srl)) {
648
+			executeQuery("point.updatePoint", $args);
649
+		} else {
650
+			executeQuery("point.insertPoint", $args);
651
+		}
540 652
 
541 653
 		// Get a new level
542 654
 		$level = $oPointModel->getLevel($point, $config->level_step);
@@ -566,7 +678,9 @@  discard block
 block discarded – undo
566 678
 						foreach($point_group as $group_srl => $target_level)
567 679
 						{
568 680
 							$del_group_list[] = $group_srl;
569
-							if($target_level == $level) $new_group_list[] = $group_srl;
681
+							if($target_level == $level) {
682
+								$new_group_list[] = $group_srl;
683
+							}
570 684
 						}
571 685
 					}
572 686
 					// Otherwise, in case the level is reduced, add the recent group
@@ -592,7 +706,9 @@  discard block
 block discarded – undo
592 706
 					// Delete the group of a level which is higher than the current level
593 707
 					foreach($point_group as $group_srl => $target_level)
594 708
 					{
595
-						if($target_level > $level) $del_group_list[] = $group_srl;
709
+						if($target_level > $level) {
710
+							$del_group_list[] = $group_srl;
711
+						}
596 712
 					}
597 713
 					$del_group_list[] = $default_group->group_srl;
598 714
 				}
@@ -603,11 +719,15 @@  discard block
 block discarded – undo
603 719
 					foreach($point_group as $group_srl => $target_level)
604 720
 					{
605 721
 						$del_group_list[] = $group_srl;
606
-						if($target_level <= $level) $new_group_list[] = $group_srl;
722
+						if($target_level <= $level) {
723
+							$new_group_list[] = $group_srl;
724
+						}
607 725
 					}
608 726
 				}
609 727
 				// If there is no a new group, granted the default group
610
-				if(!$new_group_list[0]) $new_group_list[0] = $default_group->group_srl;
728
+				if(!$new_group_list[0]) {
729
+					$new_group_list[0] = $default_group->group_srl;
730
+				}
611 731
 				// Remove linkage group
612 732
 				if($del_group_list && count($del_group_list))
613 733
 				{
Please login to merge, or discard this patch.
Spacing   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 		$point = $config->signup_point;
32 32
 		// Increase the point
33 33
 		$cur_point += $point;
34
-		$this->setPoint($member_srl,$cur_point, 'signup');
34
+		$this->setPoint($member_srl, $cur_point, 'signup');
35 35
 
36 36
 		return new Object();
37 37
 	}
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	function triggerAfterLogin(&$obj)
43 43
 	{
44 44
 		$member_srl = $obj->member_srl;
45
-		if(!$member_srl) return new Object();
45
+		if (!$member_srl) return new Object();
46 46
 		// If the last login is not today, give the points
47
-		if(substr($obj->last_login,0,8)==date("Ymd")) return new Object();
47
+		if (substr($obj->last_login, 0, 8) == date("Ymd")) return new Object();
48 48
 		// Get the point module information
49 49
 		$oModuleModel = getModel('module');
50 50
 		$config = $oModuleModel->getModuleConfig('point');
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 		$point = $config->login_point;
56 56
 		// Increase the point
57 57
 		$cur_point += $point;
58
-		$this->setPoint($member_srl,$cur_point);
58
+		$this->setPoint($member_srl, $cur_point);
59 59
 
60 60
 		return new Object();
61 61
 	}
@@ -66,30 +66,30 @@  discard block
 block discarded – undo
66 66
 	function triggerInsertDocument(&$obj)
67 67
 	{
68 68
 		$oDocumentModel = getModel('document');
69
-		if($obj->status != $oDocumentModel->getConfigStatus('temp'))
69
+		if ($obj->status != $oDocumentModel->getConfigStatus('temp'))
70 70
 		{
71 71
 			$module_srl = $obj->module_srl;
72 72
 			$member_srl = $obj->member_srl;
73
-			if(!$module_srl || !$member_srl) return new Object();
73
+			if (!$module_srl || !$member_srl) return new Object();
74 74
 			// The fix to disable giving points for saving the document temporarily
75
-			if($module_srl == $member_srl) return new Object();
75
+			if ($module_srl == $member_srl) return new Object();
76 76
 			// Get the point module information
77 77
 			$oModuleModel = getModel('module');
78 78
 			$config = $oModuleModel->getModuleConfig('point');
79
-			$module_config = $oModuleModel->getModulePartConfig('point',$module_srl);
79
+			$module_config = $oModuleModel->getModulePartConfig('point', $module_srl);
80 80
 			// Get the points of the member
81 81
 			$oPointModel = getModel('point');
82 82
 			$cur_point = $oPointModel->getPoint($member_srl, true);
83 83
 
84 84
 			$point = $module_config['insert_document'];
85
-			if(strlen($point) == 0 && !is_int($point)) $point = $config->insert_document;
85
+			if (strlen($point) == 0 && !is_int($point)) $point = $config->insert_document;
86 86
 			$cur_point += $point;
87 87
 			// Add points for attaching a file
88 88
 			$point = $module_config['upload_file'];
89
-			if(strlen($point) == 0 && !is_int($point)) $point = $config->upload_file;
90
-			if($obj->uploaded_count) $cur_point += $point * $obj->uploaded_count;
89
+			if (strlen($point) == 0 && !is_int($point)) $point = $config->upload_file;
90
+			if ($obj->uploaded_count) $cur_point += $point * $obj->uploaded_count;
91 91
 			// Increase the point
92
-			$this->setPoint($member_srl,$cur_point);
92
+			$this->setPoint($member_srl, $cur_point);
93 93
 		}
94 94
 
95 95
 		return new Object();
@@ -106,24 +106,24 @@  discard block
 block discarded – undo
106 106
 		$oDocument = $oDocumentModel->getDocument($document_srl);
107 107
 
108 108
 		// if status is TEMP or PUBLIC... give not point, only status is empty
109
-		if($oDocument->get('status') == $oDocumentModel->getConfigStatus('temp') && $obj->status != $oDocumentModel->getConfigStatus('temp'))
109
+		if ($oDocument->get('status') == $oDocumentModel->getConfigStatus('temp') && $obj->status != $oDocumentModel->getConfigStatus('temp'))
110 110
 		{
111 111
 			$oModuleModel = getModel('module');
112 112
 
113 113
 			// Get the point module information
114 114
 			$config = $oModuleModel->getModuleConfig('point');
115
-			$module_config = $oModuleModel->getModulePartConfig('point',$obj->module_srl);
115
+			$module_config = $oModuleModel->getModulePartConfig('point', $obj->module_srl);
116 116
 			// Get the points of the member
117 117
 			$oPointModel = getModel('point');
118 118
 			$cur_point = $oPointModel->getPoint($oDocument->get('member_srl'), true);
119 119
 
120 120
 			$point = $module_config['insert_document'];
121
-			if(strlen($point) == 0 && !is_int($point)) $point = $config->insert_document;
121
+			if (strlen($point) == 0 && !is_int($point)) $point = $config->insert_document;
122 122
 			$cur_point += $point;
123 123
 			// Add points for attaching a file
124 124
 			$point = $module_config['upload_file'];
125
-			if(strlen($point) == 0 && !is_int($point)) $point = $config->upload_file;
126
-			if($obj->uploaded_count) $cur_point += $point * $obj->uploaded_count;
125
+			if (strlen($point) == 0 && !is_int($point)) $point = $config->upload_file;
126
+			if ($obj->uploaded_count) $cur_point += $point * $obj->uploaded_count;
127 127
 			// Increase the point
128 128
 			$this->setPoint($oDocument->get('member_srl'), $cur_point);
129 129
 		}
@@ -141,42 +141,42 @@  discard block
 block discarded – undo
141 141
 
142 142
 		$oDocumentModel = getModel('document');
143 143
 		$oDocument = $oDocumentModel->getDocument($document_srl);
144
-		if(!$oDocument->isExists()) return new Object();
144
+		if (!$oDocument->isExists()) return new Object();
145 145
 		// Get the point module information
146 146
 		$oModuleModel = getModel('module');
147 147
 		$config = $oModuleModel->getModuleConfig('point');
148
-		$module_config = $oModuleModel->getModulePartConfig('point',$oDocument->get('module_srl'));
148
+		$module_config = $oModuleModel->getModulePartConfig('point', $oDocument->get('module_srl'));
149 149
 		// The process related to clearing the post comments
150 150
 		$comment_point = $module_config['insert_comment'];
151
-		if(strlen($comment_point) == 0 && !is_int($comment_point)) $comment_point = $config->insert_comment;
151
+		if (strlen($comment_point) == 0 && !is_int($comment_point)) $comment_point = $config->insert_comment;
152 152
 		// If there are comment points, attempt to deduct
153
-		if($comment_point>0) return new Object();
153
+		if ($comment_point > 0) return new Object();
154 154
 		// Get all the comments related to this post
155 155
 		$cp_args = new stdClass();
156 156
 		$cp_args->document_srl = $document_srl;
157 157
 		$output = executeQueryArray('point.getCommentUsers', $cp_args);
158 158
 		// Return if there is no object
159
-		if(!$output->data) return new Object();
159
+		if (!$output->data) return new Object();
160 160
 		// Organize the member number
161 161
 		$member_srls = array();
162 162
 		$cnt = count($output->data);
163
-		for($i=0;$i<$cnt;$i++)
163
+		for ($i = 0; $i < $cnt; $i++)
164 164
 		{
165
-			if($output->data[$i]->member_srl<1) continue;
165
+			if ($output->data[$i]->member_srl < 1) continue;
166 166
 			$member_srls[abs($output->data[$i]->member_srl)] = $output->data[$i]->count;
167 167
 		}
168 168
 		// Remove the member number who has written the original post
169
-		if($member_srl) unset($member_srls[abs($member_srl)]);
170
-		if(!count($member_srls)) return new Object();
169
+		if ($member_srl) unset($member_srls[abs($member_srl)]);
170
+		if (!count($member_srls)) return new Object();
171 171
 		// Remove all the points for each member
172 172
 		$oPointModel = getModel('point');
173 173
 		// Get the points
174 174
 		$point = $module_config['download_file'];
175
-		foreach($member_srls as $member_srl => $cnt)
175
+		foreach ($member_srls as $member_srl => $cnt)
176 176
 		{
177 177
 			$cur_point = $oPointModel->getPoint($member_srl, true);
178 178
 			$cur_point -= $cnt * $comment_point;
179
-			$this->setPoint($member_srl,$cur_point);
179
+			$this->setPoint($member_srl, $cur_point);
180 180
 		}
181 181
 
182 182
 		return new Object();
@@ -190,10 +190,10 @@  discard block
 block discarded – undo
190 190
 		$module_srl = $obj->module_srl;
191 191
 		$member_srl = $obj->member_srl;
192 192
 		// The process related to clearing the post object
193
-		if(!$module_srl || !$member_srl) return new Object();
193
+		if (!$module_srl || !$member_srl) return new Object();
194 194
 		// Run only when logged in
195 195
 		$logged_info = Context::get('logged_info');
196
-		if(!$logged_info->member_srl) return new Object();
196
+		if (!$logged_info->member_srl) return new Object();
197 197
 		// Get the points of the member
198 198
 		$oPointModel = getModel('point');
199 199
 		$cur_point = $oPointModel->getPoint($member_srl, true);
@@ -203,16 +203,16 @@  discard block
 block discarded – undo
203 203
 		$module_config = $oModuleModel->getModulePartConfig('point', $module_srl);
204 204
 
205 205
 		$point = $module_config['insert_document'];
206
-		if(strlen($point) == 0 && !is_int($point)) $point = $config->insert_document;
206
+		if (strlen($point) == 0 && !is_int($point)) $point = $config->insert_document;
207 207
 		// if the point is set to decrease when writing a document, make sure it does not increase the points when deleting an article
208
-		if($point < 0) return new Object();
208
+		if ($point < 0) return new Object();
209 209
 		$cur_point -= $point;
210 210
 		// Add points related to deleting an attachment
211 211
 		$point = $module_config['upload_file'];
212
-		if(strlen($point) == 0 && !is_int($point)) $point = $config->upload_file;
213
-		if($obj->uploaded_count) $cur_point -= $point * $obj->uploaded_count;
212
+		if (strlen($point) == 0 && !is_int($point)) $point = $config->upload_file;
213
+		if ($obj->uploaded_count) $cur_point -= $point * $obj->uploaded_count;
214 214
 		// Increase the point
215
-		$this->setPoint($member_srl,$cur_point);
215
+		$this->setPoint($member_srl, $cur_point);
216 216
 
217 217
 		return new Object();
218 218
 	}
@@ -224,12 +224,12 @@  discard block
 block discarded – undo
224 224
 	{
225 225
 		$module_srl = $obj->module_srl;
226 226
 		$member_srl = $obj->member_srl;
227
-		if(!$module_srl || !$member_srl) return new Object();
227
+		if (!$module_srl || !$member_srl) return new Object();
228 228
 		// Do not increase the points if the member is the author of the post
229 229
 		$document_srl = $obj->document_srl;
230 230
 		$oDocumentModel = getModel('document');
231 231
 		$oDocument = $oDocumentModel->getDocument($document_srl);
232
-		if(!$oDocument->isExists() || abs($oDocument->get('member_srl'))==abs($member_srl)) return new Object();
232
+		if (!$oDocument->isExists() || abs($oDocument->get('member_srl')) == abs($member_srl)) return new Object();
233 233
 		// Get the point module information
234 234
 		$oModuleModel = getModel('module');
235 235
 		$config = $oModuleModel->getModuleConfig('point');
@@ -239,10 +239,10 @@  discard block
 block discarded – undo
239 239
 		$cur_point = $oPointModel->getPoint($member_srl, true);
240 240
 
241 241
 		$point = $module_config['insert_comment'];
242
-		if(strlen($point) == 0 && !is_int($point)) $point = $config->insert_comment;
242
+		if (strlen($point) == 0 && !is_int($point)) $point = $config->insert_comment;
243 243
 		// Increase the point
244 244
 		$cur_point += $point;
245
-		$this->setPoint($member_srl,$cur_point);
245
+		$this->setPoint($member_srl, $cur_point);
246 246
 
247 247
 		return new Object();
248 248
 	}
@@ -259,11 +259,11 @@  discard block
 block discarded – undo
259 259
 		$module_srl = $obj->module_srl;
260 260
 		$member_srl = abs($obj->member_srl);
261 261
 		$document_srl = $obj->document_srl;
262
-		if(!$module_srl || !$member_srl) return new Object();
262
+		if (!$module_srl || !$member_srl) return new Object();
263 263
 		// Get the original article (if the original article is missing or if the member is its author, do not apply the points)
264 264
 		$oDocument = $oDocumentModel->getDocument($document_srl);
265
-		if(!$oDocument->isExists()) return new Object();
266
-		if($oDocument->get('member_srl')==$member_srl) return new Object();
265
+		if (!$oDocument->isExists()) return new Object();
266
+		if ($oDocument->get('member_srl') == $member_srl) return new Object();
267 267
 		// Get the point module information
268 268
 		$config = $oModuleModel->getModuleConfig('point');
269 269
 		$module_config = $oModuleModel->getModulePartConfig('point', $module_srl);
@@ -271,12 +271,12 @@  discard block
 block discarded – undo
271 271
 		$cur_point = $oPointModel->getPoint($member_srl, true);
272 272
 
273 273
 		$point = $module_config['insert_comment'];
274
-		if(strlen($point) == 0 && !is_int($point)) $point = $config->insert_comment;
274
+		if (strlen($point) == 0 && !is_int($point)) $point = $config->insert_comment;
275 275
 		// if the point is set to decrease when writing a comment, make sure it does not increase the points when deleting a comment
276
-		if($point < 0) return new Object();
276
+		if ($point < 0) return new Object();
277 277
 		// Increase the point
278 278
 		$cur_point -= $point;
279
-		$this->setPoint($member_srl,$cur_point);
279
+		$this->setPoint($member_srl, $cur_point);
280 280
 
281 281
 		return new Object();
282 282
 	}
@@ -296,11 +296,11 @@  discard block
 block discarded – undo
296 296
 	 */
297 297
 	function triggerDeleteFile(&$obj)
298 298
 	{
299
-		if($obj->isvalid != 'Y') return new Object();
299
+		if ($obj->isvalid != 'Y') return new Object();
300 300
 
301 301
 		$module_srl = $obj->module_srl;
302 302
 		$member_srl = $obj->member_srl;
303
-		if(!$module_srl || !$member_srl) return new Object();
303
+		if (!$module_srl || !$member_srl) return new Object();
304 304
 		// Get the point module information
305 305
 		$oModuleModel = getModel('module');
306 306
 		$config = $oModuleModel->getModuleConfig('point');
@@ -310,10 +310,10 @@  discard block
 block discarded – undo
310 310
 		$cur_point = $oPointModel->getPoint($member_srl, true);
311 311
 
312 312
 		$point = $module_config['upload_file'];
313
-		if(strlen($point) == 0 && !is_int($point)) $point = $config->upload_file;
313
+		if (strlen($point) == 0 && !is_int($point)) $point = $config->upload_file;
314 314
 		// Increase the point
315 315
 		$cur_point -= $point;
316
-		$this->setPoint($member_srl,$cur_point);
316
+		$this->setPoint($member_srl, $cur_point);
317 317
 
318 318
 		return new Object();
319 319
 	}
@@ -326,17 +326,17 @@  discard block
 block discarded – undo
326 326
 		$logged_info = Context::get('logged_info');
327 327
 		$member_srl = $logged_info->member_srl;
328 328
 		$module_srl = $obj->module_srl;
329
-		if(!$module_srl) return new Object();
329
+		if (!$module_srl) return new Object();
330 330
 		// Pass if it is your file
331
-		if(abs($obj->member_srl) == abs($member_srl)) return new Object();
331
+		if (abs($obj->member_srl) == abs($member_srl)) return new Object();
332 332
 
333 333
 		$oModuleModel = getModel('module');
334 334
 		$config = $oModuleModel->getModuleConfig('point');
335 335
 		$module_config = $oModuleModel->getModulePartConfig('point', $module_srl);
336 336
 		// If it is set not to allow downloading for non-logged in users, do not permit
337
-		if(!Context::get('is_logged'))
337
+		if (!Context::get('is_logged'))
338 338
 		{
339
-			if($config->disable_download == 'Y' && strlen($module_config['download_file']) == 0 && !is_int($module_config['download_file'])) return new Object(-1,'msg_not_permitted_download');
339
+			if ($config->disable_download == 'Y' && strlen($module_config['download_file']) == 0 && !is_int($module_config['download_file'])) return new Object(-1, 'msg_not_permitted_download');
340 340
 			else return new Object();
341 341
 		}
342 342
 		// Get the points of the member
@@ -344,9 +344,9 @@  discard block
 block discarded – undo
344 344
 		$cur_point = $oPointModel->getPoint($member_srl, true);
345 345
 		// Get the points
346 346
 		$point = $module_config['download_file'];
347
-		if(strlen($point) == 0 && !is_int($point)) $point = $config->download_file;
347
+		if (strlen($point) == 0 && !is_int($point)) $point = $config->download_file;
348 348
 		// If points are less than 0, and if downloading a file is not allowed in this case, give an errors
349
-		if($cur_point + $point < 0 && $config->disable_download == 'Y') return new Object(-1,'msg_cannot_download');
349
+		if ($cur_point + $point < 0 && $config->disable_download == 'Y') return new Object(-1, 'msg_cannot_download');
350 350
 
351 351
 		return new Object();
352 352
 	}
@@ -358,12 +358,12 @@  discard block
 block discarded – undo
358 358
 	{
359 359
 		// Run only when logged in
360 360
 		$logged_info = Context::get('logged_info');
361
-		if(!$logged_info->member_srl) return new Object();
361
+		if (!$logged_info->member_srl) return new Object();
362 362
 		$module_srl = $obj->module_srl;
363 363
 		$member_srl = $logged_info->member_srl;
364
-		if(!$module_srl) return new Object();
364
+		if (!$module_srl) return new Object();
365 365
 		// Pass if it is your file
366
-		if(abs($obj->member_srl) == abs($member_srl)) return new Object();
366
+		if (abs($obj->member_srl) == abs($member_srl)) return new Object();
367 367
 		// Get the point module information
368 368
 		$oModuleModel = getModel('module');
369 369
 		$config = $oModuleModel->getModuleConfig('point');
@@ -373,10 +373,10 @@  discard block
 block discarded – undo
373 373
 		$cur_point = $oPointModel->getPoint($member_srl, true);
374 374
 		// Get the points
375 375
 		$point = $module_config['download_file'];
376
-		if(strlen($point) == 0 && !is_int($point)) $point = $config->download_file;
376
+		if (strlen($point) == 0 && !is_int($point)) $point = $config->download_file;
377 377
 		// Increase the point
378 378
 		$cur_point += $point;
379
-		$this->setPoint($member_srl,$cur_point);
379
+		$this->setPoint($member_srl, $cur_point);
380 380
 
381 381
 		return new Object();
382 382
 	}
@@ -395,22 +395,22 @@  discard block
 block discarded – undo
395 395
 		// Get the original author number
396 396
 		$target_member_srl = abs($obj->get('member_srl'));
397 397
 		// Pass without increasing the hits if the viewer is the same as the author
398
-		if($target_member_srl == $member_srl) return new Object();
398
+		if ($target_member_srl == $member_srl) return new Object();
399 399
 		// Get the point information for each module
400 400
 		$config = $oModuleModel->getModuleConfig('point');
401 401
 		$module_config = $oModuleModel->getModulePartConfig('point', $obj->get('module_srl'));
402 402
 		// Get hits points
403 403
 		$point = $module_config['read_document'];
404
-		if(strlen($point) == 0 && !is_int($point)) $point = $config->read_document;
404
+		if (strlen($point) == 0 && !is_int($point)) $point = $config->read_document;
405 405
 		// Pass if there are no requested points
406
-		if(!$point) return new Object();
406
+		if (!$point) return new Object();
407 407
 		// In case of a registered member, if it is read but cannot just pass, then get the current points
408
-		if($member_srl)
408
+		if ($member_srl)
409 409
 		{
410 410
 			$args->member_srl = $member_srl;
411 411
 			$args->document_srl = $obj->document_srl;
412 412
 			$output = executeQuery('document.getDocumentReadedLogInfo', $args);
413
-			if($output->data->count) return new Object();
413
+			if ($output->data->count) return new Object();
414 414
 			$cur_point = $oPointModel->getPoint($member_srl, true);
415 415
 		}
416 416
 		else
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 		$config = $oModuleModel->getModuleConfig('point');
422 422
 		// When the requested points are negative, compared it with the current point
423 423
 		$_SESSION['banned_document'][$obj->document_srl] = false;
424
-		if($config->disable_read_document == 'Y' && $point < 0 && abs($point)>$cur_point)
424
+		if ($config->disable_read_document == 'Y' && $point < 0 && abs($point) > $cur_point)
425 425
 		{
426 426
 			$message = sprintf(Context::getLang('msg_disallow_by_point'), abs($point), $cur_point);
427 427
 			$obj->add('content', $message);
@@ -429,14 +429,14 @@  discard block
 block discarded – undo
429 429
 			return new Object(-1, $message);
430 430
 		}
431 431
 		// If not logged in, pass
432
-		if(!$logged_info->member_srl) return new Object();
432
+		if (!$logged_info->member_srl) return new Object();
433 433
 		// Pass, if there are no requested points
434
-		if(!$point) return new Object();
434
+		if (!$point) return new Object();
435 435
 		// If the read record is missing, leave it
436 436
 		$output = executeQuery('document.insertDocumentReadedLog', $args);
437 437
 		// Increase the point
438 438
 		$cur_point += $point;
439
-		$this->setPoint($member_srl,$cur_point);
439
+		$this->setPoint($member_srl, $cur_point);
440 440
 
441 441
 		return new Object();
442 442
 	}
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
 	{
449 449
 		$module_srl = $obj->module_srl;
450 450
 		$member_srl = $obj->member_srl;
451
-		if(!$module_srl || !$member_srl) return new Object();
451
+		if (!$module_srl || !$member_srl) return new Object();
452 452
 
453 453
 		$oModuleModel = getModel('module');
454 454
 		$config = $oModuleModel->getModuleConfig('point');
@@ -457,21 +457,21 @@  discard block
 block discarded – undo
457 457
 		$oPointModel = getModel('point');
458 458
 		$cur_point = $oPointModel->getPoint($member_srl, true);
459 459
 
460
-		if( $obj->point > 0 )
460
+		if ($obj->point > 0)
461 461
 		{
462 462
 			$point = $module_config['voted'];
463
-			if(strlen($point) == 0 && !is_int($point)) $point = $config->voted;
463
+			if (strlen($point) == 0 && !is_int($point)) $point = $config->voted;
464 464
 		}
465 465
 		else
466 466
 		{
467 467
 			$point = $module_config['blamed'];
468
-			if(strlen($point) == 0 && !is_int($point)) $point = $config->blamed;
468
+			if (strlen($point) == 0 && !is_int($point)) $point = $config->blamed;
469 469
 		}
470 470
 
471
-		if(!$point) return new Object();
471
+		if (!$point) return new Object();
472 472
 		// Increase the point
473 473
 		$cur_point += $point;
474
-		$this->setPoint($member_srl,$cur_point);
474
+		$this->setPoint($member_srl, $cur_point);
475 475
 
476 476
 		return new Object();
477 477
 	}
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
 	{
484 484
 		$member_srl = abs($member_srl);
485 485
 		$mode_arr = array('add', 'minus', 'update', 'signup');
486
-		if(!$mode || !in_array($mode,$mode_arr)) $mode = 'update';
486
+		if (!$mode || !in_array($mode, $mode_arr)) $mode = 'update';
487 487
 
488 488
 		// Get configuration information
489 489
 		$oMemberModel = getModel('member');
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
 		$args->member_srl = $member_srl;
501 501
 		$args->point = $current_point;
502 502
 
503
-		switch($mode)
503
+		switch ($mode)
504 504
 		{
505 505
 			case 'add' :
506 506
 				$args->point += $point;
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 				$args->point = $point;
514 514
 				break;
515 515
 		}
516
-		if($args->point < 0) $args->point = 0;
516
+		if ($args->point < 0) $args->point = 0;
517 517
 		$point = $args->point;
518 518
 
519 519
 		// Call a trigger (before)
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 		$trigger_obj->current_level = $current_level;
525 525
 		$trigger_obj->set_point = $point;
526 526
 		$trigger_output = ModuleHandler::triggerCall('point.setPoint', 'before', $trigger_obj);
527
-		if(!$trigger_output->toBool())
527
+		if (!$trigger_output->toBool())
528 528
 		{
529 529
 			return $trigger_output;
530 530
 		}
@@ -535,19 +535,19 @@  discard block
 block discarded – undo
535 535
 
536 536
 		// If there are points, update, if no, insert
537 537
 		$oPointModel = getModel('point');
538
-		if($oPointModel->isExistsPoint($member_srl)) executeQuery("point.updatePoint", $args);
538
+		if ($oPointModel->isExistsPoint($member_srl)) executeQuery("point.updatePoint", $args);
539 539
 		else executeQuery("point.insertPoint", $args);
540 540
 
541 541
 		// Get a new level
542 542
 		$level = $oPointModel->getLevel($point, $config->level_step);
543 543
 
544 544
 		// If existing level and a new one are different attempt to set a point group
545
-		if($level != $current_level)
545
+		if ($level != $current_level)
546 546
 		{
547 547
 			// Check if the level, for which the current points are prepared, is calculate and set the correct group
548 548
 			$point_group = $config->point_group;
549 549
 			// If the point group exists
550
-			if($point_group && is_array($point_group) && count($point_group) )
550
+			if ($point_group && is_array($point_group) && count($point_group))
551 551
 			{
552 552
 				// Get the default group
553 553
 				$default_group = $oMemberModel->getDefaultGroup();
@@ -557,29 +557,29 @@  discard block
 block discarded – undo
557 557
 
558 558
 				asort($point_group);
559 559
 				// Reset group after initialization
560
-				if($config->group_reset != 'N')
560
+				if ($config->group_reset != 'N')
561 561
 				{
562 562
 					// If the new level is in the right group
563
-					if(in_array($level, $point_group))
563
+					if (in_array($level, $point_group))
564 564
 					{
565 565
 						// Delete all groups except the one which the current level belongs to
566
-						foreach($point_group as $group_srl => $target_level)
566
+						foreach ($point_group as $group_srl => $target_level)
567 567
 						{
568 568
 							$del_group_list[] = $group_srl;
569
-							if($target_level == $level) $new_group_list[] = $group_srl;
569
+							if ($target_level == $level) $new_group_list[] = $group_srl;
570 570
 						}
571 571
 					}
572 572
 					// Otherwise, in case the level is reduced, add the recent group
573 573
 					else
574 574
 					{
575 575
 						$i = $level;
576
-						while($i > 0)
576
+						while ($i > 0)
577 577
 						{
578
-							if(in_array($i, $point_group))
578
+							if (in_array($i, $point_group))
579 579
 							{
580
-								foreach($point_group as $group_srl => $target_level)
580
+								foreach ($point_group as $group_srl => $target_level)
581 581
 								{
582
-									if($target_level == $i)
582
+									if ($target_level == $i)
583 583
 									{
584 584
 										$new_group_list[] = $group_srl;
585 585
 									}
@@ -590,9 +590,9 @@  discard block
 block discarded – undo
590 590
 						}
591 591
 					}
592 592
 					// Delete the group of a level which is higher than the current level
593
-					foreach($point_group as $group_srl => $target_level)
593
+					foreach ($point_group as $group_srl => $target_level)
594 594
 					{
595
-						if($target_level > $level) $del_group_list[] = $group_srl;
595
+						if ($target_level > $level) $del_group_list[] = $group_srl;
596 596
 					}
597 597
 					$del_group_list[] = $default_group->group_srl;
598 598
 				}
@@ -600,16 +600,16 @@  discard block
 block discarded – undo
600 600
 				else
601 601
 				{
602 602
 					// Check until the current level by rotating setting the configurations of the point groups
603
-					foreach($point_group as $group_srl => $target_level)
603
+					foreach ($point_group as $group_srl => $target_level)
604 604
 					{
605 605
 						$del_group_list[] = $group_srl;
606
-						if($target_level <= $level) $new_group_list[] = $group_srl;
606
+						if ($target_level <= $level) $new_group_list[] = $group_srl;
607 607
 					}
608 608
 				}
609 609
 				// If there is no a new group, granted the default group
610
-				if(!$new_group_list[0]) $new_group_list[0] = $default_group->group_srl;
610
+				if (!$new_group_list[0]) $new_group_list[0] = $default_group->group_srl;
611 611
 				// Remove linkage group
612
-				if($del_group_list && count($del_group_list))
612
+				if ($del_group_list && count($del_group_list))
613 613
 				{
614 614
 					$del_group_args = new stdClass;
615 615
 					$del_group_args->member_srl = $member_srl;
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
 					$del_group_output = executeQuery('point.deleteMemberGroup', $del_group_args);
618 618
 				}
619 619
 				// Grant a new group
620
-				foreach($new_group_list as $group_srl)
620
+				foreach ($new_group_list as $group_srl)
621 621
 				{
622 622
 					$new_group_args = new stdClass;
623 623
 					$new_group_args->member_srl = $member_srl;
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
 		$trigger_obj->del_group_list = $del_group_list;
633 633
 		$trigger_obj->new_level = $level;
634 634
 		$trigger_output = ModuleHandler::triggerCall('point.setPoint', 'after', $trigger_obj);
635
-		if(!$trigger_output->toBool())
635
+		if (!$trigger_output->toBool())
636 636
 		{
637 637
 			$oDB->rollback();
638 638
 			return $trigger_output;
@@ -648,17 +648,17 @@  discard block
 block discarded – undo
648 648
 		FileHandler::writeFile($cache_filename, $point);
649 649
 
650 650
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
651
-		if($new_group_list && $del_group_list && $oCacheHandler->isSupport())
651
+		if ($new_group_list && $del_group_list && $oCacheHandler->isSupport())
652 652
 		{
653
-			$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0';
653
+			$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_0';
654 654
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
655 655
 			$oCacheHandler->delete($cache_key);
656 656
 		}
657 657
 
658 658
 		$oCacheHandler = CacheHandler::getInstance('object');
659
-		if($new_group_list && $del_group_list && $oCacheHandler->isSupport())
659
+		if ($new_group_list && $del_group_list && $oCacheHandler->isSupport())
660 660
 		{
661
-			$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
661
+			$object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl;
662 662
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
663 663
 			$oCacheHandler->delete($cache_key);
664 664
 		}
@@ -672,9 +672,9 @@  discard block
 block discarded – undo
672 672
 		$pointConfig = $oModuleModel->getModulePartConfig('point', $obj->originModuleSrl);
673 673
 
674 674
 		$oModuleController = getController('module');
675
-		if(is_array($obj->moduleSrlList))
675
+		if (is_array($obj->moduleSrlList))
676 676
 		{
677
-			foreach($obj->moduleSrlList AS $key=>$moduleSrl)
677
+			foreach ($obj->moduleSrlList AS $key=>$moduleSrl)
678 678
 			{
679 679
 				$oModuleController->insertModulePartConfig('point', $moduleSrl, $pointConfig);
680 680
 			}
Please login to merge, or discard this patch.
modules/poll/poll.admin.controller.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -85,6 +85,7 @@
 block discarded – undo
85 85
 
86 86
 	/**
87 87
 	 * @brief Delete the poll (when several questions are registered in one poll, delete this question)
88
+	 * @param string $poll_index_srl
88 89
 	 */
89 90
 	function deletePollTitle($poll_index_srl) 
90 91
 	{
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -40,22 +40,22 @@  discard block
 block discarded – undo
40 40
 		// Display an error no post is selected
41 41
 		$cart = Context::get('cart');
42 42
 
43
-		if(is_array($cart)) $poll_srl_list = $cart;
44
-		else $poll_srl_list= explode('|@|', $cart);
43
+		if (is_array($cart)) $poll_srl_list = $cart;
44
+		else $poll_srl_list = explode('|@|', $cart);
45 45
 
46 46
 		$poll_count = count($poll_srl_list);
47
-		if(!$poll_count) return $this->stop('msg_cart_is_null');
47
+		if (!$poll_count) return $this->stop('msg_cart_is_null');
48 48
 		// Delete the post
49
-		for($i=0;$i<$poll_count;$i++)
49
+		for ($i = 0; $i < $poll_count; $i++)
50 50
 		{
51 51
 			$poll_index_srl = trim($poll_srl_list[$i]);
52
-			if(!$poll_index_srl) continue;
52
+			if (!$poll_index_srl) continue;
53 53
 
54 54
 			$output = $this->deletePollTitle($poll_index_srl, true);
55
-			if(!$output->toBool()) return $output;
55
+			if (!$output->toBool()) return $output;
56 56
 		}
57 57
 
58
-		$this->setMessage( sprintf(Context::getLang('msg_checked_poll_is_deleted'), $poll_count) );
58
+		$this->setMessage(sprintf(Context::getLang('msg_checked_poll_is_deleted'), $poll_count));
59 59
 
60 60
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPollAdminList');
61 61
 		$this->setRedirectUrl($returnUrl);
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
 	function procPollAdminAddCart()
65 65
 	{
66
-		$poll_index_srl = (int)Context::get('poll_index_srl');
66
+		$poll_index_srl = (int) Context::get('poll_index_srl');
67 67
 
68 68
 		$oPollAdminModel = getAdminModel('poll');
69 69
 		//$columnList = array('comment_srl');
@@ -73,11 +73,11 @@  discard block
 block discarded – undo
73 73
 
74 74
 		$output = $oPollAdminModel->getPollList($args);
75 75
 
76
-		if(is_array($output->data))
76
+		if (is_array($output->data))
77 77
 		{
78
-			foreach($output->data AS $key=>$value)
78
+			foreach ($output->data AS $key=>$value)
79 79
 			{
80
-				if($_SESSION['poll_management'][$value->poll_index_srl]) unset($_SESSION['poll_management'][$value->poll_index_srl]);
80
+				if ($_SESSION['poll_management'][$value->poll_index_srl]) unset($_SESSION['poll_management'][$value->poll_index_srl]);
81 81
 				else $_SESSION['poll_management'][$value->poll_index_srl] = true;
82 82
 			}
83 83
 		}
@@ -97,36 +97,36 @@  discard block
 block discarded – undo
97 97
 		$oDB->begin();
98 98
 
99 99
 		$output = executeQueryArray('poll.getPollByDeletePollTitle', $args);
100
-		if($output->toBool() && $output->data && $output->data[0]->count == 1)
100
+		if ($output->toBool() && $output->data && $output->data[0]->count == 1)
101 101
 		{
102 102
 			$dargs->poll_srl = $output->data[0]->poll_srl;
103 103
 		}
104 104
 
105 105
 		$output = $oDB->executeQuery('poll.deletePollTitle', $args);
106
-		if(!$output)
106
+		if (!$output)
107 107
 		{
108 108
 			$oDB->rollback();
109 109
 			return $output;
110 110
 		}
111 111
 
112 112
 		$output = $oDB->executeQuery('poll.deletePollItem', $args);
113
-		if(!$output)
113
+		if (!$output)
114 114
 		{
115 115
 			$oDB->rollback();
116 116
 			return $output;
117 117
 		}
118 118
 
119
-		if($dargs->poll_srl)
119
+		if ($dargs->poll_srl)
120 120
 		{
121 121
 			$output = executeQuery('poll.deletePoll', $dargs);
122
-			if(!$output)
122
+			if (!$output)
123 123
 			{
124 124
 				$oDB->rollback();
125 125
 				return $output;
126 126
 			}
127 127
 
128 128
 			$output = executeQuery('poll.deletePollLog', $dargs);
129
-			if(!$output)
129
+			if (!$output)
130 130
 			{
131 131
 				$oDB->rollback();
132 132
 				return $output;
@@ -149,21 +149,21 @@  discard block
 block discarded – undo
149 149
 		$oDB->begin();
150 150
 
151 151
 		$output = $oDB->executeQuery('poll.deletePoll', $args);
152
-		if(!$output)
152
+		if (!$output)
153 153
 		{
154 154
 			$oDB->rollback();
155 155
 			return $output;
156 156
 		}
157 157
 
158 158
 		$output = $oDB->executeQuery('poll.deletePollTitle', $args);
159
-		if(!$output)
159
+		if (!$output)
160 160
 		{
161 161
 			$oDB->rollback();
162 162
 			return $output;
163 163
 		}
164 164
 
165 165
 		$output = $oDB->executeQuery('poll.deletePollItem', $args);
166
-		if(!$output)
166
+		if (!$output)
167 167
 		{
168 168
 			$oDB->rollback();
169 169
 			return $output;
Please login to merge, or discard this patch.
Braces   +19 added lines, -7 removed lines patch added patch discarded remove patch
@@ -40,19 +40,28 @@  discard block
 block discarded – undo
40 40
 		// Display an error no post is selected
41 41
 		$cart = Context::get('cart');
42 42
 
43
-		if(is_array($cart)) $poll_srl_list = $cart;
44
-		else $poll_srl_list= explode('|@|', $cart);
43
+		if(is_array($cart)) {
44
+			$poll_srl_list = $cart;
45
+		} else {
46
+			$poll_srl_list= explode('|@|', $cart);
47
+		}
45 48
 
46 49
 		$poll_count = count($poll_srl_list);
47
-		if(!$poll_count) return $this->stop('msg_cart_is_null');
50
+		if(!$poll_count) {
51
+			return $this->stop('msg_cart_is_null');
52
+		}
48 53
 		// Delete the post
49 54
 		for($i=0;$i<$poll_count;$i++)
50 55
 		{
51 56
 			$poll_index_srl = trim($poll_srl_list[$i]);
52
-			if(!$poll_index_srl) continue;
57
+			if(!$poll_index_srl) {
58
+				continue;
59
+			}
53 60
 
54 61
 			$output = $this->deletePollTitle($poll_index_srl, true);
55
-			if(!$output->toBool()) return $output;
62
+			if(!$output->toBool()) {
63
+				return $output;
64
+			}
56 65
 		}
57 66
 
58 67
 		$this->setMessage( sprintf(Context::getLang('msg_checked_poll_is_deleted'), $poll_count) );
@@ -77,8 +86,11 @@  discard block
 block discarded – undo
77 86
 		{
78 87
 			foreach($output->data AS $key=>$value)
79 88
 			{
80
-				if($_SESSION['poll_management'][$value->poll_index_srl]) unset($_SESSION['poll_management'][$value->poll_index_srl]);
81
-				else $_SESSION['poll_management'][$value->poll_index_srl] = true;
89
+				if($_SESSION['poll_management'][$value->poll_index_srl]) {
90
+					unset($_SESSION['poll_management'][$value->poll_index_srl]);
91
+				} else {
92
+					$_SESSION['poll_management'][$value->poll_index_srl] = true;
93
+				}
82 94
 			}
83 95
 		}
84 96
 	}
Please login to merge, or discard this patch.
modules/rss/rss.admin.controller.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@
 block discarded – undo
110 110
 	/**
111 111
 	 * RSS Module configurations
112 112
 	 *
113
-	 * @return void
113
+	 * @return Object|null
114 114
 	 */
115 115
 	function procRssAdminInsertModuleConfig()
116 116
 	{
Please login to merge, or discard this patch.
Braces   +24 added lines, -11 removed lines patch added patch discarded remove patch
@@ -29,8 +29,12 @@  discard block
 block discarded – undo
29 29
 		$config_vars = Context::getRequestVars();
30 30
 		$config_vars->feed_document_count = (int)$config_vars->feed_document_count;
31 31
 
32
-		if(!$config_vars->use_total_feed) $alt_message = 'msg_invalid_request';
33
-		if(!in_array($config_vars->use_total_feed, array('Y','N'))) $config_vars->open_rss = 'Y';
32
+		if(!$config_vars->use_total_feed) {
33
+			$alt_message = 'msg_invalid_request';
34
+		}
35
+		if(!in_array($config_vars->use_total_feed, array('Y','N'))) {
36
+			$config_vars->open_rss = 'Y';
37
+		}
34 38
 
35 39
 		if($config_vars->image || $config_vars->del_image)
36 40
 		{
@@ -49,20 +53,23 @@  discard block
 block discarded – undo
49 53
 				// Ignore if the file is not an image (swf is accepted ~)
50 54
 				$image_obj['name'] = Context::convertEncodingStr($image_obj['name']);
51 55
 
52
-				if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) $alt_message = 'msg_rss_invalid_image_format';
53
-				else
56
+				if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) {
57
+					$alt_message = 'msg_rss_invalid_image_format';
58
+				} else
54 59
 				{
55 60
 					// Upload the file to a path
56 61
 					$path = './files/attach/images/rss/';
57 62
 					// Create a directory
58
-					if(!FileHandler::makeDir($path)) $alt_message = 'msg_error_occured';
59
-					else
63
+					if(!FileHandler::makeDir($path)) {
64
+						$alt_message = 'msg_error_occured';
65
+					} else
60 66
 					{
61 67
 						$filename = $path.$image_obj['name'];
62 68
 
63 69
 						// Move the file
64
-						if(!move_uploaded_file($image_obj['tmp_name'], $filename)) $alt_message = 'msg_error_occured';
65
-						else
70
+						if(!move_uploaded_file($image_obj['tmp_name'], $filename)) {
71
+							$alt_message = 'msg_error_occured';
72
+						} else
66 73
 						{
67 74
 							$config_vars->image = $filename;
68 75
 						}
@@ -70,11 +77,15 @@  discard block
 block discarded – undo
70 77
 				}
71 78
 			}
72 79
 		}
73
-		if(!$config_vars->image && $config_vars->del_image != 'Y') $config_vars->image = $total_config->image;
80
+		if(!$config_vars->image && $config_vars->del_image != 'Y') {
81
+			$config_vars->image = $total_config->image;
82
+		}
74 83
 
75 84
 		$output = $this->setFeedConfig($config_vars);
76 85
 
77
-		if(!$alt_message) $alt_message = 'success_updated';
86
+		if(!$alt_message) {
87
+			$alt_message = 'success_updated';
88
+		}
78 89
 
79 90
 		$alt_message = Context::getLang($alt_message);
80 91
 		$this->setMessage($alt_message, 'info');
@@ -139,7 +150,9 @@  discard block
 block discarded – undo
139 150
 					return new Object(-1, 'msg_invalid_request');
140 151
 				}
141 152
 
142
-				if(!in_array($open_rss, array('Y','H','N'))) $open_rss = 'N';
153
+				if(!in_array($open_rss, array('Y','H','N'))) {
154
+					$open_rss = 'N';
155
+				}
143 156
 
144 157
 				$this->setRssModuleConfig($module_srl, $open_rss, $openTotalFeedList[$module_srl], $feedDescriptionList[$module_srl], $feedCopyrightList[$module_srl]);
145 158
 			}
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -27,41 +27,41 @@  discard block
 block discarded – undo
27 27
 		$total_config = $oModuleModel->getModuleConfig('rss');
28 28
 
29 29
 		$config_vars = Context::getRequestVars();
30
-		$config_vars->feed_document_count = (int)$config_vars->feed_document_count;
30
+		$config_vars->feed_document_count = (int) $config_vars->feed_document_count;
31 31
 
32
-		if(!$config_vars->use_total_feed) $alt_message = 'msg_invalid_request';
33
-		if(!in_array($config_vars->use_total_feed, array('Y','N'))) $config_vars->open_rss = 'Y';
32
+		if (!$config_vars->use_total_feed) $alt_message = 'msg_invalid_request';
33
+		if (!in_array($config_vars->use_total_feed, array('Y', 'N'))) $config_vars->open_rss = 'Y';
34 34
 
35
-		if($config_vars->image || $config_vars->del_image)
35
+		if ($config_vars->image || $config_vars->del_image)
36 36
 		{
37 37
 			$image_obj = $config_vars->image;
38 38
 			$config_vars->image = $total_config->image;
39 39
 			// Get a variable for the delete request
40
-			if($config_vars->del_image == 'Y' || $image_obj)
40
+			if ($config_vars->del_image == 'Y' || $image_obj)
41 41
 			{
42 42
 				FileHandler::removeFile($config_vars->image);
43 43
 				$config_vars->image = '';
44 44
 				$total_config->image = '';
45 45
 			}
46 46
 			// Ignore if the file is not the one which has been successfully uploaded
47
-			if($image_obj['tmp_name'] && is_uploaded_file($image_obj['tmp_name']) && checkUploadedFile($image_obj['tmp_name']))
47
+			if ($image_obj['tmp_name'] && is_uploaded_file($image_obj['tmp_name']) && checkUploadedFile($image_obj['tmp_name']))
48 48
 			{
49 49
 				// Ignore if the file is not an image (swf is accepted ~)
50 50
 				$image_obj['name'] = Context::convertEncodingStr($image_obj['name']);
51 51
 
52
-				if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) $alt_message = 'msg_rss_invalid_image_format';
52
+				if (!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) $alt_message = 'msg_rss_invalid_image_format';
53 53
 				else
54 54
 				{
55 55
 					// Upload the file to a path
56 56
 					$path = './files/attach/images/rss/';
57 57
 					// Create a directory
58
-					if(!FileHandler::makeDir($path)) $alt_message = 'msg_error_occured';
58
+					if (!FileHandler::makeDir($path)) $alt_message = 'msg_error_occured';
59 59
 					else
60 60
 					{
61 61
 						$filename = $path.$image_obj['name'];
62 62
 
63 63
 						// Move the file
64
-						if(!move_uploaded_file($image_obj['tmp_name'], $filename)) $alt_message = 'msg_error_occured';
64
+						if (!move_uploaded_file($image_obj['tmp_name'], $filename)) $alt_message = 'msg_error_occured';
65 65
 						else
66 66
 						{
67 67
 							$config_vars->image = $filename;
@@ -70,11 +70,11 @@  discard block
 block discarded – undo
70 70
 				}
71 71
 			}
72 72
 		}
73
-		if(!$config_vars->image && $config_vars->del_image != 'Y') $config_vars->image = $total_config->image;
73
+		if (!$config_vars->image && $config_vars->del_image != 'Y') $config_vars->image = $total_config->image;
74 74
 
75 75
 		$output = $this->setFeedConfig($config_vars);
76 76
 
77
-		if(!$alt_message) $alt_message = 'success_updated';
77
+		if (!$alt_message) $alt_message = 'success_updated';
78 78
 
79 79
 		$alt_message = Context::getLang($alt_message);
80 80
 		$this->setMessage($alt_message, 'info');
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 		$originConfig = $oModuleModel->getModuleConfig('rss');
97 97
 
98 98
 		// Get a variable for the delete request
99
-		if($delImage == 'Y')
99
+		if ($delImage == 'Y')
100 100
 		{
101 101
 			FileHandler::removeFile($originConfig->image);
102 102
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 		$feedCopyrightList = $config_vars->feed_copyright;
123 123
 		$targetModuleSrl = $config_vars->target_module_srl;
124 124
 
125
-		if($targetModuleSrl && !is_array($openRssList))
125
+		if ($targetModuleSrl && !is_array($openRssList))
126 126
 		{
127 127
 			$openRssList = array($targetModuleSrl => $openRssList);
128 128
 			$openTotalFeedList = array($targetModuleSrl => $openTotalFeedList);
@@ -130,16 +130,16 @@  discard block
 block discarded – undo
130 130
 			$feedCopyrightList = array($targetModuleSrl => $feedCopyrightList);
131 131
 		}
132 132
 
133
-		if(is_array($openRssList))
133
+		if (is_array($openRssList))
134 134
 		{
135
-			foreach($openRssList AS $module_srl=>$open_rss)
135
+			foreach ($openRssList AS $module_srl=>$open_rss)
136 136
 			{
137
-				if(!$module_srl || !$open_rss)
137
+				if (!$module_srl || !$open_rss)
138 138
 				{
139 139
 					return new Object(-1, 'msg_invalid_request');
140 140
 				}
141 141
 
142
-				if(!in_array($open_rss, array('Y','H','N'))) $open_rss = 'N';
142
+				if (!in_array($open_rss, array('Y', 'H', 'N'))) $open_rss = 'N';
143 143
 
144 144
 				$this->setRssModuleConfig($module_srl, $open_rss, $openTotalFeedList[$module_srl], $feedDescriptionList[$module_srl], $feedCopyrightList[$module_srl]);
145 145
 			}
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	function setFeedConfig($config)
162 162
 	{
163 163
 		$oModuleController = getController('module');
164
-		$oModuleController->insertModuleConfig('rss',$config);
164
+		$oModuleController->insertModuleConfig('rss', $config);
165 165
 		return new Object();
166 166
 	}
167 167
 
@@ -181,9 +181,9 @@  discard block
 block discarded – undo
181 181
 		$config = new stdClass;
182 182
 		$config->open_rss = $open_rss;
183 183
 		$config->open_total_feed = $open_total_feed;
184
-		if($feed_description != 'N') { $config->feed_description = $feed_description; }
185
-		if($feed_copyright != 'N') { $config->feed_copyright = $feed_copyright; }
186
-		$oModuleController->insertModulePartConfig('rss',$module_srl,$config);
184
+		if ($feed_description != 'N') { $config->feed_description = $feed_description; }
185
+		if ($feed_copyright != 'N') { $config->feed_copyright = $feed_copyright; }
186
+		$oModuleController->insertModulePartConfig('rss', $module_srl, $config);
187 187
 		return new Object();
188 188
 	}
189 189
 }
Please login to merge, or discard this patch.
modules/spamfilter/spamfilter.admin.controller.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -98,6 +98,7 @@  discard block
 block discarded – undo
98 98
 	/**
99 99
 	 * @brief Delete IP
100 100
 	 * Remove the IP address which was previously registered as a spammers
101
+	 * @param string $ipaddress
101 102
 	 */
102 103
 	function deleteIP($ipaddress)
103 104
 	{
@@ -111,6 +112,7 @@  discard block
 block discarded – undo
111 112
 	/**
112 113
 	 * @brief Register the spam word
113 114
 	 * The post, which contains the newly registered spam word, should be considered as a spam
115
+	 * @param string $word_list
114 116
 	 */
115 117
 	function insertWord($word_list)
116 118
 	{
@@ -141,6 +143,7 @@  discard block
 block discarded – undo
141 143
 	/**
142 144
 	 * @brief Remove the spam word
143 145
 	 * Remove the word which was previously registered as a spam word
146
+	 * @param string $word
144 147
 	 */
145 148
 	function deleteWord($word)
146 149
 	{
Please login to merge, or discard this patch.
Braces   +36 added lines, -12 removed lines patch added patch discarded remove patch
@@ -20,12 +20,18 @@  discard block
 block discarded – undo
20 20
 		$argsConfig = Context::gets('limits','check_trackback');
21 21
 		$flag = Context::get('flag');
22 22
 		//interval, limit_count
23
-		if($argsConfig->check_trackback!='Y') $argsConfig->check_trackback = 'N';
24
-		if($argsConfig->limits!='Y') $argsConfig->limits = 'N';
23
+		if($argsConfig->check_trackback!='Y') {
24
+			$argsConfig->check_trackback = 'N';
25
+		}
26
+		if($argsConfig->limits!='Y') {
27
+			$argsConfig->limits = 'N';
28
+		}
25 29
 		// Create and insert the module Controller object
26 30
 		$oModuleController = getController('module');
27 31
 		$moduleConfigOutput = $oModuleController->insertModuleConfig('spamfilter',$argsConfig);
28
-		if(!$moduleConfigOutput->toBool()) return $moduleConfigOutput;
32
+		if(!$moduleConfigOutput->toBool()) {
33
+			return $moduleConfigOutput;
34
+		}
29 35
 
30 36
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispSpamfilterAdminConfigBlock');
31 37
 		$this->setRedirectUrl($returnUrl);
@@ -39,9 +45,13 @@  discard block
 block discarded – undo
39 45
 		if($ipaddress_list)
40 46
 		{
41 47
 			$output = $oSpamfilterController->insertIP($ipaddress_list);
42
-			if(!$output->toBool() && !$output->get('fail_list')) return $output;
48
+			if(!$output->toBool() && !$output->get('fail_list')) {
49
+				return $output;
50
+			}
43 51
 
44
-			if($output->get('fail_list')) $message_fail = '<em>'.sprintf(Context::getLang('msg_faillist'),$output->get('fail_list')).'</em>';
52
+			if($output->get('fail_list')) {
53
+				$message_fail = '<em>'.sprintf(Context::getLang('msg_faillist'),$output->get('fail_list')).'</em>';
54
+			}
45 55
 			$this->setMessage(Context::getLang('success_registed').$message_fail);
46 56
 		}
47 57
 
@@ -57,9 +67,13 @@  discard block
 block discarded – undo
57 67
 		if($word_list)
58 68
 		{
59 69
 			$output = $this->insertWord($word_list);
60
-			if(!$output->toBool() && !$output->get('fail_list')) return $output;
70
+			if(!$output->toBool() && !$output->get('fail_list')) {
71
+				return $output;
72
+			}
61 73
 
62
-			if($output->get('fail_list')) $message_fail = '<em>'.sprintf(Context::getLang('msg_faillist'),$output->get('fail_list')).'</em>';
74
+			if($output->get('fail_list')) {
75
+				$message_fail = '<em>'.sprintf(Context::getLang('msg_faillist'),$output->get('fail_list')).'</em>';
76
+			}
63 77
 			$this->setMessage(Context::getLang('success_registed').$message_fail);
64 78
 		}
65 79
 
@@ -73,7 +87,9 @@  discard block
 block discarded – undo
73 87
 	function procSpamfilterAdminDeleteDeniedIP()
74 88
 	{
75 89
 		$ipAddressList = Context::get('ipaddress');
76
-		if($ipAddressList) $this->deleteIP($ipAddressList);
90
+		if($ipAddressList) {
91
+			$this->deleteIP($ipAddressList);
92
+		}
77 93
 
78 94
 		$this->setMessage(Context::getLang('success_deleted'));
79 95
 
@@ -101,7 +117,9 @@  discard block
 block discarded – undo
101 117
 	 */
102 118
 	function deleteIP($ipaddress)
103 119
 	{
104
-		if(!$ipaddress) return;
120
+		if(!$ipaddress) {
121
+			return;
122
+		}
105 123
 
106 124
 		$args = new stdClass;
107 125
 		$args->ipaddress = $ipaddress;
@@ -130,9 +148,13 @@  discard block
 block discarded – undo
130 148
 		foreach($word_list as $word)
131 149
 		{
132 150
 			$args = new stdClass;
133
-			if(trim($word)) $args->word = $word;
151
+			if(trim($word)) {
152
+				$args->word = $word;
153
+			}
134 154
 			$output = executeQuery('spamfilter.insertDeniedWord', $args);
135
-			if(!$output->toBool()) $fail_word .= $word.'<br />';
155
+			if(!$output->toBool()) {
156
+				$fail_word .= $word.'<br />';
157
+			}
136 158
 		}
137 159
 		$output->add('fail_list',$fail_word);
138 160
 		return $output;
@@ -144,7 +166,9 @@  discard block
 block discarded – undo
144 166
 	 */
145 167
 	function deleteWord($word)
146 168
 	{
147
-		if(!$word) return;
169
+		if(!$word) {
170
+			return;
171
+		}
148 172
 		$args = new stdClass;
149 173
 		$args->word = $word;
150 174
 		return executeQuery('spamfilter.deleteDeniedWord', $args);
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -17,15 +17,15 @@  discard block
 block discarded – undo
17 17
 	function procSpamfilterAdminInsertConfig()
18 18
 	{
19 19
 		// Get the default information
20
-		$argsConfig = Context::gets('limits','check_trackback');
20
+		$argsConfig = Context::gets('limits', 'check_trackback');
21 21
 		$flag = Context::get('flag');
22 22
 		//interval, limit_count
23
-		if($argsConfig->check_trackback!='Y') $argsConfig->check_trackback = 'N';
24
-		if($argsConfig->limits!='Y') $argsConfig->limits = 'N';
23
+		if ($argsConfig->check_trackback != 'Y') $argsConfig->check_trackback = 'N';
24
+		if ($argsConfig->limits != 'Y') $argsConfig->limits = 'N';
25 25
 		// Create and insert the module Controller object
26 26
 		$oModuleController = getController('module');
27
-		$moduleConfigOutput = $oModuleController->insertModuleConfig('spamfilter',$argsConfig);
28
-		if(!$moduleConfigOutput->toBool()) return $moduleConfigOutput;
27
+		$moduleConfigOutput = $oModuleController->insertModuleConfig('spamfilter', $argsConfig);
28
+		if (!$moduleConfigOutput->toBool()) return $moduleConfigOutput;
29 29
 
30 30
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispSpamfilterAdminConfigBlock');
31 31
 		$this->setRedirectUrl($returnUrl);
@@ -36,12 +36,12 @@  discard block
 block discarded – undo
36 36
 		//스팸IP  추가
37 37
 		$ipaddress_list = Context::get('ipaddress_list');
38 38
 		$oSpamfilterController = getController('spamfilter');
39
-		if($ipaddress_list)
39
+		if ($ipaddress_list)
40 40
 		{
41 41
 			$output = $oSpamfilterController->insertIP($ipaddress_list);
42
-			if(!$output->toBool() && !$output->get('fail_list')) return $output;
42
+			if (!$output->toBool() && !$output->get('fail_list')) return $output;
43 43
 
44
-			if($output->get('fail_list')) $message_fail = '<em>'.sprintf(Context::getLang('msg_faillist'),$output->get('fail_list')).'</em>';
44
+			if ($output->get('fail_list')) $message_fail = '<em>'.sprintf(Context::getLang('msg_faillist'), $output->get('fail_list')).'</em>';
45 45
 			$this->setMessage(Context::getLang('success_registed').$message_fail);
46 46
 		}
47 47
 
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
 	{
55 55
 		//스팸 키워드 추가
56 56
 		$word_list = Context::get('word_list');
57
-		if($word_list)
57
+		if ($word_list)
58 58
 		{
59 59
 			$output = $this->insertWord($word_list);
60
-			if(!$output->toBool() && !$output->get('fail_list')) return $output;
60
+			if (!$output->toBool() && !$output->get('fail_list')) return $output;
61 61
 
62
-			if($output->get('fail_list')) $message_fail = '<em>'.sprintf(Context::getLang('msg_faillist'),$output->get('fail_list')).'</em>';
62
+			if ($output->get('fail_list')) $message_fail = '<em>'.sprintf(Context::getLang('msg_faillist'), $output->get('fail_list')).'</em>';
63 63
 			$this->setMessage(Context::getLang('success_registed').$message_fail);
64 64
 		}
65 65
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	function procSpamfilterAdminDeleteDeniedIP()
74 74
 	{
75 75
 		$ipAddressList = Context::get('ipaddress');
76
-		if($ipAddressList) $this->deleteIP($ipAddressList);
76
+		if ($ipAddressList) $this->deleteIP($ipAddressList);
77 77
 
78 78
 		$this->setMessage(Context::getLang('success_deleted'));
79 79
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 		$this->setMessage(Context::getLang('success_deleted'));
93 93
 
94
-		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispSpamfilterAdminDeniedWordList','active','word');
94
+		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispSpamfilterAdminDeniedWordList', 'active', 'word');
95 95
 		return $this->setRedirectUrl($returnUrl);
96 96
 	}
97 97
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 */
102 102
 	function deleteIP($ipaddress)
103 103
 	{
104
-		if(!$ipaddress) return;
104
+		if (!$ipaddress) return;
105 105
 
106 106
 		$args = new stdClass;
107 107
 		$args->ipaddress = $ipaddress;
@@ -115,26 +115,26 @@  discard block
 block discarded – undo
115 115
 	function insertWord($word_list)
116 116
 	{
117 117
 
118
-		$word_list = str_replace("\r","",$word_list);
119
-		$word_list = explode("\n",$word_list);
118
+		$word_list = str_replace("\r", "", $word_list);
119
+		$word_list = explode("\n", $word_list);
120 120
 
121
-		foreach($word_list as $word)
121
+		foreach ($word_list as $word)
122 122
 		{
123
-			if(!preg_match("/^(.{2,40}[\r\n]+)*.{2,40}$/", $word))
123
+			if (!preg_match("/^(.{2,40}[\r\n]+)*.{2,40}$/", $word))
124 124
 			{
125 125
 				return new Object(-1, 'msg_invalid');
126 126
 			}
127 127
 		}
128 128
 
129 129
 		$fail_word = '';
130
-		foreach($word_list as $word)
130
+		foreach ($word_list as $word)
131 131
 		{
132 132
 			$args = new stdClass;
133
-			if(trim($word)) $args->word = $word;
133
+			if (trim($word)) $args->word = $word;
134 134
 			$output = executeQuery('spamfilter.insertDeniedWord', $args);
135
-			if(!$output->toBool()) $fail_word .= $word.'<br />';
135
+			if (!$output->toBool()) $fail_word .= $word.'<br />';
136 136
 		}
137
-		$output->add('fail_list',$fail_word);
137
+		$output->add('fail_list', $fail_word);
138 138
 		return $output;
139 139
 	}
140 140
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 	 */
145 145
 	function deleteWord($word)
146 146
 	{
147
-		if(!$word) return;
147
+		if (!$word) return;
148 148
 		$args = new stdClass;
149 149
 		$args->word = $word;
150 150
 		return executeQuery('spamfilter.deleteDeniedWord', $args);
Please login to merge, or discard this patch.
modules/spamfilter/spamfilter.controller.php 3 patches
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -161,6 +161,8 @@
 block discarded – undo
161 161
 	/**
162 162
 	 * @brief IP registration
163 163
 	 * The registered IP address is considered as a spammer
164
+	 * @param string $ipaddress_list
165
+	 * @param string $description
164 166
 	 */
165 167
 	function insertIP($ipaddress_list, $description = null)
166 168
 	{
Please login to merge, or discard this patch.
Braces   +76 added lines, -29 removed lines patch added patch discarded remove patch
@@ -27,7 +27,9 @@  discard block
 block discarded – undo
27 27
 	 */
28 28
 	function triggerInsertDocument(&$obj)
29 29
 	{
30
-		if($_SESSION['avoid_log']) return new Object();
30
+		if($_SESSION['avoid_log']) {
31
+			return new Object();
32
+		}
31 33
 		// Check the login status, login information, and permission
32 34
 		$is_logged = Context::get('is_logged');
33 35
 		$logged_info = Context::get('logged_info');
@@ -35,31 +37,40 @@  discard block
 block discarded – undo
35 37
 		// In case logged in, check if it is an administrator
36 38
 		if($is_logged)
37 39
 		{
38
-			if($logged_info->is_admin == 'Y') return new Object();
39
-			if($grant->manager) return new Object();
40
+			if($logged_info->is_admin == 'Y') {
41
+				return new Object();
42
+			}
43
+			if($grant->manager) {
44
+				return new Object();
45
+			}
40 46
 		}
41 47
 
42 48
 		$oFilterModel = getModel('spamfilter');
43 49
 		// Check if the IP is prohibited
44 50
 		$output = $oFilterModel->isDeniedIP();
45
-		if(!$output->toBool()) return $output;
51
+		if(!$output->toBool()) {
52
+			return $output;
53
+		}
46 54
 		// Check if there is a ban on the word
47 55
 		$text = '';
48 56
 		if($is_logged)
49 57
 		{
50 58
 			$text = $obj->title . ' ' . $obj->content . ' ' . $obj->tags;
51
-		}
52
-		else
59
+		} else
53 60
 		{
54 61
 			$text = $obj->title . ' ' . $obj->content . ' ' . $obj->nick_name . ' ' . $obj->homepage . ' ' . $obj->tags;	
55 62
 		}
56 63
 		$output = $oFilterModel->isDeniedWord($text);
57
-		if(!$output->toBool()) return $output;
64
+		if(!$output->toBool()) {
65
+			return $output;
66
+		}
58 67
 		// Check the specified time beside the modificaiton time
59 68
 		if($obj->document_srl == 0)
60 69
 		{
61 70
 			$output = $oFilterModel->checkLimited();
62
-			if(!$output->toBool()) return $output;
71
+			if(!$output->toBool()) {
72
+				return $output;
73
+			}
63 74
 		}
64 75
 		// Save a log
65 76
 		$this->insertLog();
@@ -72,7 +83,9 @@  discard block
 block discarded – undo
72 83
 	 */
73 84
 	function triggerInsertComment(&$obj)
74 85
 	{
75
-		if($_SESSION['avoid_log']) return new Object();
86
+		if($_SESSION['avoid_log']) {
87
+			return new Object();
88
+		}
76 89
 		// Check the login status, login information, and permission
77 90
 		$is_logged = Context::get('is_logged');
78 91
 		$logged_info = Context::get('logged_info');
@@ -80,31 +93,40 @@  discard block
 block discarded – undo
80 93
 		// In case logged in, check if it is an administrator
81 94
 		if($is_logged)
82 95
 		{
83
-			if($logged_info->is_admin == 'Y') return new Object();
84
-			if($grant->manager) return new Object();
96
+			if($logged_info->is_admin == 'Y') {
97
+				return new Object();
98
+			}
99
+			if($grant->manager) {
100
+				return new Object();
101
+			}
85 102
 		}
86 103
 
87 104
 		$oFilterModel = getModel('spamfilter');
88 105
 		// Check if the IP is prohibited
89 106
 		$output = $oFilterModel->isDeniedIP();
90
-		if(!$output->toBool()) return $output;
107
+		if(!$output->toBool()) {
108
+			return $output;
109
+		}
91 110
 		// Check if there is a ban on the word
92 111
 		$text = '';
93 112
 		if($is_logged)
94 113
 		{
95 114
 			$text = $obj->content;
96
-		}
97
-		else
115
+		} else
98 116
 		{
99 117
 			$text = $obj->content . ' ' . $obj->nick_name . ' ' . $obj->homepage;	
100 118
 		}
101 119
 		$output = $oFilterModel->isDeniedWord($text);
102
-		if(!$output->toBool()) return $output;
120
+		if(!$output->toBool()) {
121
+			return $output;
122
+		}
103 123
 		// If the specified time check is not modified
104 124
 		if(!$obj->__isupdate)
105 125
 		{
106 126
 			$output = $oFilterModel->checkLimited();
107
-			if(!$output->toBool()) return $output;
127
+			if(!$output->toBool()) {
128
+				return $output;
129
+			}
108 130
 		}
109 131
 		unset($obj->__isupdate);
110 132
 		// Save a log
@@ -118,20 +140,28 @@  discard block
 block discarded – undo
118 140
 	 */
119 141
 	function triggerInsertTrackback(&$obj)
120 142
 	{
121
-		if($_SESSION['avoid_log']) return new Object();
143
+		if($_SESSION['avoid_log']) {
144
+			return new Object();
145
+		}
122 146
 
123 147
 		$oFilterModel = getModel('spamfilter');
124 148
 		// Confirm if the trackbacks have been added more than once to your document
125 149
 		$output = $oFilterModel->isInsertedTrackback($obj->document_srl);
126
-		if(!$output->toBool()) return $output;
150
+		if(!$output->toBool()) {
151
+			return $output;
152
+		}
127 153
 
128 154
 		// Check if the IP is prohibited
129 155
 		$output = $oFilterModel->isDeniedIP();
130
-		if(!$output->toBool()) return $output;
156
+		if(!$output->toBool()) {
157
+			return $output;
158
+		}
131 159
 		// Check if there is a ban on the word
132 160
 		$text = $obj->blog_name . ' ' . $obj->title . ' ' . $obj->excerpt . ' ' . $obj->url;
133 161
 		$output = $oFilterModel->isDeniedWord($text);
134
-		if(!$output->toBool()) return $output;
162
+		if(!$output->toBool()) {
163
+			return $output;
164
+		}
135 165
 		// Start Filtering
136 166
 		$oTrackbackModel = getModel('trackback');
137 167
 		$oTrackbackController = getController('trackback');
@@ -165,7 +195,9 @@  discard block
 block discarded – undo
165 195
 	function insertIP($ipaddress_list, $description = null)
166 196
 	{
167 197
 		$regExr = "/^((\d{1,3}(?:.(\d{1,3}|\*)){3})\s*(\/\/(.*)\s*)?)*\s*$/";
168
-		if(!preg_match($regExr,$ipaddress_list)) return new Object(-1, 'msg_invalid');
198
+		if(!preg_match($regExr,$ipaddress_list)) {
199
+			return new Object(-1, 'msg_invalid');
200
+		}
169 201
 		$ipaddress_list = str_replace("\r","",$ipaddress_list);
170 202
 		$ipaddress_list = explode("\n",$ipaddress_list);
171 203
 		foreach($ipaddress_list as $ipaddressValue)
@@ -175,11 +207,16 @@  discard block
 block discarded – undo
175 207
 			if($ipaddress=trim($matches[1]))
176 208
 			{
177 209
 				$args->ipaddress = $ipaddress;
178
-				if(!$description && $matches[4]) $args->description = $matches[4];
179
-				else $args->description = $description;
210
+				if(!$description && $matches[4]) {
211
+					$args->description = $matches[4];
212
+				} else {
213
+					$args->description = $description;
214
+				}
180 215
 			}
181 216
 			$output = executeQuery('spamfilter.insertDeniedIP', $args);
182
-			if(!$output->toBool()) $fail_list .= $ipaddress.'<br/>';
217
+			if(!$output->toBool()) {
218
+				$fail_list .= $ipaddress.'<br/>';
219
+			}
183 220
 		}
184 221
 
185 222
 		$output->add('fail_list',$fail_list);
@@ -191,22 +228,32 @@  discard block
 block discarded – undo
191 228
 	 */
192 229
 	function triggerSendMessage(&$obj)
193 230
 	{
194
-		if($_SESSION['avoid_log']) return new Object();
231
+		if($_SESSION['avoid_log']) {
232
+			return new Object();
233
+		}
195 234
 
196 235
 		$logged_info = Context::get('logged_info');
197
-		if($logged_info->is_admin == 'Y') return new Object();
236
+		if($logged_info->is_admin == 'Y') {
237
+			return new Object();
238
+		}
198 239
 
199 240
 		$oFilterModel = getModel('spamfilter');
200 241
 		// Check if the IP is prohibited
201 242
 		$output = $oFilterModel->isDeniedIP();
202
-		if(!$output->toBool()) return $output;
243
+		if(!$output->toBool()) {
244
+			return $output;
245
+		}
203 246
 		// Check if there is a ban on the word
204 247
 		$text = $obj->title . ' ' . $obj->content;
205 248
 		$output = $oFilterModel->isDeniedWord($text);
206
-		if(!$output->toBool()) return $output;
249
+		if(!$output->toBool()) {
250
+			return $output;
251
+		}
207 252
 		// Check the specified time
208 253
 		$output = $oFilterModel->checkLimited(TRUE);
209
-		if(!$output->toBool()) return $output;
254
+		if(!$output->toBool()) {
255
+			return $output;
256
+		}
210 257
 		// Save a log
211 258
 		$this->insertLog();
212 259
 
Please login to merge, or discard this patch.
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -27,39 +27,39 @@  discard block
 block discarded – undo
27 27
 	 */
28 28
 	function triggerInsertDocument(&$obj)
29 29
 	{
30
-		if($_SESSION['avoid_log']) return new Object();
30
+		if ($_SESSION['avoid_log']) return new Object();
31 31
 		// Check the login status, login information, and permission
32 32
 		$is_logged = Context::get('is_logged');
33 33
 		$logged_info = Context::get('logged_info');
34 34
 		$grant = Context::get('grant');
35 35
 		// In case logged in, check if it is an administrator
36
-		if($is_logged)
36
+		if ($is_logged)
37 37
 		{
38
-			if($logged_info->is_admin == 'Y') return new Object();
39
-			if($grant->manager) return new Object();
38
+			if ($logged_info->is_admin == 'Y') return new Object();
39
+			if ($grant->manager) return new Object();
40 40
 		}
41 41
 
42 42
 		$oFilterModel = getModel('spamfilter');
43 43
 		// Check if the IP is prohibited
44 44
 		$output = $oFilterModel->isDeniedIP();
45
-		if(!$output->toBool()) return $output;
45
+		if (!$output->toBool()) return $output;
46 46
 		// Check if there is a ban on the word
47 47
 		$text = '';
48
-		if($is_logged)
48
+		if ($is_logged)
49 49
 		{
50
-			$text = $obj->title . ' ' . $obj->content . ' ' . $obj->tags;
50
+			$text = $obj->title.' '.$obj->content.' '.$obj->tags;
51 51
 		}
52 52
 		else
53 53
 		{
54
-			$text = $obj->title . ' ' . $obj->content . ' ' . $obj->nick_name . ' ' . $obj->homepage . ' ' . $obj->tags;	
54
+			$text = $obj->title.' '.$obj->content.' '.$obj->nick_name.' '.$obj->homepage.' '.$obj->tags;	
55 55
 		}
56 56
 		$output = $oFilterModel->isDeniedWord($text);
57
-		if(!$output->toBool()) return $output;
57
+		if (!$output->toBool()) return $output;
58 58
 		// Check the specified time beside the modificaiton time
59
-		if($obj->document_srl == 0)
59
+		if ($obj->document_srl == 0)
60 60
 		{
61 61
 			$output = $oFilterModel->checkLimited();
62
-			if(!$output->toBool()) return $output;
62
+			if (!$output->toBool()) return $output;
63 63
 		}
64 64
 		// Save a log
65 65
 		$this->insertLog();
@@ -72,39 +72,39 @@  discard block
 block discarded – undo
72 72
 	 */
73 73
 	function triggerInsertComment(&$obj)
74 74
 	{
75
-		if($_SESSION['avoid_log']) return new Object();
75
+		if ($_SESSION['avoid_log']) return new Object();
76 76
 		// Check the login status, login information, and permission
77 77
 		$is_logged = Context::get('is_logged');
78 78
 		$logged_info = Context::get('logged_info');
79 79
 		$grant = Context::get('grant');
80 80
 		// In case logged in, check if it is an administrator
81
-		if($is_logged)
81
+		if ($is_logged)
82 82
 		{
83
-			if($logged_info->is_admin == 'Y') return new Object();
84
-			if($grant->manager) return new Object();
83
+			if ($logged_info->is_admin == 'Y') return new Object();
84
+			if ($grant->manager) return new Object();
85 85
 		}
86 86
 
87 87
 		$oFilterModel = getModel('spamfilter');
88 88
 		// Check if the IP is prohibited
89 89
 		$output = $oFilterModel->isDeniedIP();
90
-		if(!$output->toBool()) return $output;
90
+		if (!$output->toBool()) return $output;
91 91
 		// Check if there is a ban on the word
92 92
 		$text = '';
93
-		if($is_logged)
93
+		if ($is_logged)
94 94
 		{
95 95
 			$text = $obj->content;
96 96
 		}
97 97
 		else
98 98
 		{
99
-			$text = $obj->content . ' ' . $obj->nick_name . ' ' . $obj->homepage;	
99
+			$text = $obj->content.' '.$obj->nick_name.' '.$obj->homepage;	
100 100
 		}
101 101
 		$output = $oFilterModel->isDeniedWord($text);
102
-		if(!$output->toBool()) return $output;
102
+		if (!$output->toBool()) return $output;
103 103
 		// If the specified time check is not modified
104
-		if(!$obj->__isupdate)
104
+		if (!$obj->__isupdate)
105 105
 		{
106 106
 			$output = $oFilterModel->checkLimited();
107
-			if(!$output->toBool()) return $output;
107
+			if (!$output->toBool()) return $output;
108 108
 		}
109 109
 		unset($obj->__isupdate);
110 110
 		// Save a log
@@ -118,32 +118,32 @@  discard block
 block discarded – undo
118 118
 	 */
119 119
 	function triggerInsertTrackback(&$obj)
120 120
 	{
121
-		if($_SESSION['avoid_log']) return new Object();
121
+		if ($_SESSION['avoid_log']) return new Object();
122 122
 
123 123
 		$oFilterModel = getModel('spamfilter');
124 124
 		// Confirm if the trackbacks have been added more than once to your document
125 125
 		$output = $oFilterModel->isInsertedTrackback($obj->document_srl);
126
-		if(!$output->toBool()) return $output;
126
+		if (!$output->toBool()) return $output;
127 127
 
128 128
 		// Check if the IP is prohibited
129 129
 		$output = $oFilterModel->isDeniedIP();
130
-		if(!$output->toBool()) return $output;
130
+		if (!$output->toBool()) return $output;
131 131
 		// Check if there is a ban on the word
132
-		$text = $obj->blog_name . ' ' . $obj->title . ' ' . $obj->excerpt . ' ' . $obj->url;
132
+		$text = $obj->blog_name.' '.$obj->title.' '.$obj->excerpt.' '.$obj->url;
133 133
 		$output = $oFilterModel->isDeniedWord($text);
134
-		if(!$output->toBool()) return $output;
134
+		if (!$output->toBool()) return $output;
135 135
 		// Start Filtering
136 136
 		$oTrackbackModel = getModel('trackback');
137 137
 		$oTrackbackController = getController('trackback');
138 138
 
139
-		list($ipA,$ipB,$ipC,$ipD) = explode('.',$_SERVER['REMOTE_ADDR']);
139
+		list($ipA, $ipB, $ipC, $ipD) = explode('.', $_SERVER['REMOTE_ADDR']);
140 140
 		$ipaddress = $ipA.'.'.$ipB.'.'.$ipC;
141 141
 		// In case the title and the blog name are indentical, investigate the IP address of the last 6 hours, delete and ban it.
142
-		if($obj->title == $obj->excerpt)
142
+		if ($obj->title == $obj->excerpt)
143 143
 		{
144
-			$oTrackbackController->deleteTrackbackSender(60*60*6, $ipaddress, $obj->url, $obj->blog_name, $obj->title, $obj->excerpt);
144
+			$oTrackbackController->deleteTrackbackSender(60 * 60 * 6, $ipaddress, $obj->url, $obj->blog_name, $obj->title, $obj->excerpt);
145 145
 			$this->insertIP($ipaddress.'.*', 'AUTO-DENIED : trackback.insertTrackback');
146
-			return new Object(-1,'msg_alert_trackback_denied');
146
+			return new Object(-1, 'msg_alert_trackback_denied');
147 147
 		}
148 148
 		// If trackbacks have been registered by one C-class IP address more than once for the last 30 minutes, ban the IP address and delete all the posts
149 149
 		/* 호스팅 환경을 감안하여 일단 이 부분은 동작하지 않도록 주석 처리
@@ -165,24 +165,24 @@  discard block
 block discarded – undo
165 165
 	function insertIP($ipaddress_list, $description = null)
166 166
 	{
167 167
 		$regExr = "/^((\d{1,3}(?:.(\d{1,3}|\*)){3})\s*(\/\/(.*)\s*)?)*\s*$/";
168
-		if(!preg_match($regExr,$ipaddress_list)) return new Object(-1, 'msg_invalid');
169
-		$ipaddress_list = str_replace("\r","",$ipaddress_list);
170
-		$ipaddress_list = explode("\n",$ipaddress_list);
171
-		foreach($ipaddress_list as $ipaddressValue)
168
+		if (!preg_match($regExr, $ipaddress_list)) return new Object(-1, 'msg_invalid');
169
+		$ipaddress_list = str_replace("\r", "", $ipaddress_list);
170
+		$ipaddress_list = explode("\n", $ipaddress_list);
171
+		foreach ($ipaddress_list as $ipaddressValue)
172 172
 		{
173 173
 			$args = new stdClass();
174
-			preg_match("/(\d{1,3}(?:.(\d{1,3}|\*)){3})\s*(\/\/(.*)\s*)?/",$ipaddressValue,$matches);
175
-			if($ipaddress=trim($matches[1]))
174
+			preg_match("/(\d{1,3}(?:.(\d{1,3}|\*)){3})\s*(\/\/(.*)\s*)?/", $ipaddressValue, $matches);
175
+			if ($ipaddress = trim($matches[1]))
176 176
 			{
177 177
 				$args->ipaddress = $ipaddress;
178
-				if(!$description && $matches[4]) $args->description = $matches[4];
178
+				if (!$description && $matches[4]) $args->description = $matches[4];
179 179
 				else $args->description = $description;
180 180
 			}
181 181
 			$output = executeQuery('spamfilter.insertDeniedIP', $args);
182
-			if(!$output->toBool()) $fail_list .= $ipaddress.'<br/>';
182
+			if (!$output->toBool()) $fail_list .= $ipaddress.'<br/>';
183 183
 		}
184 184
 
185
-		$output->add('fail_list',$fail_list);
185
+		$output->add('fail_list', $fail_list);
186 186
 		return $output;
187 187
 	}
188 188
 
@@ -191,22 +191,22 @@  discard block
 block discarded – undo
191 191
 	 */
192 192
 	function triggerSendMessage(&$obj)
193 193
 	{
194
-		if($_SESSION['avoid_log']) return new Object();
194
+		if ($_SESSION['avoid_log']) return new Object();
195 195
 
196 196
 		$logged_info = Context::get('logged_info');
197
-		if($logged_info->is_admin == 'Y') return new Object();
197
+		if ($logged_info->is_admin == 'Y') return new Object();
198 198
 
199 199
 		$oFilterModel = getModel('spamfilter');
200 200
 		// Check if the IP is prohibited
201 201
 		$output = $oFilterModel->isDeniedIP();
202
-		if(!$output->toBool()) return $output;
202
+		if (!$output->toBool()) return $output;
203 203
 		// Check if there is a ban on the word
204
-		$text = $obj->title . ' ' . $obj->content;
204
+		$text = $obj->title.' '.$obj->content;
205 205
 		$output = $oFilterModel->isDeniedWord($text);
206
-		if(!$output->toBool()) return $output;
206
+		if (!$output->toBool()) return $output;
207 207
 		// Check the specified time
208 208
 		$output = $oFilterModel->checkLimited(TRUE);
209
-		if(!$output->toBool()) return $output;
209
+		if (!$output->toBool()) return $output;
210 210
 		// Save a log
211 211
 		$this->insertLog();
212 212
 
Please login to merge, or discard this patch.
modules/tag/tag.model.php 3 patches
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -49,6 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
 	/**
51 51
 	 * @brief document_srl the import tag
52
+	 * @param stdClass $obj
52 53
 	 */
53 54
 	function getDocumentSrlByTag($obj)
54 55
 	{
@@ -70,6 +71,7 @@  discard block
 block discarded – undo
70 71
 
71 72
 	/**
72 73
 	 * @brief document used in the import tag
74
+	 * @param stdClass $obj
73 75
 	 */
74 76
 	function getDocumentsTagList($obj)
75 77
 	{
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	 */
21 21
 	function getTagList($obj)
22 22
 	{
23
-		if($obj->mid)
23
+		if ($obj->mid)
24 24
 		{
25 25
 			$oModuleModel = getModel('module');
26 26
 			$obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid);
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
 		// Module_srl passed the array may be a check whether the array
31 31
 		$args = new stdClass;
32
-		if(is_array($obj->module_srl))
32
+		if (is_array($obj->module_srl))
33 33
 		{
34 34
 			$args->module_srl = implode(',', $obj->module_srl);
35 35
 		}
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 		$args->count = $obj->sort_index;
43 43
 
44 44
 		$output = executeQueryArray('tag.getTagList', $args);
45
-		if(!$output->toBool()) return $output;
45
+		if (!$output->toBool()) return $output;
46 46
 
47 47
 		return $output;
48 48
 	}
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	function getDocumentSrlByTag($obj)
54 54
 	{
55 55
 		$args = new stdClass;
56
-		if(is_array($obj->module_srl))
56
+		if (is_array($obj->module_srl))
57 57
 		{
58 58
 			$args->module_srl = implode(',', $obj->module_srl);
59 59
 		}
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	function getDocumentsTagList($obj)
75 75
 	{
76 76
 		$args = new stdClass;
77
-		if(is_array($obj->document_srl))
77
+		if (is_array($obj->document_srl))
78 78
 		{
79 79
 			$args->document_srl = implode(',', $obj->document_srl);
80 80
 		}
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		}
85 85
 
86 86
 		$output = executeQueryArray('tag.getDocumentsTagList', $args);
87
-		if(!$output->toBool()) return $output;
87
+		if (!$output->toBool()) return $output;
88 88
 
89 89
 		return $output;
90 90
 	}
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	function getTagWithUsedList($obj)
96 96
 	{
97 97
 		$args = new stdClass;
98
-		if(is_array($obj->module_srl))
98
+		if (is_array($obj->module_srl))
99 99
 		{
100 100
 			$args->module_srl = implode(',', $obj->module_srl);
101 101
 		}
@@ -108,9 +108,9 @@  discard block
 block discarded – undo
108 108
 		$output = $this->getDocumentSrlByTag($args);
109 109
 		$document_srl = array();
110 110
 
111
-		if($output->data)
111
+		if ($output->data)
112 112
 		{
113
-			foreach($output->data as $k => $v) $document_srl[] = $v->document_srl;
113
+			foreach ($output->data as $k => $v) $document_srl[] = $v->document_srl;
114 114
 		}
115 115
 		unset($args);
116 116
 
Please login to merge, or discard this patch.
Braces   +13 added lines, -11 removed lines patch added patch discarded remove patch
@@ -32,8 +32,7 @@  discard block
 block discarded – undo
32 32
 		if(is_array($obj->module_srl))
33 33
 		{
34 34
 			$args->module_srl = implode(',', $obj->module_srl);
35
-		}
36
-		else
35
+		} else
37 36
 		{
38 37
 			$args->module_srl = $obj->module_srl;
39 38
 		}
@@ -42,7 +41,9 @@  discard block
 block discarded – undo
42 41
 		$args->count = $obj->sort_index;
43 42
 
44 43
 		$output = executeQueryArray('tag.getTagList', $args);
45
-		if(!$output->toBool()) return $output;
44
+		if(!$output->toBool()) {
45
+			return $output;
46
+		}
46 47
 
47 48
 		return $output;
48 49
 	}
@@ -56,8 +57,7 @@  discard block
 block discarded – undo
56 57
 		if(is_array($obj->module_srl))
57 58
 		{
58 59
 			$args->module_srl = implode(',', $obj->module_srl);
59
-		}
60
-		else
60
+		} else
61 61
 		{
62 62
 			$args->module_srl = $obj->module_srl;
63 63
 		}
@@ -77,14 +77,15 @@  discard block
 block discarded – undo
77 77
 		if(is_array($obj->document_srl))
78 78
 		{
79 79
 			$args->document_srl = implode(',', $obj->document_srl);
80
-		}
81
-		else
80
+		} else
82 81
 		{
83 82
 			$args->document_srl = $obj->document_srl;
84 83
 		}
85 84
 
86 85
 		$output = executeQueryArray('tag.getDocumentsTagList', $args);
87
-		if(!$output->toBool()) return $output;
86
+		if(!$output->toBool()) {
87
+			return $output;
88
+		}
88 89
 
89 90
 		return $output;
90 91
 	}
@@ -98,8 +99,7 @@  discard block
 block discarded – undo
98 99
 		if(is_array($obj->module_srl))
99 100
 		{
100 101
 			$args->module_srl = implode(',', $obj->module_srl);
101
-		}
102
-		else
102
+		} else
103 103
 		{
104 104
 			$args->module_srl = $obj->module_srl;
105 105
 		}
@@ -110,7 +110,9 @@  discard block
 block discarded – undo
110 110
 
111 111
 		if($output->data)
112 112
 		{
113
-			foreach($output->data as $k => $v) $document_srl[] = $v->document_srl;
113
+			foreach($output->data as $k => $v) {
114
+				$document_srl[] = $v->document_srl;
115
+			}
114 116
 		}
115 117
 		unset($args);
116 118
 
Please login to merge, or discard this patch.
modules/trash/trash.admin.controller.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	/**
40 40
 	 * Empty trash
41 41
 	 * @param array trashSrls
42
-	 * @return Object
42
+	 * @return Object|null
43 43
 	 */
44 44
 	function procTrashAdminEmptyTrash()
45 45
 	{
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
 	/**
129 129
 	 * Restore content object
130
-	 * @return void|Object
130
+	 * @return Object|null
131 131
 	 */
132 132
 	function procTrashAdminRestore()
133 133
 	{
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
 	/**
185 185
 	 * Set trash list to Context
186
-	 * @return void|Object
186
+	 * @return Object|null
187 187
 	 */
188 188
 	function procTrashAdminGetList()
189 189
 	{
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	 */
18 18
 	function insertTrash($obj)
19 19
 	{
20
-		if(!Context::get('is_logged'))
20
+		if (!Context::get('is_logged'))
21 21
 		{
22 22
 			return new Object(-1, 'msg_not_permitted');
23 23
 		}
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
 		$oTrashVO = new TrashVO();
28 28
 		$oTrashVO = &$obj;
29 29
 
30
-		if(!$oTrashVO->getTrashSrl()) $oTrashVO->setTrashSrl(getNextSequence());
31
-		if(!is_string($oTrashVO->getSerializedObject())) $oTrashVO->setSerializedObject(serialize($oTrashVO->getSerializedObject()));
30
+		if (!$oTrashVO->getTrashSrl()) $oTrashVO->setTrashSrl(getNextSequence());
31
+		if (!is_string($oTrashVO->getSerializedObject())) $oTrashVO->setSerializedObject(serialize($oTrashVO->getSerializedObject()));
32 32
 		$oTrashVO->setIpaddress($_SERVER['REMOTE_ADDR']);
33 33
 		$oTrashVO->setRemoverSrl($logged_info->member_srl);
34 34
 		$oTrashVO->setRegdate(date('YmdHis'));
@@ -49,17 +49,17 @@  discard block
 block discarded – undo
49 49
 		$tmpTrashSrls = Context::get('cart');
50 50
 
51 51
 		$trashSrls = array();
52
-		if($isAll != 'true')
52
+		if ($isAll != 'true')
53 53
 		{
54
-			if(is_array($tmpTrashSrls)) $trashSrls = $tmpTrashSrls;
54
+			if (is_array($tmpTrashSrls)) $trashSrls = $tmpTrashSrls;
55 55
 			else $trashSrls = explode('|@|', $tmpTrashSrls);
56 56
 		}
57 57
 
58 58
 		//module relation data delete...
59 59
 		$output = $this->_relationDataDelete($isAll, $trashSrls);
60
-		if(!$output->toBool()) return new Object(-1, $output->message);
60
+		if (!$output->toBool()) return new Object(-1, $output->message);
61 61
 
62
-		if(!$this->_emptyTrash($trashSrls)) return new Object(-1, $lang->fail_empty);
62
+		if (!$this->_emptyTrash($trashSrls)) return new Object(-1, $lang->fail_empty);
63 63
 
64 64
 		$this->setMessage('success_deleted', 'info');
65 65
 
@@ -76,17 +76,17 @@  discard block
 block discarded – undo
76 76
 	function _relationDataDelete($isAll, &$trashSrls)
77 77
 	{
78 78
 		$oTrashModel = getModel('trash');
79
-		if($isAll == 'true')
79
+		if ($isAll == 'true')
80 80
 		{
81 81
 			$output = $oTrashModel->getTrashAllList(array());
82
-			if(!$output->toBool())
82
+			if (!$output->toBool())
83 83
 			{
84 84
 				return new Object(-1, $output->message);
85 85
 			}
86 86
 
87
-			if(is_array($output->data))
87
+			if (is_array($output->data))
88 88
 			{
89
-				foreach($output->data as $value)
89
+				foreach ($output->data as $value)
90 90
 				{
91 91
 					$trashSrls[] = $value->getTrashSrl();
92 92
 				}
@@ -97,29 +97,29 @@  discard block
 block discarded – undo
97 97
 			$args = new stdClass();
98 98
 			$args->trashSrl = $trashSrls;
99 99
 			$output = $oTrashModel->getTrashList($args);
100
-			if(!$output->toBool())
100
+			if (!$output->toBool())
101 101
 			{
102 102
 				return new Object(-1, $output->message);
103 103
 			}
104 104
 		}
105 105
 
106
-		if(is_array($output->data))
106
+		if (is_array($output->data))
107 107
 		{
108
-			foreach($output->data as $oTrashVO)
108
+			foreach ($output->data as $oTrashVO)
109 109
 			{
110 110
 				//class file check
111 111
 				$classPath = ModuleHandler::getModulePath($oTrashVO->getOriginModule());
112
-				if(!is_dir(FileHandler::getRealPath($classPath))) return new Object(-1, 'not exist restore module directory');
112
+				if (!is_dir(FileHandler::getRealPath($classPath))) return new Object(-1, 'not exist restore module directory');
113 113
 
114 114
 				$classFile = sprintf('%s%s.admin.controller.php', $classPath, $oTrashVO->getOriginModule());
115 115
 				$classFile = FileHandler::getRealPath($classFile);
116
-				if(!file_exists($classFile)) return new Object(-1, 'not exist restore module class file');
116
+				if (!file_exists($classFile)) return new Object(-1, 'not exist restore module class file');
117 117
 
118 118
 				$oAdminController = getAdminController($oTrashVO->getOriginModule());
119
-				if(!method_exists($oAdminController, 'emptyTrash')) return new Object(-1, 'not exist restore method in module class file');
119
+				if (!method_exists($oAdminController, 'emptyTrash')) return new Object(-1, 'not exist restore method in module class file');
120 120
 
121 121
 				$output2 = $oAdminController->emptyTrash($oTrashVO->getSerializedObject());
122
-				if(!$output2->toBool()) return new Object(-1, $output2->message);
122
+				if (!$output2->toBool()) return new Object(-1, $output2->message);
123 123
 			}
124 124
 		}
125 125
 		return new Object(0, $lang->success_deleted);
@@ -134,33 +134,33 @@  discard block
 block discarded – undo
134 134
 		global $lang;
135 135
 		$trashSrlList = Context::get('cart');
136 136
 
137
-		if(is_array($trashSrlList))
137
+		if (is_array($trashSrlList))
138 138
 		{
139 139
 			// begin transaction
140 140
 			$oDB = &DB::getInstance();
141 141
 			$oDB->begin();
142 142
 			// eache restore method call in each classfile
143
-			foreach($trashSrlList as $value)
143
+			foreach ($trashSrlList as $value)
144 144
 			{
145 145
 				$oTrashModel = getModel('trash');
146 146
 				$output = $oTrashModel->getTrash($value);
147
-				if(!$output->toBool()) return new Object(-1, $output->message);
147
+				if (!$output->toBool()) return new Object(-1, $output->message);
148 148
 
149 149
 				//class file check
150 150
 				$classPath = ModuleHandler::getModulePath($output->data->getOriginModule());
151
-				if(!is_dir(FileHandler::getRealPath($classPath))) return new Object(-1, 'not exist restore module directory');
151
+				if (!is_dir(FileHandler::getRealPath($classPath))) return new Object(-1, 'not exist restore module directory');
152 152
 
153 153
 				$classFile = sprintf('%s%s.admin.controller.php', $classPath, $output->data->getOriginModule());
154 154
 				$classFile = FileHandler::getRealPath($classFile);
155
-				if(!file_exists($classFile)) return new Object(-1, 'not exist restore module class file');
155
+				if (!file_exists($classFile)) return new Object(-1, 'not exist restore module class file');
156 156
 
157 157
 				$oAdminController = getAdminController($output->data->getOriginModule());
158
-				if(!method_exists($oAdminController, 'restoreTrash')) return new Object(-1, 'not exist restore method in module class file');
158
+				if (!method_exists($oAdminController, 'restoreTrash')) return new Object(-1, 'not exist restore method in module class file');
159 159
 
160 160
 				$originObject = unserialize($output->data->getSerializedObject());
161 161
 				$output = $oAdminController->restoreTrash($originObject);
162 162
 
163
-				if(!$output->toBool())
163
+				if (!$output->toBool())
164 164
 				{
165 165
 					$oDB->rollback();
166 166
 					return new Object(-1, $output->message);
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 			}
169 169
 
170 170
 			// restore object delete in trash box
171
-			if(!$this->_emptyTrash($trashSrlList)) {
171
+			if (!$this->_emptyTrash($trashSrlList)) {
172 172
 				$oDB->rollback();
173 173
 				return new Object(-1, $lang->fail_empty);
174 174
 			}
@@ -187,11 +187,11 @@  discard block
 block discarded – undo
187 187
 	 */
188 188
 	function procTrashAdminGetList()
189 189
 	{
190
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
190
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
191 191
 		$trashSrls = Context::get('trash_srls');
192
-		if($trashSrls) $trashSrlList = explode(',', $trashSrls);
192
+		if ($trashSrls) $trashSrlList = explode(',', $trashSrls);
193 193
 
194
-		if(count($trashSrlList) > 0)
194
+		if (count($trashSrlList) > 0)
195 195
 		{
196 196
 			$oTrashModel = getModel('trash');
197 197
 			$args = new stdClass();
@@ -218,11 +218,11 @@  discard block
 block discarded – undo
218 218
 	 */
219 219
 	function _emptyTrash($trashSrls)
220 220
 	{
221
-		if(!is_array($trashSrls)) return false;
221
+		if (!is_array($trashSrls)) return false;
222 222
 		$args = new stdClass();
223 223
 		$args->trashSrls = $trashSrls;
224 224
 		$output = executeQuery('trash.deleteTrash', $args);
225
-		if(!$output->toBool()) return false;
225
+		if (!$output->toBool()) return false;
226 226
 
227 227
 		return true;
228 228
 	}
Please login to merge, or discard this patch.
Braces   +55 added lines, -22 removed lines patch added patch discarded remove patch
@@ -27,8 +27,12 @@  discard block
 block discarded – undo
27 27
 		$oTrashVO = new TrashVO();
28 28
 		$oTrashVO = &$obj;
29 29
 
30
-		if(!$oTrashVO->getTrashSrl()) $oTrashVO->setTrashSrl(getNextSequence());
31
-		if(!is_string($oTrashVO->getSerializedObject())) $oTrashVO->setSerializedObject(serialize($oTrashVO->getSerializedObject()));
30
+		if(!$oTrashVO->getTrashSrl()) {
31
+			$oTrashVO->setTrashSrl(getNextSequence());
32
+		}
33
+		if(!is_string($oTrashVO->getSerializedObject())) {
34
+			$oTrashVO->setSerializedObject(serialize($oTrashVO->getSerializedObject()));
35
+		}
32 36
 		$oTrashVO->setIpaddress($_SERVER['REMOTE_ADDR']);
33 37
 		$oTrashVO->setRemoverSrl($logged_info->member_srl);
34 38
 		$oTrashVO->setRegdate(date('YmdHis'));
@@ -51,15 +55,22 @@  discard block
 block discarded – undo
51 55
 		$trashSrls = array();
52 56
 		if($isAll != 'true')
53 57
 		{
54
-			if(is_array($tmpTrashSrls)) $trashSrls = $tmpTrashSrls;
55
-			else $trashSrls = explode('|@|', $tmpTrashSrls);
58
+			if(is_array($tmpTrashSrls)) {
59
+				$trashSrls = $tmpTrashSrls;
60
+			} else {
61
+				$trashSrls = explode('|@|', $tmpTrashSrls);
62
+			}
56 63
 		}
57 64
 
58 65
 		//module relation data delete...
59 66
 		$output = $this->_relationDataDelete($isAll, $trashSrls);
60
-		if(!$output->toBool()) return new Object(-1, $output->message);
67
+		if(!$output->toBool()) {
68
+			return new Object(-1, $output->message);
69
+		}
61 70
 
62
-		if(!$this->_emptyTrash($trashSrls)) return new Object(-1, $lang->fail_empty);
71
+		if(!$this->_emptyTrash($trashSrls)) {
72
+			return new Object(-1, $lang->fail_empty);
73
+		}
63 74
 
64 75
 		$this->setMessage('success_deleted', 'info');
65 76
 
@@ -91,8 +102,7 @@  discard block
 block discarded – undo
91 102
 					$trashSrls[] = $value->getTrashSrl();
92 103
 				}
93 104
 			}
94
-		}
95
-		else
105
+		} else
96 106
 		{
97 107
 			$args = new stdClass();
98 108
 			$args->trashSrl = $trashSrls;
@@ -109,17 +119,25 @@  discard block
 block discarded – undo
109 119
 			{
110 120
 				//class file check
111 121
 				$classPath = ModuleHandler::getModulePath($oTrashVO->getOriginModule());
112
-				if(!is_dir(FileHandler::getRealPath($classPath))) return new Object(-1, 'not exist restore module directory');
122
+				if(!is_dir(FileHandler::getRealPath($classPath))) {
123
+					return new Object(-1, 'not exist restore module directory');
124
+				}
113 125
 
114 126
 				$classFile = sprintf('%s%s.admin.controller.php', $classPath, $oTrashVO->getOriginModule());
115 127
 				$classFile = FileHandler::getRealPath($classFile);
116
-				if(!file_exists($classFile)) return new Object(-1, 'not exist restore module class file');
128
+				if(!file_exists($classFile)) {
129
+					return new Object(-1, 'not exist restore module class file');
130
+				}
117 131
 
118 132
 				$oAdminController = getAdminController($oTrashVO->getOriginModule());
119
-				if(!method_exists($oAdminController, 'emptyTrash')) return new Object(-1, 'not exist restore method in module class file');
133
+				if(!method_exists($oAdminController, 'emptyTrash')) {
134
+					return new Object(-1, 'not exist restore method in module class file');
135
+				}
120 136
 
121 137
 				$output2 = $oAdminController->emptyTrash($oTrashVO->getSerializedObject());
122
-				if(!$output2->toBool()) return new Object(-1, $output2->message);
138
+				if(!$output2->toBool()) {
139
+					return new Object(-1, $output2->message);
140
+				}
123 141
 			}
124 142
 		}
125 143
 		return new Object(0, $lang->success_deleted);
@@ -144,18 +162,26 @@  discard block
 block discarded – undo
144 162
 			{
145 163
 				$oTrashModel = getModel('trash');
146 164
 				$output = $oTrashModel->getTrash($value);
147
-				if(!$output->toBool()) return new Object(-1, $output->message);
165
+				if(!$output->toBool()) {
166
+					return new Object(-1, $output->message);
167
+				}
148 168
 
149 169
 				//class file check
150 170
 				$classPath = ModuleHandler::getModulePath($output->data->getOriginModule());
151
-				if(!is_dir(FileHandler::getRealPath($classPath))) return new Object(-1, 'not exist restore module directory');
171
+				if(!is_dir(FileHandler::getRealPath($classPath))) {
172
+					return new Object(-1, 'not exist restore module directory');
173
+				}
152 174
 
153 175
 				$classFile = sprintf('%s%s.admin.controller.php', $classPath, $output->data->getOriginModule());
154 176
 				$classFile = FileHandler::getRealPath($classFile);
155
-				if(!file_exists($classFile)) return new Object(-1, 'not exist restore module class file');
177
+				if(!file_exists($classFile)) {
178
+					return new Object(-1, 'not exist restore module class file');
179
+				}
156 180
 
157 181
 				$oAdminController = getAdminController($output->data->getOriginModule());
158
-				if(!method_exists($oAdminController, 'restoreTrash')) return new Object(-1, 'not exist restore method in module class file');
182
+				if(!method_exists($oAdminController, 'restoreTrash')) {
183
+					return new Object(-1, 'not exist restore method in module class file');
184
+				}
159 185
 
160 186
 				$originObject = unserialize($output->data->getSerializedObject());
161 187
 				$output = $oAdminController->restoreTrash($originObject);
@@ -187,9 +213,13 @@  discard block
 block discarded – undo
187 213
 	 */
188 214
 	function procTrashAdminGetList()
189 215
 	{
190
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
216
+		if(!Context::get('is_logged')) {
217
+			return new Object(-1,'msg_not_permitted');
218
+		}
191 219
 		$trashSrls = Context::get('trash_srls');
192
-		if($trashSrls) $trashSrlList = explode(',', $trashSrls);
220
+		if($trashSrls) {
221
+			$trashSrlList = explode(',', $trashSrls);
222
+		}
193 223
 
194 224
 		if(count($trashSrlList) > 0)
195 225
 		{
@@ -198,8 +228,7 @@  discard block
 block discarded – undo
198 228
 			$args->trashSrl = $trashSrlList;
199 229
 			$output = $oTrashModel->getTrashList($args);
200 230
 			$trashList = $output->data;
201
-		}
202
-		else
231
+		} else
203 232
 		{
204 233
 			global $lang;
205 234
 			$trashList = array();
@@ -218,11 +247,15 @@  discard block
 block discarded – undo
218 247
 	 */
219 248
 	function _emptyTrash($trashSrls)
220 249
 	{
221
-		if(!is_array($trashSrls)) return false;
250
+		if(!is_array($trashSrls)) {
251
+			return false;
252
+		}
222 253
 		$args = new stdClass();
223 254
 		$args->trashSrls = $trashSrls;
224 255
 		$output = executeQuery('trash.deleteTrash', $args);
225
-		if(!$output->toBool()) return false;
256
+		if(!$output->toBool()) {
257
+			return false;
258
+		}
226 259
 
227 260
 		return true;
228 261
 	}
Please login to merge, or discard this patch.
modules/widget/widget.controller.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -696,6 +696,9 @@
 block discarded – undo
696 696
 		return $GLOBALS['_xe_loaded_widgets_'][$widget];
697 697
 	}
698 698
 
699
+	/**
700
+	 * @param boolean $javascript_mode
701
+	 */
699 702
 	function compileWidgetStyle($widgetStyle,$widget,$widget_content_body, $args, $javascript_mode)
700 703
 	{
701 704
 		if(!$widgetStyle) return $widget_content_body;
Please login to merge, or discard this patch.
Braces   +171 added lines, -69 removed lines patch added patch discarded remove patch
@@ -40,7 +40,9 @@  discard block
 block discarded – undo
40 40
 			$colorset_list[] = $colorset;
41 41
 		}
42 42
 
43
-		if(count($colorset_list)) $colorsets = implode("\n", $colorset_list);
43
+		if(count($colorset_list)) {
44
+			$colorsets = implode("\n", $colorset_list);
45
+		}
44 46
 		$this->add('colorset_list', $colorsets);
45 47
 	}
46 48
 
@@ -50,8 +52,12 @@  discard block
 block discarded – undo
50 52
 	function procWidgetGenerateCode()
51 53
 	{
52 54
 		$widget = Context::get('selected_widget');
53
-		if(!$widget) return new Object(-1,'msg_invalid_request');
54
-		if(!Context::get('skin')) return new Object(-1,Context::getLang('msg_widget_skin_is_null'));
55
+		if(!$widget) {
56
+			return new Object(-1,'msg_invalid_request');
57
+		}
58
+		if(!Context::get('skin')) {
59
+			return new Object(-1,Context::getLang('msg_widget_skin_is_null'));
60
+		}
55 61
 
56 62
 		$attribute = $this->arrangeWidgetVars($widget, Context::getRequestVars(), $vars);
57 63
 
@@ -66,9 +72,13 @@  discard block
 block discarded – undo
66 72
 	function procWidgetGenerateCodeInPage()
67 73
 	{
68 74
 		$widget = Context::get('selected_widget');
69
-		if(!$widget) return new Object(-1,'msg_invalid_request');
75
+		if(!$widget) {
76
+			return new Object(-1,'msg_invalid_request');
77
+		}
70 78
 
71
-		if(!in_array($widget,array('widgetBox','widgetContent')) && !Context::get('skin')) return new Object(-1,Context::getLang('msg_widget_skin_is_null'));
79
+		if(!in_array($widget,array('widgetBox','widgetContent')) && !Context::get('skin')) {
80
+			return new Object(-1,Context::getLang('msg_widget_skin_is_null'));
81
+		}
72 82
 
73 83
 		$attribute = $this->arrangeWidgetVars($widget, Context::getRequestVars(), $vars);
74 84
 		// Wanted results
@@ -107,14 +117,20 @@  discard block
 block discarded – undo
107 117
 		$err = 0;
108 118
 		$oLayoutModel = getModel('layout');
109 119
 		$layout_info = $oLayoutModel->getLayout($module_srl);
110
-		if(!$layout_info || $layout_info->type != 'faceoff') $err++;
120
+		if(!$layout_info || $layout_info->type != 'faceoff') {
121
+			$err++;
122
+		}
111 123
 		// Destination Information Wanted page module
112 124
 		$oModuleModel = getModel('module');
113 125
 		$columnList = array('module_srl', 'module');
114 126
 		$page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
115
-		if(!$page_info->module_srl || $page_info->module != 'page') $err++;
127
+		if(!$page_info->module_srl || $page_info->module != 'page') {
128
+			$err++;
129
+		}
116 130
 
117
-		if($err > 1) return new Object(-1,'msg_invalid_request');
131
+		if($err > 1) {
132
+			return new Object(-1,'msg_invalid_request');
133
+		}
118 134
 		// Check permissions
119 135
 		$is_logged = Context::get('is_logged');
120 136
 		$logged_info = Context::get('logged_info');
@@ -125,10 +141,14 @@  discard block
 block discarded – undo
125 141
 			$manager_group = $page_info->grants['manager'];
126 142
 			foreach($user_group as $group_srl => $group_info)
127 143
 			{
128
-				if(in_array($group_srl, $manager_group)) $is_admin = true;
144
+				if(in_array($group_srl, $manager_group)) {
145
+					$is_admin = true;
146
+				}
129 147
 			}
130 148
 		}
131
-		if(!$is_admin && !$is_logged && $logged_info->is_admin != 'Y' && !$oModuleModel->isSiteAdmin($logged_info) && !(is_array($page_info->admin_id) && in_array($logged_info->user_id, $page_info->admin_id))) return new Object(-1,'msg_not_permitted');
149
+		if(!$is_admin && !$is_logged && $logged_info->is_admin != 'Y' && !$oModuleModel->isSiteAdmin($logged_info) && !(is_array($page_info->admin_id) && in_array($logged_info->user_id, $page_info->admin_id))) {
150
+			return new Object(-1,'msg_not_permitted');
151
+		}
132 152
 		// Enter post
133 153
 		$oDocumentModel = getModel('document');
134 154
 		$oDocumentController = getController('document');
@@ -142,14 +162,15 @@  discard block
 block discarded – undo
142 162
 		if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl)
143 163
 		{
144 164
 			$output = $oDocumentController->updateDocument($oDocument, $obj);
145
-		}
146
-		else
165
+		} else
147 166
 		{
148 167
 			$output = $oDocumentController->insertDocument($obj);
149 168
 			$obj->document_srl = $output->get('document_srl');
150 169
 		}
151 170
 		// Stop when an error occurs
152
-		if(!$output->toBool()) return $output;
171
+		if(!$output->toBool()) {
172
+			return $output;
173
+		}
153 174
 		// Return results
154 175
 		$this->add('document_srl', $obj->document_srl);
155 176
 	}
@@ -167,13 +188,17 @@  discard block
 block discarded – undo
167 188
 		$oDocumentAdminController = getAdminController('document');
168 189
 
169 190
 		$oDocument = $oDocumentModel->getDocument($document_srl, true);
170
-		if(!$oDocument->isExists()) return new Object(-1,'msg_invalid_request');
191
+		if(!$oDocument->isExists()) {
192
+			return new Object(-1,'msg_invalid_request');
193
+		}
171 194
 		$module_srl = $oDocument->get('module_srl');
172 195
 		// Destination Information Wanted page module
173 196
 		$oModuleModel = getModel('module');
174 197
 		$columnList = array('module_srl', 'module');
175 198
 		$page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
176
-		if(!$page_info->module_srl || $page_info->module != 'page') return new Object(-1,'msg_invalid_request');
199
+		if(!$page_info->module_srl || $page_info->module != 'page') {
200
+			return new Object(-1,'msg_invalid_request');
201
+		}
177 202
 		// Check permissions
178 203
 		$is_logged = Context::get('is_logged');
179 204
 		$logged_info = Context::get('logged_info');
@@ -184,13 +209,19 @@  discard block
 block discarded – undo
184 209
 			$manager_group = $page_info->grants['manager'];
185 210
 			foreach($user_group as $group_srl => $group_info)
186 211
 			{
187
-				if(in_array($group_srl, $manager_group)) $is_admin = true;
212
+				if(in_array($group_srl, $manager_group)) {
213
+					$is_admin = true;
214
+				}
188 215
 			}
189 216
 		}
190
-		if(!$is_admin && !$is_logged && $logged_info->is_admin != 'Y' && !$oModuleModel->isSiteAdmin($logged_info) && !(is_array($page_info->admin_id) && in_array($logged_info->user_id, $page_info->admin_id))) return new Object(-1,'msg_not_permitted');
217
+		if(!$is_admin && !$is_logged && $logged_info->is_admin != 'Y' && !$oModuleModel->isSiteAdmin($logged_info) && !(is_array($page_info->admin_id) && in_array($logged_info->user_id, $page_info->admin_id))) {
218
+			return new Object(-1,'msg_not_permitted');
219
+		}
191 220
 
192 221
 		$output = $oDocumentAdminController->copyDocumentModule(array($oDocument->get('document_srl')), $oDocument->get('module_srl'),0);
193
-		if(!$output->toBool()) return $output;
222
+		if(!$output->toBool()) {
223
+			return $output;
224
+		}
194 225
 		// Return results
195 226
 		$copied_srls = $output->get('copied_srls');
196 227
 		$this->add('document_srl', $copied_srls[$oDocument->get('document_srl')]);
@@ -208,12 +239,16 @@  discard block
 block discarded – undo
208 239
 		$oDocumentController = getController('document');
209 240
 
210 241
 		$oDocument = $oDocumentModel->getDocument($document_srl, true);
211
-		if(!$oDocument->isExists()) return new Object();
242
+		if(!$oDocument->isExists()) {
243
+			return new Object();
244
+		}
212 245
 		$module_srl = $oDocument->get('module_srl');
213 246
 		// Destination Information Wanted page module
214 247
 		$oModuleModel = getModel('module');
215 248
 		$page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
216
-		if(!$page_info->module_srl || $page_info->module != 'page') return new Object(-1,'msg_invalid_request');
249
+		if(!$page_info->module_srl || $page_info->module != 'page') {
250
+			return new Object(-1,'msg_invalid_request');
251
+		}
217 252
 		// Check permissions
218 253
 		$is_logged = Context::get('is_logged');
219 254
 		$logged_info = Context::get('logged_info');
@@ -224,13 +259,19 @@  discard block
 block discarded – undo
224 259
 			$manager_group = $page_info->grants['manager'];
225 260
 			foreach($user_group as $group_srl => $group_info)
226 261
 			{
227
-				if(in_array($group_srl, $manager_group)) $is_admin = true;
262
+				if(in_array($group_srl, $manager_group)) {
263
+					$is_admin = true;
264
+				}
228 265
 			}
229 266
 		}
230
-		if(!$is_admin && !$is_logged && $logged_info->is_admin != 'Y' && !$oModuleModel->isSiteAdmin($logged_info) && !(is_array($page_info->admin_id) && in_array($logged_info->user_id, $page_info->admin_id))) return new Object(-1,'msg_not_permitted');
267
+		if(!$is_admin && !$is_logged && $logged_info->is_admin != 'Y' && !$oModuleModel->isSiteAdmin($logged_info) && !(is_array($page_info->admin_id) && in_array($logged_info->user_id, $page_info->admin_id))) {
268
+			return new Object(-1,'msg_not_permitted');
269
+		}
231 270
 
232 271
 		$output = $oDocumentController->deleteDocument($oDocument->get('document_srl'), true);
233
-		if(!$output->toBool()) return $output;
272
+		if(!$output->toBool()) {
273
+			return $output;
274
+		}
234 275
 	}
235 276
 
236 277
 	/**
@@ -247,7 +288,9 @@  discard block
 block discarded – undo
247 288
 	 */
248 289
 	function triggerWidgetCompile(&$content)
249 290
 	{
250
-		if(Context::getResponseMethod()!='HTML') return new Object();
291
+		if(Context::getResponseMethod()!='HTML') {
292
+			return new Object();
293
+		}
251 294
 		$content = $this->transWidgetCode($content, $this->layout_javascript_mode);
252 295
 		return new Object();
253 296
 	}
@@ -280,11 +323,16 @@  discard block
 block discarded – undo
280 323
 		$oXmlParser = new XmlParser();
281 324
 		$xml_doc = $oXmlParser->parse(trim($buff));
282 325
 
283
-		if($xml_doc->img) $vars = $xml_doc->img->attrs;
284
-		else $vars = $xml_doc->attrs;
326
+		if($xml_doc->img) {
327
+			$vars = $xml_doc->img->attrs;
328
+		} else {
329
+			$vars = $xml_doc->attrs;
330
+		}
285 331
 
286 332
 		$widget = $vars->widget;
287
-		if(!$widget) return $matches[0];
333
+		if(!$widget) {
334
+			return $matches[0];
335
+		}
288 336
 		unset($vars->widget);
289 337
 
290 338
 		return $this->execute($widget, $vars, $this->javascript_mode);
@@ -301,7 +349,9 @@  discard block
 block discarded – undo
301 349
 
302 350
 		$vars = $xml_doc->div->attrs;
303 351
 		$widget = $vars->widget;
304
-		if(!$widget) return $matches[0];
352
+		if(!$widget) {
353
+			return $matches[0];
354
+		}
305 355
 		unset($vars->widget);
306 356
 
307 357
 		$vars->widgetbox_content = $matches[3];
@@ -328,22 +378,30 @@  discard block
 block discarded – undo
328 378
 			$xml_doc = $oXmlParser->parse(trim($buff));
329 379
 
330 380
 			$args = $xml_doc->img->attrs;
331
-			if(!$args) continue;
381
+			if(!$args) {
382
+				continue;
383
+			}
332 384
 			// If you are not caching path
333 385
 			$widget = $args->widget;
334 386
 			$sequence = $args->widget_sequence;
335 387
 			$cache = $args->widget_cache;
336
-			if(!$sequence || !$cache) continue;
388
+			if(!$sequence || !$cache) {
389
+				continue;
390
+			}
337 391
 
338 392
 			if(count($args))
339 393
 			{
340
-				foreach($args as $k => $v) $args->{$k} = urldecode($v);
394
+				foreach($args as $k => $v) {
395
+					$args->{$k} = urldecode($v);
396
+				}
341 397
 			}
342 398
 			// If the cache file for each language widget regeneration
343 399
 			foreach($lang_list as $lang_type => $val)
344 400
 			{
345 401
 				$cache_file = sprintf('%s%d.%s.cache', $this->cache_path, $sequence, $lang_type);
346
-				if(!file_exists($cache_file)) continue;
402
+				if(!file_exists($cache_file)) {
403
+					continue;
404
+				}
347 405
 				$this->getCache($widget, $args, $lang_type, true);
348 406
 			}
349 407
 		}
@@ -355,7 +413,9 @@  discard block
 block discarded – undo
355 413
 	function getCache($widget, $args, $lang_type = null, $ignore_cache = false)
356 414
 	{
357 415
 		// If the specified language specifies the current language
358
-		if(!$lang_type) $lang_type = Context::getLangType();
416
+		if(!$lang_type) {
417
+			$lang_type = Context::getLangType();
418
+		}
359 419
 		// widget, the cache number and cache values are set
360 420
 		$widget_sequence = $args->widget_sequence;
361 421
 		$widget_cache = $args->widget_cache;
@@ -366,7 +426,9 @@  discard block
 block discarded – undo
366 426
 		if(!$ignore_cache && (!$widget_cache || !$widget_sequence))
367 427
 		{
368 428
 			$oWidget = $this->getWidgetObject($widget);
369
-			if(!$oWidget || !method_exists($oWidget, 'proc')) return;
429
+			if(!$oWidget || !method_exists($oWidget, 'proc')) {
430
+				return;
431
+			}
370 432
 
371 433
 			$widget_content = $oWidget->proc($args);
372 434
 			$oModuleController = getController('module');
@@ -386,8 +448,7 @@  discard block
 block discarded – undo
386 448
 		if($cache_body)
387 449
 		{
388 450
 			return $cache_body;
389
-		}
390
-		else
451
+		} else
391 452
 		{
392 453
 			/**
393 454
 			 * Cache number and cache values are set so that the cache file should call
@@ -415,7 +476,9 @@  discard block
 block discarded – undo
415 476
 			}
416 477
 
417 478
 			$oWidget = $this->getWidgetObject($widget);
418
-			if(!$oWidget || !method_exists($oWidget,'proc')) return;
479
+			if(!$oWidget || !method_exists($oWidget,'proc')) {
480
+				return;
481
+			}
419 482
 
420 483
 			$widget_content = $oWidget->proc($args);
421 484
 			$oModuleController = getController('module');
@@ -423,8 +486,7 @@  discard block
 block discarded – undo
423 486
 			if($oCacheHandler->isSupport())
424 487
 			{
425 488
 				$oCacheHandler->put($key, $widget_content, $widget_cache * 60);
426
-			}
427
-			else
489
+			} else
428 490
 			{
429 491
 				FileHandler::writeFile($cache_file, $widget_content);
430 492
 			}
@@ -442,7 +504,9 @@  discard block
 block discarded – undo
442 504
 	function execute($widget, $args, $javascript_mode = false, $escaped = true)
443 505
 	{
444 506
 		// Save for debug run-time widget
445
-		if(__DEBUG__==3) $start = getMicroTime();
507
+		if(__DEBUG__==3) {
508
+			$start = getMicroTime();
509
+		}
446 510
 		$before = microtime(true);
447 511
 		// urldecode the value of args haejum
448 512
 		$object_vars = get_object_vars($args);
@@ -450,8 +514,12 @@  discard block
 block discarded – undo
450 514
 		{
451 515
 			foreach($object_vars as $key => $val)
452 516
 			{
453
-				if(in_array($key, array('widgetbox_content','body','class','style','widget_sequence','widget','widget_padding_left','widget_padding_top','widget_padding_bottom','widget_padding_right','widgetstyle','document_srl'))) continue;
454
-				if($escaped) $args->{$key} = utf8RawUrlDecode($val);
517
+				if(in_array($key, array('widgetbox_content','body','class','style','widget_sequence','widget','widget_padding_left','widget_padding_top','widget_padding_bottom','widget_padding_right','widgetstyle','document_srl'))) {
518
+					continue;
519
+				}
520
+				if($escaped) {
521
+					$args->{$key} = utf8RawUrlDecode($val);
522
+				}
455 523
 			}
456 524
 		}
457 525
 
@@ -462,7 +530,9 @@  discard block
 block discarded – undo
462 530
 		$widget_content = '';
463 531
 		if($widget != 'widgetContent' && $widget != 'widgetBox')
464 532
 		{
465
-			if(!is_dir(sprintf(_XE_PATH_.'widgets/%s/',$widget))) return;
533
+			if(!is_dir(sprintf(_XE_PATH_.'widgets/%s/',$widget))) {
534
+				return;
535
+			}
466 536
 			// Hold the contents of the widget parameter
467 537
 			$widget_content = $this->getCache($widget, $args);
468 538
 		}
@@ -494,7 +564,9 @@  discard block
 block discarded – undo
494 564
 		// If general call is given on page styles should return immediately dreamin '
495 565
 		if(!$javascript_mode)
496 566
 		{
497
-			if($args->id) $args->id = ' id="'.$args->id.'" ';
567
+			if($args->id) {
568
+				$args->id = ' id="'.$args->id.'" ';
569
+			}
498 570
 			switch($widget)
499 571
 			{
500 572
 				// If a direct orthogonal addition information
@@ -504,8 +576,7 @@  discard block
 block discarded – undo
504 576
 						$oDocumentModel = getModel('document');
505 577
 						$oDocument = $oDocumentModel->getDocument($args->document_srl);
506 578
 						$body = $oDocument->getContent(false,false,false, false);
507
-					}
508
-					else
579
+					} else
509 580
 					{
510 581
 						$body = base64_decode($args->body);
511 582
 					}
@@ -532,8 +603,7 @@  discard block
 block discarded – undo
532 603
 					break;
533 604
 			}
534 605
 			// Edit page is called when a widget if you add the code for handling
535
-		}
536
-		else
606
+		} else
537 607
 		{
538 608
 			switch($widget)
539 609
 			{
@@ -544,8 +614,7 @@  discard block
 block discarded – undo
544 614
 						$oDocumentModel = getModel('document');
545 615
 						$oDocument = $oDocumentModel->getDocument($args->document_srl);
546 616
 						$body = $oDocument->getContent(false,false,false);
547
-					}
548
-					else
617
+					} else
549 618
 					{
550 619
 						$body = base64_decode($args->body);
551 620
 					}
@@ -555,8 +624,12 @@  discard block
 block discarded – undo
555 624
 					{
556 625
 						foreach($args as $key => $val)
557 626
 						{
558
-							if(in_array($key, array('class','style','widget_padding_top','widget_padding_right','widget_padding_bottom','widget_padding_left','widget','widgetstyle','document_srl'))) continue;
559
-							if(strpos($val,'|@|')>0) $val = str_replace('|@|',',',$val);
627
+							if(in_array($key, array('class','style','widget_padding_top','widget_padding_right','widget_padding_bottom','widget_padding_left','widget','widgetstyle','document_srl'))) {
628
+								continue;
629
+							}
630
+							if(strpos($val,'|@|')>0) {
631
+								$val = str_replace('|@|',',',$val);
632
+							}
560 633
 							$attribute[] = sprintf('%s="%s"', $key, htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
561 634
 						}
562 635
 					}
@@ -590,9 +663,15 @@  discard block
 block discarded – undo
590 663
 					{
591 664
 						foreach($args as $key => $val)
592 665
 						{
593
-							if(in_array($key, array('class','style','widget_padding_top','widget_padding_right','widget_padding_bottom','widget_padding_left','widget','widgetstyle','document_srl'))) continue;
594
-							if(!is_numeric($val) && (!is_string($val) || strlen($val)==0)) continue;
595
-							if(strpos($val,'|@|')>0) $val = str_replace('|@|',',',$val);
666
+							if(in_array($key, array('class','style','widget_padding_top','widget_padding_right','widget_padding_bottom','widget_padding_left','widget','widgetstyle','document_srl'))) {
667
+								continue;
668
+							}
669
+							if(!is_numeric($val) && (!is_string($val) || strlen($val)==0)) {
670
+								continue;
671
+							}
672
+							if(strpos($val,'|@|')>0) {
673
+								$val = str_replace('|@|',',',$val);
674
+							}
596 675
 							$attribute[] = sprintf('%s="%s"', $key, htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
597 676
 						}
598 677
 					}
@@ -615,9 +694,15 @@  discard block
 block discarded – undo
615 694
 						$allowed_key = array('class','style','widget_padding_top','widget_padding_right','widget_padding_bottom','widget_padding_left','widget');
616 695
 						foreach($args as $key => $val)
617 696
 						{
618
-							if(in_array($key, $allowed_key)) continue;
619
-							if(!is_numeric($val) && (!is_string($val) || strlen($val)==0)) continue;
620
-							if(strpos($val,'|@|')>0) $val = str_replace('|@|',',',$val);
697
+							if(in_array($key, $allowed_key)) {
698
+								continue;
699
+							}
700
+							if(!is_numeric($val) && (!is_string($val) || strlen($val)==0)) {
701
+								continue;
702
+							}
703
+							if(strpos($val,'|@|')>0) {
704
+								$val = str_replace('|@|',',',$val);
705
+							}
621 706
 							$attribute[] = sprintf('%s="%s"', $key, htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
622 707
 						}
623 708
 					}
@@ -637,11 +722,15 @@  discard block
 block discarded – undo
637 722
 			}
638 723
 		}
639 724
 		// Compile the widget style.
640
-		if($args->widgetstyle) $widget_content_body = $this->compileWidgetStyle($args->widgetstyle,$widget, $widget_content_body, $args, $javascript_mode);
725
+		if($args->widgetstyle) {
726
+			$widget_content_body = $this->compileWidgetStyle($args->widgetstyle,$widget, $widget_content_body, $args, $javascript_mode);
727
+		}
641 728
 
642 729
 		$output = $widget_content_header . $widget_content_body . $widget_content_footer;
643 730
 		// Debug widget creation time information added to the results
644
-		if(__DEBUG__==3) $GLOBALS['__widget_excute_elapsed__'] += getMicroTime() - $start;
731
+		if(__DEBUG__==3) {
732
+			$GLOBALS['__widget_excute_elapsed__'] += getMicroTime() - $start;
733
+		}
645 734
 
646 735
 		$after = microtime(true);
647 736
 
@@ -674,7 +763,9 @@  discard block
 block discarded – undo
674 763
 			$path = $oWidgetModel->getWidgetPath($widget);
675 764
 			// If you do not find the class file error output widget (html output)
676 765
 			$class_file = sprintf('%s%s.class.php', $path, $widget);
677
-			if(!file_exists($class_file)) return sprintf(Context::getLang('msg_widget_is_not_exists'), $widget);
766
+			if(!file_exists($class_file)) {
767
+				return sprintf(Context::getLang('msg_widget_is_not_exists'), $widget);
768
+			}
678 769
 			// Widget classes include
679 770
 			require_once($class_file);
680 771
 
@@ -685,9 +776,13 @@  discard block
 block discarded – undo
685 776
 			}
686 777
 
687 778
 			$oWidget = new $widget();
688
-			if(!is_object($oWidget)) return sprintf(Context::getLang('msg_widget_object_is_null'), $widget);
779
+			if(!is_object($oWidget)) {
780
+				return sprintf(Context::getLang('msg_widget_object_is_null'), $widget);
781
+			}
689 782
 
690
-			if(!method_exists($oWidget, 'proc')) return sprintf(Context::getLang('msg_widget_proc_is_null'), $widget);
783
+			if(!method_exists($oWidget, 'proc')) {
784
+				return sprintf(Context::getLang('msg_widget_proc_is_null'), $widget);
785
+			}
691 786
 
692 787
 			$oWidget->widget_path = $path;
693 788
 
@@ -698,12 +793,16 @@  discard block
 block discarded – undo
698 793
 
699 794
 	function compileWidgetStyle($widgetStyle,$widget,$widget_content_body, $args, $javascript_mode)
700 795
 	{
701
-		if(!$widgetStyle) return $widget_content_body;
796
+		if(!$widgetStyle) {
797
+			return $widget_content_body;
798
+		}
702 799
 
703 800
 		$oWidgetModel = getModel('widget');
704 801
 		// Bring extra_var widget style tie
705 802
 		$widgetstyle_info = $oWidgetModel->getWidgetStyleInfo($widgetStyle);
706
-		if(!$widgetstyle_info) return $widget_content_body;
803
+		if(!$widgetstyle_info) {
804
+			return $widget_content_body;
805
+		}
707 806
 
708 807
 		$widgetstyle_extra_var = new stdClass();
709 808
 		$widgetstyle_extra_var_key = get_object_vars($widgetstyle_info);
@@ -721,8 +820,7 @@  discard block
 block discarded – undo
721 820
 		if($javascript_mode && $widget=='widgetBox')
722 821
 		{
723 822
 			Context::set('widget_content', '<div class="widget_inner">'.$widget_content_body.'</div>');
724
-		}
725
-		else
823
+		} else
726 824
 		{
727 825
 			Context::set('widget_content', $widget_content_body);
728 826
 		}
@@ -791,7 +889,9 @@  discard block
 block discarded – undo
791 889
 			FileHandler::removeFile($cache_file);
792 890
 		}
793 891
 
794
-		if($vars->widget_cache>0) $vars->widget_sequence = getNextSequence();
892
+		if($vars->widget_cache>0) {
893
+			$vars->widget_sequence = getNextSequence();
894
+		}
795 895
 
796 896
 		$attribute = array();
797 897
 		foreach($vars as $key => $val)
@@ -801,7 +901,9 @@  discard block
 block discarded – undo
801 901
 				unset($vars->{$key});
802 902
 				continue;
803 903
 			}
804
-			if(strpos($val,'|@|') > 0) $val = str_replace('|@|', ',', $val);
904
+			if(strpos($val,'|@|') > 0) {
905
+				$val = str_replace('|@|', ',', $val);
906
+			}
805 907
 			$vars->{$key} = Context::convertEncodingStr($val);
806 908
 			$attribute[] = sprintf('%s="%s"', $key, htmlspecialchars(Context::convertEncodingStr($val), ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
807 909
 		}
Please login to merge, or discard this patch.
Spacing   +133 added lines, -133 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
 		$oModuleModel = getModel('module');
35 35
 		$skin_info = $oModuleModel->loadSkinInfo($path, $skin);
36 36
 
37
-		for($i=0;$i<count($skin_info->colorset);$i++)
37
+		for ($i = 0; $i < count($skin_info->colorset); $i++)
38 38
 		{
39 39
 			$colorset = sprintf('%s|@|%s', $skin_info->colorset[$i]->name, $skin_info->colorset[$i]->title);
40 40
 			$colorset_list[] = $colorset;
41 41
 		}
42 42
 
43
-		if(count($colorset_list)) $colorsets = implode("\n", $colorset_list);
43
+		if (count($colorset_list)) $colorsets = implode("\n", $colorset_list);
44 44
 		$this->add('colorset_list', $colorsets);
45 45
 	}
46 46
 
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
 	function procWidgetGenerateCode()
51 51
 	{
52 52
 		$widget = Context::get('selected_widget');
53
-		if(!$widget) return new Object(-1,'msg_invalid_request');
54
-		if(!Context::get('skin')) return new Object(-1,Context::getLang('msg_widget_skin_is_null'));
53
+		if (!$widget) return new Object(-1, 'msg_invalid_request');
54
+		if (!Context::get('skin')) return new Object(-1, Context::getLang('msg_widget_skin_is_null'));
55 55
 
56 56
 		$attribute = $this->arrangeWidgetVars($widget, Context::getRequestVars(), $vars);
57 57
 
58
-		$widget_code = sprintf('<img class="zbxe_widget_output" widget="%s" %s />', $widget, implode(' ',$attribute));
58
+		$widget_code = sprintf('<img class="zbxe_widget_output" widget="%s" %s />', $widget, implode(' ', $attribute));
59 59
 		// Code output
60 60
 		$this->add('widget_code', $widget_code);
61 61
 	}
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
 	function procWidgetGenerateCodeInPage()
67 67
 	{
68 68
 		$widget = Context::get('selected_widget');
69
-		if(!$widget) return new Object(-1,'msg_invalid_request');
69
+		if (!$widget) return new Object(-1, 'msg_invalid_request');
70 70
 
71
-		if(!in_array($widget,array('widgetBox','widgetContent')) && !Context::get('skin')) return new Object(-1,Context::getLang('msg_widget_skin_is_null'));
71
+		if (!in_array($widget, array('widgetBox', 'widgetContent')) && !Context::get('skin')) return new Object(-1, Context::getLang('msg_widget_skin_is_null'));
72 72
 
73 73
 		$attribute = $this->arrangeWidgetVars($widget, Context::getRequestVars(), $vars);
74 74
 		// Wanted results
@@ -107,28 +107,28 @@  discard block
 block discarded – undo
107 107
 		$err = 0;
108 108
 		$oLayoutModel = getModel('layout');
109 109
 		$layout_info = $oLayoutModel->getLayout($module_srl);
110
-		if(!$layout_info || $layout_info->type != 'faceoff') $err++;
110
+		if (!$layout_info || $layout_info->type != 'faceoff') $err++;
111 111
 		// Destination Information Wanted page module
112 112
 		$oModuleModel = getModel('module');
113 113
 		$columnList = array('module_srl', 'module');
114 114
 		$page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
115
-		if(!$page_info->module_srl || $page_info->module != 'page') $err++;
115
+		if (!$page_info->module_srl || $page_info->module != 'page') $err++;
116 116
 
117
-		if($err > 1) return new Object(-1,'msg_invalid_request');
117
+		if ($err > 1) return new Object(-1, 'msg_invalid_request');
118 118
 		// Check permissions
119 119
 		$is_logged = Context::get('is_logged');
120 120
 		$logged_info = Context::get('logged_info');
121 121
 		$user_group = $logged_info->group_list;
122 122
 		$is_admin = false;
123
-		if(count($user_group)&&count($page_info->grants['manager']))
123
+		if (count($user_group) && count($page_info->grants['manager']))
124 124
 		{
125 125
 			$manager_group = $page_info->grants['manager'];
126
-			foreach($user_group as $group_srl => $group_info)
126
+			foreach ($user_group as $group_srl => $group_info)
127 127
 			{
128
-				if(in_array($group_srl, $manager_group)) $is_admin = true;
128
+				if (in_array($group_srl, $manager_group)) $is_admin = true;
129 129
 			}
130 130
 		}
131
-		if(!$is_admin && !$is_logged && $logged_info->is_admin != 'Y' && !$oModuleModel->isSiteAdmin($logged_info) && !(is_array($page_info->admin_id) && in_array($logged_info->user_id, $page_info->admin_id))) return new Object(-1,'msg_not_permitted');
131
+		if (!$is_admin && !$is_logged && $logged_info->is_admin != 'Y' && !$oModuleModel->isSiteAdmin($logged_info) && !(is_array($page_info->admin_id) && in_array($logged_info->user_id, $page_info->admin_id))) return new Object(-1, 'msg_not_permitted');
132 132
 		// Enter post
133 133
 		$oDocumentModel = getModel('document');
134 134
 		$oDocumentController = getController('document');
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 		$obj->document_srl = $document_srl;
140 140
 
141 141
 		$oDocument = $oDocumentModel->getDocument($obj->document_srl, true);
142
-		if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl)
142
+		if ($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl)
143 143
 		{
144 144
 			$output = $oDocumentController->updateDocument($oDocument, $obj);
145 145
 		}
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 			$obj->document_srl = $output->get('document_srl');
150 150
 		}
151 151
 		// Stop when an error occurs
152
-		if(!$output->toBool()) return $output;
152
+		if (!$output->toBool()) return $output;
153 153
 		// Return results
154 154
 		$this->add('document_srl', $obj->document_srl);
155 155
 	}
@@ -167,30 +167,30 @@  discard block
 block discarded – undo
167 167
 		$oDocumentAdminController = getAdminController('document');
168 168
 
169 169
 		$oDocument = $oDocumentModel->getDocument($document_srl, true);
170
-		if(!$oDocument->isExists()) return new Object(-1,'msg_invalid_request');
170
+		if (!$oDocument->isExists()) return new Object(-1, 'msg_invalid_request');
171 171
 		$module_srl = $oDocument->get('module_srl');
172 172
 		// Destination Information Wanted page module
173 173
 		$oModuleModel = getModel('module');
174 174
 		$columnList = array('module_srl', 'module');
175 175
 		$page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
176
-		if(!$page_info->module_srl || $page_info->module != 'page') return new Object(-1,'msg_invalid_request');
176
+		if (!$page_info->module_srl || $page_info->module != 'page') return new Object(-1, 'msg_invalid_request');
177 177
 		// Check permissions
178 178
 		$is_logged = Context::get('is_logged');
179 179
 		$logged_info = Context::get('logged_info');
180 180
 		$user_group = $logged_info->group_list;
181 181
 		$is_admin = false;
182
-		if(count($user_group)&&count($page_info->grants['manager']))
182
+		if (count($user_group) && count($page_info->grants['manager']))
183 183
 		{
184 184
 			$manager_group = $page_info->grants['manager'];
185
-			foreach($user_group as $group_srl => $group_info)
185
+			foreach ($user_group as $group_srl => $group_info)
186 186
 			{
187
-				if(in_array($group_srl, $manager_group)) $is_admin = true;
187
+				if (in_array($group_srl, $manager_group)) $is_admin = true;
188 188
 			}
189 189
 		}
190
-		if(!$is_admin && !$is_logged && $logged_info->is_admin != 'Y' && !$oModuleModel->isSiteAdmin($logged_info) && !(is_array($page_info->admin_id) && in_array($logged_info->user_id, $page_info->admin_id))) return new Object(-1,'msg_not_permitted');
190
+		if (!$is_admin && !$is_logged && $logged_info->is_admin != 'Y' && !$oModuleModel->isSiteAdmin($logged_info) && !(is_array($page_info->admin_id) && in_array($logged_info->user_id, $page_info->admin_id))) return new Object(-1, 'msg_not_permitted');
191 191
 
192
-		$output = $oDocumentAdminController->copyDocumentModule(array($oDocument->get('document_srl')), $oDocument->get('module_srl'),0);
193
-		if(!$output->toBool()) return $output;
192
+		$output = $oDocumentAdminController->copyDocumentModule(array($oDocument->get('document_srl')), $oDocument->get('module_srl'), 0);
193
+		if (!$output->toBool()) return $output;
194 194
 		// Return results
195 195
 		$copied_srls = $output->get('copied_srls');
196 196
 		$this->add('document_srl', $copied_srls[$oDocument->get('document_srl')]);
@@ -208,29 +208,29 @@  discard block
 block discarded – undo
208 208
 		$oDocumentController = getController('document');
209 209
 
210 210
 		$oDocument = $oDocumentModel->getDocument($document_srl, true);
211
-		if(!$oDocument->isExists()) return new Object();
211
+		if (!$oDocument->isExists()) return new Object();
212 212
 		$module_srl = $oDocument->get('module_srl');
213 213
 		// Destination Information Wanted page module
214 214
 		$oModuleModel = getModel('module');
215 215
 		$page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
216
-		if(!$page_info->module_srl || $page_info->module != 'page') return new Object(-1,'msg_invalid_request');
216
+		if (!$page_info->module_srl || $page_info->module != 'page') return new Object(-1, 'msg_invalid_request');
217 217
 		// Check permissions
218 218
 		$is_logged = Context::get('is_logged');
219 219
 		$logged_info = Context::get('logged_info');
220 220
 		$user_group = $logged_info->group_list;
221 221
 		$is_admin = false;
222
-		if(count($user_group)&&count($page_info->grants['manager']))
222
+		if (count($user_group) && count($page_info->grants['manager']))
223 223
 		{
224 224
 			$manager_group = $page_info->grants['manager'];
225
-			foreach($user_group as $group_srl => $group_info)
225
+			foreach ($user_group as $group_srl => $group_info)
226 226
 			{
227
-				if(in_array($group_srl, $manager_group)) $is_admin = true;
227
+				if (in_array($group_srl, $manager_group)) $is_admin = true;
228 228
 			}
229 229
 		}
230
-		if(!$is_admin && !$is_logged && $logged_info->is_admin != 'Y' && !$oModuleModel->isSiteAdmin($logged_info) && !(is_array($page_info->admin_id) && in_array($logged_info->user_id, $page_info->admin_id))) return new Object(-1,'msg_not_permitted');
230
+		if (!$is_admin && !$is_logged && $logged_info->is_admin != 'Y' && !$oModuleModel->isSiteAdmin($logged_info) && !(is_array($page_info->admin_id) && in_array($logged_info->user_id, $page_info->admin_id))) return new Object(-1, 'msg_not_permitted');
231 231
 
232 232
 		$output = $oDocumentController->deleteDocument($oDocument->get('document_srl'), true);
233
-		if(!$output->toBool()) return $output;
233
+		if (!$output->toBool()) return $output;
234 234
 	}
235 235
 
236 236
 	/**
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 	 */
248 248
 	function triggerWidgetCompile(&$content)
249 249
 	{
250
-		if(Context::getResponseMethod()!='HTML') return new Object();
250
+		if (Context::getResponseMethod() != 'HTML') return new Object();
251 251
 		$content = $this->transWidgetCode($content, $this->layout_javascript_mode);
252 252
 		return new Object();
253 253
 	}
@@ -263,9 +263,9 @@  discard block
 block discarded – undo
263 263
 		// Check whether to include information about editing
264 264
 		$this->javascript_mode = $javascript_mode;
265 265
 		// Widget code box change
266
-		$content = preg_replace_callback('!<div([^\>]*)widget=([^\>]*?)\><div><div>((<img.*?>)*)!is', array($this,'transWidgetBox'), $content);
266
+		$content = preg_replace_callback('!<div([^\>]*)widget=([^\>]*?)\><div><div>((<img.*?>)*)!is', array($this, 'transWidgetBox'), $content);
267 267
 		// Widget code information byeogyeong
268
-		$content = preg_replace_callback('!<img([^\>]*)widget=([^\>]*?)\>!is', array($this,'transWidget'), $content);
268
+		$content = preg_replace_callback('!<img([^\>]*)widget=([^\>]*?)\>!is', array($this, 'transWidget'), $content);
269 269
 
270 270
 		return $content;
271 271
 	}
@@ -280,11 +280,11 @@  discard block
 block discarded – undo
280 280
 		$oXmlParser = new XmlParser();
281 281
 		$xml_doc = $oXmlParser->parse(trim($buff));
282 282
 
283
-		if($xml_doc->img) $vars = $xml_doc->img->attrs;
283
+		if ($xml_doc->img) $vars = $xml_doc->img->attrs;
284 284
 		else $vars = $xml_doc->attrs;
285 285
 
286 286
 		$widget = $vars->widget;
287
-		if(!$widget) return $matches[0];
287
+		if (!$widget) return $matches[0];
288 288
 		unset($vars->widget);
289 289
 
290 290
 		return $this->execute($widget, $vars, $this->javascript_mode);
@@ -295,13 +295,13 @@  discard block
 block discarded – undo
295 295
 	 */
296 296
 	function transWidgetBox($matches)
297 297
 	{
298
-		$buff = preg_replace('/<div><div>(.*)$/i','</div>',$matches[0]);
298
+		$buff = preg_replace('/<div><div>(.*)$/i', '</div>', $matches[0]);
299 299
 		$oXmlParser = new XmlParser();
300 300
 		$xml_doc = $oXmlParser->parse($buff);
301 301
 
302 302
 		$vars = $xml_doc->div->attrs;
303 303
 		$widget = $vars->widget;
304
-		if(!$widget) return $matches[0];
304
+		if (!$widget) return $matches[0];
305 305
 		unset($vars->widget);
306 306
 
307 307
 		$vars->widgetbox_content = $matches[3];
@@ -322,28 +322,28 @@  discard block
 block discarded – undo
322 322
 		$oXmlParser = new XmlParser();
323 323
 
324 324
 		$cnt = count($matches[1]);
325
-		for($i=0;$i<$cnt;$i++)
325
+		for ($i = 0; $i < $cnt; $i++)
326 326
 		{
327 327
 			$buff = $matches[0][$i];
328 328
 			$xml_doc = $oXmlParser->parse(trim($buff));
329 329
 
330 330
 			$args = $xml_doc->img->attrs;
331
-			if(!$args) continue;
331
+			if (!$args) continue;
332 332
 			// If you are not caching path
333 333
 			$widget = $args->widget;
334 334
 			$sequence = $args->widget_sequence;
335 335
 			$cache = $args->widget_cache;
336
-			if(!$sequence || !$cache) continue;
336
+			if (!$sequence || !$cache) continue;
337 337
 
338
-			if(count($args))
338
+			if (count($args))
339 339
 			{
340
-				foreach($args as $k => $v) $args->{$k} = urldecode($v);
340
+				foreach ($args as $k => $v) $args->{$k} = urldecode($v);
341 341
 			}
342 342
 			// If the cache file for each language widget regeneration
343
-			foreach($lang_list as $lang_type => $val)
343
+			foreach ($lang_list as $lang_type => $val)
344 344
 			{
345 345
 				$cache_file = sprintf('%s%d.%s.cache', $this->cache_path, $sequence, $lang_type);
346
-				if(!file_exists($cache_file)) continue;
346
+				if (!file_exists($cache_file)) continue;
347 347
 				$this->getCache($widget, $args, $lang_type, true);
348 348
 			}
349 349
 		}
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 	function getCache($widget, $args, $lang_type = null, $ignore_cache = false)
356 356
 	{
357 357
 		// If the specified language specifies the current language
358
-		if(!$lang_type) $lang_type = Context::getLangType();
358
+		if (!$lang_type) $lang_type = Context::getLangType();
359 359
 		// widget, the cache number and cache values are set
360 360
 		$widget_sequence = $args->widget_sequence;
361 361
 		$widget_cache = $args->widget_cache;
@@ -363,10 +363,10 @@  discard block
 block discarded – undo
363 363
 		/**
364 364
 		 * Even if the cache number and value of the cache and return it to extract data
365 365
 		 */
366
-		if(!$ignore_cache && (!$widget_cache || !$widget_sequence))
366
+		if (!$ignore_cache && (!$widget_cache || !$widget_sequence))
367 367
 		{
368 368
 			$oWidget = $this->getWidgetObject($widget);
369
-			if(!$oWidget || !method_exists($oWidget, 'proc')) return;
369
+			if (!$oWidget || !method_exists($oWidget, 'proc')) return;
370 370
 
371 371
 			$widget_content = $oWidget->proc($args);
372 372
 			$oModuleController = getController('module');
@@ -375,15 +375,15 @@  discard block
 block discarded – undo
375 375
 		}
376 376
 
377 377
 		$oCacheHandler = CacheHandler::getInstance('template');
378
-		if($oCacheHandler->isSupport())
378
+		if ($oCacheHandler->isSupport())
379 379
 		{
380
-			$key = 'widget_cache:' . $widget_sequence;
380
+			$key = 'widget_cache:'.$widget_sequence;
381 381
 
382 382
 			$cache_body = $oCacheHandler->get($key);
383 383
 			$cache_body = preg_replace('@<\!--#Meta:@', '<!--Meta:', $cache_body);
384 384
 		}
385 385
 
386
-		if($cache_body)
386
+		if ($cache_body)
387 387
 		{
388 388
 			return $cache_body;
389 389
 		}
@@ -396,11 +396,11 @@  discard block
 block discarded – undo
396 396
 			// Wanted cache file
397 397
 			$cache_file = sprintf('%s%d.%s.cache', $this->cache_path, $widget_sequence, $lang_type);
398 398
 			// If the file exists in the cache, the file validation
399
-			if(!$ignore_cache && file_exists($cache_file))
399
+			if (!$ignore_cache && file_exists($cache_file))
400 400
 			{
401 401
 				$filemtime = filemtime($cache_file);
402 402
 				// Should be modified compared to the time of the cache or in the future if creating more than widget.controller.php file a return value of the cache
403
-				if($filemtime + $widget_cache * 60 > $_SERVER['REQUEST_TIME'] && $filemtime > filemtime(_XE_PATH_.'modules/widget/widget.controller.php'))
403
+				if ($filemtime + $widget_cache * 60 > $_SERVER['REQUEST_TIME'] && $filemtime > filemtime(_XE_PATH_.'modules/widget/widget.controller.php'))
404 404
 				{
405 405
 					$cache_body = FileHandler::readFile($cache_file);
406 406
 					$cache_body = preg_replace('@<\!--#Meta:@', '<!--Meta:', $cache_body);
@@ -409,18 +409,18 @@  discard block
 block discarded – undo
409 409
 				}
410 410
 			}
411 411
 			// cache update and cache renewal of the file mtime
412
-			if(!$oCacheHandler->isSupport())
412
+			if (!$oCacheHandler->isSupport())
413 413
 			{
414 414
 			touch($cache_file);
415 415
 			}
416 416
 
417 417
 			$oWidget = $this->getWidgetObject($widget);
418
-			if(!$oWidget || !method_exists($oWidget,'proc')) return;
418
+			if (!$oWidget || !method_exists($oWidget, 'proc')) return;
419 419
 
420 420
 			$widget_content = $oWidget->proc($args);
421 421
 			$oModuleController = getController('module');
422 422
 			$oModuleController->replaceDefinedLangCode($widget_content);
423
-			if($oCacheHandler->isSupport())
423
+			if ($oCacheHandler->isSupport())
424 424
 			{
425 425
 				$oCacheHandler->put($key, $widget_content, $widget_cache * 60);
426 426
 			}
@@ -442,16 +442,16 @@  discard block
 block discarded – undo
442 442
 	function execute($widget, $args, $javascript_mode = false, $escaped = true)
443 443
 	{
444 444
 		// Save for debug run-time widget
445
-		if(__DEBUG__==3) $start = getMicroTime();
445
+		if (__DEBUG__ == 3) $start = getMicroTime();
446 446
 		$before = microtime(true);
447 447
 		// urldecode the value of args haejum
448 448
 		$object_vars = get_object_vars($args);
449
-		if(count($object_vars))
449
+		if (count($object_vars))
450 450
 		{
451
-			foreach($object_vars as $key => $val)
451
+			foreach ($object_vars as $key => $val)
452 452
 			{
453
-				if(in_array($key, array('widgetbox_content','body','class','style','widget_sequence','widget','widget_padding_left','widget_padding_top','widget_padding_bottom','widget_padding_right','widgetstyle','document_srl'))) continue;
454
-				if($escaped) $args->{$key} = utf8RawUrlDecode($val);
453
+				if (in_array($key, array('widgetbox_content', 'body', 'class', 'style', 'widget_sequence', 'widget', 'widget_padding_left', 'widget_padding_top', 'widget_padding_bottom', 'widget_padding_right', 'widgetstyle', 'document_srl'))) continue;
454
+				if ($escaped) $args->{$key} = utf8RawUrlDecode($val);
455 455
 			}
456 456
 		}
457 457
 
@@ -460,14 +460,14 @@  discard block
 block discarded – undo
460 460
 		 * Widgets widgetContent/widgetBox Wanted If you are not content
461 461
 		 */
462 462
 		$widget_content = '';
463
-		if($widget != 'widgetContent' && $widget != 'widgetBox')
463
+		if ($widget != 'widgetContent' && $widget != 'widgetBox')
464 464
 		{
465
-			if(!is_dir(sprintf(_XE_PATH_.'widgets/%s/',$widget))) return;
465
+			if (!is_dir(sprintf(_XE_PATH_.'widgets/%s/', $widget))) return;
466 466
 			// Hold the contents of the widget parameter
467 467
 			$widget_content = $this->getCache($widget, $args);
468 468
 		}
469 469
 
470
-		if($widget == 'widgetBox')
470
+		if ($widget == 'widgetBox')
471 471
 		{
472 472
 			$widgetbox_content = $args->widgetbox_content;
473 473
 		}
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
 		 * Wanted specified by the administrator of the widget style
477 477
 		 */
478 478
 		// Sometimes the wrong code, background-image: url (none) can be heard but none in this case, the request for the url so unconditionally Removed
479
-		$style = preg_replace('/url\((.+)(\/?)none\)/is','', $args->style);
479
+		$style = preg_replace('/url\((.+)(\/?)none\)/is', '', $args->style);
480 480
 		// Find a style statement that based on the internal margin dropping pre-change
481 481
 		$widget_padding_left = $args->widget_padding_left;
482 482
 		$widget_padding_right = $args->widget_padding_right;
@@ -492,18 +492,18 @@  discard block
 block discarded – undo
492 492
 		$widget_content_body = '';
493 493
 		$widget_content_footer = '';
494 494
 		// If general call is given on page styles should return immediately dreamin '
495
-		if(!$javascript_mode)
495
+		if (!$javascript_mode)
496 496
 		{
497
-			if($args->id) $args->id = ' id="'.$args->id.'" ';
498
-			switch($widget)
497
+			if ($args->id) $args->id = ' id="'.$args->id.'" ';
498
+			switch ($widget)
499 499
 			{
500 500
 				// If a direct orthogonal addition information
501 501
 				case 'widgetContent' :
502
-					if($args->document_srl)
502
+					if ($args->document_srl)
503 503
 					{
504 504
 						$oDocumentModel = getModel('document');
505 505
 						$oDocument = $oDocumentModel->getDocument($args->document_srl);
506
-						$body = $oDocument->getContent(false,false,false, false);
506
+						$body = $oDocument->getContent(false, false, false, false);
507 507
 					}
508 508
 					else
509 509
 					{
@@ -513,21 +513,21 @@  discard block
 block discarded – undo
513 513
 					$oEditorController = getController('editor');
514 514
 					$body = $oEditorController->transComponent($body);
515 515
 
516
-					$widget_content_header = sprintf('<div class="xe_content xe-widget-wrapper ' . $args->css_class . '" %sstyle="%s"><div style="%s">', $args->id, $style,  $inner_style);
516
+					$widget_content_header = sprintf('<div class="xe_content xe-widget-wrapper '.$args->css_class.'" %sstyle="%s"><div style="%s">', $args->id, $style, $inner_style);
517 517
 					$widget_content_body = $body;
518 518
 					$widget_content_footer = '</div></div>';
519 519
 
520 520
 					break;
521 521
 					// If the widget box; it could
522 522
 				case 'widgetBox' :
523
-					$widget_content_header = sprintf('<div class="xe-widget-wrapper ' . $args->css_class . '" %sstyle="%s;"><div style="%s"><div>', $args->id, $style,  $inner_style);
523
+					$widget_content_header = sprintf('<div class="xe-widget-wrapper '.$args->css_class.'" %sstyle="%s;"><div style="%s"><div>', $args->id, $style, $inner_style);
524 524
 					$widget_content_body = $widgetbox_content;
525 525
 
526 526
 					break;
527 527
 					// If the General wijetil
528 528
 				default :
529
-					$widget_content_header = sprintf('<div class="xe-widget-wrapper ' . $args->css_class . '" %sstyle="%s">',$args->id,$style);
530
-					$widget_content_body = sprintf('<div style="*zoom:1;%s">%s</div>', $inner_style,$widget_content);
529
+					$widget_content_header = sprintf('<div class="xe-widget-wrapper '.$args->css_class.'" %sstyle="%s">', $args->id, $style);
530
+					$widget_content_body = sprintf('<div style="*zoom:1;%s">%s</div>', $inner_style, $widget_content);
531 531
 					$widget_content_footer = '</div>';
532 532
 					break;
533 533
 			}
@@ -535,15 +535,15 @@  discard block
 block discarded – undo
535 535
 		}
536 536
 		else
537 537
 		{
538
-			switch($widget)
538
+			switch ($widget)
539 539
 			{
540 540
 				// If a direct orthogonal addition information
541 541
 				case 'widgetContent' :
542
-					if($args->document_srl)
542
+					if ($args->document_srl)
543 543
 					{
544 544
 						$oDocumentModel = getModel('document');
545 545
 						$oDocument = $oDocumentModel->getDocument($args->document_srl);
546
-						$body = $oDocument->getContent(false,false,false);
546
+						$body = $oDocument->getContent(false, false, false);
547 547
 					}
548 548
 					else
549 549
 					{
@@ -551,12 +551,12 @@  discard block
 block discarded – undo
551 551
 					}
552 552
 					// by args
553 553
 					$attribute = array();
554
-					if($args)
554
+					if ($args)
555 555
 					{
556
-						foreach($args as $key => $val)
556
+						foreach ($args as $key => $val)
557 557
 						{
558
-							if(in_array($key, array('class','style','widget_padding_top','widget_padding_right','widget_padding_bottom','widget_padding_left','widget','widgetstyle','document_srl'))) continue;
559
-							if(strpos($val,'|@|')>0) $val = str_replace('|@|',',',$val);
558
+							if (in_array($key, array('class', 'style', 'widget_padding_top', 'widget_padding_right', 'widget_padding_bottom', 'widget_padding_left', 'widget', 'widgetstyle', 'document_srl'))) continue;
559
+							if (strpos($val, '|@|') > 0) $val = str_replace('|@|', ',', $val);
560 560
 							$attribute[] = sprintf('%s="%s"', $key, htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
561 561
 						}
562 562
 					}
@@ -564,44 +564,44 @@  discard block
 block discarded – undo
564 564
 					$oWidgetController = getController('widget');
565 565
 
566 566
 					$widget_content_header = sprintf(
567
-						'<div class="xe_content widgetOutput ' . $args->css_class . '" widgetstyle="%s" style="%s" widget_padding_left="%s" widget_padding_right="%s" widget_padding_top="%s" widget_padding_bottom="%s" widget="widgetContent" document_srl="%d" %s>'.
567
+						'<div class="xe_content widgetOutput '.$args->css_class.'" widgetstyle="%s" style="%s" widget_padding_left="%s" widget_padding_right="%s" widget_padding_top="%s" widget_padding_bottom="%s" widget="widgetContent" document_srl="%d" %s>'.
568 568
 						'<div class="widgetResize"></div>'.
569 569
 						'<div class="widgetResizeLeft"></div>'.
570 570
 						'<div class="widgetBorder">'.
571
-						'<div style="%s">',$args->widgetstyle,
571
+						'<div style="%s">', $args->widgetstyle,
572 572
 						$style,
573 573
 						$args->widget_padding_left, $args->widget_padding_right, $args->widget_padding_top, $args->widget_padding_bottom,
574 574
 						$args->document_srl,
575
-						implode(' ',$attribute),
575
+						implode(' ', $attribute),
576 576
 						$inner_style);
577 577
 
578 578
 					$widget_content_body = $body;
579 579
 					$widget_content_footer = sprintf('</div>'.
580 580
 						'</div>'.
581 581
 						'<div class="widgetContent" style="display:none;width:1px;height:1px;overflow:hidden;">%s</div>'.
582
-						'</div>',base64_encode($body));
582
+						'</div>', base64_encode($body));
583 583
 
584 584
 					break;
585 585
 					// If the widget box; it could
586 586
 				case 'widgetBox' :
587 587
 					// by args
588 588
 					$attribute = array();
589
-					if($args)
589
+					if ($args)
590 590
 					{
591
-						foreach($args as $key => $val)
591
+						foreach ($args as $key => $val)
592 592
 						{
593
-							if(in_array($key, array('class','style','widget_padding_top','widget_padding_right','widget_padding_bottom','widget_padding_left','widget','widgetstyle','document_srl'))) continue;
594
-							if(!is_numeric($val) && (!is_string($val) || strlen($val)==0)) continue;
595
-							if(strpos($val,'|@|')>0) $val = str_replace('|@|',',',$val);
593
+							if (in_array($key, array('class', 'style', 'widget_padding_top', 'widget_padding_right', 'widget_padding_bottom', 'widget_padding_left', 'widget', 'widgetstyle', 'document_srl'))) continue;
594
+							if (!is_numeric($val) && (!is_string($val) || strlen($val) == 0)) continue;
595
+							if (strpos($val, '|@|') > 0) $val = str_replace('|@|', ',', $val);
596 596
 							$attribute[] = sprintf('%s="%s"', $key, htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
597 597
 						}
598 598
 					}
599 599
 
600 600
 					$widget_content_header = sprintf(
601
-						'<div class="widgetOutput ' . $args->css_class . '" widgetstyle="%s" widget="widgetBox" style="%s;" widget_padding_top="%s" widget_padding_right="%s" widget_padding_bottom="%s" widget_padding_left="%s" %s >'.
601
+						'<div class="widgetOutput '.$args->css_class.'" widgetstyle="%s" widget="widgetBox" style="%s;" widget_padding_top="%s" widget_padding_right="%s" widget_padding_bottom="%s" widget_padding_left="%s" %s >'.
602 602
 						'<div class="widgetBoxResize"></div>'.
603 603
 						'<div class="widgetBoxResizeLeft"></div>'.
604
-						'<div class="widgetBoxBorder"><div class="nullWidget" style="%s">',$args->widgetstyle,$style, $widget_padding_top, $widget_padding_right, $widget_padding_bottom, $widget_padding_left,implode(' ',$attribute),$inner_style);
604
+						'<div class="widgetBoxBorder"><div class="nullWidget" style="%s">', $args->widgetstyle, $style, $widget_padding_top, $widget_padding_right, $widget_padding_bottom, $widget_padding_left, implode(' ', $attribute), $inner_style);
605 605
 
606 606
 					$widget_content_body = $widgetbox_content;
607 607
 
@@ -610,26 +610,26 @@  discard block
 block discarded – undo
610 610
 				default :
611 611
 					// by args
612 612
 					$attribute = array();
613
-					if($args)
613
+					if ($args)
614 614
 					{
615
-						$allowed_key = array('class','style','widget_padding_top','widget_padding_right','widget_padding_bottom','widget_padding_left','widget');
616
-						foreach($args as $key => $val)
615
+						$allowed_key = array('class', 'style', 'widget_padding_top', 'widget_padding_right', 'widget_padding_bottom', 'widget_padding_left', 'widget');
616
+						foreach ($args as $key => $val)
617 617
 						{
618
-							if(in_array($key, $allowed_key)) continue;
619
-							if(!is_numeric($val) && (!is_string($val) || strlen($val)==0)) continue;
620
-							if(strpos($val,'|@|')>0) $val = str_replace('|@|',',',$val);
618
+							if (in_array($key, $allowed_key)) continue;
619
+							if (!is_numeric($val) && (!is_string($val) || strlen($val) == 0)) continue;
620
+							if (strpos($val, '|@|') > 0) $val = str_replace('|@|', ',', $val);
621 621
 							$attribute[] = sprintf('%s="%s"', $key, htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
622 622
 						}
623 623
 					}
624 624
 
625
-					$widget_content_header = sprintf('<div class="widgetOutput ' . $args->css_class . '" widgetstyle="%s" style="%s" widget_padding_top="%s" widget_padding_right="%s" widget_padding_bottom="%s" widget_padding_left="%s" widget="%s" %s >'.
625
+					$widget_content_header = sprintf('<div class="widgetOutput '.$args->css_class.'" widgetstyle="%s" style="%s" widget_padding_top="%s" widget_padding_right="%s" widget_padding_bottom="%s" widget_padding_left="%s" widget="%s" %s >'.
626 626
 						'<div class="widgetResize"></div>'.
627 627
 						'<div class="widgetResizeLeft"></div>'.
628
-						'<div class="widgetBorder">',$args->widgetstyle,$style,
628
+						'<div class="widgetBorder">', $args->widgetstyle, $style,
629 629
 						$widget_padding_top, $widget_padding_right, $widget_padding_bottom, $widget_padding_left,
630
-						$widget, implode(' ',$attribute));
630
+						$widget, implode(' ', $attribute));
631 631
 
632
-					$widget_content_body = sprintf('<div style="%s">%s</div>',$inner_style, $widget_content);
632
+					$widget_content_body = sprintf('<div style="%s">%s</div>', $inner_style, $widget_content);
633 633
 
634 634
 					$widget_content_footer = '</div></div>';
635 635
 
@@ -637,11 +637,11 @@  discard block
 block discarded – undo
637 637
 			}
638 638
 		}
639 639
 		// Compile the widget style.
640
-		if($args->widgetstyle) $widget_content_body = $this->compileWidgetStyle($args->widgetstyle,$widget, $widget_content_body, $args, $javascript_mode);
640
+		if ($args->widgetstyle) $widget_content_body = $this->compileWidgetStyle($args->widgetstyle, $widget, $widget_content_body, $args, $javascript_mode);
641 641
 
642
-		$output = $widget_content_header . $widget_content_body . $widget_content_footer;
642
+		$output = $widget_content_header.$widget_content_body.$widget_content_footer;
643 643
 		// Debug widget creation time information added to the results
644
-		if(__DEBUG__==3) $GLOBALS['__widget_excute_elapsed__'] += getMicroTime() - $start;
644
+		if (__DEBUG__ == 3) $GLOBALS['__widget_excute_elapsed__'] += getMicroTime() - $start;
645 645
 
646 646
 		$after = microtime(true);
647 647
 
@@ -662,32 +662,32 @@  discard block
 block discarded – undo
662 662
 	 */
663 663
 	function getWidgetObject($widget)
664 664
 	{
665
-		if(!preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $widget))
665
+		if (!preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $widget))
666 666
 		{
667 667
 			return Context::getLang('msg_invalid_request');
668 668
 		}
669 669
 
670
-		if(!$GLOBALS['_xe_loaded_widgets_'][$widget])
670
+		if (!$GLOBALS['_xe_loaded_widgets_'][$widget])
671 671
 		{
672 672
 			// Finding the location of a widget
673 673
 			$oWidgetModel = getModel('widget');
674 674
 			$path = $oWidgetModel->getWidgetPath($widget);
675 675
 			// If you do not find the class file error output widget (html output)
676 676
 			$class_file = sprintf('%s%s.class.php', $path, $widget);
677
-			if(!file_exists($class_file)) return sprintf(Context::getLang('msg_widget_is_not_exists'), $widget);
677
+			if (!file_exists($class_file)) return sprintf(Context::getLang('msg_widget_is_not_exists'), $widget);
678 678
 			// Widget classes include
679 679
 			require_once($class_file);
680 680
 
681 681
 			// Creating Objects
682
-			if(!class_exists($widget, false))
682
+			if (!class_exists($widget, false))
683 683
 			{
684 684
 				return sprintf(Context::getLang('msg_widget_object_is_null'), $widget);
685 685
 			}
686 686
 
687 687
 			$oWidget = new $widget();
688
-			if(!is_object($oWidget)) return sprintf(Context::getLang('msg_widget_object_is_null'), $widget);
688
+			if (!is_object($oWidget)) return sprintf(Context::getLang('msg_widget_object_is_null'), $widget);
689 689
 
690
-			if(!method_exists($oWidget, 'proc')) return sprintf(Context::getLang('msg_widget_proc_is_null'), $widget);
690
+			if (!method_exists($oWidget, 'proc')) return sprintf(Context::getLang('msg_widget_proc_is_null'), $widget);
691 691
 
692 692
 			$oWidget->widget_path = $path;
693 693
 
@@ -696,29 +696,29 @@  discard block
 block discarded – undo
696 696
 		return $GLOBALS['_xe_loaded_widgets_'][$widget];
697 697
 	}
698 698
 
699
-	function compileWidgetStyle($widgetStyle,$widget,$widget_content_body, $args, $javascript_mode)
699
+	function compileWidgetStyle($widgetStyle, $widget, $widget_content_body, $args, $javascript_mode)
700 700
 	{
701
-		if(!$widgetStyle) return $widget_content_body;
701
+		if (!$widgetStyle) return $widget_content_body;
702 702
 
703 703
 		$oWidgetModel = getModel('widget');
704 704
 		// Bring extra_var widget style tie
705 705
 		$widgetstyle_info = $oWidgetModel->getWidgetStyleInfo($widgetStyle);
706
-		if(!$widgetstyle_info) return $widget_content_body;
706
+		if (!$widgetstyle_info) return $widget_content_body;
707 707
 
708 708
 		$widgetstyle_extra_var = new stdClass();
709 709
 		$widgetstyle_extra_var_key = get_object_vars($widgetstyle_info);
710
-		if(count($widgetstyle_extra_var_key['extra_var']))
710
+		if (count($widgetstyle_extra_var_key['extra_var']))
711 711
 		{
712
-			foreach($widgetstyle_extra_var_key['extra_var'] as $key => $val)
712
+			foreach ($widgetstyle_extra_var_key['extra_var'] as $key => $val)
713 713
 			{
714
-				$widgetstyle_extra_var->{$key} =  $args->{$key};
714
+				$widgetstyle_extra_var->{$key} = $args->{$key};
715 715
 			}
716 716
 		}
717 717
 		Context::set('widgetstyle_extra_var', $widgetstyle_extra_var);
718 718
 		// #18994272 오타를 수정했으나 하위 호환성을 위해 남겨둠 - deprecated
719 719
 		Context::set('widgetstyle_extar_var', $widgetstyle_extra_var);
720 720
 
721
-		if($javascript_mode && $widget=='widgetBox')
721
+		if ($javascript_mode && $widget == 'widgetBox')
722 722
 		{
723 723
 			Context::set('widget_content', '<div class="widget_inner">'.$widget_content_body.'</div>');
724 724
 		}
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
 		$oWidgetModel = getModel('widget');
743 743
 		$widget_info = $oWidgetModel->getWidgetInfo($widget);
744 744
 
745
-		if(!$vars)
745
+		if (!$vars)
746 746
 		{
747 747
 			$vars = new stdClass();
748 748
 		}
@@ -753,31 +753,31 @@  discard block
 block discarded – undo
753 753
 
754 754
 		$vars->skin = trim($request_vars->skin);
755 755
 		$vars->colorset = trim($request_vars->colorset);
756
-		$vars->widget_sequence = (int)($request_vars->widget_sequence);
757
-		$vars->widget_cache = (int)($request_vars->widget_cache);
756
+		$vars->widget_sequence = (int) ($request_vars->widget_sequence);
757
+		$vars->widget_cache = (int) ($request_vars->widget_cache);
758 758
 		$vars->style = trim($request_vars->style);
759 759
 		$vars->widget_padding_left = trim($request_vars->widget_padding_left);
760 760
 		$vars->widget_padding_right = trim($request_vars->widget_padding_right);
761 761
 		$vars->widget_padding_top = trim($request_vars->widget_padding_top);
762 762
 		$vars->widget_padding_bottom = trim($request_vars->widget_padding_bottom);
763
-		$vars->document_srl= trim($request_vars->document_srl);
763
+		$vars->document_srl = trim($request_vars->document_srl);
764 764
 
765
-		if(count($widget_info->extra_var))
765
+		if (count($widget_info->extra_var))
766 766
 		{
767
-			foreach($widget_info->extra_var as $key=>$val)
767
+			foreach ($widget_info->extra_var as $key=>$val)
768 768
 			{
769 769
 				$vars->{$key} = trim($request_vars->{$key});
770 770
 			}
771 771
 		}
772 772
 		// If the widget style
773
-		if($request_vars->widgetstyle)
773
+		if ($request_vars->widgetstyle)
774 774
 		{
775 775
 			$widgetStyle_info = $oWidgetModel->getWidgetStyleInfo($request_vars->widgetstyle);
776
-			if(count($widgetStyle_info->extra_var))
776
+			if (count($widgetStyle_info->extra_var))
777 777
 			{
778
-				foreach($widgetStyle_info->extra_var as $key=>$val)
778
+				foreach ($widgetStyle_info->extra_var as $key=>$val)
779 779
 				{
780
-					if($val->type =='color' || $val->type =='text' || $val->type =='select' || $val->type =='filebox' || $val->type == 'textarea')
780
+					if ($val->type == 'color' || $val->type == 'text' || $val->type == 'select' || $val->type == 'filebox' || $val->type == 'textarea')
781 781
 					{
782 782
 						$vars->{$key} = trim($request_vars->{$key});
783 783
 					}
@@ -785,23 +785,23 @@  discard block
 block discarded – undo
785 785
 			}
786 786
 		}
787 787
 
788
-		if($vars->widget_sequence)
788
+		if ($vars->widget_sequence)
789 789
 		{
790 790
 			$cache_file = sprintf('%s%d.%s.cache', $this->cache_path, $vars->widget_sequence, Context::getLangType());
791 791
 			FileHandler::removeFile($cache_file);
792 792
 		}
793 793
 
794
-		if($vars->widget_cache>0) $vars->widget_sequence = getNextSequence();
794
+		if ($vars->widget_cache > 0) $vars->widget_sequence = getNextSequence();
795 795
 
796 796
 		$attribute = array();
797
-		foreach($vars as $key => $val)
797
+		foreach ($vars as $key => $val)
798 798
 		{
799
-			if(!$val)
799
+			if (!$val)
800 800
 			{
801 801
 				unset($vars->{$key});
802 802
 				continue;
803 803
 			}
804
-			if(strpos($val,'|@|') > 0) $val = str_replace('|@|', ',', $val);
804
+			if (strpos($val, '|@|') > 0) $val = str_replace('|@|', ',', $val);
805 805
 			$vars->{$key} = Context::convertEncodingStr($val);
806 806
 			$attribute[] = sprintf('%s="%s"', $key, htmlspecialchars(Context::convertEncodingStr($val), ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
807 807
 		}
Please login to merge, or discard this patch.