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 (#2396)
by
unknown
07:48
created
classes/display/VirtualXMLDisplayHandler.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,35 +17,35 @@
 block discarded – undo
17 17
 		$request_url = Context::getRequestUri();
18 18
 		$output = new stdClass();
19 19
 
20
-		if(substr_compare($request_url, '/', -1) !== 0)
20
+		if (substr_compare($request_url, '/', -1) !== 0)
21 21
 		{
22 22
 			$request_url .= '/';
23 23
 		}
24 24
 
25
-		if($error === 0)
25
+		if ($error === 0)
26 26
 		{
27
-			if($message != 'success') $output->message = $message;
27
+			if ($message != 'success') $output->message = $message;
28 28
 
29 29
 			$output->url = ($redirect_url) ? $redirect_url : $request_uri;
30 30
 		}
31 31
 		else
32 32
 		{
33
-			if($message != 'fail') $output->message = $message;
33
+			if ($message != 'fail') $output->message = $message;
34 34
 		}
35 35
 
36 36
 		$html = array();
37 37
 		$html[] = '<!DOCTYPE html><html><head><title>Moved...</title><meta charset="utf-8" /><script>';
38 38
 
39
-		if($output->message)
39
+		if ($output->message)
40 40
 		{
41
-			$html[] = 'alert(' . json_encode($output->message, JSON_UNESCAPED_SLASHES) . ');';
41
+			$html[] = 'alert('.json_encode($output->message, JSON_UNESCAPED_SLASHES).');';
42 42
 		}
43 43
 
44
-		if($output->url)
44
+		if ($output->url)
45 45
 		{
46 46
 			$url = json_encode(preg_replace('/#(.+)$/i', '', $output->url), JSON_UNESCAPED_SLASHES);
47 47
 			$html[] = 'var win = (window.opener) ? window.opener : window.parent;';
48
-			$html[] = 'win.location.href = ' . $url;
48
+			$html[] = 'win.location.href = '.$url;
49 49
 			$html[] = 'if(window.opener) self.close();';
50 50
 		}
51 51
 
Please login to merge, or discard this patch.
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,13 +24,16 @@
 block discarded – undo
24 24
 
25 25
 		if($error === 0)
26 26
 		{
27
-			if($message != 'success') $output->message = $message;
27
+			if($message != 'success') {
28
+				$output->message = $message;
29
+			}
28 30
 
29 31
 			$output->url = ($redirect_url) ? $redirect_url : $request_uri;
30
-		}
31
-		else
32
+		} else
32 33
 		{
33
-			if($message != 'fail') $output->message = $message;
34
+			if($message != 'fail') {
35
+				$output->message = $message;
36
+			}
34 37
 		}
35 38
 
36 39
 		$html = array();
Please login to merge, or discard this patch.
classes/mobile/Mobile.class.php 2 patches
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	function &getInstance()
24 24
 	{
25 25
 		static $theInstance;
26
-		if(!isset($theInstance))
26
+		if (!isset($theInstance))
27 27
 		{
28 28
 			$theInstance = new Mobile();
29 29
 		}
@@ -48,11 +48,11 @@  discard block
 block discarded – undo
48 48
 	 */
49 49
 	function _isFromMobilePhone()
50 50
 	{
51
-		if($this->ismobile !== NULL)
51
+		if ($this->ismobile !== NULL)
52 52
 		{
53 53
 			return $this->ismobile;
54 54
 		}
55
-		if(Mobile::isMobileEnabled() === false || Context::get('full_browse') || $_COOKIE["FullBrowse"])
55
+		if (Mobile::isMobileEnabled() === false || Context::get('full_browse') || $_COOKIE["FullBrowse"])
56 56
 		{
57 57
 			return ($this->ismobile = false);
58 58
 		}
@@ -63,22 +63,22 @@  discard block
 block discarded – undo
63 63
 		$this->ismobile = FALSE;
64 64
 
65 65
 		$m = Context::get('m');
66
-		if(strlen($m) == 1)
66
+		if (strlen($m) == 1)
67 67
 		{
68
-			if($m == "1")
68
+			if ($m == "1")
69 69
 			{
70 70
 				$this->ismobile = TRUE;
71 71
 			}
72
-			elseif($m == "0")
72
+			elseif ($m == "0")
73 73
 			{
74 74
 				$this->ismobile = FALSE;
75 75
 			}
76 76
 		}
77
-		elseif(isset($_COOKIE['mobile']))
77
+		elseif (isset($_COOKIE['mobile']))
78 78
 		{
79
-			if($_COOKIE['user-agent'] == md5($_SERVER['HTTP_USER_AGENT']))
79
+			if ($_COOKIE['user-agent'] == md5($_SERVER['HTTP_USER_AGENT']))
80 80
 			{
81
-				if($_COOKIE['mobile'] == 'true')
81
+				if ($_COOKIE['mobile'] == 'true')
82 82
 				{
83 83
 					$this->ismobile = TRUE;
84 84
 				}
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 				$this->ismobile = FALSE;
93 93
 				setcookie("mobile", FALSE);
94 94
 				setcookie("user-agent", FALSE);
95
-				if(!$this->isMobilePadCheckByAgent() && $this->isMobileCheckByAgent())
95
+				if (!$this->isMobilePadCheckByAgent() && $this->isMobileCheckByAgent())
96 96
 				{
97 97
 					$this->ismobile = TRUE;
98 98
 				}
@@ -100,36 +100,36 @@  discard block
 block discarded – undo
100 100
 		}
101 101
 		else
102 102
 		{
103
-			if($this->isMobilePadCheckByAgent())
103
+			if ($this->isMobilePadCheckByAgent())
104 104
 			{
105 105
 				$this->ismobile = FALSE;
106 106
 			}
107 107
 			else
108 108
 			{
109
-				if($this->isMobileCheckByAgent())
109
+				if ($this->isMobileCheckByAgent())
110 110
 				{
111 111
 					$this->ismobile = TRUE;
112 112
 				}
113 113
 			}
114 114
 		}
115 115
 
116
-		if($this->ismobile !== NULL)
116
+		if ($this->ismobile !== NULL)
117 117
 		{
118
-			if($this->ismobile == TRUE)
118
+			if ($this->ismobile == TRUE)
119 119
 			{
120
-				if($_COOKIE['mobile'] != 'true')
120
+				if ($_COOKIE['mobile'] != 'true')
121 121
 				{
122 122
 					$_COOKIE['mobile'] = 'true';
123 123
 					setcookie("mobile", 'true');
124 124
 				}
125 125
 			}
126
-			elseif($_COOKIE['mobile'] != 'false')
126
+			elseif ($_COOKIE['mobile'] != 'false')
127 127
 			{
128 128
 				$_COOKIE['mobile'] = 'false';
129 129
 				setcookie("mobile", 'false');
130 130
 			}
131 131
 
132
-			if($_COOKIE['user-agent'] != md5($_SERVER['HTTP_USER_AGENT']))
132
+			if ($_COOKIE['user-agent'] != md5($_SERVER['HTTP_USER_AGENT']))
133 133
 			{
134 134
 				setcookie("user-agent", md5($_SERVER['HTTP_USER_AGENT']));
135 135
 			}
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	function isMobileCheckByAgent()
147 147
 	{
148 148
 		static $UACheck;
149
-		if(isset($UACheck))
149
+		if (isset($UACheck))
150 150
 		{
151 151
 			return $UACheck;
152 152
 		}
@@ -154,15 +154,15 @@  discard block
 block discarded – undo
154 154
 		$oMobile = Mobile::getInstance();
155 155
 		$mobileAgent = array('iPod', 'iPhone', 'Android', 'BlackBerry', 'SymbianOS', 'Bada', 'Tizen', 'Kindle', 'Wii', 'SCH-', 'SPH-', 'CANU-', 'Windows Phone', 'Windows CE', 'POLARIS', 'Palm', 'Dorothy Browser', 'Mobile', 'Opera Mobi', 'Opera Mini', 'Minimo', 'AvantGo', 'NetFront', 'Nokia', 'LGPlayer', 'SonyEricsson', 'HTC');
156 156
 
157
-		if($oMobile->isMobilePadCheckByAgent())
157
+		if ($oMobile->isMobilePadCheckByAgent())
158 158
 		{
159 159
 			$UACheck = TRUE;
160 160
 			return TRUE;
161 161
 		}
162 162
 
163
-		foreach($mobileAgent as $agent)
163
+		foreach ($mobileAgent as $agent)
164 164
 		{
165
-			if(stripos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE)
165
+			if (stripos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE)
166 166
 			{
167 167
 				$UACheck = TRUE;
168 168
 				return TRUE;
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 	function isMobilePadCheckByAgent()
181 181
 	{
182 182
 		static $UACheck;
183
-		if(isset($UACheck))
183
+		if (isset($UACheck))
184 184
 		{
185 185
 			return $UACheck;
186 186
 		}
@@ -190,21 +190,21 @@  discard block
 block discarded – undo
190 190
 		// $exceptionAgent[0] contains exception agents for all exceptions.
191 191
 		$exceptionAgent = array(0 => array('Opera Mini', 'Opera Mobi'), 'Android' => 'Mobile');
192 192
 
193
-		foreach($padAgent as $agent)
193
+		foreach ($padAgent as $agent)
194 194
 		{
195
-			if(strpos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE)
195
+			if (strpos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE)
196 196
 			{
197
-				if(!isset($exceptionAgent[$agent]))
197
+				if (!isset($exceptionAgent[$agent]))
198 198
 				{
199 199
 					$UACheck = TRUE;
200 200
 					return TRUE;
201 201
 				}
202
-				elseif(strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE)
202
+				elseif (strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE)
203 203
 				{
204 204
 					// If the agent is the Android, that can be either tablet and mobile phone.
205
-					foreach($exceptionAgent[0] as $val)
205
+					foreach ($exceptionAgent[0] as $val)
206 206
 					{
207
-						if(strpos($_SERVER['HTTP_USER_AGENT'], $val) !== FALSE)
207
+						if (strpos($_SERVER['HTTP_USER_AGENT'], $val) !== FALSE)
208 208
 						{
209 209
 							$UACheck = FALSE;
210 210
 							return FALSE;
Please login to merge, or discard this patch.
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -68,26 +68,22 @@  discard block
 block discarded – undo
68 68
 			if($m == "1")
69 69
 			{
70 70
 				$this->ismobile = TRUE;
71
-			}
72
-			elseif($m == "0")
71
+			} elseif($m == "0")
73 72
 			{
74 73
 				$this->ismobile = FALSE;
75 74
 			}
76
-		}
77
-		elseif(isset($_COOKIE['mobile']))
75
+		} elseif(isset($_COOKIE['mobile']))
78 76
 		{
79 77
 			if($_COOKIE['user-agent'] == md5($_SERVER['HTTP_USER_AGENT']))
80 78
 			{
81 79
 				if($_COOKIE['mobile'] == 'true')
82 80
 				{
83 81
 					$this->ismobile = TRUE;
84
-				}
85
-				else
82
+				} else
86 83
 				{
87 84
 					$this->ismobile = FALSE;
88 85
 				}
89
-			}
90
-			else
86
+			} else
91 87
 			{
92 88
 				$this->ismobile = FALSE;
93 89
 				setcookie("mobile", FALSE);
@@ -97,14 +93,12 @@  discard block
 block discarded – undo
97 93
 					$this->ismobile = TRUE;
98 94
 				}
99 95
 			}
100
-		}
101
-		else
96
+		} else
102 97
 		{
103 98
 			if($this->isMobilePadCheckByAgent())
104 99
 			{
105 100
 				$this->ismobile = FALSE;
106
-			}
107
-			else
101
+			} else
108 102
 			{
109 103
 				if($this->isMobileCheckByAgent())
110 104
 				{
@@ -122,8 +116,7 @@  discard block
 block discarded – undo
122 116
 					$_COOKIE['mobile'] = 'true';
123 117
 					setcookie("mobile", 'true');
124 118
 				}
125
-			}
126
-			elseif($_COOKIE['mobile'] != 'false')
119
+			} elseif($_COOKIE['mobile'] != 'false')
127 120
 			{
128 121
 				$_COOKIE['mobile'] = 'false';
129 122
 				setcookie("mobile", 'false');
@@ -198,8 +191,7 @@  discard block
 block discarded – undo
198 191
 				{
199 192
 					$UACheck = TRUE;
200 193
 					return TRUE;
201
-				}
202
-				elseif(strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE)
194
+				} elseif(strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE)
203 195
 				{
204 196
 					// If the agent is the Android, that can be either tablet and mobile phone.
205 197
 					foreach($exceptionAgent[0] as $val)
Please login to merge, or discard this patch.
modules/board/board.mobile.php 2 patches
Braces   +24 added lines, -13 removed lines patch added patch discarded remove patch
@@ -10,12 +10,24 @@  discard block
 block discarded – undo
10 10
 		$oSecurity = new Security();
11 11
 		$oSecurity->encodeHTML('document_srl', 'comment_srl', 'vid', 'mid', 'page', 'category', 'search_target', 'search_keyword', 'sort_index', 'order_type', 'trackback_srl');
12 12
 
13
-		if($this->module_info->list_count) $this->list_count = $this->module_info->list_count;
14
-		if($this->module_info->mobile_list_count) $this->list_count = $this->module_info->mobile_list_count;
15
-		if($this->module_info->search_list_count) $this->search_list_count = $this->module_info->search_list_count;
16
-		if($this->module_info->mobile_search_list_count) $this->search_list_count = $this->module_info->mobile_search_list_count;
17
-		if($this->module_info->page_count) $this->page_count = $this->module_info->page_count;
18
-		if($this->module_info->mobile_page_count) $this->page_count = $this->module_info->mobile_page_count;
13
+		if($this->module_info->list_count) {
14
+			$this->list_count = $this->module_info->list_count;
15
+		}
16
+		if($this->module_info->mobile_list_count) {
17
+			$this->list_count = $this->module_info->mobile_list_count;
18
+		}
19
+		if($this->module_info->search_list_count) {
20
+			$this->search_list_count = $this->module_info->search_list_count;
21
+		}
22
+		if($this->module_info->mobile_search_list_count) {
23
+			$this->search_list_count = $this->module_info->mobile_search_list_count;
24
+		}
25
+		if($this->module_info->page_count) {
26
+			$this->page_count = $this->module_info->page_count;
27
+		}
28
+		if($this->module_info->mobile_page_count) {
29
+			$this->page_count = $this->module_info->mobile_page_count;
30
+		}
19 31
 		$this->except_notice = $this->module_info->except_notice == 'N' ? false : true;
20 32
 
21 33
 		// $this->_getStatusNameListecret option backward compatibility
@@ -34,18 +46,15 @@  discard block
 block discarded – undo
34 46
 			if($this->module_info->hide_category)
35 47
 			{
36 48
 				$this->module_info->use_category = ($this->module_info->hide_category == 'Y') ? 'N' : 'Y';
37
-			}
38
-			else if($this->module_info->use_category)
49
+			} else if($this->module_info->use_category)
39 50
 			{
40 51
 				$this->module_info->hide_category = ($this->module_info->use_category == 'Y') ? 'N' : 'Y';
41
-			}
42
-			else
52
+			} else
43 53
 			{
44 54
 				$this->module_info->hide_category = 'N';
45 55
 				$this->module_info->use_category = 'Y';
46 56
 			}
47
-		}
48
-		else
57
+		} else
49 58
 		{
50 59
 			$this->module_info->hide_category = 'Y';
51 60
 			$this->module_info->use_category = 'N';
@@ -58,7 +67,9 @@  discard block
 block discarded – undo
58 67
 		if($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read)
59 68
 		{
60 69
 			$this->consultation = true;
61
-			if(!Context::get('is_logged')) $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false;
70
+			if(!Context::get('is_logged')) {
71
+				$this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false;
72
+			}
62 73
 		} else {
63 74
 			$this->consultation = false;
64 75
 		}
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -10,32 +10,32 @@  discard block
 block discarded – undo
10 10
 		$oSecurity = new Security();
11 11
 		$oSecurity->encodeHTML('document_srl', 'comment_srl', 'vid', 'mid', 'page', 'category', 'search_target', 'search_keyword', 'sort_index', 'order_type', 'trackback_srl');
12 12
 
13
-		if($this->module_info->list_count) $this->list_count = $this->module_info->list_count;
14
-		if($this->module_info->mobile_list_count) $this->list_count = $this->module_info->mobile_list_count;
15
-		if($this->module_info->search_list_count) $this->search_list_count = $this->module_info->search_list_count;
16
-		if($this->module_info->mobile_search_list_count) $this->search_list_count = $this->module_info->mobile_search_list_count;
17
-		if($this->module_info->page_count) $this->page_count = $this->module_info->page_count;
18
-		if($this->module_info->mobile_page_count) $this->page_count = $this->module_info->mobile_page_count;
13
+		if ($this->module_info->list_count) $this->list_count = $this->module_info->list_count;
14
+		if ($this->module_info->mobile_list_count) $this->list_count = $this->module_info->mobile_list_count;
15
+		if ($this->module_info->search_list_count) $this->search_list_count = $this->module_info->search_list_count;
16
+		if ($this->module_info->mobile_search_list_count) $this->search_list_count = $this->module_info->mobile_search_list_count;
17
+		if ($this->module_info->page_count) $this->page_count = $this->module_info->page_count;
18
+		if ($this->module_info->mobile_page_count) $this->page_count = $this->module_info->mobile_page_count;
19 19
 		$this->except_notice = $this->module_info->except_notice == 'N' ? false : true;
20 20
 
21 21
 		// $this->_getStatusNameListecret option backward compatibility
22 22
 		$oDocumentModel = getModel('document');
23 23
 
24 24
 		$statusList = $this->_getStatusNameList($oDocumentModel);
25
-		if(isset($statusList['SECRET']))
25
+		if (isset($statusList['SECRET']))
26 26
 		{
27 27
 			$this->module_info->secret = 'Y';
28 28
 		}
29 29
 
30 30
 		// use_category <=1.5.x, hide_category >=1.7.x
31 31
 		$count_category = count($oDocumentModel->getCategoryList($this->module_info->module_srl));
32
-		if($count_category)
32
+		if ($count_category)
33 33
 		{
34
-			if($this->module_info->hide_category)
34
+			if ($this->module_info->hide_category)
35 35
 			{
36 36
 				$this->module_info->use_category = ($this->module_info->hide_category == 'Y') ? 'N' : 'Y';
37 37
 			}
38
-			else if($this->module_info->use_category)
38
+			else if ($this->module_info->use_category)
39 39
 			{
40 40
 				$this->module_info->hide_category = ($this->module_info->use_category == 'Y') ? 'N' : 'Y';
41 41
 			}
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 		 * check the consultation function, if the user is admin then swich off consultation function
56 56
 		 * if the user is not logged, then disppear write document/write comment./ view document
57 57
 		 **/
58
-		if($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read)
58
+		if ($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read)
59 59
 		{
60 60
 			$this->consultation = true;
61
-			if(!Context::get('is_logged')) $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false;
61
+			if (!Context::get('is_logged')) $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false;
62 62
 		} else {
63 63
 			$this->consultation = false;
64 64
 		}
@@ -67,11 +67,11 @@  discard block
 block discarded – undo
67 67
 		$extra_keys = $oDocumentModel->getExtraKeys($this->module_info->module_srl);
68 68
 		Context::set('extra_keys', $extra_keys);
69 69
 
70
-		$template_path = sprintf("%sm.skins/%s/",$this->module_path, $this->module_info->mskin);
71
-		if(!is_dir($template_path)||!$this->module_info->mskin)
70
+		$template_path = sprintf("%sm.skins/%s/", $this->module_path, $this->module_info->mskin);
71
+		if (!is_dir($template_path) || !$this->module_info->mskin)
72 72
 		{
73 73
 			$this->module_info->mskin = 'default';
74
-			$template_path = sprintf("%sm.skins/%s/",$this->module_path, $this->module_info->mskin);
74
+			$template_path = sprintf("%sm.skins/%s/", $this->module_path, $this->module_info->mskin);
75 75
 		}
76 76
 		$this->setTemplatePath($template_path);
77 77
 		Context::addJsFilter($this->module_path.'tpl/filter', 'input_password.xml');
@@ -87,19 +87,19 @@  discard block
 block discarded – undo
87 87
 	function getBoardCommentPage()
88 88
 	{
89 89
 		$document_srl = Context::get('document_srl');
90
-		$oDocumentModel =& getModel('document');
91
-		if(!$document_srl)
90
+		$oDocumentModel = & getModel('document');
91
+		if (!$document_srl)
92 92
 		{
93 93
 			return new BaseObject(-1, "msg_invalid_request");
94 94
 		}
95 95
 		
96
-		if($this->grant->view == false || ($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read))
96
+		if ($this->grant->view == false || ($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read))
97 97
 		{
98 98
 			return new BaseObject(-1, "msg_not_permitted");
99 99
 		}
100 100
 		
101 101
 		$oDocument = $oDocumentModel->getDocument($document_srl);
102
-		if(!$oDocument->isExists())
102
+		if (!$oDocument->isExists())
103 103
 		{
104 104
 			return new BaseObject(-1, "msg_invalid_request");
105 105
 		}
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 	function dispBoardMessage($msg_code)
113 113
 	{
114 114
 		$msg = Context::getLang($msg_code);
115
-		$oMessageObject = &ModuleHandler::getModuleInstance('message','mobile');
115
+		$oMessageObject = &ModuleHandler::getModuleInstance('message', 'mobile');
116 116
 		$oMessageObject->setError(-1);
117 117
 		$oMessageObject->setMessage($msg);
118 118
 		$oMessageObject->dispMessage();
Please login to merge, or discard this patch.
widgets/content/content.class.php 2 patches
Braces   +183 added lines, -81 removed lines patch added patch discarded remove patch
@@ -18,36 +18,62 @@  discard block
 block discarded – undo
18 18
 	function proc($args)
19 19
 	{
20 20
 		// Targets to sort
21
-		if(!in_array($args->order_target, array('regdate','update_order'))) $args->order_target = 'regdate';
21
+		if(!in_array($args->order_target, array('regdate','update_order'))) {
22
+			$args->order_target = 'regdate';
23
+		}
22 24
 		// Sort order
23
-		if(!in_array($args->order_type, array('asc','desc'))) $args->order_type = 'asc';
25
+		if(!in_array($args->order_type, array('asc','desc'))) {
26
+			$args->order_type = 'asc';
27
+		}
24 28
 		// Pages
25 29
 		$args->page_count = (int)$args->page_count;
26
-		if(!$args->page_count) $args->page_count = 1;
30
+		if(!$args->page_count) {
31
+			$args->page_count = 1;
32
+		}
27 33
 		// The number of displayed lists
28 34
 		$args->list_count = (int)$args->list_count;
29
-		if(!$args->list_count) $args->list_count = 5;
35
+		if(!$args->list_count) {
36
+			$args->list_count = 5;
37
+		}
30 38
 		// The number of thumbnail columns
31 39
 		$args->cols_list_count = (int)$args->cols_list_count;
32
-		if(!$args->cols_list_count) $args->cols_list_count = 5;
40
+		if(!$args->cols_list_count) {
41
+			$args->cols_list_count = 5;
42
+		}
33 43
 		// Cut the length of the title
34
-		if(!$args->subject_cut_size) $args->subject_cut_size = 0;
44
+		if(!$args->subject_cut_size) {
45
+			$args->subject_cut_size = 0;
46
+		}
35 47
 		// Cut the length of contents
36
-		if(!$args->content_cut_size) $args->content_cut_size = 100;
48
+		if(!$args->content_cut_size) {
49
+			$args->content_cut_size = 100;
50
+		}
37 51
 		// Cut the length of nickname
38
-		if(!$args->nickname_cut_size) $args->nickname_cut_size = 0;
52
+		if(!$args->nickname_cut_size) {
53
+			$args->nickname_cut_size = 0;
54
+		}
39 55
 		// Display time of the latest post
40
-		if(!$args->duration_new) $args->duration_new = 12;
56
+		if(!$args->duration_new) {
57
+			$args->duration_new = 12;
58
+		}
41 59
 		// How to create thumbnails
42
-		if(!$args->thumbnail_type) $args->thumbnail_type = 'crop';
60
+		if(!$args->thumbnail_type) {
61
+			$args->thumbnail_type = 'crop';
62
+		}
43 63
 		// Horizontal size of thumbnails
44
-		if(!$args->thumbnail_width) $args->thumbnail_width = 100;
64
+		if(!$args->thumbnail_width) {
65
+			$args->thumbnail_width = 100;
66
+		}
45 67
 		// Vertical size of thumbnails
46
-		if(!$args->thumbnail_height) $args->thumbnail_height = 75;
68
+		if(!$args->thumbnail_height) {
69
+			$args->thumbnail_height = 75;
70
+		}
47 71
 		// Viewing options
48 72
 		$args->option_view_arr = explode(',',$args->option_view);
49 73
 		// markup options
50
-		if(!$args->markup_type) $args->markup_type = 'table';
74
+		if(!$args->markup_type) {
75
+			$args->markup_type = 'table';
76
+		}
51 77
 		// Set variables used internally
52 78
 		$oModuleModel = getModel('module');
53 79
 		$module_srls = $args->modules_info = $args->module_srls_info = $args->mid_lists = array();
@@ -59,11 +85,12 @@  discard block
 block discarded – undo
59 85
 			$rss_urls = array_unique(array($args->rss_url0,$args->rss_url1,$args->rss_url2,$args->rss_url3,$args->rss_url4));
60 86
 			for($i=0,$c=count($rss_urls);$i<$c;$i++)
61 87
 			{
62
-				if($rss_urls[$i]) $args->rss_urls[] = $rss_urls[$i];
88
+				if($rss_urls[$i]) {
89
+					$args->rss_urls[] = $rss_urls[$i];
90
+				}
63 91
 			}
64 92
 			// Get module information after listing module_srls if the module is not RSS
65
-		}
66
-		else
93
+		} else
67 94
 		{
68 95
 			$obj = new stdClass();
69 96
 			// Apply to all modules in the site if a target module is not specified
@@ -84,8 +111,7 @@  discard block
 block discarded – undo
84 111
 
85 112
 				$args->modules_info = $oModuleModel->getMidList($obj);
86 113
 				// Apply to the module only if a target module is specified
87
-			}
88
-			else
114
+			} else
89 115
 			{
90 116
 				$obj->module_srls = $args->module_srls;
91 117
 				$output = executeQueryArray('widgets.content.getMids', $obj);
@@ -101,13 +127,17 @@  discard block
 block discarded – undo
101 127
 					for($i=0,$c=count($idx);$i<$c;$i++)
102 128
 					{
103 129
 						$srl = $idx[$i];
104
-						if(!$args->module_srls_info[$srl]) continue;
130
+						if(!$args->module_srls_info[$srl]) {
131
+							continue;
132
+						}
105 133
 						$args->mid_lists[$srl] = $args->module_srls_info[$srl]->mid;
106 134
 					}
107 135
 				}
108 136
 			}
109 137
 			// Exit if no module is found
110
-			if(!count($args->modules_info)) return Context::get('msg_not_founded');
138
+			if(!count($args->modules_info)) {
139
+				return Context::get('msg_not_founded');
140
+			}
111 141
 			$args->module_srl = implode(',',$module_srls);
112 142
 		}
113 143
 
@@ -136,8 +166,7 @@  discard block
 block discarded – undo
136 166
 					break;
137 167
 			}
138 168
 			// If not a tab type
139
-		}
140
-		else
169
+		} else
141 170
 		{
142 171
 			$content_items = array();
143 172
 
@@ -197,7 +226,9 @@  discard block
 block discarded – undo
197 226
 
198 227
 		$content_items = array();
199 228
 
200
-		if(!count($output)) return;
229
+		if(!count($output)) {
230
+			return;
231
+		}
201 232
 
202 233
 		foreach($output as $key => $oComment)
203 234
 		{
@@ -244,15 +275,16 @@  discard block
 block discarded – undo
244 275
 		if($args->order_target == 'list_order' || $args->order_target == 'update_order')
245 276
 		{
246 277
 			$obj->order_type = $args->order_type=="desc"?"asc":"desc";
247
-		}
248
-		else
278
+		} else
249 279
 		{
250 280
 			$obj->order_type = $args->order_type=="desc"?"desc":"asc";
251 281
 		}
252 282
 		$obj->list_count = $args->list_count * $args->page_count;
253 283
 		$obj->statusList = array('PUBLIC');
254 284
 		$output = executeQueryArray('widgets.content.getNewestDocuments', $obj);
255
-		if(!$output->toBool() || !$output->data) return;
285
+		if(!$output->toBool() || !$output->data) {
286
+			return;
287
+		}
256 288
 		// If the result exists, make each document as an object
257 289
 		$content_items = array();
258 290
 		$first_thumbnail_idx = -1;
@@ -286,7 +318,9 @@  discard block
 block discarded – undo
286 318
 				$content_item->setThumbnail($thumbnail);
287 319
 				$content_item->setExtraImages($oDocument->printExtraImages($args->duration_new * 60 * 60));
288 320
 				$content_item->add('mid', $args->mid_lists[$module_srl]);
289
-				if($first_thumbnail_idx==-1 && $thumbnail) $first_thumbnail_idx = $i;
321
+				if($first_thumbnail_idx==-1 && $thumbnail) {
322
+					$first_thumbnail_idx = $i;
323
+				}
290 324
 				$content_items[] = $content_item;
291 325
 			}
292 326
 
@@ -319,15 +353,21 @@  discard block
 block discarded – undo
319 353
 		$obj->list_count = $args->list_count * $args->page_count;
320 354
 		$files_output = executeQueryArray("file.getOneFileInDocument", $obj);
321 355
 		$files_count = count($files_output->data);
322
-		if(!$files_count) return;
356
+		if(!$files_count) {
357
+			return;
358
+		}
323 359
 
324 360
 		$content_items = array();
325 361
 
326
-		for($i=0;$i<$files_count;$i++) $document_srl_list[] = $files_output->data[$i]->document_srl;
362
+		for($i=0;$i<$files_count;$i++) {
363
+			$document_srl_list[] = $files_output->data[$i]->document_srl;
364
+		}
327 365
 
328 366
 		$tmp_document_list = $oDocumentModel->getDocuments($document_srl_list);
329 367
 
330
-		if(!count($tmp_document_list)) return;
368
+		if(!count($tmp_document_list)) {
369
+			return;
370
+		}
331 371
 
332 372
 		foreach($tmp_document_list as $oDocument)
333 373
 		{
@@ -381,16 +421,20 @@  discard block
 block discarded – undo
381 421
 				{
382 422
 					$date = $v->get('regdate');
383 423
 					$i=0;
384
-					while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) $i++;
424
+					while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) {
425
+						$i++;
426
+					}
385 427
 					$items[sprintf('%s%02d',$date,$i)] = $v;
386 428
 				}
387 429
 			}
388
-			if($args->order_type =='asc') ksort($items);
389
-			else krsort($items);
430
+			if($args->order_type =='asc') {
431
+				ksort($items);
432
+			} else {
433
+				krsort($items);
434
+			}
390 435
 			$content_items = array_slice(array_values($items),0,$args->list_count*$args->page_count);
391 436
 			// Tab Type
392
-		}
393
-		else
437
+		} else
394 438
 		{
395 439
 			foreach($content_items as $key=> $content_item_list)
396 440
 			{
@@ -399,11 +443,16 @@  discard block
 block discarded – undo
399 443
 				{
400 444
 					$date = $content_item->get('regdate');
401 445
 					$i=0;
402
-					while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) $i++;
446
+					while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) {
447
+						$i++;
448
+					}
403 449
 					$items[sprintf('%s%02d',$date,$i)] = $content_item;
404 450
 				}
405
-				if($args->order_type =='asc') ksort($items);
406
-				else krsort($items);
451
+				if($args->order_type =='asc') {
452
+					ksort($items);
453
+				} else {
454
+					krsort($items);
455
+				}
407 456
 
408 457
 				$content_items[$key] = array_values($items);
409 458
 			}
@@ -413,10 +462,16 @@  discard block
 block discarded – undo
413 462
 
414 463
 	function _getRssBody($value)
415 464
 	{
416
-		if(!$value || is_string($value)) return $value;
417
-		if(is_object($value)) $value = get_object_vars($value);
465
+		if(!$value || is_string($value)) {
466
+			return $value;
467
+		}
468
+		if(is_object($value)) {
469
+			$value = get_object_vars($value);
470
+		}
418 471
 		$body = null;
419
-		if(!count($value)) return;
472
+		if(!count($value)) {
473
+			return;
474
+		}
420 475
 		foreach($value as $key => $val)
421 476
 		{
422 477
 			if($key == 'body')
@@ -424,8 +479,12 @@  discard block
 block discarded – undo
424 479
 				$body = $val;
425 480
 				continue;
426 481
 			}
427
-			if(is_object($val)||is_array($val)) $body = $this->_getRssBody($val);
428
-			if($body !== null) return $body;
482
+			if(is_object($val)||is_array($val)) {
483
+				$body = $this->_getRssBody($val);
484
+			}
485
+			if($body !== null) {
486
+				return $body;
487
+			}
429 488
 		}
430 489
 		return $body;
431 490
 	}
@@ -468,7 +527,9 @@  discard block
 block discarded – undo
468 527
 		$buff = $this->requestFeedContents($args->rss_url);
469 528
 
470 529
 		$encoding = preg_match("/<\?xml.*encoding=\"(.+)\".*\?>/i", $buff, $matches);
471
-		if($encoding && stripos($matches[1], "UTF-8") === FALSE) $buff = Context::convertEncodingStr($buff);
530
+		if($encoding && stripos($matches[1], "UTF-8") === FALSE) {
531
+			$buff = Context::convertEncodingStr($buff);
532
+		}
472 533
 
473 534
 		$buff = preg_replace("/<\?xml.*\?>/i", "", $buff);
474 535
 
@@ -481,19 +542,27 @@  discard block
 block discarded – undo
481 542
 
482 543
 			$items = $xml_doc->rss->channel->item;
483 544
 
484
-			if(!$items) return;
485
-			if($items && !is_array($items)) $items = array($items);
545
+			if(!$items) {
546
+				return;
547
+			}
548
+			if($items && !is_array($items)) {
549
+				$items = array($items);
550
+			}
486 551
 
487 552
 			$content_items = array();
488 553
 
489 554
 			foreach ($items as $key => $value)
490 555
 			{
491
-				if($key >= $args->list_count * $args->page_count) break;
556
+				if($key >= $args->list_count * $args->page_count) {
557
+					break;
558
+				}
492 559
 				unset($item);
493 560
 
494 561
 				foreach($value as $key2 => $value2)
495 562
 				{
496
-					if(is_array($value2)) $value2 = array_shift($value2);
563
+					if(is_array($value2)) {
564
+						$value2 = array_shift($value2);
565
+					}
497 566
 					$item->{$key2} = $this->_getRssBody($value2);
498 567
 				}
499 568
 
@@ -511,8 +580,7 @@  discard block
 block discarded – undo
511 580
 
512 581
 				$content_items[] = $content_item;
513 582
 			}
514
-		}
515
-		else if($xml_doc->{'rdf:rdf'})
583
+		} else if($xml_doc->{'rdf:rdf'})
516 584
 		{
517 585
 			// rss1.0 supported (XE's XML is case-insensitive because XML parser converts all to small letters. Fixed by misol
518 586
 			$rss->title = $xml_doc->{'rdf:rdf'}->channel->title->body;
@@ -520,19 +588,27 @@  discard block
 block discarded – undo
520 588
 
521 589
 			$items = $xml_doc->{'rdf:rdf'}->item;
522 590
 
523
-			if(!$items) return;
524
-			if($items && !is_array($items)) $items = array($items);
591
+			if(!$items) {
592
+				return;
593
+			}
594
+			if($items && !is_array($items)) {
595
+				$items = array($items);
596
+			}
525 597
 
526 598
 			$content_items = array();
527 599
 
528 600
 			foreach ($items as $key => $value)
529 601
 			{
530
-				if($key >= $args->list_count * $args->page_count) break;
602
+				if($key >= $args->list_count * $args->page_count) {
603
+					break;
604
+				}
531 605
 				unset($item);
532 606
 
533 607
 				foreach($value as $key2 => $value2)
534 608
 				{
535
-					if(is_array($value2)) $value2 = array_shift($value2);
609
+					if(is_array($value2)) {
610
+						$value2 = array_shift($value2);
611
+					}
536 612
 					$item->{$key2} = $this->_getRssBody($value2);
537 613
 				}
538 614
 
@@ -550,8 +626,7 @@  discard block
 block discarded – undo
550 626
 
551 627
 				$content_items[] = $content_item;
552 628
 			}
553
-		}
554
-		else if($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom')
629
+		} else if($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom')
555 630
 		{
556 631
 			// Atom 1.0 spec supported by misol
557 632
 			$rss->title = $xml_doc->feed->title->body;
@@ -566,24 +641,33 @@  discard block
 block discarded – undo
566 641
 						break;
567 642
 					}
568 643
 				}
644
+			} else if($links->attrs->rel == 'alternate') {
645
+				$rss->link = $links->attrs->href;
569 646
 			}
570
-			else if($links->attrs->rel == 'alternate') $rss->link = $links->attrs->href;
571 647
 
572 648
 			$items = $xml_doc->feed->entry;
573 649
 
574
-			if(!$items) return;
575
-			if($items && !is_array($items)) $items = array($items);
650
+			if(!$items) {
651
+				return;
652
+			}
653
+			if($items && !is_array($items)) {
654
+				$items = array($items);
655
+			}
576 656
 
577 657
 			$content_items = array();
578 658
 
579 659
 			foreach ($items as $key => $value)
580 660
 			{
581
-				if($key >= $args->list_count * $args->page_count) break;
661
+				if($key >= $args->list_count * $args->page_count) {
662
+					break;
663
+				}
582 664
 				unset($item);
583 665
 
584 666
 				foreach($value as $key2 => $value2)
585 667
 				{
586
-					if(is_array($value2)) $value2 = array_shift($value2);
668
+					if(is_array($value2)) {
669
+						$value2 = array_shift($value2);
670
+					}
587 671
 					$item->{$key2} = $this->_getRssBody($value2);
588 672
 				}
589 673
 
@@ -599,13 +683,16 @@  discard block
 block discarded – undo
599 683
 							break;
600 684
 						}
601 685
 					}
686
+				} else if($links->attrs->rel == 'alternate') {
687
+					$item->link = $links->attrs->href;
602 688
 				}
603
-				else if($links->attrs->rel == 'alternate') $item->link = $links->attrs->href;
604 689
 
605 690
 				$content_item->setContentsLink($rss->link);
606 691
 				if($item->title)
607 692
 				{
608
-					if(stripos($value->title->attrs->type, "html") === FALSE) $item->title = $value->title->body;
693
+					if(stripos($value->title->attrs->type, "html") === FALSE) {
694
+						$item->title = $value->title->body;
695
+					}
609 696
 				}
610 697
 				$content_item->setTitle($item->title);
611 698
 				$content_item->setNickName(max($item->author,$item->{'dc:creator'}));
@@ -640,16 +727,13 @@  discard block
 block discarded – undo
640 727
 		if($matches[1])
641 728
 		{
642 729
 			return $matches[1];
643
-		}
644
-		elseif($matches[2])
730
+		} elseif($matches[2])
645 731
 		{
646 732
 			return $matches[2];
647
-		}
648
-		elseif($matches[3])
733
+		} elseif($matches[3])
649 734
 		{
650 735
 			return $matches[3];
651
-		}
652
-		else
736
+		} else
653 737
 		{
654 738
 			return NULL;
655 739
 		}
@@ -681,7 +765,9 @@  discard block
 block discarded – undo
681 765
 		// Get model object from the trackback module and execute getTrackbackList() method
682 766
 		$output = $oTrackbackModel->getNewestTrackbackList($obj);
683 767
 		// If an error occurs, just ignore it.
684
-		if(!$output->toBool() || !$output->data) return;
768
+		if(!$output->toBool() || !$output->data) {
769
+			return;
770
+		}
685 771
 		// If the result exists, make each document as an object
686 772
 		$content_items = array();
687 773
 		foreach($output->data as $key => $item)
@@ -743,7 +829,9 @@  discard block
 block discarded – undo
743 829
 			$tab = array();
744 830
 			foreach($args->mid_lists as $module_srl => $mid)
745 831
 			{
746
-				if(!is_array($content_items[$module_srl]) || !count($content_items[$module_srl])) continue;
832
+				if(!is_array($content_items[$module_srl]) || !count($content_items[$module_srl])) {
833
+					continue;
834
+				}
747 835
 
748 836
 				unset($tab_item);
749 837
 				$tab_item = new stdClass();
@@ -751,12 +839,13 @@  discard block
 block discarded – undo
751 839
 				$tab_item->content_items = $content_items[$module_srl];
752 840
 				$tab_item->domain = $content_items[$module_srl][0]->getDomain();
753 841
 				$tab_item->url = $content_items[$module_srl][0]->getContentsLink();
754
-				if(!$tab_item->url) $tab_item->url = getSiteUrl($tab_item->domain, '','mid',$mid);
842
+				if(!$tab_item->url) {
843
+					$tab_item->url = getSiteUrl($tab_item->domain, '','mid',$mid);
844
+				}
755 845
 				$tab[] = $tab_item;
756 846
 			}
757 847
 			$widget_info->tab = $tab;
758
-		}
759
-		else
848
+		} else
760 849
 		{
761 850
 			$widget_info->content_items = $content_items;
762 851
 		}
@@ -804,7 +893,9 @@  discard block
 block discarded – undo
804 893
 		static $default_domain = null;
805 894
 		if(!$domain)
806 895
 		{
807
-			if(is_null($default_domain)) $default_domain = Context::getDefaultUrl();
896
+			if(is_null($default_domain)) {
897
+				$default_domain = Context::getDefaultUrl();
898
+			}
808 899
 			$domain = $default_domain;
809 900
 		}
810 901
 		$this->domain = $domain;
@@ -872,13 +963,21 @@  discard block
 block discarded – undo
872 963
 	{
873 964
 		$title = htmlspecialchars($this->get('title'), ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
874 965
 
875
-		if($cut_size) $title = cut_str($title, $cut_size, $tail);
966
+		if($cut_size) {
967
+			$title = cut_str($title, $cut_size, $tail);
968
+		}
876 969
 
877 970
 		$attrs = array();
878
-		if($this->get('title_bold') == 'Y') $attrs[] = 'font-weight:bold';
879
-		if($this->get('title_color') && $this->get('title_color') != 'N') $attrs[] = 'color:#'.$this->get('title_color');
971
+		if($this->get('title_bold') == 'Y') {
972
+			$attrs[] = 'font-weight:bold';
973
+		}
974
+		if($this->get('title_color') && $this->get('title_color') != 'N') {
975
+			$attrs[] = 'color:#'.$this->get('title_color');
976
+		}
880 977
 
881
-		if(count($attrs)) $title = sprintf("<span style=\"%s\">%s</span>", implode(';', $attrs), $title);
978
+		if(count($attrs)) {
979
+			$title = sprintf("<span style=\"%s\">%s</span>", implode(';', $attrs), $title);
980
+		}
882 981
 
883 982
 		return $title;
884 983
 	}
@@ -892,8 +991,11 @@  discard block
 block discarded – undo
892 991
 	}
893 992
 	function getNickName($cut_size = 0, $tail='...')
894 993
 	{
895
-		if($cut_size) $nick_name = cut_str($this->get('nick_name'), $cut_size, $tail);
896
-		else $nick_name = $this->get('nick_name');
994
+		if($cut_size) {
995
+			$nick_name = cut_str($this->get('nick_name'), $cut_size, $tail);
996
+		} else {
997
+			$nick_name = $this->get('nick_name');
998
+		}
897 999
 
898 1000
 		return $nick_name;
899 1001
 	}
Please login to merge, or discard this patch.
Spacing   +167 added lines, -167 removed lines patch added patch discarded remove patch
@@ -18,48 +18,48 @@  discard block
 block discarded – undo
18 18
 	function proc($args)
19 19
 	{
20 20
 		// Targets to sort
21
-		if(!in_array($args->order_target, array('regdate','update_order'))) $args->order_target = 'regdate';
21
+		if (!in_array($args->order_target, array('regdate', 'update_order'))) $args->order_target = 'regdate';
22 22
 		// Sort order
23
-		if(!in_array($args->order_type, array('asc','desc'))) $args->order_type = 'asc';
23
+		if (!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc';
24 24
 		// Pages
25
-		$args->page_count = (int)$args->page_count;
26
-		if(!$args->page_count) $args->page_count = 1;
25
+		$args->page_count = (int) $args->page_count;
26
+		if (!$args->page_count) $args->page_count = 1;
27 27
 		// The number of displayed lists
28
-		$args->list_count = (int)$args->list_count;
29
-		if(!$args->list_count) $args->list_count = 5;
28
+		$args->list_count = (int) $args->list_count;
29
+		if (!$args->list_count) $args->list_count = 5;
30 30
 		// The number of thumbnail columns
31
-		$args->cols_list_count = (int)$args->cols_list_count;
32
-		if(!$args->cols_list_count) $args->cols_list_count = 5;
31
+		$args->cols_list_count = (int) $args->cols_list_count;
32
+		if (!$args->cols_list_count) $args->cols_list_count = 5;
33 33
 		// Cut the length of the title
34
-		if(!$args->subject_cut_size) $args->subject_cut_size = 0;
34
+		if (!$args->subject_cut_size) $args->subject_cut_size = 0;
35 35
 		// Cut the length of contents
36
-		if(!$args->content_cut_size) $args->content_cut_size = 100;
36
+		if (!$args->content_cut_size) $args->content_cut_size = 100;
37 37
 		// Cut the length of nickname
38
-		if(!$args->nickname_cut_size) $args->nickname_cut_size = 0;
38
+		if (!$args->nickname_cut_size) $args->nickname_cut_size = 0;
39 39
 		// Display time of the latest post
40
-		if(!$args->duration_new) $args->duration_new = 12;
40
+		if (!$args->duration_new) $args->duration_new = 12;
41 41
 		// How to create thumbnails
42
-		if(!$args->thumbnail_type) $args->thumbnail_type = 'crop';
42
+		if (!$args->thumbnail_type) $args->thumbnail_type = 'crop';
43 43
 		// Horizontal size of thumbnails
44
-		if(!$args->thumbnail_width) $args->thumbnail_width = 100;
44
+		if (!$args->thumbnail_width) $args->thumbnail_width = 100;
45 45
 		// Vertical size of thumbnails
46
-		if(!$args->thumbnail_height) $args->thumbnail_height = 75;
46
+		if (!$args->thumbnail_height) $args->thumbnail_height = 75;
47 47
 		// Viewing options
48
-		$args->option_view_arr = explode(',',$args->option_view);
48
+		$args->option_view_arr = explode(',', $args->option_view);
49 49
 		// markup options
50
-		if(!$args->markup_type) $args->markup_type = 'table';
50
+		if (!$args->markup_type) $args->markup_type = 'table';
51 51
 		// Set variables used internally
52 52
 		$oModuleModel = getModel('module');
53 53
 		$module_srls = $args->modules_info = $args->module_srls_info = $args->mid_lists = array();
54 54
 		$site_module_info = Context::get('site_module_info');
55 55
 		// List URLs if a type is RSS
56
-		if($args->content_type == 'rss')
56
+		if ($args->content_type == 'rss')
57 57
 		{
58 58
 			$args->rss_urls = array();
59
-			$rss_urls = array_unique(array($args->rss_url0,$args->rss_url1,$args->rss_url2,$args->rss_url3,$args->rss_url4));
60
-			for($i=0,$c=count($rss_urls);$i<$c;$i++)
59
+			$rss_urls = array_unique(array($args->rss_url0, $args->rss_url1, $args->rss_url2, $args->rss_url3, $args->rss_url4));
60
+			for ($i = 0, $c = count($rss_urls); $i < $c; $i++)
61 61
 			{
62
-				if($rss_urls[$i]) $args->rss_urls[] = $rss_urls[$i];
62
+				if ($rss_urls[$i]) $args->rss_urls[] = $rss_urls[$i];
63 63
 			}
64 64
 			// Get module information after listing module_srls if the module is not RSS
65 65
 		}
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
 		{
68 68
 			$obj = new stdClass();
69 69
 			// Apply to all modules in the site if a target module is not specified
70
-			if(!$args->module_srls)
70
+			if (!$args->module_srls)
71 71
 			{
72
-				$obj->site_srl = (int)$site_module_info->site_srl;
72
+				$obj->site_srl = (int) $site_module_info->site_srl;
73 73
 				$output = executeQueryArray('widgets.content.getMids', $obj);
74
-				if($output->data)
74
+				if ($output->data)
75 75
 				{
76
-					foreach($output->data as $key => $val)
76
+					foreach ($output->data as $key => $val)
77 77
 					{
78 78
 						$args->modules_info[$val->mid] = $val;
79 79
 						$args->module_srls_info[$val->module_srl] = $val;
@@ -89,35 +89,35 @@  discard block
 block discarded – undo
89 89
 			{
90 90
 				$obj->module_srls = $args->module_srls;
91 91
 				$output = executeQueryArray('widgets.content.getMids', $obj);
92
-				if($output->data)
92
+				if ($output->data)
93 93
 				{
94
-					foreach($output->data as $key => $val)
94
+					foreach ($output->data as $key => $val)
95 95
 					{
96 96
 						$args->modules_info[$val->mid] = $val;
97 97
 						$args->module_srls_info[$val->module_srl] = $val;
98 98
 						$module_srls[] = $val->module_srl;
99 99
 					}
100
-					$idx = explode(',',$args->module_srls);
101
-					for($i=0,$c=count($idx);$i<$c;$i++)
100
+					$idx = explode(',', $args->module_srls);
101
+					for ($i = 0, $c = count($idx); $i < $c; $i++)
102 102
 					{
103 103
 						$srl = $idx[$i];
104
-						if(!$args->module_srls_info[$srl]) continue;
104
+						if (!$args->module_srls_info[$srl]) continue;
105 105
 						$args->mid_lists[$srl] = $args->module_srls_info[$srl]->mid;
106 106
 					}
107 107
 				}
108 108
 			}
109 109
 			// Exit if no module is found
110
-			if(!count($args->modules_info)) return Context::get('msg_not_founded');
111
-			$args->module_srl = implode(',',$module_srls);
110
+			if (!count($args->modules_info)) return Context::get('msg_not_founded');
111
+			$args->module_srl = implode(',', $module_srls);
112 112
 		}
113 113
 
114 114
 		/**
115 115
 		 * Method is separately made because content extraction, articles, comments, trackbacks, RSS and other elements exist
116 116
 		 */
117 117
 		// tab type
118
-		if($args->tab_type == 'none' || $args->tab_type == '')
118
+		if ($args->tab_type == 'none' || $args->tab_type == '')
119 119
 		{
120
-			switch($args->content_type)
120
+			switch ($args->content_type)
121 121
 			{
122 122
 				case 'comment':
123 123
 					$content_items = $this->_getCommentItems($args);
@@ -141,17 +141,17 @@  discard block
 block discarded – undo
141 141
 		{
142 142
 			$content_items = array();
143 143
 
144
-			switch($args->content_type)
144
+			switch ($args->content_type)
145 145
 			{
146 146
 				case 'comment':
147
-					foreach($args->mid_lists as $module_srl => $mid)
147
+					foreach ($args->mid_lists as $module_srl => $mid)
148 148
 					{
149 149
 						$args->module_srl = $module_srl;
150 150
 						$content_items[$module_srl] = $this->_getCommentItems($args);
151 151
 					}
152 152
 					break;
153 153
 				case 'image':
154
-					foreach($args->mid_lists as $module_srl => $mid)
154
+					foreach ($args->mid_lists as $module_srl => $mid)
155 155
 					{
156 156
 						$args->module_srl = $module_srl;
157 157
 						$content_items[$module_srl] = $this->_getImageItems($args);
@@ -161,14 +161,14 @@  discard block
 block discarded – undo
161 161
 					$content_items = $this->getRssItems($args);
162 162
 					break;
163 163
 				case 'trackback':
164
-					foreach($args->mid_lists as $module_srl => $mid)
164
+					foreach ($args->mid_lists as $module_srl => $mid)
165 165
 					{
166 166
 						$args->module_srl = $module_srl;
167 167
 						$content_items[$module_srl] = $this->_getTrackbackItems($args);
168 168
 					}
169 169
 					break;
170 170
 				default:
171
-					foreach($args->mid_lists as $module_srl => $mid)
171
+					foreach ($args->mid_lists as $module_srl => $mid)
172 172
 					{
173 173
 						$args->module_srl = $module_srl;
174 174
 						$content_items[$module_srl] = $this->_getDocumentItems($args);
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 			}
178 178
 		}
179 179
 
180
-		$output = $this->_compile($args,$content_items);
180
+		$output = $this->_compile($args, $content_items);
181 181
 		return $output;
182 182
 	}
183 183
 
@@ -197,14 +197,14 @@  discard block
 block discarded – undo
197 197
 
198 198
 		$content_items = array();
199 199
 
200
-		if(!count($output)) return;
200
+		if (!count($output)) return;
201 201
 
202
-		foreach($output as $key => $oComment)
202
+		foreach ($output as $key => $oComment)
203 203
 		{
204 204
 			$attribute = $oComment->getObjectVars();
205 205
 			$title = $oComment->getSummary($args->content_cut_size);
206
-			$thumbnail = $oComment->getThumbnail($args->thumbnail_width,$args->thumbnail_height,$args->thumbnail_type);
207
-			$url = sprintf("%s#comment_%s",getUrl('','mid', $args->mid_lists[$attribute->module_srl], 'document_srl',$oComment->get('document_srl')),$oComment->get('comment_srl'));
206
+			$thumbnail = $oComment->getThumbnail($args->thumbnail_width, $args->thumbnail_height, $args->thumbnail_type);
207
+			$url = sprintf("%s#comment_%s", getUrl('', 'mid', $args->mid_lists[$attribute->module_srl], 'document_srl', $oComment->get('document_srl')), $oComment->get('comment_srl'));
208 208
 
209 209
 			$attribute->mid = $args->mid_lists[$attribute->module_srl];
210 210
 			$browser_title = $args->module_srls_info[$attribute->module_srl]->browser_title;
@@ -229,10 +229,10 @@  discard block
 block discarded – undo
229 229
 		// Get categories
230 230
 		$obj = new stdClass();
231 231
 		$obj->module_srl = $args->module_srl;
232
-		$output = executeQueryArray('widgets.content.getCategories',$obj);
233
-		if($output->toBool() && $output->data)
232
+		$output = executeQueryArray('widgets.content.getCategories', $obj);
233
+		if ($output->toBool() && $output->data)
234 234
 		{
235
-			foreach($output->data as $key => $val)
235
+			foreach ($output->data as $key => $val)
236 236
 			{
237 237
 				$category_lists[$val->module_srl][$val->category_srl] = $val;
238 238
 			}
@@ -241,24 +241,24 @@  discard block
 block discarded – undo
241 241
 		$obj->module_srl = $args->module_srl;
242 242
 		$obj->category_srl = $args->category_srl;
243 243
 		$obj->sort_index = $args->order_target;
244
-		if($args->order_target == 'list_order' || $args->order_target == 'update_order')
244
+		if ($args->order_target == 'list_order' || $args->order_target == 'update_order')
245 245
 		{
246
-			$obj->order_type = $args->order_type=="desc"?"asc":"desc";
246
+			$obj->order_type = $args->order_type == "desc" ? "asc" : "desc";
247 247
 		}
248 248
 		else
249 249
 		{
250
-			$obj->order_type = $args->order_type=="desc"?"desc":"asc";
250
+			$obj->order_type = $args->order_type == "desc" ? "desc" : "asc";
251 251
 		}
252 252
 		$obj->list_count = $args->list_count * $args->page_count;
253 253
 		$obj->statusList = array('PUBLIC');
254 254
 		$output = executeQueryArray('widgets.content.getNewestDocuments', $obj);
255
-		if(!$output->toBool() || !$output->data) return;
255
+		if (!$output->toBool() || !$output->data) return;
256 256
 		// If the result exists, make each document as an object
257 257
 		$content_items = array();
258 258
 		$first_thumbnail_idx = -1;
259
-		if(count($output->data))
259
+		if (count($output->data))
260 260
 		{
261
-			foreach($output->data as $key => $attribute)
261
+			foreach ($output->data as $key => $attribute)
262 262
 			{
263 263
 				$oDocument = new documentItem();
264 264
 				$oDocument->setAttribute($attribute, false);
@@ -267,26 +267,26 @@  discard block
 block discarded – undo
267 267
 			}
268 268
 			$oDocumentModel->setToAllDocumentExtraVars();
269 269
 
270
-			for($i=0,$c=count($document_srls);$i<$c;$i++)
270
+			for ($i = 0, $c = count($document_srls); $i < $c; $i++)
271 271
 			{
272 272
 				$oDocument = $GLOBALS['XE_DOCUMENT_LIST'][$document_srls[$i]];
273 273
 				$document_srl = $oDocument->document_srl;
274 274
 				$module_srl = $oDocument->get('module_srl');
275 275
 				$category_srl = $oDocument->get('category_srl');
276
-				$thumbnail = $oDocument->getThumbnail($args->thumbnail_width,$args->thumbnail_height,$args->thumbnail_type);
276
+				$thumbnail = $oDocument->getThumbnail($args->thumbnail_width, $args->thumbnail_height, $args->thumbnail_type);
277 277
 
278
-				$content_item = new contentItem( $args->module_srls_info[$module_srl]->browser_title );
278
+				$content_item = new contentItem($args->module_srls_info[$module_srl]->browser_title);
279 279
 				$content_item->adds($oDocument->getObjectVars());
280 280
 				$content_item->add('original_content', $oDocument->get('content'));
281 281
 				$content_item->setTitle($oDocument->getTitleText());
282
-				$content_item->setCategory( $category_lists[$module_srl][$category_srl]->title );
283
-				$content_item->setDomain( $args->module_srls_info[$module_srl]->domain );
282
+				$content_item->setCategory($category_lists[$module_srl][$category_srl]->title);
283
+				$content_item->setDomain($args->module_srls_info[$module_srl]->domain);
284 284
 				$content_item->setContent($oDocument->getSummary($args->content_cut_size));
285
-				$content_item->setLink( getSiteUrl($domain, '', 'mid', $args->mid_lists[$module_srl],'document_srl',$document_srl) );
285
+				$content_item->setLink(getSiteUrl($domain, '', 'mid', $args->mid_lists[$module_srl], 'document_srl', $document_srl));
286 286
 				$content_item->setThumbnail($thumbnail);
287 287
 				$content_item->setExtraImages($oDocument->printExtraImages($args->duration_new * 60 * 60));
288 288
 				$content_item->add('mid', $args->mid_lists[$module_srl]);
289
-				if($first_thumbnail_idx==-1 && $thumbnail) $first_thumbnail_idx = $i;
289
+				if ($first_thumbnail_idx == -1 && $thumbnail) $first_thumbnail_idx = $i;
290 290
 				$content_items[] = $content_item;
291 291
 			}
292 292
 
@@ -307,10 +307,10 @@  discard block
 block discarded – undo
307 307
 		$obj->direct_download = 'Y';
308 308
 		$obj->isvalid = 'Y';
309 309
 		// Get categories
310
-		$output = executeQueryArray('widgets.content.getCategories',$obj);
311
-		if($output->toBool() && $output->data)
310
+		$output = executeQueryArray('widgets.content.getCategories', $obj);
311
+		if ($output->toBool() && $output->data)
312 312
 		{
313
-			foreach($output->data as $key => $val)
313
+			foreach ($output->data as $key => $val)
314 314
 			{
315 315
 				$category_lists[$val->module_srl][$val->category_srl] = $val;
316 316
 			}
@@ -319,25 +319,25 @@  discard block
 block discarded – undo
319 319
 		$obj->list_count = $args->list_count * $args->page_count;
320 320
 		$files_output = executeQueryArray("file.getOneFileInDocument", $obj);
321 321
 		$files_count = count($files_output->data);
322
-		if(!$files_count) return;
322
+		if (!$files_count) return;
323 323
 
324 324
 		$content_items = array();
325 325
 
326
-		for($i=0;$i<$files_count;$i++) $document_srl_list[] = $files_output->data[$i]->document_srl;
326
+		for ($i = 0; $i < $files_count; $i++) $document_srl_list[] = $files_output->data[$i]->document_srl;
327 327
 
328 328
 		$tmp_document_list = $oDocumentModel->getDocuments($document_srl_list);
329 329
 
330
-		if(!count($tmp_document_list)) return;
330
+		if (!count($tmp_document_list)) return;
331 331
 
332
-		foreach($tmp_document_list as $oDocument)
332
+		foreach ($tmp_document_list as $oDocument)
333 333
 		{
334 334
 			$attribute = $oDocument->getObjectVars();
335 335
 			$browser_title = $args->module_srls_info[$attribute->module_srl]->browser_title;
336 336
 			$domain = $args->module_srls_info[$attribute->module_srl]->domain;
337 337
 			$category = $category_lists[$attribute->module_srl]->text;
338 338
 			$content = $oDocument->getSummary($args->content_cut_size);
339
-			$url = sprintf("%s#%s",$oDocument->getPermanentUrl() ,$oDocument->getCommentCount());
340
-			$thumbnail = $oDocument->getThumbnail($args->thumbnail_width,$args->thumbnail_height,$args->thumbnail_type);
339
+			$url = sprintf("%s#%s", $oDocument->getPermanentUrl(), $oDocument->getCommentCount());
340
+			$thumbnail = $oDocument->getThumbnail($args->thumbnail_width, $args->thumbnail_height, $args->thumbnail_type);
341 341
 			$extra_images = $oDocument->printExtraImages($args->duration_new);
342 342
 
343 343
 			$content_item = new contentItem($browser_title);
@@ -360,11 +360,11 @@  discard block
 block discarded – undo
360 360
 		$content_items = array();
361 361
 		$args->mid_lists = array();
362 362
 
363
-		foreach($args->rss_urls as $key => $rss)
363
+		foreach ($args->rss_urls as $key => $rss)
364 364
 		{
365 365
 			$args->rss_url = $rss;
366 366
 			$content_item = $this->_getRssItems($args);
367
-			if(count($content_item) > 0)
367
+			if (count($content_item) > 0)
368 368
 			{
369 369
 				$browser_title = $content_item[0]->getBrowserTitle();
370 370
 				$args->mid_lists[] = $browser_title;
@@ -372,37 +372,37 @@  discard block
 block discarded – undo
372 372
 			}
373 373
 		}
374 374
 		// If it is not a tab type
375
-		if($args->tab_type == 'none' || $args->tab_type == '')
375
+		if ($args->tab_type == 'none' || $args->tab_type == '')
376 376
 		{
377 377
 			$items = array();
378
-			foreach($content_items as $key => $val)
378
+			foreach ($content_items as $key => $val)
379 379
 			{
380
-				foreach($val as $k => $v)
380
+				foreach ($val as $k => $v)
381 381
 				{
382 382
 					$date = $v->get('regdate');
383
-					$i=0;
384
-					while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) $i++;
385
-					$items[sprintf('%s%02d',$date,$i)] = $v;
383
+					$i = 0;
384
+					while (array_key_exists(sprintf('%s%02d', $date, $i), $items)) $i++;
385
+					$items[sprintf('%s%02d', $date, $i)] = $v;
386 386
 				}
387 387
 			}
388
-			if($args->order_type =='asc') ksort($items);
388
+			if ($args->order_type == 'asc') ksort($items);
389 389
 			else krsort($items);
390
-			$content_items = array_slice(array_values($items),0,$args->list_count*$args->page_count);
390
+			$content_items = array_slice(array_values($items), 0, $args->list_count * $args->page_count);
391 391
 			// Tab Type
392 392
 		}
393 393
 		else
394 394
 		{
395
-			foreach($content_items as $key=> $content_item_list)
395
+			foreach ($content_items as $key=> $content_item_list)
396 396
 			{
397 397
 				$items = array();
398
-				foreach($content_item_list as $k => $content_item)
398
+				foreach ($content_item_list as $k => $content_item)
399 399
 				{
400 400
 					$date = $content_item->get('regdate');
401
-					$i=0;
402
-					while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) $i++;
403
-					$items[sprintf('%s%02d',$date,$i)] = $content_item;
401
+					$i = 0;
402
+					while (array_key_exists(sprintf('%s%02d', $date, $i), $items)) $i++;
403
+					$items[sprintf('%s%02d', $date, $i)] = $content_item;
404 404
 				}
405
-				if($args->order_type =='asc') ksort($items);
405
+				if ($args->order_type == 'asc') ksort($items);
406 406
 				else krsort($items);
407 407
 
408 408
 				$content_items[$key] = array_values($items);
@@ -413,19 +413,19 @@  discard block
 block discarded – undo
413 413
 
414 414
 	function _getRssBody($value)
415 415
 	{
416
-		if(!$value || is_string($value)) return $value;
417
-		if(is_object($value)) $value = get_object_vars($value);
416
+		if (!$value || is_string($value)) return $value;
417
+		if (is_object($value)) $value = get_object_vars($value);
418 418
 		$body = null;
419
-		if(!count($value)) return;
420
-		foreach($value as $key => $val)
419
+		if (!count($value)) return;
420
+		foreach ($value as $key => $val)
421 421
 		{
422
-			if($key == 'body')
422
+			if ($key == 'body')
423 423
 			{
424 424
 				$body = $val;
425 425
 				continue;
426 426
 			}
427
-			if(is_object($val)||is_array($val)) $body = $this->_getRssBody($val);
428
-			if($body !== null) return $body;
427
+			if (is_object($val) || is_array($val)) $body = $this->_getRssBody($val);
428
+			if ($body !== null) return $body;
429 429
 		}
430 430
 		return $body;
431 431
 	}
@@ -436,17 +436,17 @@  discard block
 block discarded – undo
436 436
 		// Replace tags such as </p> , </div> , </li> and others to a whitespace
437 437
 		$content = str_replace(array('</p>', '</div>', '</li>'), ' ', $content);
438 438
 		// Remove Tag
439
-		$content = preg_replace('!<([^>]*?)>!is','', $content);
439
+		$content = preg_replace('!<([^>]*?)>!is', '', $content);
440 440
 		// Replace tags to <, >, " and whitespace
441
-		$content = str_replace(array('&lt;','&gt;','&quot;','&nbsp;'), array('<','>','"',' '), $content);
441
+		$content = str_replace(array('&lt;', '&gt;', '&quot;', '&nbsp;'), array('<', '>', '"', ' '), $content);
442 442
 		// Delete  a series of whitespaces
443 443
 		$content = preg_replace('/ ( +)/is', ' ', $content);
444 444
 		// Truncate string
445 445
 		$content = trim(cut_str($content, $str_size, $tail));
446 446
 		// Replace back <, >, " to the original tags
447
-		$content = str_replace(array('<','>','"'),array('&lt;','&gt;','&quot;'), $content);
447
+		$content = str_replace(array('<', '>', '"'), array('&lt;', '&gt;', '&quot;'), $content);
448 448
 		// Fixed to a newline bug for consecutive sets of English letters
449
-		$content = preg_replace('/([a-z0-9\+:\/\.\~,\|\!\@\#\$\%\^\&\*\(\)\_]){20}/is',"$0-",$content);
449
+		$content = preg_replace('/([a-z0-9\+:\/\.\~,\|\!\@\#\$\%\^\&\*\(\)\_]){20}/is', "$0-", $content);
450 450
 		return $content; 
451 451
 	}
452 452
 
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 	 */
457 457
 	function requestFeedContents($rss_url)
458 458
 	{
459
-		$rss_url = str_replace('&amp;','&',Context::convertEncodingStr($rss_url));
459
+		$rss_url = str_replace('&amp;', '&', Context::convertEncodingStr($rss_url));
460 460
 		return FileHandler::getRemoteResource($rss_url, null, 3, 'GET', 'application/xml');
461 461
 	}
462 462
 
@@ -468,51 +468,51 @@  discard block
 block discarded – undo
468 468
 		$buff = $this->requestFeedContents($args->rss_url);
469 469
 
470 470
 		$encoding = preg_match("/<\?xml.*encoding=\"(.+)\".*\?>/i", $buff, $matches);
471
-		if($encoding && stripos($matches[1], "UTF-8") === FALSE) $buff = Context::convertEncodingStr($buff);
471
+		if ($encoding && stripos($matches[1], "UTF-8") === FALSE) $buff = Context::convertEncodingStr($buff);
472 472
 
473 473
 		$buff = preg_replace("/<\?xml.*\?>/i", "", $buff);
474 474
 
475 475
 		$oXmlParser = new XmlParser();
476 476
 		$xml_doc = $oXmlParser->parse($buff);
477
-		if($xml_doc->rss)
477
+		if ($xml_doc->rss)
478 478
 		{
479 479
 			$rss->title = $xml_doc->rss->channel->title->body;
480 480
 			$rss->link = $xml_doc->rss->channel->link->body;
481 481
 
482 482
 			$items = $xml_doc->rss->channel->item;
483 483
 
484
-			if(!$items) return;
485
-			if($items && !is_array($items)) $items = array($items);
484
+			if (!$items) return;
485
+			if ($items && !is_array($items)) $items = array($items);
486 486
 
487 487
 			$content_items = array();
488 488
 
489 489
 			foreach ($items as $key => $value)
490 490
 			{
491
-				if($key >= $args->list_count * $args->page_count) break;
491
+				if ($key >= $args->list_count * $args->page_count) break;
492 492
 				unset($item);
493 493
 
494
-				foreach($value as $key2 => $value2)
494
+				foreach ($value as $key2 => $value2)
495 495
 				{
496
-					if(is_array($value2)) $value2 = array_shift($value2);
496
+					if (is_array($value2)) $value2 = array_shift($value2);
497 497
 					$item->{$key2} = $this->_getRssBody($value2);
498 498
 				}
499 499
 
500 500
 				$content_item = new contentItem($rss->title);
501 501
 				$content_item->setContentsLink($rss->link);
502 502
 				$content_item->setTitle($item->title);
503
-				$content_item->setNickName(max($item->author,$item->{'dc:creator'}));
503
+				$content_item->setNickName(max($item->author, $item->{'dc:creator'}));
504 504
 				//$content_item->setCategory($item->category);
505
-				$item->description = preg_replace('!<a href=!is','<a target="_blank" rel="noopener" href=', $item->description);
505
+				$item->description = preg_replace('!<a href=!is', '<a target="_blank" rel="noopener" href=', $item->description);
506 506
 				$content_item->setContent($this->_getSummary($item->description, $args->content_cut_size));
507 507
 				$content_item->setThumbnail($this->_getRssThumbnail($item->description));
508 508
 				$content_item->setLink($item->link);
509
-				$date = date('YmdHis', strtotime(max($item->pubdate,$item->pubDate,$item->{'dc:date'})));
509
+				$date = date('YmdHis', strtotime(max($item->pubdate, $item->pubDate, $item->{'dc:date'})));
510 510
 				$content_item->setRegdate($date);
511 511
 
512 512
 				$content_items[] = $content_item;
513 513
 			}
514 514
 		}
515
-		else if($xml_doc->{'rdf:rdf'})
515
+		else if ($xml_doc->{'rdf:rdf'})
516 516
 		{
517 517
 			// rss1.0 supported (XE's XML is case-insensitive because XML parser converts all to small letters. Fixed by misol
518 518
 			$rss->title = $xml_doc->{'rdf:rdf'}->channel->title->body;
@@ -520,102 +520,102 @@  discard block
 block discarded – undo
520 520
 
521 521
 			$items = $xml_doc->{'rdf:rdf'}->item;
522 522
 
523
-			if(!$items) return;
524
-			if($items && !is_array($items)) $items = array($items);
523
+			if (!$items) return;
524
+			if ($items && !is_array($items)) $items = array($items);
525 525
 
526 526
 			$content_items = array();
527 527
 
528 528
 			foreach ($items as $key => $value)
529 529
 			{
530
-				if($key >= $args->list_count * $args->page_count) break;
530
+				if ($key >= $args->list_count * $args->page_count) break;
531 531
 				unset($item);
532 532
 
533
-				foreach($value as $key2 => $value2)
533
+				foreach ($value as $key2 => $value2)
534 534
 				{
535
-					if(is_array($value2)) $value2 = array_shift($value2);
535
+					if (is_array($value2)) $value2 = array_shift($value2);
536 536
 					$item->{$key2} = $this->_getRssBody($value2);
537 537
 				}
538 538
 
539 539
 				$content_item = new contentItem($rss->title);
540 540
 				$content_item->setContentsLink($rss->link);
541 541
 				$content_item->setTitle($item->title);
542
-				$content_item->setNickName(max($item->author,$item->{'dc:creator'}));
542
+				$content_item->setNickName(max($item->author, $item->{'dc:creator'}));
543 543
 				//$content_item->setCategory($item->category);
544
-				$item->description = preg_replace('!<a href=!is','<a target="_blank" rel="noopener" href=', $item->description);
544
+				$item->description = preg_replace('!<a href=!is', '<a target="_blank" rel="noopener" href=', $item->description);
545 545
 				$content_item->setContent($this->_getSummary($item->description, $args->content_cut_size));
546 546
 				$content_item->setThumbnail($this->_getRssThumbnail($item->description));
547 547
 				$content_item->setLink($item->link);
548
-				$date = date('YmdHis', strtotime(max($item->pubdate,$item->pubDate,$item->{'dc:date'})));
548
+				$date = date('YmdHis', strtotime(max($item->pubdate, $item->pubDate, $item->{'dc:date'})));
549 549
 				$content_item->setRegdate($date);
550 550
 
551 551
 				$content_items[] = $content_item;
552 552
 			}
553 553
 		}
554
-		else if($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom')
554
+		else if ($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom')
555 555
 		{
556 556
 			// Atom 1.0 spec supported by misol
557 557
 			$rss->title = $xml_doc->feed->title->body;
558 558
 			$links = $xml_doc->feed->link;
559
-			if(is_array($links))
559
+			if (is_array($links))
560 560
 			{
561 561
 				foreach ($links as $value)
562 562
 				{
563
-					if($value->attrs->rel == 'alternate')
563
+					if ($value->attrs->rel == 'alternate')
564 564
 					{
565 565
 						$rss->link = $value->attrs->href;
566 566
 						break;
567 567
 					}
568 568
 				}
569 569
 			}
570
-			else if($links->attrs->rel == 'alternate') $rss->link = $links->attrs->href;
570
+			else if ($links->attrs->rel == 'alternate') $rss->link = $links->attrs->href;
571 571
 
572 572
 			$items = $xml_doc->feed->entry;
573 573
 
574
-			if(!$items) return;
575
-			if($items && !is_array($items)) $items = array($items);
574
+			if (!$items) return;
575
+			if ($items && !is_array($items)) $items = array($items);
576 576
 
577 577
 			$content_items = array();
578 578
 
579 579
 			foreach ($items as $key => $value)
580 580
 			{
581
-				if($key >= $args->list_count * $args->page_count) break;
581
+				if ($key >= $args->list_count * $args->page_count) break;
582 582
 				unset($item);
583 583
 
584
-				foreach($value as $key2 => $value2)
584
+				foreach ($value as $key2 => $value2)
585 585
 				{
586
-					if(is_array($value2)) $value2 = array_shift($value2);
586
+					if (is_array($value2)) $value2 = array_shift($value2);
587 587
 					$item->{$key2} = $this->_getRssBody($value2);
588 588
 				}
589 589
 
590 590
 				$content_item = new contentItem($rss->title);
591 591
 				$links = $value->link;
592
-				if(is_array($links))
592
+				if (is_array($links))
593 593
 				{
594 594
 					foreach ($links as $val)
595 595
 					{
596
-						if($val->attrs->rel == 'alternate')
596
+						if ($val->attrs->rel == 'alternate')
597 597
 						{
598 598
 							$item->link = $val->attrs->href;
599 599
 							break;
600 600
 						}
601 601
 					}
602 602
 				}
603
-				else if($links->attrs->rel == 'alternate') $item->link = $links->attrs->href;
603
+				else if ($links->attrs->rel == 'alternate') $item->link = $links->attrs->href;
604 604
 
605 605
 				$content_item->setContentsLink($rss->link);
606
-				if($item->title)
606
+				if ($item->title)
607 607
 				{
608
-					if(stripos($value->title->attrs->type, "html") === FALSE) $item->title = $value->title->body;
608
+					if (stripos($value->title->attrs->type, "html") === FALSE) $item->title = $value->title->body;
609 609
 				}
610 610
 				$content_item->setTitle($item->title);
611
-				$content_item->setNickName(max($item->author,$item->{'dc:creator'}));
611
+				$content_item->setNickName(max($item->author, $item->{'dc:creator'}));
612 612
 				$content_item->setAuthorSite($value->author->uri->body);
613 613
 
614 614
 				//$content_item->setCategory($item->category);
615 615
 				$item->description = ($item->content) ? $item->content : $item->description = $item->summary;
616
-				$item->description = preg_replace('!<a href=!is','<a target="_blank" rel="noopener" href=', $item->description);
616
+				$item->description = preg_replace('!<a href=!is', '<a target="_blank" rel="noopener" href=', $item->description);
617 617
 
618
-				if(($item->content && stripos($value->content->attrs->type, "html") === FALSE) || (!$item->content && stripos($value->summary->attrs->type, "html") === FALSE))
618
+				if (($item->content && stripos($value->content->attrs->type, "html") === FALSE) || (!$item->content && stripos($value->summary->attrs->type, "html") === FALSE))
619 619
 				{
620 620
 					$item->description = htmlspecialchars($item->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
621 621
 
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 				$content_item->setContent($this->_getSummary($item->description, $args->content_cut_size));
625 625
 				$content_item->setThumbnail($this->_getRssThumbnail($item->description));
626 626
 				$content_item->setLink($item->link);
627
-				$date = date('YmdHis', strtotime(max($item->published,$item->updated,$item->{'dc:date'})));
627
+				$date = date('YmdHis', strtotime(max($item->published, $item->updated, $item->{'dc:date'})));
628 628
 				$content_item->setRegdate($date);
629 629
 
630 630
 				$content_items[] = $content_item;
@@ -637,15 +637,15 @@  discard block
 block discarded – undo
637 637
 	{
638 638
 		@preg_match('@<img[^>]+src\s*=\s*(?:"(.+)"|\'(.+)\'|([^\s>(?:/>)]+))@', $content, $matches);
639 639
 
640
-		if($matches[1])
640
+		if ($matches[1])
641 641
 		{
642 642
 			return $matches[1];
643 643
 		}
644
-		elseif($matches[2])
644
+		elseif ($matches[2])
645 645
 		{
646 646
 			return $matches[2];
647 647
 		}
648
-		elseif($matches[3])
648
+		elseif ($matches[3])
649 649
 		{
650 650
 			return $matches[3];
651 651
 		}
@@ -658,17 +658,17 @@  discard block
 block discarded – undo
658 658
 	function _getTrackbackItems($args)
659 659
 	{
660 660
 		$oTrackbackModel = getModel('trackback');
661
-		if(!$oTrackbackModel)
661
+		if (!$oTrackbackModel)
662 662
 		{
663 663
 			return;
664 664
 		}
665 665
 
666 666
 		$obj = new stdClass;
667 667
 		// Get categories
668
-		$output = executeQueryArray('widgets.content.getCategories',$obj);
669
-		if($output->toBool() && $output->data)
668
+		$output = executeQueryArray('widgets.content.getCategories', $obj);
669
+		if ($output->toBool() && $output->data)
670 670
 		{
671
-			foreach($output->data as $key => $val)
671
+			foreach ($output->data as $key => $val)
672 672
 			{
673 673
 				$category_lists[$val->module_srl][$val->category_srl] = $val;
674 674
 			}
@@ -681,14 +681,14 @@  discard block
 block discarded – undo
681 681
 		// Get model object from the trackback module and execute getTrackbackList() method
682 682
 		$output = $oTrackbackModel->getNewestTrackbackList($obj);
683 683
 		// If an error occurs, just ignore it.
684
-		if(!$output->toBool() || !$output->data) return;
684
+		if (!$output->toBool() || !$output->data) return;
685 685
 		// If the result exists, make each document as an object
686 686
 		$content_items = array();
687
-		foreach($output->data as $key => $item)
687
+		foreach ($output->data as $key => $item)
688 688
 		{
689 689
 			$domain = $args->module_srls_info[$item->module_srl]->domain;
690 690
 			$category = $category_lists[$item->module_srl]->text;
691
-			$url = getSiteUrl($domain,'','document_srl',$item->document_srl);
691
+			$url = getSiteUrl($domain, '', 'document_srl', $item->document_srl);
692 692
 			$browser_title = $args->module_srls_info[$item->module_srl]->browser_title;
693 693
 
694 694
 			$content_item = new contentItem($browser_title);
@@ -696,8 +696,8 @@  discard block
 block discarded – undo
696 696
 			$content_item->setTitle($item->title);
697 697
 			$content_item->setCategory($category);
698 698
 			$content_item->setNickName($item->blog_name);
699
-			$content_item->setContent($item->excerpt);  ///<<
700
-			$content_item->setDomain($domain);  ///<<
699
+			$content_item->setContent($item->excerpt); ///<<
700
+			$content_item->setDomain($domain); ///<<
701 701
 			$content_item->setLink($url);
702 702
 			$content_item->add('mid', $args->mid_lists[$item->module_srl]);
703 703
 			$content_item->setRegdate($item->regdate);
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
 		return $content_items;
707 707
 	}
708 708
 
709
-	function _compile($args,$content_items)
709
+	function _compile($args, $content_items)
710 710
 	{
711 711
 		$oTemplate = &TemplateHandler::getInstance();
712 712
 		// Set variables for widget
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
 		$widget_info->nickname_cut_size = $args->nickname_cut_size;
721 721
 		$widget_info->new_window = $args->new_window;
722 722
 
723
-		$widget_info->duration_new = $args->duration_new * 60*60;
723
+		$widget_info->duration_new = $args->duration_new * 60 * 60;
724 724
 		$widget_info->thumbnail_type = $args->thumbnail_type;
725 725
 		$widget_info->thumbnail_width = $args->thumbnail_width;
726 726
 		$widget_info->thumbnail_height = $args->thumbnail_height;
@@ -738,12 +738,12 @@  discard block
 block discarded – undo
738 738
 
739 739
 		$widget_info->markup_type = $args->markup_type;
740 740
 		// If it is a tab type, list up tab items and change key value(module_srl) to index 
741
-		if($args->tab_type != 'none' && $args->tab_type)
741
+		if ($args->tab_type != 'none' && $args->tab_type)
742 742
 		{
743 743
 			$tab = array();
744
-			foreach($args->mid_lists as $module_srl => $mid)
744
+			foreach ($args->mid_lists as $module_srl => $mid)
745 745
 			{
746
-				if(!is_array($content_items[$module_srl]) || !count($content_items[$module_srl])) continue;
746
+				if (!is_array($content_items[$module_srl]) || !count($content_items[$module_srl])) continue;
747 747
 
748 748
 				unset($tab_item);
749 749
 				$tab_item = new stdClass();
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 				$tab_item->content_items = $content_items[$module_srl];
752 752
 				$tab_item->domain = $content_items[$module_srl][0]->getDomain();
753 753
 				$tab_item->url = $content_items[$module_srl][0]->getContentsLink();
754
-				if(!$tab_item->url) $tab_item->url = getSiteUrl($tab_item->domain, '','mid',$mid);
754
+				if (!$tab_item->url) $tab_item->url = getSiteUrl($tab_item->domain, '', 'mid', $mid);
755 755
 				$tab[] = $tab_item;
756 756
 			}
757 757
 			$widget_info->tab = $tab;
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
 	var $contents_link = null;
780 780
 	var $domain = null;
781 781
 
782
-	function __construct($browser_title='')
782
+	function __construct($browser_title = '')
783 783
 	{
784 784
 		$this->browser_title = $browser_title;
785 785
 	}
@@ -789,22 +789,22 @@  discard block
 block discarded – undo
789 789
 	}
790 790
 	function setFirstThumbnailIdx($first_thumbnail_idx)
791 791
 	{
792
-		if(is_null($this->first_thumbnail) && $first_thumbnail_idx>-1)
792
+		if (is_null($this->first_thumbnail) && $first_thumbnail_idx > -1)
793 793
 		{
794 794
 			$this->has_first_thumbnail_idx = true;
795
-			$this->first_thumbnail_idx= $first_thumbnail_idx;
795
+			$this->first_thumbnail_idx = $first_thumbnail_idx;
796 796
 		}
797 797
 	}
798 798
 	function setExtraImages($extra_images)
799 799
 	{
800
-		$this->add('extra_images',$extra_images);
800
+		$this->add('extra_images', $extra_images);
801 801
 	}
802 802
 	function setDomain($domain)
803 803
 	{
804 804
 		static $default_domain = null;
805
-		if(!$domain)
805
+		if (!$domain)
806 806
 		{
807
-			if(is_null($default_domain)) $default_domain = Context::getDefaultUrl();
807
+			if (is_null($default_domain)) $default_domain = Context::getDefaultUrl();
808 808
 			$domain = $default_domain;
809 809
 		}
810 810
 		$this->domain = $domain;
@@ -868,17 +868,17 @@  discard block
 block discarded – undo
868 868
 	{
869 869
 		return $this->get('module_srl');
870 870
 	}
871
-	function getTitle($cut_size = 0, $tail='...')
871
+	function getTitle($cut_size = 0, $tail = '...')
872 872
 	{
873 873
 		$title = htmlspecialchars($this->get('title'), ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
874 874
 
875
-		if($cut_size) $title = cut_str($title, $cut_size, $tail);
875
+		if ($cut_size) $title = cut_str($title, $cut_size, $tail);
876 876
 
877 877
 		$attrs = array();
878
-		if($this->get('title_bold') == 'Y') $attrs[] = 'font-weight:bold';
879
-		if($this->get('title_color') && $this->get('title_color') != 'N') $attrs[] = 'color:#'.$this->get('title_color');
878
+		if ($this->get('title_bold') == 'Y') $attrs[] = 'font-weight:bold';
879
+		if ($this->get('title_color') && $this->get('title_color') != 'N') $attrs[] = 'color:#'.$this->get('title_color');
880 880
 
881
-		if(count($attrs)) $title = sprintf("<span style=\"%s\">%s</span>", implode(';', $attrs), $title);
881
+		if (count($attrs)) $title = sprintf("<span style=\"%s\">%s</span>", implode(';', $attrs), $title);
882 882
 
883 883
 		return $title;
884 884
 	}
@@ -890,9 +890,9 @@  discard block
 block discarded – undo
890 890
 	{
891 891
 		return $this->get('category');
892 892
 	}
893
-	function getNickName($cut_size = 0, $tail='...')
893
+	function getNickName($cut_size = 0, $tail = '...')
894 894
 	{
895
-		if($cut_size) $nick_name = cut_str($this->get('nick_name'), $cut_size, $tail);
895
+		if ($cut_size) $nick_name = cut_str($this->get('nick_name'), $cut_size, $tail);
896 896
 		else $nick_name = $this->get('nick_name');
897 897
 
898 898
 		return $nick_name;
@@ -904,12 +904,12 @@  discard block
 block discarded – undo
904 904
 	function getCommentCount()
905 905
 	{
906 906
 		$comment_count = $this->get('comment_count');
907
-		return $comment_count>0 ? $comment_count : '';
907
+		return $comment_count > 0 ? $comment_count : '';
908 908
 	}
909 909
 	function getTrackbackCount()
910 910
 	{
911 911
 		$trackback_count = $this->get('trackback_count');
912
-		return $trackback_count>0 ? $trackback_count : '';
912
+		return $trackback_count > 0 ? $trackback_count : '';
913 913
 	}
914 914
 	function getRegdate($format = 'Y.m.d H:i:s')
915 915
 	{
Please login to merge, or discard this patch.
modules/file/file.model.php 3 patches
Braces   +82 added lines, -31 removed lines patch added patch discarded remove patch
@@ -29,7 +29,9 @@  discard block
 block discarded – undo
29 29
 		$mid = Context::get('mid');
30 30
 		$editor_sequence = Context::get('editor_sequence');
31 31
 		$upload_target_srl = Context::get('upload_target_srl');
32
-		if(!$upload_target_srl) $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl;
32
+		if(!$upload_target_srl) {
33
+			$upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl;
34
+		}
33 35
 
34 36
 		if($upload_target_srl)
35 37
 		{
@@ -68,26 +70,32 @@  discard block
 block discarded – undo
68 70
 			}
69 71
 
70 72
 			$tmp_files = $this->getFiles($upload_target_srl);
71
-			if(!$tmp_files) $tmp_files = array();
73
+			if(!$tmp_files) {
74
+				$tmp_files = array();
75
+			}
72 76
 
73 77
 			foreach($tmp_files as $file_info)
74 78
 			{
75
-				if(!$file_info->file_srl) continue;
79
+				if(!$file_info->file_srl) {
80
+					continue;
81
+				}
76 82
 
77 83
 				$obj = new stdClass;
78 84
 				$obj->file_srl = $file_info->file_srl;
79 85
 				$obj->source_filename = $file_info->source_filename;
80 86
 				$obj->file_size = $file_info->file_size;
81 87
 				$obj->disp_file_size = FileHandler::filesize($file_info->file_size);
82
-				if($file_info->direct_download=='N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl);
83
-				else $obj->download_url = str_replace('./', '', $file_info->uploaded_filename);
88
+				if($file_info->direct_download=='N') {
89
+					$obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl);
90
+				} else {
91
+					$obj->download_url = str_replace('./', '', $file_info->uploaded_filename);
92
+				}
84 93
 				$obj->direct_download = $file_info->direct_download;
85 94
 				$obj->cover_image = ($file_info->cover_image === 'Y') ? true : false;
86 95
 				$files[] = $obj;
87 96
 				$attached_size += $file_info->file_size;
88 97
 			}
89
-		}
90
-		else
98
+		} else
91 99
 		{
92 100
 			$upload_target_srl = 0;
93 101
 			$attached_size = 0;
@@ -155,8 +163,12 @@  discard block
 block discarded – undo
155 163
 
156 164
 		$file_module_config = $oModuleModel->getModuleConfig('file');
157 165
 
158
-		if($module_srl) $file_config = $oModuleModel->getModulePartConfig('file',$module_srl);
159
-		if(!$file_config) $file_config = $file_module_config;
166
+		if($module_srl) {
167
+			$file_config = $oModuleModel->getModulePartConfig('file',$module_srl);
168
+		}
169
+		if(!$file_config) {
170
+			$file_config = $file_module_config;
171
+		}
160 172
 
161 173
 		$config = new stdClass();
162 174
 
@@ -171,25 +183,53 @@  discard block
 block discarded – undo
171 183
 			$config->allow_outlink_format = $file_config->allow_outlink_format;
172 184
 		}
173 185
 		// Property for all files comes first than each property
174
-		if(!$config->allowed_filesize) $config->allowed_filesize = $file_module_config->allowed_filesize;
175
-		if(!$config->allowed_attach_size) $config->allowed_attach_size = $file_module_config->allowed_attach_size;
176
-		if(!$config->allowed_filetypes) $config->allowed_filetypes = $file_module_config->allowed_filetypes;
177
-		if(!$config->allow_outlink) $config->allow_outlink = $file_module_config->allow_outlink;
178
-		if(!$config->allow_outlink_site) $config->allow_outlink_site = $file_module_config->allow_outlink_site;
179
-		if(!$config->allow_outlink_format) $config->allow_outlink_format = $file_module_config->allow_outlink_format;
180
-		if(!$config->download_grant) $config->download_grant = $file_module_config->download_grant;
186
+		if(!$config->allowed_filesize) {
187
+			$config->allowed_filesize = $file_module_config->allowed_filesize;
188
+		}
189
+		if(!$config->allowed_attach_size) {
190
+			$config->allowed_attach_size = $file_module_config->allowed_attach_size;
191
+		}
192
+		if(!$config->allowed_filetypes) {
193
+			$config->allowed_filetypes = $file_module_config->allowed_filetypes;
194
+		}
195
+		if(!$config->allow_outlink) {
196
+			$config->allow_outlink = $file_module_config->allow_outlink;
197
+		}
198
+		if(!$config->allow_outlink_site) {
199
+			$config->allow_outlink_site = $file_module_config->allow_outlink_site;
200
+		}
201
+		if(!$config->allow_outlink_format) {
202
+			$config->allow_outlink_format = $file_module_config->allow_outlink_format;
203
+		}
204
+		if(!$config->download_grant) {
205
+			$config->download_grant = $file_module_config->download_grant;
206
+		}
181 207
 		// Default setting if not exists
182
-		if(!$config->allowed_filesize) $config->allowed_filesize = '2';
183
-		if(!$config->allowed_attach_size) $config->allowed_attach_size = '3';
184
-		if(!$config->allowed_filetypes) $config->allowed_filetypes = '*.*';
185
-		if(!$config->allow_outlink) $config->allow_outlink = 'Y';
186
-		if(!$config->download_grant) $config->download_grant = array();
208
+		if(!$config->allowed_filesize) {
209
+			$config->allowed_filesize = '2';
210
+		}
211
+		if(!$config->allowed_attach_size) {
212
+			$config->allowed_attach_size = '3';
213
+		}
214
+		if(!$config->allowed_filetypes) {
215
+			$config->allowed_filetypes = '*.*';
216
+		}
217
+		if(!$config->allow_outlink) {
218
+			$config->allow_outlink = 'Y';
219
+		}
220
+		if(!$config->download_grant) {
221
+			$config->download_grant = array();
222
+		}
187 223
 
188 224
 		$size = ini_get('upload_max_filesize');
189 225
 		$unit = strtolower($size[strlen($size) - 1]);
190 226
 		$size = (float)$size;
191
-		if($unit == 'g') $size *= 1024;
192
-		if($unit == 'k') $size /= 1024;
227
+		if($unit == 'g') {
228
+			$size *= 1024;
229
+		}
230
+		if($unit == 'k') {
231
+			$size /= 1024;
232
+		}
193 233
 
194 234
 		if($config->allowed_filesize > $size) 
195 235
 		{	
@@ -215,7 +255,9 @@  discard block
 block discarded – undo
215 255
 		$args = new stdClass();
216 256
 		$args->file_srl = $file_srl;
217 257
 		$output = executeQueryArray('file.getFile', $args, $columnList);
218
-		if(!$output->toBool()) return $output;
258
+		if(!$output->toBool()) {
259
+			return $output;
260
+		}
219 261
 
220 262
 		// old version compatibility
221 263
 		if(count($output->data) == 1)
@@ -224,8 +266,7 @@  discard block
 block discarded – undo
224 266
 			$file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid, $file->module_srl);
225 267
 
226 268
 			return $file;
227
-		}
228
-		else
269
+		} else
229 270
 		{
230 271
 			$fileList = array();
231 272
 
@@ -255,13 +296,19 @@  discard block
 block discarded – undo
255 296
 		$args = new stdClass();
256 297
 		$args->upload_target_srl = $upload_target_srl;
257 298
 		$args->sort_index = $sortIndex;
258
-		if($ckValid) $args->isvalid = 'Y';
299
+		if($ckValid) {
300
+			$args->isvalid = 'Y';
301
+		}
259 302
 		$output = executeQueryArray('file.getFiles', $args, $columnList);
260
-		if(!$output->data) return;
303
+		if(!$output->data) {
304
+			return;
305
+		}
261 306
 
262 307
 		$file_list = $output->data;
263 308
 
264
-		if($file_list && !is_array($file_list)) $file_list = array($file_list);
309
+		if($file_list && !is_array($file_list)) {
310
+			$file_list = array($file_list);
311
+		}
265 312
 
266 313
 		foreach ($file_list as &$file)
267 314
 		{
@@ -346,7 +393,9 @@  discard block
 block discarded – undo
346 393
 	 */
347 394
 	function getFileGrant($file_info, $member_info)
348 395
 	{
349
-		if(!$file_info) return null;
396
+		if(!$file_info) {
397
+			return null;
398
+		}
350 399
 
351 400
 		if($_SESSION['__XE_UPLOADING_FILES_INFO__'][$file_info->file_srl])
352 401
 		{
@@ -359,7 +408,9 @@  discard block
 block discarded – undo
359 408
 
360 409
 		$oDocumentModel = getModel('document');
361 410
 		$oDocument = $oDocumentModel->getDocument($file_info->upload_target_srl);
362
-		if($oDocument->isExists()) $document_grant = $oDocument->isGranted();
411
+		if($oDocument->isExists()) {
412
+			$document_grant = $oDocument->isGranted();
413
+		}
363 414
 
364 415
 		$file_grant->is_deletable = ($document_grant || $member_info->is_admin == 'Y' || $member_info->member_srl == $file_info->member_srl || $grant->manager);
365 416
 
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	 * It is used when a file list of the upload_target_srl is requested for creating/updating a document.
21 21
 	 * Attempt to replace with sever-side session if upload_target_srl is not yet determined
22 22
 	 *
23
-	 * @return void
23
+	 * @return BaseObject|null
24 24
 	 */
25 25
 	function getFileList()
26 26
 	{
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 * Get file configurations
147 147
 	 *
148 148
 	 * @param int $module_srl If set this, returns specific module's configuration. Otherwise returns global configuration.
149
-	 * @return object Returns configuration.
149
+	 * @return stdClass Returns configuration.
150 150
 	 */
151 151
 	function getFileConfig($module_srl = null)
152 152
 	{
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 	/**
277 277
 	 * Return configurations of the attachement (it automatically checks if an administrator is)
278 278
 	 *
279
-	 * @return object Returns a file configuration of current module. If user is admin, returns PHP's max file size and allow all file types.
279
+	 * @return stdClass Returns a file configuration of current module. If user is admin, returns PHP's max file size and allow all file types.
280 280
 	 */
281 281
 	function getUploadConfig()
282 282
 	{
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 	 * Return file configuration of the module
331 331
 	 *
332 332
 	 * @param int $module_srl The sequence of module to get configuration
333
-	 * @return object
333
+	 * @return stdClass
334 334
 	 */
335 335
 	function getFileModuleConfig($module_srl)
336 336
 	{
Please login to merge, or discard this patch.
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
 		$mid = Context::get('mid');
30 30
 		$editor_sequence = Context::get('editor_sequence');
31 31
 		$upload_target_srl = Context::get('upload_target_srl');
32
-		if(!$upload_target_srl) $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl;
32
+		if (!$upload_target_srl) $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl;
33 33
 
34
-		if($upload_target_srl)
34
+		if ($upload_target_srl)
35 35
 		{
36 36
 			$oDocumentModel = getModel('document');
37 37
 			$oCommentModel = getModel('comment');
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
 			$oDocument = $oDocumentModel->getDocument($upload_target_srl);
41 41
 
42 42
 			// comment 권한 확인
43
-			if(!$oDocument->isExists())
43
+			if (!$oDocument->isExists())
44 44
 			{
45 45
 				$oComment = $oCommentModel->getComment($upload_target_srl);
46
-				if($oComment->isExists() && $oComment->isSecret() && !$oComment->isGranted())
46
+				if ($oComment->isExists() && $oComment->isSecret() && !$oComment->isGranted())
47 47
 				{
48 48
 					return new BaseObject(-1, 'msg_not_permitted');
49 49
 				}
@@ -52,34 +52,34 @@  discard block
 block discarded – undo
52 52
 			}
53 53
 
54 54
 			// document 권한 확인
55
-			if($oDocument->isExists() && $oDocument->isSecret() && !$oDocument->isGranted())
55
+			if ($oDocument->isExists() && $oDocument->isSecret() && !$oDocument->isGranted())
56 56
 			{
57 57
 				return new BaseObject(-1, 'msg_not_permitted');
58 58
 			}
59 59
 
60 60
 			// 모듈 권한 확인
61
-			if($oDocument->isExists())
61
+			if ($oDocument->isExists())
62 62
 			{
63 63
 				$grant = $oModuleModel->getGrant($oModuleModel->getModuleInfoByModuleSrl($oDocument->get('module_srl')), $logged_info);
64
-				if(!$grant->access)
64
+				if (!$grant->access)
65 65
 				{
66 66
 					return new BaseObject(-1, 'msg_not_permitted');
67 67
 				}
68 68
 			}
69 69
 
70 70
 			$tmp_files = $this->getFiles($upload_target_srl);
71
-			if(!$tmp_files) $tmp_files = array();
71
+			if (!$tmp_files) $tmp_files = array();
72 72
 
73
-			foreach($tmp_files as $file_info)
73
+			foreach ($tmp_files as $file_info)
74 74
 			{
75
-				if(!$file_info->file_srl) continue;
75
+				if (!$file_info->file_srl) continue;
76 76
 
77 77
 				$obj = new stdClass;
78 78
 				$obj->file_srl = $file_info->file_srl;
79 79
 				$obj->source_filename = $file_info->source_filename;
80 80
 				$obj->file_size = $file_info->file_size;
81 81
 				$obj->disp_file_size = FileHandler::filesize($file_info->file_size);
82
-				if($file_info->direct_download=='N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl);
82
+				if ($file_info->direct_download == 'N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl);
83 83
 				else $obj->download_url = str_replace('./', '', $file_info->uploaded_filename);
84 84
 				$obj->direct_download = $file_info->direct_download;
85 85
 				$obj->cover_image = ($file_info->cover_image === 'Y') ? true : false;
@@ -99,17 +99,17 @@  discard block
 block discarded – undo
99 99
 		//$config = $oModuleModel->getModuleInfoByMid($mid);	//perhaps config varialbles not used
100 100
 
101 101
 		$file_config = $this->getUploadConfig();
102
-		$left_size = $file_config->allowed_attach_size*1024*1024 - $attached_size;
102
+		$left_size = $file_config->allowed_attach_size * 1024 * 1024 - $attached_size;
103 103
 		// Settings of required information
104 104
 		$attached_size = FileHandler::filesize($attached_size);
105
-		$allowed_attach_size = FileHandler::filesize($file_config->allowed_attach_size*1024*1024);
106
-		$allowed_filesize = FileHandler::filesize($file_config->allowed_filesize*1024*1024);
105
+		$allowed_attach_size = FileHandler::filesize($file_config->allowed_attach_size * 1024 * 1024);
106
+		$allowed_filesize = FileHandler::filesize($file_config->allowed_filesize * 1024 * 1024);
107 107
 		$allowed_filetypes = $file_config->allowed_filetypes;
108
-		$this->add("files",$files);
109
-		$this->add("editor_sequence",$editor_sequence);
110
-		$this->add("upload_target_srl",$upload_target_srl);
111
-		$this->add("upload_status",$upload_status);
112
-		$this->add("left_size",$left_size);
108
+		$this->add("files", $files);
109
+		$this->add("editor_sequence", $editor_sequence);
110
+		$this->add("upload_target_srl", $upload_target_srl);
111
+		$this->add("upload_status", $upload_status);
112
+		$this->add("left_size", $left_size);
113 113
 		$this->add('attached_size', $attached_size);
114 114
 		$this->add('allowed_attach_size', $allowed_attach_size);
115 115
 		$this->add('allowed_filesize', $allowed_filesize);
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 		$args = new stdClass();
128 128
 		$args->upload_target_srl = $upload_target_srl;
129 129
 		$output = executeQuery('file.getFilesCount', $args);
130
-		return (int)$output->data->count;
130
+		return (int) $output->data->count;
131 131
 	}
132 132
 
133 133
 	/**
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 	 * @param string $sid
138 138
 	 * @return string Returns a url
139 139
 	 */
140
-	function getDownloadUrl($file_srl, $sid, $module_srl="")
140
+	function getDownloadUrl($file_srl, $sid, $module_srl = "")
141 141
 	{
142 142
 		return sprintf('?module=%s&amp;act=%s&amp;file_srl=%s&amp;sid=%s&amp;module_srl=%s', 'file', 'procFileDownload', $file_srl, $sid, $module_srl);
143 143
 	}
@@ -155,12 +155,12 @@  discard block
 block discarded – undo
155 155
 
156 156
 		$file_module_config = $oModuleModel->getModuleConfig('file');
157 157
 
158
-		if($module_srl) $file_config = $oModuleModel->getModulePartConfig('file',$module_srl);
159
-		if(!$file_config) $file_config = $file_module_config;
158
+		if ($module_srl) $file_config = $oModuleModel->getModulePartConfig('file', $module_srl);
159
+		if (!$file_config) $file_config = $file_module_config;
160 160
 
161 161
 		$config = new stdClass();
162 162
 
163
-		if($file_config)
163
+		if ($file_config)
164 164
 		{
165 165
 			$config->allowed_filesize = $file_config->allowed_filesize;
166 166
 			$config->allowed_attach_size = $file_config->allowed_attach_size;
@@ -171,31 +171,31 @@  discard block
 block discarded – undo
171 171
 			$config->allow_outlink_format = $file_config->allow_outlink_format;
172 172
 		}
173 173
 		// Property for all files comes first than each property
174
-		if(!$config->allowed_filesize) $config->allowed_filesize = $file_module_config->allowed_filesize;
175
-		if(!$config->allowed_attach_size) $config->allowed_attach_size = $file_module_config->allowed_attach_size;
176
-		if(!$config->allowed_filetypes) $config->allowed_filetypes = $file_module_config->allowed_filetypes;
177
-		if(!$config->allow_outlink) $config->allow_outlink = $file_module_config->allow_outlink;
178
-		if(!$config->allow_outlink_site) $config->allow_outlink_site = $file_module_config->allow_outlink_site;
179
-		if(!$config->allow_outlink_format) $config->allow_outlink_format = $file_module_config->allow_outlink_format;
180
-		if(!$config->download_grant) $config->download_grant = $file_module_config->download_grant;
174
+		if (!$config->allowed_filesize) $config->allowed_filesize = $file_module_config->allowed_filesize;
175
+		if (!$config->allowed_attach_size) $config->allowed_attach_size = $file_module_config->allowed_attach_size;
176
+		if (!$config->allowed_filetypes) $config->allowed_filetypes = $file_module_config->allowed_filetypes;
177
+		if (!$config->allow_outlink) $config->allow_outlink = $file_module_config->allow_outlink;
178
+		if (!$config->allow_outlink_site) $config->allow_outlink_site = $file_module_config->allow_outlink_site;
179
+		if (!$config->allow_outlink_format) $config->allow_outlink_format = $file_module_config->allow_outlink_format;
180
+		if (!$config->download_grant) $config->download_grant = $file_module_config->download_grant;
181 181
 		// Default setting if not exists
182
-		if(!$config->allowed_filesize) $config->allowed_filesize = '2';
183
-		if(!$config->allowed_attach_size) $config->allowed_attach_size = '3';
184
-		if(!$config->allowed_filetypes) $config->allowed_filetypes = '*.*';
185
-		if(!$config->allow_outlink) $config->allow_outlink = 'Y';
186
-		if(!$config->download_grant) $config->download_grant = array();
182
+		if (!$config->allowed_filesize) $config->allowed_filesize = '2';
183
+		if (!$config->allowed_attach_size) $config->allowed_attach_size = '3';
184
+		if (!$config->allowed_filetypes) $config->allowed_filetypes = '*.*';
185
+		if (!$config->allow_outlink) $config->allow_outlink = 'Y';
186
+		if (!$config->download_grant) $config->download_grant = array();
187 187
 
188 188
 		$size = ini_get('upload_max_filesize');
189 189
 		$unit = strtolower($size[strlen($size) - 1]);
190
-		$size = (float)$size;
191
-		if($unit == 'g') $size *= 1024;
192
-		if($unit == 'k') $size /= 1024;
190
+		$size = (float) $size;
191
+		if ($unit == 'g') $size *= 1024;
192
+		if ($unit == 'k') $size /= 1024;
193 193
 
194
-		if($config->allowed_filesize > $size) 
194
+		if ($config->allowed_filesize > $size) 
195 195
 		{	
196 196
 			$config->allowed_filesize = $size;
197 197
 		}
198
-		if($config->allowed_attach_size > $size) 
198
+		if ($config->allowed_attach_size > $size) 
199 199
 		{
200 200
 			$config->allowed_attach_size = $size;
201 201
 		}
@@ -215,10 +215,10 @@  discard block
 block discarded – undo
215 215
 		$args = new stdClass();
216 216
 		$args->file_srl = $file_srl;
217 217
 		$output = executeQueryArray('file.getFile', $args, $columnList);
218
-		if(!$output->toBool()) return $output;
218
+		if (!$output->toBool()) return $output;
219 219
 
220 220
 		// old version compatibility
221
-		if(count($output->data) == 1)
221
+		if (count($output->data) == 1)
222 222
 		{
223 223
 			$file = $output->data[0];
224 224
 			$file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid, $file->module_srl);
@@ -229,9 +229,9 @@  discard block
 block discarded – undo
229 229
 		{
230 230
 			$fileList = array();
231 231
 
232
-			if(is_array($output->data))
232
+			if (is_array($output->data))
233 233
 			{
234
-				foreach($output->data as $key=>$value)
234
+				foreach ($output->data as $key=>$value)
235 235
 				{
236 236
 					$file = $value;
237 237
 					$file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid, $file->module_srl);
@@ -255,13 +255,13 @@  discard block
 block discarded – undo
255 255
 		$args = new stdClass();
256 256
 		$args->upload_target_srl = $upload_target_srl;
257 257
 		$args->sort_index = $sortIndex;
258
-		if($ckValid) $args->isvalid = 'Y';
258
+		if ($ckValid) $args->isvalid = 'Y';
259 259
 		$output = executeQueryArray('file.getFiles', $args, $columnList);
260
-		if(!$output->data) return;
260
+		if (!$output->data) return;
261 261
 
262 262
 		$file_list = $output->data;
263 263
 
264
-		if($file_list && !is_array($file_list)) $file_list = array($file_list);
264
+		if ($file_list && !is_array($file_list)) $file_list = array($file_list);
265 265
 
266 266
 		foreach ($file_list as &$file)
267 267
 		{
@@ -284,14 +284,14 @@  discard block
 block discarded – undo
284 284
 
285 285
 		$module_srl = Context::get('module_srl');
286 286
 		// Get the current module if module_srl doesn't exist
287
-		if(!$module_srl)
287
+		if (!$module_srl)
288 288
 		{
289 289
 			$current_module_info = Context::get('current_module_info');
290 290
 			$module_srl = $current_module_info->module_srl;
291 291
 		}
292 292
 		$file_config = $this->getFileConfig($module_srl);
293 293
 
294
-		if($logged_info->is_admin == 'Y')
294
+		if ($logged_info->is_admin == 'Y')
295 295
 		{
296 296
 			$iniPostMaxSize = FileHandler::returnbytes(ini_get('post_max_size'));
297 297
 			$iniUploadMaxSize = FileHandler::returnbytes(ini_get('upload_max_filesize'));
@@ -317,9 +317,9 @@  discard block
 block discarded – undo
317 317
 			'%s : %s/ %s<br /> %s : %s (%s : %s)',
318 318
 			Context::getLang('allowed_attach_size'),
319 319
 			FileHandler::filesize($attached_size),
320
-			FileHandler::filesize($file_config->allowed_attach_size*1024*1024),
320
+			FileHandler::filesize($file_config->allowed_attach_size * 1024 * 1024),
321 321
 			Context::getLang('allowed_filesize'),
322
-			FileHandler::filesize($file_config->allowed_filesize*1024*1024),
322
+			FileHandler::filesize($file_config->allowed_filesize * 1024 * 1024),
323 323
 			Context::getLang('allowed_filetypes'),
324 324
 			$file_config->allowed_filetypes
325 325
 		);
@@ -346,9 +346,9 @@  discard block
 block discarded – undo
346 346
 	 */
347 347
 	function getFileGrant($file_info, $member_info)
348 348
 	{
349
-		if(!$file_info) return null;
349
+		if (!$file_info) return null;
350 350
 
351
-		if($_SESSION['__XE_UPLOADING_FILES_INFO__'][$file_info->file_srl])
351
+		if ($_SESSION['__XE_UPLOADING_FILES_INFO__'][$file_info->file_srl])
352 352
 		{
353 353
 			$file_grant->is_deletable = true;
354 354
 			return $file_grant;
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 
360 360
 		$oDocumentModel = getModel('document');
361 361
 		$oDocument = $oDocumentModel->getDocument($file_info->upload_target_srl);
362
-		if($oDocument->isExists()) $document_grant = $oDocument->isGranted();
362
+		if ($oDocument->isExists()) $document_grant = $oDocument->isGranted();
363 363
 
364 364
 		$file_grant->is_deletable = ($document_grant || $member_info->is_admin == 'Y' || $member_info->member_srl == $file_info->member_srl || $grant->manager);
365 365
 
Please login to merge, or discard this patch.
modules/board/board.controller.php 2 patches
Braces   +47 added lines, -24 removed lines patch added patch discarded remove patch
@@ -36,26 +36,39 @@  discard block
 block discarded – undo
36 36
 		// setup variables
37 37
 		$obj = Context::getRequestVars();
38 38
 		$obj->module_srl = $this->module_srl;
39
-		if($obj->is_notice!='Y'||!$this->grant->manager) $obj->is_notice = 'N';
39
+		if($obj->is_notice!='Y'||!$this->grant->manager) {
40
+			$obj->is_notice = 'N';
41
+		}
40 42
 		$obj->commentStatus = $obj->comment_status;
41 43
 
42 44
 		$oModuleModel = getModel('module');
43 45
 		$module_config = $oModuleModel->getModuleInfoByModuleSrl($obj->module_srl);
44 46
 		if($module_config->mobile_use_editor === 'Y')
45 47
 		{
46
-			if(!isset($obj->use_editor)) $obj->use_editor = 'Y';
47
-			if(!isset($obj->use_html)) $obj->use_html = 'Y';
48
-		}
49
-		else
48
+			if(!isset($obj->use_editor)) {
49
+				$obj->use_editor = 'Y';
50
+			}
51
+			if(!isset($obj->use_html)) {
52
+				$obj->use_html = 'Y';
53
+			}
54
+		} else
50 55
 		{
51
-			if(!isset($obj->use_editor)) $obj->use_editor = 'N';
52
-			if(!isset($obj->use_html)) $obj->use_html = 'N';
56
+			if(!isset($obj->use_editor)) {
57
+				$obj->use_editor = 'N';
58
+			}
59
+			if(!isset($obj->use_html)) {
60
+				$obj->use_html = 'N';
61
+			}
53 62
 		}
54 63
 
55 64
 		settype($obj->title, "string");
56
-		if($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...');
65
+		if($obj->title == '') {
66
+			$obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...');
67
+		}
57 68
 		//setup dpcument title tp 'Untitled'
58
-		if($obj->title == '') $obj->title = 'Untitled';
69
+		if($obj->title == '') {
70
+			$obj->title = 'Untitled';
71
+		}
59 72
 
60 73
 		// unset document style if the user is not the document manager
61 74
 		if(!$this->grant->manager)
@@ -96,8 +109,7 @@  discard block
 block discarded – undo
96 109
 			{
97 110
 				$oDocument->add('member_srl', $obj->member_srl);
98 111
 			}
99
-		}
100
-		else
112
+		} else
101 113
 		{
102 114
 			$bAnonymous = false;
103 115
 		}
@@ -169,7 +181,9 @@  discard block
 block discarded – undo
169 181
 				for($i=0;$i<count($target_mail);$i++)
170 182
 				{
171 183
 					$email_address = trim($target_mail[$i]);
172
-					if(!$email_address) continue;
184
+					if(!$email_address) {
185
+						continue;
186
+					}
173 187
 					$oMail->setReceiptor($email_address, $email_address);
174 188
 					$oMail->send();
175 189
 				}
@@ -263,7 +277,9 @@  discard block
 block discarded – undo
263 277
 		$obj = Context::getRequestVars();
264 278
 		$obj->module_srl = $this->module_srl;
265 279
 
266
-		if(!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC';
280
+		if(!$this->module_info->use_status) {
281
+			$this->module_info->use_status = 'PUBLIC';
282
+		}
267 283
 		if(!is_array($this->module_info->use_status))
268 284
 		{
269 285
 			$this->module_info->use_status = explode('|@|', $this->module_info->use_status);
@@ -272,8 +288,7 @@  discard block
 block discarded – undo
272 288
 		if(in_array('SECRET', $this->module_info->use_status))
273 289
 		{
274 290
 			$this->module_info->secret = 'Y';
275
-		}
276
-		else
291
+		} else
277 292
 		{
278 293
 			unset($obj->is_secret);
279 294
 			$this->module_info->secret = 'N';
@@ -283,13 +298,20 @@  discard block
 block discarded – undo
283 298
 		$module_config = $oModuleModel->getModuleInfoByModuleSrl($obj->module_srl);
284 299
 		if($module_config->mobile_use_editor === 'Y')
285 300
 		{
286
-			if(!isset($obj->use_editor)) $obj->use_editor = 'Y';
287
-			if(!isset($obj->use_html)) $obj->use_html = 'Y';
288
-		}
289
-		else
301
+			if(!isset($obj->use_editor)) {
302
+				$obj->use_editor = 'Y';
303
+			}
304
+			if(!isset($obj->use_html)) {
305
+				$obj->use_html = 'Y';
306
+			}
307
+		} else
290 308
 		{
291
-			if(!isset($obj->use_editor)) $obj->use_editor = 'N';
292
-			if(!isset($obj->use_html)) $obj->use_html = 'N';
309
+			if(!isset($obj->use_editor)) {
310
+				$obj->use_editor = 'N';
311
+			}
312
+			if(!isset($obj->use_html)) {
313
+				$obj->use_html = 'N';
314
+			}
293 315
 		}
294 316
 
295 317
 		// check if the doument is existed
@@ -309,8 +331,7 @@  discard block
 block discarded – undo
309 331
 			$obj->email_address = $obj->homepage = $obj->user_id = '';
310 332
 			$obj->user_name = $obj->nick_name = 'anonymous';
311 333
 			$bAnonymous = true;
312
-		}
313
-		else
334
+		} else
314 335
 		{
315 336
 			$bAnonymous = false;
316 337
 		}
@@ -416,7 +437,9 @@  discard block
 block discarded – undo
416 437
 		// generate trackback module controller object
417 438
 		$oTrackbackController = getController('trackback');
418 439
 
419
-		if(!$oTrackbackController) return;
440
+		if(!$oTrackbackController) {
441
+			return;
442
+		}
420 443
 
421 444
 		$output = $oTrackbackController->deleteTrackback($trackback_srl, $this->grant->manager);
422 445
 		if(!$output->toBool())
Please login to merge, or discard this patch.
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
 	function procBoardInsertDocument()
24 24
 	{
25 25
 		// check grant
26
-		if($this->module_info->module != "board")
26
+		if ($this->module_info->module != "board")
27 27
 		{
28 28
 			return new BaseObject(-1, "msg_invalid_request");
29 29
 		}
30
-		if(!$this->grant->write_document)
30
+		if (!$this->grant->write_document)
31 31
 		{
32 32
 			return new BaseObject(-1, 'msg_not_permitted');
33 33
 		}
@@ -36,29 +36,29 @@  discard block
 block discarded – undo
36 36
 		// setup variables
37 37
 		$obj = Context::getRequestVars();
38 38
 		$obj->module_srl = $this->module_srl;
39
-		if($obj->is_notice!='Y'||!$this->grant->manager) $obj->is_notice = 'N';
39
+		if ($obj->is_notice != 'Y' || !$this->grant->manager) $obj->is_notice = 'N';
40 40
 		$obj->commentStatus = $obj->comment_status;
41 41
 
42 42
 		$oModuleModel = getModel('module');
43 43
 		$module_config = $oModuleModel->getModuleInfoByModuleSrl($obj->module_srl);
44
-		if($module_config->mobile_use_editor === 'Y')
44
+		if ($module_config->mobile_use_editor === 'Y')
45 45
 		{
46
-			if(!isset($obj->use_editor)) $obj->use_editor = 'Y';
47
-			if(!isset($obj->use_html)) $obj->use_html = 'Y';
46
+			if (!isset($obj->use_editor)) $obj->use_editor = 'Y';
47
+			if (!isset($obj->use_html)) $obj->use_html = 'Y';
48 48
 		}
49 49
 		else
50 50
 		{
51
-			if(!isset($obj->use_editor)) $obj->use_editor = 'N';
52
-			if(!isset($obj->use_html)) $obj->use_html = 'N';
51
+			if (!isset($obj->use_editor)) $obj->use_editor = 'N';
52
+			if (!isset($obj->use_html)) $obj->use_html = 'N';
53 53
 		}
54 54
 
55 55
 		settype($obj->title, "string");
56
-		if($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...');
56
+		if ($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))), 20, '...');
57 57
 		//setup dpcument title tp 'Untitled'
58
-		if($obj->title == '') $obj->title = 'Untitled';
58
+		if ($obj->title == '') $obj->title = 'Untitled';
59 59
 
60 60
 		// unset document style if the user is not the document manager
61
-		if(!$this->grant->manager)
61
+		if (!$this->grant->manager)
62 62
 		{
63 63
 			unset($obj->title_color);
64 64
 			unset($obj->title_bold);
@@ -75,24 +75,24 @@  discard block
 block discarded – undo
75 75
 
76 76
 		// update the document if it is existed
77 77
 		$is_update = false;
78
-		if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl)
78
+		if ($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl)
79 79
 		{
80 80
 			$is_update = true;
81 81
 		}
82 82
 
83 83
 		// if use anonymous is true
84
-		if($this->module_info->use_anonymous == 'Y')
84
+		if ($this->module_info->use_anonymous == 'Y')
85 85
 		{
86 86
 			$this->module_info->admin_mail = '';
87 87
 			$obj->notify_message = 'N';
88
-			if($is_update===false)
88
+			if ($is_update === false)
89 89
 			{
90
-				$obj->member_srl = -1*$logged_info->member_srl;
90
+				$obj->member_srl = -1 * $logged_info->member_srl;
91 91
 			}
92 92
 			$obj->email_address = $obj->homepage = $obj->user_id = '';
93 93
 			$obj->user_name = $obj->nick_name = 'anonymous';
94 94
 			$bAnonymous = true;
95
-			if($is_update===false)
95
+			if ($is_update === false)
96 96
 			{
97 97
 				$oDocument->add('member_srl', $obj->member_srl);
98 98
 			}
@@ -102,10 +102,10 @@  discard block
 block discarded – undo
102 102
 			$bAnonymous = false;
103 103
 		}
104 104
 
105
-		if($obj->is_secret == 'Y' || strtoupper($obj->status == 'SECRET'))
105
+		if ($obj->is_secret == 'Y' || strtoupper($obj->status == 'SECRET'))
106 106
 		{
107 107
 			$use_status = explode('|@|', $this->module_info->use_status);
108
-			if(!is_array($use_status) || !in_array('SECRET', $use_status))
108
+			if (!is_array($use_status) || !in_array('SECRET', $use_status))
109 109
 			{
110 110
 				unset($obj->is_secret);
111 111
 				$obj->status = 'PUBLIC';
@@ -113,24 +113,24 @@  discard block
 block discarded – undo
113 113
 		}
114 114
 
115 115
 		// update the document if it is existed
116
-		if($is_update)
116
+		if ($is_update)
117 117
 		{
118
-			if(!$oDocument->isGranted())
118
+			if (!$oDocument->isGranted())
119 119
 			{
120
-				return new BaseObject(-1,'msg_not_permitted');
120
+				return new BaseObject(-1, 'msg_not_permitted');
121 121
 			}
122 122
 
123
-			if($this->module_info->use_anonymous == 'Y') {
123
+			if ($this->module_info->use_anonymous == 'Y') {
124 124
 				$obj->member_srl = abs($oDocument->get('member_srl')) * -1;
125 125
 				$oDocument->add('member_srl', $obj->member_srl);
126 126
 			}
127 127
 
128
-			if($this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false)
128
+			if ($this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false)
129 129
 			{
130
-				return new BaseObject(-1,'msg_protect_content');
130
+				return new BaseObject(-1, 'msg_protect_content');
131 131
 			}
132 132
 
133
-			if(!$this->grant->manager)
133
+			if (!$this->grant->manager)
134 134
 			{
135 135
 				// notice & document style same as before if not manager
136 136
 				$obj->is_notice = $oDocument->get('is_notice');
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 			}
140 140
 			
141 141
 			// modify list_order if document status is temp
142
-			if($oDocument->get('status') == 'TEMP')
142
+			if ($oDocument->get('status') == 'TEMP')
143 143
 			{
144 144
 				$obj->last_update = $obj->regdate = date('YmdHis');
145 145
 				$obj->update_order = $obj->list_order = (getNextSequence() * -1);
@@ -155,21 +155,21 @@  discard block
 block discarded – undo
155 155
 			$obj->document_srl = $output->get('document_srl');
156 156
 
157 157
 			// send an email to admin user
158
-			if($output->toBool() && $this->module_info->admin_mail)
158
+			if ($output->toBool() && $this->module_info->admin_mail)
159 159
 			{
160 160
 				$oModuleModel = getModel('module');
161 161
 				$member_config = $oModuleModel->getModuleConfig('member');
162 162
 				
163 163
 				$oMail = new Mail();
164 164
 				$oMail->setTitle($obj->title);
165
-				$oMail->setContent( sprintf("From : <a href=\"%s\">%s</a><br/>\r\n%s", getFullUrl('','document_srl',$obj->document_srl), getFullUrl('','document_srl',$obj->document_srl), $obj->content));
165
+				$oMail->setContent(sprintf("From : <a href=\"%s\">%s</a><br/>\r\n%s", getFullUrl('', 'document_srl', $obj->document_srl), getFullUrl('', 'document_srl', $obj->document_srl), $obj->content));
166 166
 				$oMail->setSender($obj->user_name ? $obj->user_name : 'anonymous', $obj->email_address ? $obj->email_address : $member_config->webmaster_email);
167 167
 
168
-				$target_mail = explode(',',$this->module_info->admin_mail);
169
-				for($i=0;$i<count($target_mail);$i++)
168
+				$target_mail = explode(',', $this->module_info->admin_mail);
169
+				for ($i = 0; $i < count($target_mail); $i++)
170 170
 				{
171 171
 					$email_address = trim($target_mail[$i]);
172
-					if(!$email_address) continue;
172
+					if (!$email_address) continue;
173 173
 					$oMail->setReceiptor($email_address, $email_address);
174 174
 					$oMail->send();
175 175
 				}
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 		}
178 178
 
179 179
 		// if there is an error
180
-		if(!$output->toBool())
180
+		if (!$output->toBool())
181 181
 		{
182 182
 			return $output;
183 183
 		}
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 		$this->add('document_srl', $output->get('document_srl'));
188 188
 
189 189
 		// alert a message
190
-		if(Context::get('xeVirtualRequestMethod') !== 'xml')
190
+		if (Context::get('xeVirtualRequestMethod') !== 'xml')
191 191
 		{
192 192
 			$this->setMessage($msg_code);
193 193
 		}
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 		$document_srl = Context::get('document_srl');
203 203
 
204 204
 		// if the document is not existed
205
-		if(!$document_srl)
205
+		if (!$document_srl)
206 206
 		{
207 207
 			return $this->doError('msg_invalid_document');
208 208
 		}
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 		$oDocumentModel = &getModel('document');
211 211
 		$oDocument = $oDocumentModel->getDocument($document_srl);
212 212
 		// check protect content
213
-		if($this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false)
213
+		if ($this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false)
214 214
 		{
215 215
 			return new BaseObject(-1, 'msg_protect_content');
216 216
 		}
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 
221 221
 		// delete the document
222 222
 		$output = $oDocumentController->deleteDocument($document_srl, $this->grant->manager);
223
-		if(!$output->toBool())
223
+		if (!$output->toBool())
224 224
 		{
225 225
 			return $output;
226 226
 		}
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 		$this->setRedirectUrl(getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '', 'page', Context::get('page'), 'document_srl', ''));
230 230
 		$this->add('mid', Context::get('mid'));
231 231
 		$this->add('page', Context::get('page'));
232
-		if(Context::get('xeVirtualRequestMethod') !== 'xml')
232
+		if (Context::get('xeVirtualRequestMethod') !== 'xml')
233 233
 		{
234 234
 			$this->setMessage('success_deleted');
235 235
 		}
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 	function procBoardInsertComment()
254 254
 	{
255 255
 		// check grant
256
-		if(!$this->grant->write_comment)
256
+		if (!$this->grant->write_comment)
257 257
 		{
258 258
 			return new BaseObject(-1, 'msg_not_permitted');
259 259
 		}
@@ -263,13 +263,13 @@  discard block
 block discarded – undo
263 263
 		$obj = Context::getRequestVars();
264 264
 		$obj->module_srl = $this->module_srl;
265 265
 
266
-		if(!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC';
267
-		if(!is_array($this->module_info->use_status))
266
+		if (!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC';
267
+		if (!is_array($this->module_info->use_status))
268 268
 		{
269 269
 			$this->module_info->use_status = explode('|@|', $this->module_info->use_status);
270 270
 		}
271 271
 
272
-		if(in_array('SECRET', $this->module_info->use_status))
272
+		if (in_array('SECRET', $this->module_info->use_status))
273 273
 		{
274 274
 			$this->module_info->secret = 'Y';
275 275
 		}
@@ -281,31 +281,31 @@  discard block
 block discarded – undo
281 281
 
282 282
 		$oModuleModel = getModel('module');
283 283
 		$module_config = $oModuleModel->getModuleInfoByModuleSrl($obj->module_srl);
284
-		if($module_config->mobile_use_editor === 'Y')
284
+		if ($module_config->mobile_use_editor === 'Y')
285 285
 		{
286
-			if(!isset($obj->use_editor)) $obj->use_editor = 'Y';
287
-			if(!isset($obj->use_html)) $obj->use_html = 'Y';
286
+			if (!isset($obj->use_editor)) $obj->use_editor = 'Y';
287
+			if (!isset($obj->use_html)) $obj->use_html = 'Y';
288 288
 		}
289 289
 		else
290 290
 		{
291
-			if(!isset($obj->use_editor)) $obj->use_editor = 'N';
292
-			if(!isset($obj->use_html)) $obj->use_html = 'N';
291
+			if (!isset($obj->use_editor)) $obj->use_editor = 'N';
292
+			if (!isset($obj->use_html)) $obj->use_html = 'N';
293 293
 		}
294 294
 
295 295
 		// check if the doument is existed
296 296
 		$oDocumentModel = getModel('document');
297 297
 		$oDocument = $oDocumentModel->getDocument($obj->document_srl);
298
-		if(!$oDocument->isExists())
298
+		if (!$oDocument->isExists())
299 299
 		{
300
-			return new BaseObject(-1,'msg_not_founded');
300
+			return new BaseObject(-1, 'msg_not_founded');
301 301
 		}
302 302
 
303 303
 		// For anonymous use, remove writer's information and notifying information
304
-		if($this->module_info->use_anonymous == 'Y')
304
+		if ($this->module_info->use_anonymous == 'Y')
305 305
 		{
306 306
 			$this->module_info->admin_mail = '';
307 307
 			$obj->notify_message = 'N';
308
-			$obj->member_srl = -1*$logged_info->member_srl;
308
+			$obj->member_srl = -1 * $logged_info->member_srl;
309 309
 			$obj->email_address = $obj->homepage = $obj->user_id = '';
310 310
 			$obj->user_name = $obj->nick_name = 'anonymous';
311 311
 			$bAnonymous = true;
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 
324 324
 		// check the comment is existed
325 325
 		// if the comment is not existed, then generate a new sequence
326
-		if(!$obj->comment_srl)
326
+		if (!$obj->comment_srl)
327 327
 		{
328 328
 			$obj->comment_srl = getNextSequence();
329 329
 		} else {
@@ -331,14 +331,14 @@  discard block
 block discarded – undo
331 331
 		}
332 332
 
333 333
 		// if comment_srl is not existed, then insert the comment
334
-		if($comment->comment_srl != $obj->comment_srl)
334
+		if ($comment->comment_srl != $obj->comment_srl)
335 335
 		{
336 336
 
337 337
 			// parent_srl is existed
338
-			if($obj->parent_srl)
338
+			if ($obj->parent_srl)
339 339
 			{
340 340
 				$parent_comment = $oCommentModel->getComment($obj->parent_srl);
341
-				if(!$parent_comment->comment_srl)
341
+				if (!$parent_comment->comment_srl)
342 342
 				{
343 343
 					return new BaseObject(-1, 'msg_invalid_request');
344 344
 				}
@@ -352,9 +352,9 @@  discard block
 block discarded – undo
352 352
 		// update the comment if it is not existed
353 353
 		} else {
354 354
 			// check the grant
355
-			if(!$comment->isGranted())
355
+			if (!$comment->isGranted())
356 356
 			{
357
-				return new BaseObject(-1,'msg_not_permitted');
357
+				return new BaseObject(-1, 'msg_not_permitted');
358 358
 			}
359 359
 
360 360
 			$obj->parent_srl = $comment->parent_srl;
@@ -362,12 +362,12 @@  discard block
 block discarded – undo
362 362
 			$comment_srl = $obj->comment_srl;
363 363
 		}
364 364
 
365
-		if(!$output->toBool())
365
+		if (!$output->toBool())
366 366
 		{
367 367
 			return $output;
368 368
 		}
369 369
 
370
-		if(Context::get('xeVirtualRequestMethod') !== 'xml')
370
+		if (Context::get('xeVirtualRequestMethod') !== 'xml')
371 371
 		{
372 372
 			$this->setMessage('success_registed');
373 373
 		}
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 	{
384 384
 		// get the comment_srl
385 385
 		$comment_srl = Context::get('comment_srl');
386
-		if(!$comment_srl)
386
+		if (!$comment_srl)
387 387
 		{
388 388
 			return $this->doError('msg_invalid_request');
389 389
 		}
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 		$oCommentController = getController('comment');
393 393
 
394 394
 		$output = $oCommentController->deleteComment($comment_srl, $this->grant->manager);
395
-		if(!$output->toBool())
395
+		if (!$output->toBool())
396 396
 		{
397 397
 			return $output;
398 398
 		}
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 		$this->add('mid', Context::get('mid'));
401 401
 		$this->add('page', Context::get('page'));
402 402
 		$this->add('document_srl', $output->get('document_srl'));
403
-		if(Context::get('xeVirtualRequestMethod') !== 'xml')
403
+		if (Context::get('xeVirtualRequestMethod') !== 'xml')
404 404
 		{
405 405
 			$this->setMessage('success_deleted');
406 406
 		}
@@ -416,10 +416,10 @@  discard block
 block discarded – undo
416 416
 		// generate trackback module controller object
417 417
 		$oTrackbackController = getController('trackback');
418 418
 
419
-		if(!$oTrackbackController) return;
419
+		if (!$oTrackbackController) return;
420 420
 
421 421
 		$output = $oTrackbackController->deleteTrackback($trackback_srl, $this->grant->manager);
422
-		if(!$output->toBool())
422
+		if (!$output->toBool())
423 423
 		{
424 424
 			return $output;
425 425
 		}
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 		$this->add('mid', Context::get('mid'));
428 428
 		$this->add('page', Context::get('page'));
429 429
 		$this->add('document_srl', $output->get('document_srl'));
430
-		if(Context::get('xeVirtualRequestMethod') !== 'xml')
430
+		if (Context::get('xeVirtualRequestMethod') !== 'xml')
431 431
 		{
432 432
 			$this->setMessage('success_deleted');
433 433
 		}
@@ -446,18 +446,18 @@  discard block
 block discarded – undo
446 446
 		$oMemberModel = getModel('member');
447 447
 
448 448
 		// if the comment exists
449
-		if($comment_srl)
449
+		if ($comment_srl)
450 450
 		{
451 451
 			// get the comment information
452 452
 			$oCommentModel = getModel('comment');
453 453
 			$oComment = $oCommentModel->getComment($comment_srl);
454
-			if(!$oComment->isExists())
454
+			if (!$oComment->isExists())
455 455
 			{
456 456
 				return new BaseObject(-1, 'msg_invalid_request');
457 457
 			}
458 458
 
459 459
 			// compare the comment password and the user input password
460
-			if(!$oMemberModel->isValidPassword($oComment->get('password'),$password))
460
+			if (!$oMemberModel->isValidPassword($oComment->get('password'), $password))
461 461
 			{
462 462
 				return new BaseObject(-1, 'msg_invalid_password');
463 463
 			}
@@ -467,13 +467,13 @@  discard block
 block discarded – undo
467 467
 			 // get the document information
468 468
 			$oDocumentModel = getModel('document');
469 469
 			$oDocument = $oDocumentModel->getDocument($document_srl);
470
-			if(!$oDocument->isExists())
470
+			if (!$oDocument->isExists())
471 471
 			{
472 472
 				return new BaseObject(-1, 'msg_invalid_request');
473 473
 			}
474 474
 
475 475
 			// compare the document password and the user input password
476
-			if(!$oMemberModel->isValidPassword($oDocument->get('password'),$password))
476
+			if (!$oMemberModel->isValidPassword($oDocument->get('password'), $password))
477 477
 			{
478 478
 				return new BaseObject(-1, 'msg_invalid_password');
479 479
 			}
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 		$member_srl = Context::get('target_srl');
491 491
 		$mid = Context::get('cur_mid');
492 492
 
493
-		if(!$member_srl || !$mid)
493
+		if (!$member_srl || !$mid)
494 494
 		{
495 495
 			return new BaseObject();
496 496
 		}
@@ -502,13 +502,13 @@  discard block
 block discarded – undo
502 502
 		$columnList = array('module');
503 503
 		$cur_module_info = $oModuleModel->getModuleInfoByMid($mid, 0, $columnList);
504 504
 
505
-		if($cur_module_info->module != 'board')
505
+		if ($cur_module_info->module != 'board')
506 506
 		{
507 507
 			return new BaseObject();
508 508
 		}
509 509
 
510 510
 		// get the member information
511
-		if($member_srl == $logged_info->member_srl)
511
+		if ($member_srl == $logged_info->member_srl)
512 512
 		{
513 513
 			$member_info = $logged_info;
514 514
 		} else {
@@ -516,13 +516,13 @@  discard block
 block discarded – undo
516 516
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
517 517
 		}
518 518
 
519
-		if(!$member_info->user_id)
519
+		if (!$member_info->user_id)
520 520
 		{
521 521
 			return new BaseObject();
522 522
 		}
523 523
 
524 524
 		//search
525
-		$url = getUrl('','mid',$mid,'search_target','nick_name','search_keyword',$member_info->nick_name);
525
+		$url = getUrl('', 'mid', $mid, 'search_target', 'nick_name', 'search_keyword', $member_info->nick_name);
526 526
 		$oMemberController = getController('member');
527 527
 		$oMemberController->addMemberPopupMenu($url, 'cmd_view_own_document', '');
528 528
 
Please login to merge, or discard this patch.
modules/widget/widget.class.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
 		$oModuleModel = getModel('module');
31 31
 		$oModuleController = getController('module');
32 32
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
33
-		if($oModuleModel->needUpdate($version_update_id))
33
+		if ($oModuleModel->needUpdate($version_update_id))
34 34
 		{
35 35
 			// widget compile display.after trigger for further (04/14/2009)
36
-			if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) return true;
36
+			if (!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) return true;
37 37
 
38 38
 			$oModuleController->insertUpdatedLog($version_update_id);
39 39
 		}
@@ -49,10 +49,10 @@  discard block
 block discarded – undo
49 49
 		$oModuleModel = getModel('module');
50 50
 		$oModuleController = getController('module');
51 51
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
52
-		if($oModuleModel->needUpdate($version_update_id))
52
+		if ($oModuleModel->needUpdate($version_update_id))
53 53
 		{
54 54
 			// widget compile display.after trigger for further (04/14/2009)
55
-			if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before'))
55
+			if (!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before'))
56 56
 			{
57 57
 				$oModuleController->insertTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before');
58 58
 			}
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@
 block discarded – undo
33 33
 		if($oModuleModel->needUpdate($version_update_id))
34 34
 		{
35 35
 			// widget compile display.after trigger for further (04/14/2009)
36
-			if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) return true;
36
+			if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) {
37
+				return true;
38
+			}
37 39
 
38 40
 			$oModuleController->insertUpdatedLog($version_update_id);
39 41
 		}
Please login to merge, or discard this patch.
modules/message/message.class.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,17 +23,17 @@  discard block
 block discarded – undo
23 23
 		$oModuleModel = getModel('module');
24 24
 		$oModuleController = getController('module');
25 25
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
26
-		if($oModuleModel->needUpdate($version_update_id))
26
+		if ($oModuleModel->needUpdate($version_update_id))
27 27
 		{
28 28
 			$config = $oModuleModel->getModuleConfig('message');
29 29
 
30
-			if($config->skin)
30
+			if ($config->skin)
31 31
 			{
32 32
 				$config_parse = explode('.', $config->skin);
33 33
 				if (count($config_parse) > 1)
34 34
 				{
35 35
 					$template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
36
-					if(is_dir($template_path)) return true;
36
+					if (is_dir($template_path)) return true;
37 37
 				}
38 38
 			}
39 39
 
@@ -51,17 +51,17 @@  discard block
 block discarded – undo
51 51
 		$oModuleModel = getModel('module');
52 52
 		$oModuleController = getController('module');
53 53
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
54
-		if($oModuleModel->needUpdate($version_update_id))
54
+		if ($oModuleModel->needUpdate($version_update_id))
55 55
 		{
56 56
 			$config = $oModuleModel->getModuleConfig('message');
57 57
 
58
-			if($config->skin)
58
+			if ($config->skin)
59 59
 			{
60 60
 				$config_parse = explode('.', $config->skin);
61 61
 				if (count($config_parse) > 1)
62 62
 				{
63 63
 					$template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
64
-					if(is_dir($template_path))
64
+					if (is_dir($template_path))
65 65
 					{
66 66
 						$config->skin = implode('|@|', $config_parse);
67 67
 						$oModuleController = getController('module');
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@
 block discarded – undo
33 33
 				if (count($config_parse) > 1)
34 34
 				{
35 35
 					$template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
36
-					if(is_dir($template_path)) return true;
36
+					if(is_dir($template_path)) {
37
+						return true;
38
+					}
37 39
 				}
38 40
 			}
39 41
 
Please login to merge, or discard this patch.
modules/comment/comment.class.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 
4
-require_once(_XE_PATH_ . 'modules/comment/comment.item.php');
4
+require_once(_XE_PATH_.'modules/comment/comment.item.php');
5 5
 
6 6
 /**
7 7
  * comment
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 		// 2008. 02. 22 add comment setting when a new module added
37 37
 		$oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before');
38 38
 
39
-		if(!is_dir('./files/cache/tmp'))
39
+		if (!is_dir('./files/cache/tmp'))
40 40
 		{
41 41
 			FileHandler::makeDir('./files/cache/tmp');
42 42
 		}
@@ -54,63 +54,63 @@  discard block
 block discarded – undo
54 54
 		$oModuleModel = getModel('module');
55 55
 		$oModuleController = getController('module');
56 56
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
57
-		if($oModuleModel->needUpdate($version_update_id))
57
+		if ($oModuleModel->needUpdate($version_update_id))
58 58
 		{
59 59
 			// 2007. 10. 17 add a trigger to delete comments together with posting deleted
60
-			if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
60
+			if (!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
61 61
 			{
62 62
 				return TRUE;
63 63
 			}
64 64
 			// 2007. 10. 17 add a trigger to delete all of comments together with module deleted
65
-			if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
65
+			if (!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
66 66
 			{
67 67
 				return TRUE;
68 68
 			}
69 69
 			// 2007. 10. 23 add a column for recommendation votes or notification of the comments
70
-			if(!$oDB->isColumnExists("comments", "voted_count"))
70
+			if (!$oDB->isColumnExists("comments", "voted_count"))
71 71
 			{
72 72
 				return TRUE;
73 73
 			}
74
-			if(!$oDB->isColumnExists("comments", "notify_message"))
74
+			if (!$oDB->isColumnExists("comments", "notify_message"))
75 75
 			{
76 76
 				return TRUE;
77 77
 			}
78 78
 			// 2008. 02. 22 add comment setting when a new module added
79
-			if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
79
+			if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
80 80
 			{
81 81
 				return TRUE;
82 82
 			}
83 83
 			// 2008. 05. 14 add a column for blamed count
84
-			if(!$oDB->isColumnExists("comments", "blamed_count"))
84
+			if (!$oDB->isColumnExists("comments", "blamed_count"))
85 85
 			{
86 86
 				return TRUE;
87 87
 			}
88
-			if(!$oDB->isColumnExists("comment_voted_log", "point"))
88
+			if (!$oDB->isColumnExists("comment_voted_log", "point"))
89 89
 			{
90 90
 				return TRUE;
91 91
 			}
92 92
 
93
-			if(!$oDB->isIndexExists("comments", "idx_module_list_order"))
93
+			if (!$oDB->isIndexExists("comments", "idx_module_list_order"))
94 94
 			{
95 95
 				return TRUE;
96 96
 			}
97 97
 			//2012. 02. 24 add comment published status column and index
98
-			if(!$oDB->isColumnExists("comments", "status"))
98
+			if (!$oDB->isColumnExists("comments", "status"))
99 99
 			{
100 100
 				return TRUE;
101 101
 			}
102
-			if(!$oDB->isIndexExists("comments", "idx_status"))
102
+			if (!$oDB->isIndexExists("comments", "idx_status"))
103 103
 			{
104 104
 				return TRUE;
105 105
 			}
106 106
 
107 107
 			// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied 
108
-			if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
108
+			if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
109 109
 			{
110 110
 				return TRUE;
111 111
 			}
112 112
 
113
-			if(!$oDB->isIndexExists("comments", "idx_parent_srl"))
113
+			if (!$oDB->isIndexExists("comments", "idx_parent_srl"))
114 114
 			{
115 115
 				return TRUE;
116 116
 			}
@@ -131,46 +131,46 @@  discard block
 block discarded – undo
131 131
 		$oModuleModel = getModel('module');
132 132
 		$oModuleController = getController('module');
133 133
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
134
-		if($oModuleModel->needUpdate($version_update_id))
134
+		if ($oModuleModel->needUpdate($version_update_id))
135 135
 		{
136 136
 			// 2007. 10. 17 add a trigger to delete comments together with posting deleted
137
-			if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
137
+			if (!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
138 138
 			{
139 139
 				$oModuleController->insertTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after');
140 140
 			}
141 141
 			// 2007. 10. 17 add a trigger to delete all of comments together with module deleted
142
-			if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
142
+			if (!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
143 143
 			{
144 144
 				$oModuleController->insertTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after');
145 145
 			}
146 146
 			// 2007. 10. 23 add a column for recommendation votes or notification of the comments
147
-			if(!$oDB->isColumnExists("comments", "voted_count"))
147
+			if (!$oDB->isColumnExists("comments", "voted_count"))
148 148
 			{
149 149
 				$oDB->addColumn("comments", "voted_count", "number", "11");
150 150
 				$oDB->addIndex("comments", "idx_voted_count", array("voted_count"));
151 151
 			}
152 152
 
153
-			if(!$oDB->isColumnExists("comments", "notify_message"))
153
+			if (!$oDB->isColumnExists("comments", "notify_message"))
154 154
 			{
155 155
 				$oDB->addColumn("comments", "notify_message", "char", "1");
156 156
 			}
157 157
 			// 2008. 02. 22 add comment setting when a new module added
158
-			if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
158
+			if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
159 159
 			{
160 160
 				$oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before');
161 161
 			}
162 162
 			// 2008. 05. 14 add a column for blamed count
163
-			if(!$oDB->isColumnExists("comments", "blamed_count"))
163
+			if (!$oDB->isColumnExists("comments", "blamed_count"))
164 164
 			{
165 165
 				$oDB->addColumn('comments', 'blamed_count', 'number', 11, 0, TRUE);
166 166
 				$oDB->addIndex('comments', 'idx_blamed_count', array('blamed_count'));
167 167
 			}
168
-			if(!$oDB->isColumnExists("comment_voted_log", "point"))
168
+			if (!$oDB->isColumnExists("comment_voted_log", "point"))
169 169
 			{
170 170
 				$oDB->addColumn('comment_voted_log', 'point', 'number', 11, 0, TRUE);
171 171
 			}
172 172
 
173
-			if(!$oDB->isIndexExists("comments", "idx_module_list_order"))
173
+			if (!$oDB->isIndexExists("comments", "idx_module_list_order"))
174 174
 			{
175 175
 				$oDB->addIndex(
176 176
 						"comments", "idx_module_list_order", array("module_srl", "list_order"), TRUE
@@ -178,11 +178,11 @@  discard block
 block discarded – undo
178 178
 			}
179 179
 
180 180
 			//2012. 02. 24 add comment published status column and index
181
-			if(!$oDB->isColumnExists("comments", "status"))
181
+			if (!$oDB->isColumnExists("comments", "status"))
182 182
 			{
183 183
 				$oDB->addColumn("comments", "status", "number", 1, 1, TRUE);
184 184
 			}
185
-			if(!$oDB->isIndexExists("comments", "idx_status"))
185
+			if (!$oDB->isIndexExists("comments", "idx_status"))
186 186
 			{
187 187
 				$oDB->addIndex(
188 188
 						"comments", "idx_status", array("status", "comment_srl", "module_srl", "document_srl"), TRUE
@@ -190,12 +190,12 @@  discard block
 block discarded – undo
190 190
 			}
191 191
 
192 192
 			// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied 
193
-			if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
193
+			if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
194 194
 			{
195 195
 				$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after');
196 196
 			}
197 197
 
198
-			if(!$oDB->isIndexExists("comments", "idx_parent_srl"))
198
+			if (!$oDB->isIndexExists("comments", "idx_parent_srl"))
199 199
 			{
200 200
 				$oDB->addIndex('comments', 'idx_parent_srl', array('parent_srl'));
201 201
 			}
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 	 */
213 213
 	function recompileCache()
214 214
 	{
215
-		if(!is_dir('./files/cache/tmp'))
215
+		if (!is_dir('./files/cache/tmp'))
216 216
 		{
217 217
 			FileHandler::makeDir('./files/cache/tmp');
218 218
 		}
Please login to merge, or discard this patch.