@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | function init() { |
18 | 18 | // check module_srl is existed or not |
19 | 19 | $module_srl = Context::get('module_srl'); |
20 | - if(!$module_srl && $this->module_srl) { |
|
20 | + if (!$module_srl && $this->module_srl) { |
|
21 | 21 | $module_srl = $this->module_srl; |
22 | 22 | Context::set('module_srl', $module_srl); |
23 | 23 | } |
@@ -26,20 +26,20 @@ discard block |
||
26 | 26 | $oModuleModel = getModel('module'); |
27 | 27 | |
28 | 28 | // get the module infomation based on the module_srl |
29 | - if($module_srl) { |
|
29 | + if ($module_srl) { |
|
30 | 30 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); |
31 | - if(!$module_info) { |
|
32 | - Context::set('module_srl',''); |
|
31 | + if (!$module_info) { |
|
32 | + Context::set('module_srl', ''); |
|
33 | 33 | $this->act = 'list'; |
34 | 34 | } else { |
35 | 35 | ModuleModel::syncModuleToSite($module_info); |
36 | 36 | $this->module_info = $module_info; |
37 | 37 | $this->module_info->use_status = explode('|@|', $module_info->use_status); |
38 | - Context::set('module_info',$module_info); |
|
38 | + Context::set('module_info', $module_info); |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | |
42 | - if($module_info && $module_info->module != 'board') return $this->stop("msg_invalid_request"); |
|
42 | + if ($module_info && $module_info->module != 'board') return $this->stop("msg_invalid_request"); |
|
43 | 43 | |
44 | 44 | // get the module category list |
45 | 45 | $module_category = $oModuleModel->getModuleCategories(); |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | $security->encodeHTML('module_category..'); |
51 | 51 | |
52 | 52 | // setup template path (board admin panel templates is resided in the tpl folder) |
53 | - $template_path = sprintf("%stpl/",$this->module_path); |
|
53 | + $template_path = sprintf("%stpl/", $this->module_path); |
|
54 | 54 | $this->setTemplatePath($template_path); |
55 | 55 | |
56 | 56 | // install order (sorting) options |
57 | - foreach($this->order_target as $key) $order_target[$key] = Context::getLang($key); |
|
57 | + foreach ($this->order_target as $key) $order_target[$key] = Context::getLang($key); |
|
58 | 58 | $order_target['list_order'] = Context::getLang('document_srl'); |
59 | 59 | $order_target['update_order'] = Context::getLang('last_update'); |
60 | 60 | Context::set('order_target', $order_target); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $search_target = Context::get('search_target'); |
76 | 76 | $search_keyword = Context::get('search_keyword'); |
77 | 77 | |
78 | - switch ($search_target){ |
|
78 | + switch ($search_target) { |
|
79 | 79 | case 'mid': |
80 | 80 | $args->s_mid = $search_keyword; |
81 | 81 | break; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | // get the skins path |
91 | 91 | $oModuleModel = getModel('module'); |
92 | 92 | $skin_list = $oModuleModel->getSkins($this->module_path); |
93 | - Context::set('skin_list',$skin_list); |
|
93 | + Context::set('skin_list', $skin_list); |
|
94 | 94 | |
95 | 95 | $mskin_list = $oModuleModel->getSkins($this->module_path, "m.skins"); |
96 | 96 | Context::set('mskin_list', $mskin_list); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $layout_list = $oLayoutModel->getLayoutList(); |
101 | 101 | Context::set('layout_list', $layout_list); |
102 | 102 | |
103 | - $mobile_layout_list = $oLayoutModel->getLayoutList(0,"M"); |
|
103 | + $mobile_layout_list = $oLayoutModel->getLayoutList(0, "M"); |
|
104 | 104 | Context::set('mlayout_list', $mobile_layout_list); |
105 | 105 | |
106 | 106 | $oModuleAdminModel = getAdminModel('module'); |
@@ -115,10 +115,10 @@ discard block |
||
115 | 115 | Context::set('page_navigation', $output->page_navigation); |
116 | 116 | |
117 | 117 | $security = new Security(); |
118 | - $security->encodeHTML('board_list..browser_title','board_list..mid'); |
|
119 | - $security->encodeHTML('skin_list..title','mskin_list..title'); |
|
120 | - $security->encodeHTML('layout_list..title','layout_list..layout'); |
|
121 | - $security->encodeHTML('mlayout_list..title','mlayout_list..layout'); |
|
118 | + $security->encodeHTML('board_list..browser_title', 'board_list..mid'); |
|
119 | + $security->encodeHTML('skin_list..title', 'mskin_list..title'); |
|
120 | + $security->encodeHTML('layout_list..title', 'layout_list..layout'); |
|
121 | + $security->encodeHTML('mlayout_list..title', 'mlayout_list..layout'); |
|
122 | 122 | |
123 | 123 | // 템플릿 파일 지정 |
124 | 124 | $this->setTemplateFile('index'); |
@@ -135,14 +135,14 @@ discard block |
||
135 | 135 | * @brief display the module insert form |
136 | 136 | **/ |
137 | 137 | function dispBoardAdminInsertBoard() { |
138 | - if(!in_array($this->module_info->module, array('admin', 'board','blog','guestbook'))) { |
|
138 | + if (!in_array($this->module_info->module, array('admin', 'board', 'blog', 'guestbook'))) { |
|
139 | 139 | return $this->alertMessage('msg_invalid_request'); |
140 | 140 | } |
141 | 141 | |
142 | 142 | // get the skins list |
143 | 143 | $oModuleModel = getModel('module'); |
144 | 144 | $skin_list = $oModuleModel->getSkins($this->module_path); |
145 | - Context::set('skin_list',$skin_list); |
|
145 | + Context::set('skin_list', $skin_list); |
|
146 | 146 | |
147 | 147 | $mskin_list = $oModuleModel->getSkins($this->module_path, "m.skins"); |
148 | 148 | Context::set('mskin_list', $mskin_list); |
@@ -152,13 +152,13 @@ discard block |
||
152 | 152 | $layout_list = $oLayoutModel->getLayoutList(); |
153 | 153 | Context::set('layout_list', $layout_list); |
154 | 154 | |
155 | - $mobile_layout_list = $oLayoutModel->getLayoutList(0,"M"); |
|
155 | + $mobile_layout_list = $oLayoutModel->getLayoutList(0, "M"); |
|
156 | 156 | Context::set('mlayout_list', $mobile_layout_list); |
157 | 157 | |
158 | 158 | $security = new Security(); |
159 | - $security->encodeHTML('skin_list..title','mskin_list..title'); |
|
160 | - $security->encodeHTML('layout_list..title','layout_list..layout'); |
|
161 | - $security->encodeHTML('mlayout_list..title','mlayout_list..layout'); |
|
159 | + $security->encodeHTML('skin_list..title', 'mskin_list..title'); |
|
160 | + $security->encodeHTML('layout_list..title', 'layout_list..layout'); |
|
161 | + $security->encodeHTML('mlayout_list..title', 'mlayout_list..layout'); |
|
162 | 162 | |
163 | 163 | // get document status list |
164 | 164 | $oDocumentModel = getModel('document'); |
@@ -177,14 +177,14 @@ discard block |
||
177 | 177 | // setup extra_order_target |
178 | 178 | $module_extra_vars = $oDocumentModel->getExtraKeys($this->module_info->module_srl); |
179 | 179 | $extra_order_target = array(); |
180 | - foreach($module_extra_vars as $oExtraItem) |
|
180 | + foreach ($module_extra_vars as $oExtraItem) |
|
181 | 181 | { |
182 | 182 | $extra_order_target[$oExtraItem->eid] = $oExtraItem->name; |
183 | 183 | } |
184 | 184 | Context::set('extra_order_target', $extra_order_target); |
185 | 185 | |
186 | 186 | $security = new Security(); |
187 | - $security->encodeHTML('extra_vars..name','list_config..name'); |
|
187 | + $security->encodeHTML('extra_vars..name', 'list_config..name'); |
|
188 | 188 | |
189 | 189 | // set the template file |
190 | 190 | $this->setTemplateFile('board_insert'); |
@@ -212,8 +212,8 @@ discard block |
||
212 | 212 | * @brief display the board mdoule delete page |
213 | 213 | **/ |
214 | 214 | function dispBoardAdminDeleteBoard() { |
215 | - if(!Context::get('module_srl')) return $this->dispBoardAdminContent(); |
|
216 | - if(!in_array($this->module_info->module, array('admin', 'board','blog','guestbook'))) { |
|
215 | + if (!Context::get('module_srl')) return $this->dispBoardAdminContent(); |
|
216 | + if (!in_array($this->module_info->module, array('admin', 'board', 'blog', 'guestbook'))) { |
|
217 | 217 | return $this->alertMessage('msg_invalid_request'); |
218 | 218 | } |
219 | 219 | |
@@ -223,10 +223,10 @@ discard block |
||
223 | 223 | $document_count = $oDocumentModel->getDocumentCount($module_info->module_srl); |
224 | 224 | $module_info->document_count = $document_count; |
225 | 225 | |
226 | - Context::set('module_info',$module_info); |
|
226 | + Context::set('module_info', $module_info); |
|
227 | 227 | |
228 | 228 | $security = new Security(); |
229 | - $security->encodeHTML('module_info..mid','module_info..module','module_info..document_count'); |
|
229 | + $security->encodeHTML('module_info..mid', 'module_info..module', 'module_info..document_count'); |
|
230 | 230 | |
231 | 231 | // setup the template file |
232 | 232 | $this->setTemplateFile('board_delete'); |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | * @brief board module message |
296 | 296 | **/ |
297 | 297 | function alertMessage($message) { |
298 | - $script = sprintf('<script> xAddEventListener(window,"load", function() { alert("%s"); } );</script>', Context::getLang($message)); |
|
299 | - Context::addHtmlHeader( $script ); |
|
298 | + $script = sprintf('<script> xAddEventListener(window,"load", function() { alert("%s"); } );</script>', Context::getLang($message)); |
|
299 | + Context::addHtmlHeader($script); |
|
300 | 300 | } |
301 | 301 | } |
@@ -39,7 +39,9 @@ discard block |
||
39 | 39 | } |
40 | 40 | } |
41 | 41 | |
42 | - if($module_info && $module_info->module != 'board') return $this->stop("msg_invalid_request"); |
|
42 | + if($module_info && $module_info->module != 'board') { |
|
43 | + return $this->stop("msg_invalid_request"); |
|
44 | + } |
|
43 | 45 | |
44 | 46 | // get the module category list |
45 | 47 | $module_category = $oModuleModel->getModuleCategories(); |
@@ -54,7 +56,9 @@ discard block |
||
54 | 56 | $this->setTemplatePath($template_path); |
55 | 57 | |
56 | 58 | // install order (sorting) options |
57 | - foreach($this->order_target as $key) $order_target[$key] = Context::getLang($key); |
|
59 | + foreach($this->order_target as $key) { |
|
60 | + $order_target[$key] = Context::getLang($key); |
|
61 | + } |
|
58 | 62 | $order_target['list_order'] = Context::getLang('document_srl'); |
59 | 63 | $order_target['update_order'] = Context::getLang('last_update'); |
60 | 64 | Context::set('order_target', $order_target); |
@@ -212,7 +216,9 @@ discard block |
||
212 | 216 | * @brief display the board mdoule delete page |
213 | 217 | **/ |
214 | 218 | function dispBoardAdminDeleteBoard() { |
215 | - if(!Context::get('module_srl')) return $this->dispBoardAdminContent(); |
|
219 | + if(!Context::get('module_srl')) { |
|
220 | + return $this->dispBoardAdminContent(); |
|
221 | + } |
|
216 | 222 | if(!in_array($this->module_info->module, array('admin', 'board','blog','guestbook'))) { |
217 | 223 | return $this->alertMessage('msg_invalid_request'); |
218 | 224 | } |
@@ -40,13 +40,11 @@ |
||
40 | 40 | if($inserted_extra_vars[$key]) |
41 | 41 | { |
42 | 42 | $output['extra_vars'.$key] = $inserted_extra_vars[$key]; |
43 | - } |
|
44 | - else |
|
43 | + } else |
|
45 | 44 | { |
46 | 45 | continue; |
47 | 46 | } |
48 | - } |
|
49 | - else |
|
47 | + } else |
|
50 | 48 | { |
51 | 49 | $output[$key] = new ExtraItem($module_srl, -1, Context::getLang($key), $key, 'N', 'N', 'N', null); |
52 | 50 | } |
@@ -25,19 +25,19 @@ discard block |
||
25 | 25 | |
26 | 26 | // get the list config value, if it is not exitsted then setup the default value |
27 | 27 | $list_config = $oModuleModel->getModulePartConfig('board', $module_srl); |
28 | - if(!$list_config || count($list_config) <= 0) |
|
28 | + if (!$list_config || count($list_config) <= 0) |
|
29 | 29 | { |
30 | - $list_config = array( 'no', 'title', 'nick_name','regdate','readed_count'); |
|
30 | + $list_config = array('no', 'title', 'nick_name', 'regdate', 'readed_count'); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | // get the extra variables |
34 | 34 | $inserted_extra_vars = $oDocumentModel->getExtraKeys($module_srl); |
35 | 35 | |
36 | - foreach($list_config as $key) |
|
36 | + foreach ($list_config as $key) |
|
37 | 37 | { |
38 | - if(preg_match('/^([0-9]+)$/',$key)) |
|
38 | + if (preg_match('/^([0-9]+)$/', $key)) |
|
39 | 39 | { |
40 | - if($inserted_extra_vars[$key]) |
|
40 | + if ($inserted_extra_vars[$key]) |
|
41 | 41 | { |
42 | 42 | $output['extra_vars'.$key] = $inserted_extra_vars[$key]; |
43 | 43 | } |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | function getDefaultListConfig($module_srl) |
61 | 61 | { |
62 | 62 | // add virtual srl, title, registered date, update date, nickname, ID, name, readed count, voted count etc. |
63 | - $virtual_vars = array( 'no', 'title', 'regdate', 'last_update', 'last_post', 'nick_name', |
|
63 | + $virtual_vars = array('no', 'title', 'regdate', 'last_update', 'last_post', 'nick_name', |
|
64 | 64 | 'user_id', 'user_name', 'readed_count', 'voted_count', 'blamed_count', 'thumbnail', 'summary', 'comment_status'); |
65 | - foreach($virtual_vars as $key) |
|
65 | + foreach ($virtual_vars as $key) |
|
66 | 66 | { |
67 | 67 | $extra_vars[$key] = new ExtraItem($module_srl, -1, Context::getLang($key), $key, 'N', 'N', 'N', null); |
68 | 68 | } |
@@ -71,9 +71,9 @@ discard block |
||
71 | 71 | $oDocumentModel = getModel('document'); |
72 | 72 | $inserted_extra_vars = $oDocumentModel->getExtraKeys($module_srl); |
73 | 73 | |
74 | - if(count($inserted_extra_vars)) |
|
74 | + if (count($inserted_extra_vars)) |
|
75 | 75 | { |
76 | - foreach($inserted_extra_vars as $obj) |
|
76 | + foreach ($inserted_extra_vars as $obj) |
|
77 | 77 | { |
78 | 78 | $extra_vars['extra_vars'.$obj->idx] = $obj; |
79 | 79 | } |
@@ -54,7 +54,9 @@ discard block |
||
54 | 54 | $oComment = new commentItem(); |
55 | 55 | $oComment->setAttribute($val); |
56 | 56 | |
57 | - if(!$oComment->isAccessible()) continue; |
|
57 | + if(!$oComment->isAccessible()) { |
|
58 | + continue; |
|
59 | + } |
|
58 | 60 | |
59 | 61 | $content .= "<b>".$oComment->getNickName()."</b> (".$oComment->getRegdate("Y-m-d").")<br>\r\n".$oComment->getContent(false,false)."<br>\r\n"; |
60 | 62 | } |
@@ -110,7 +112,9 @@ discard block |
||
110 | 112 | $obj['href'] = $val->getPermanentUrl(); |
111 | 113 | |
112 | 114 | $title = htmlspecialchars($val->getTitleText()); |
113 | - if($val->getCommentCount()) $title .= ' ['.$val->getCommentCount().']'; |
|
115 | + if($val->getCommentCount()) { |
|
116 | + $title .= ' ['.$val->getCommentCount().']'; |
|
117 | + } |
|
114 | 118 | $obj['link'] = $obj['text'] = '['.$val->getNickName().'] '.$title; |
115 | 119 | $childs[] = $obj; |
116 | 120 | } |
@@ -119,7 +123,9 @@ discard block |
||
119 | 123 | |
120 | 124 | $totalPage = $page_navigation->last_page; |
121 | 125 | $page = (int)Context::get('page'); |
122 | - if(!$page) $page = 1; |
|
126 | + if(!$page) { |
|
127 | + $page = 1; |
|
128 | + } |
|
123 | 129 | |
124 | 130 | // next/prevUrl specification |
125 | 131 | if($page > 1) |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | function procWAP(&$oMobile) |
16 | 16 | { |
17 | 17 | // check grant |
18 | - if(!$this->grant->list || $this->module_info->consultation == 'Y') |
|
18 | + if (!$this->grant->list || $this->module_info->consultation == 'Y') |
|
19 | 19 | { |
20 | 20 | return $oMobile->setContent(Context::getLang('msg_not_permitted')); |
21 | 21 | } |
@@ -25,13 +25,13 @@ discard block |
||
25 | 25 | |
26 | 26 | // if the doument is existed |
27 | 27 | $document_srl = Context::get('document_srl'); |
28 | - if($document_srl) |
|
28 | + if ($document_srl) |
|
29 | 29 | { |
30 | 30 | $oDocument = $oDocumentModel->getDocument($document_srl); |
31 | - if($oDocument->isExists()) |
|
31 | + if ($oDocument->isExists()) |
|
32 | 32 | { |
33 | 33 | // check the grant |
34 | - if(!$this->grant->view) |
|
34 | + if (!$this->grant->view) |
|
35 | 35 | { |
36 | 36 | return $oMobile->setContent(Context::getLang('msg_not_permitted')); |
37 | 37 | } |
@@ -40,48 +40,48 @@ discard block |
||
40 | 40 | Context::setBrowserTitle($oDocument->getTitleText()); |
41 | 41 | |
42 | 42 | // if the act is display comment list |
43 | - if($this->act=='dispBoardContentCommentList') |
|
43 | + if ($this->act == 'dispBoardContentCommentList') |
|
44 | 44 | { |
45 | 45 | |
46 | 46 | $oCommentModel = getModel('comment'); |
47 | 47 | $output = $oCommentModel->getCommentList($oDocument->document_srl, 0, false, $oDocument->getCommentCount()); |
48 | 48 | |
49 | 49 | $content = ''; |
50 | - if(count($output->data)) |
|
50 | + if (count($output->data)) |
|
51 | 51 | { |
52 | - foreach($output->data as $key => $val) |
|
52 | + foreach ($output->data as $key => $val) |
|
53 | 53 | { |
54 | 54 | $oComment = new commentItem(); |
55 | 55 | $oComment->setAttribute($val); |
56 | 56 | |
57 | - if(!$oComment->isAccessible()) continue; |
|
57 | + if (!$oComment->isAccessible()) continue; |
|
58 | 58 | |
59 | - $content .= "<b>".$oComment->getNickName()."</b> (".$oComment->getRegdate("Y-m-d").")<br>\r\n".$oComment->getContent(false,false)."<br>\r\n"; |
|
59 | + $content .= "<b>".$oComment->getNickName()."</b> (".$oComment->getRegdate("Y-m-d").")<br>\r\n".$oComment->getContent(false, false)."<br>\r\n"; |
|
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
63 | 63 | // setup mobile contents |
64 | - $oMobile->setContent( $content ); |
|
64 | + $oMobile->setContent($content); |
|
65 | 65 | |
66 | 66 | // setup upper URL |
67 | - $oMobile->setUpperUrl( getUrl('act',''), Context::getLang('cmd_go_upper') ); |
|
67 | + $oMobile->setUpperUrl(getUrl('act', ''), Context::getLang('cmd_go_upper')); |
|
68 | 68 | |
69 | 69 | // display the document if the act is not display the comment list |
70 | 70 | } else { |
71 | 71 | |
72 | 72 | // setup contents (strip all html tags) |
73 | - $content = strip_tags(str_replace('<p>','<br> ',$oDocument->getContent(false,false,false)),'<br><b><i><u><em><small><strong><big>'); |
|
73 | + $content = strip_tags(str_replace('<p>', '<br> ', $oDocument->getContent(false, false, false)), '<br><b><i><u><em><small><strong><big>'); |
|
74 | 74 | |
75 | 75 | |
76 | 76 | // setup content information(include the comments link) |
77 | - $content = Context::getLang('replies').' : <a href="'.getUrl('act','dispBoardContentCommentList').'">'.$oDocument->getCommentCount().'</a><br>'."\r\n".$content; |
|
77 | + $content = Context::getLang('replies').' : <a href="'.getUrl('act', 'dispBoardContentCommentList').'">'.$oDocument->getCommentCount().'</a><br>'."\r\n".$content; |
|
78 | 78 | $content = '<b>'.$oDocument->getNickName().'</b> ('.$oDocument->getRegdate("Y-m-d").")<br>\r\n".$content; |
79 | 79 | |
80 | 80 | // setup mobile contents |
81 | - $oMobile->setContent( $content ); |
|
81 | + $oMobile->setContent($content); |
|
82 | 82 | |
83 | 83 | // setup upper URL |
84 | - $oMobile->setUpperUrl( getUrl('document_srl',''), Context::getLang('cmd_list') ); |
|
84 | + $oMobile->setUpperUrl(getUrl('document_srl', ''), Context::getLang('cmd_list')); |
|
85 | 85 | |
86 | 86 | } |
87 | 87 | |
@@ -92,25 +92,25 @@ discard block |
||
92 | 92 | // board index |
93 | 93 | $args = new stdClass; |
94 | 94 | $args->module_srl = $this->module_srl; |
95 | - $args->page = Context::get('page');; |
|
95 | + $args->page = Context::get('page'); ; |
|
96 | 96 | $args->list_count = 9; |
97 | - $args->sort_index = $this->module_info->order_target?$this->module_info->order_target:'list_order'; |
|
98 | - $args->order_type = $this->module_info->order_type?$this->module_info->order_type:'asc'; |
|
97 | + $args->sort_index = $this->module_info->order_target ? $this->module_info->order_target : 'list_order'; |
|
98 | + $args->order_type = $this->module_info->order_type ? $this->module_info->order_type : 'asc'; |
|
99 | 99 | $output = $oDocumentModel->getDocumentList($args, $this->except_notice); |
100 | 100 | $document_list = $output->data; |
101 | 101 | $page_navigation = $output->page_navigation; |
102 | 102 | |
103 | 103 | $childs = array(); |
104 | - if($document_list && count($document_list)) |
|
104 | + if ($document_list && count($document_list)) |
|
105 | 105 | { |
106 | - foreach($document_list as $key => $val) |
|
106 | + foreach ($document_list as $key => $val) |
|
107 | 107 | { |
108 | - $href = getUrl('mid',$_GET['mid'],'document_srl',$val->document_srl); |
|
108 | + $href = getUrl('mid', $_GET['mid'], 'document_srl', $val->document_srl); |
|
109 | 109 | $obj = null; |
110 | 110 | $obj['href'] = $val->getPermanentUrl(); |
111 | 111 | |
112 | 112 | $title = htmlspecialchars($val->getTitleText()); |
113 | - if($val->getCommentCount()) $title .= ' ['.$val->getCommentCount().']'; |
|
113 | + if ($val->getCommentCount()) $title .= ' ['.$val->getCommentCount().']'; |
|
114 | 114 | $obj['link'] = $obj['text'] = '['.$val->getNickName().'] '.$title; |
115 | 115 | $childs[] = $obj; |
116 | 116 | } |
@@ -118,18 +118,18 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | $totalPage = $page_navigation->last_page; |
121 | - $page = (int)Context::get('page'); |
|
122 | - if(!$page) $page = 1; |
|
121 | + $page = (int) Context::get('page'); |
|
122 | + if (!$page) $page = 1; |
|
123 | 123 | |
124 | 124 | // next/prevUrl specification |
125 | - if($page > 1) |
|
125 | + if ($page > 1) |
|
126 | 126 | { |
127 | - $oMobile->setPrevUrl(getUrl('mid',$_GET['mid'],'page',$page-1), sprintf('%s (%d/%d)', Context::getLang('cmd_prev'), $page-1, $totalPage)); |
|
127 | + $oMobile->setPrevUrl(getUrl('mid', $_GET['mid'], 'page', $page - 1), sprintf('%s (%d/%d)', Context::getLang('cmd_prev'), $page - 1, $totalPage)); |
|
128 | 128 | } |
129 | 129 | |
130 | - if($page < $totalPage) |
|
130 | + if ($page < $totalPage) |
|
131 | 131 | { |
132 | - $oMobile->setNextUrl(getUrl('mid',$_GET['mid'],'page',$page+1), sprintf('%s (%d/%d)', Context::getLang('cmd_next'), $page+1, $totalPage)); |
|
132 | + $oMobile->setNextUrl(getUrl('mid', $_GET['mid'], 'page', $page + 1), sprintf('%s (%d/%d)', Context::getLang('cmd_next'), $page + 1, $totalPage)); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | $oMobile->mobilePage = $page; |
@@ -581,7 +581,7 @@ |
||
581 | 581 | //mail to author of thread - START |
582 | 582 | /** |
583 | 583 | * @todo Removed code send email to document author. |
584 | - */ |
|
584 | + */ |
|
585 | 585 | /* |
586 | 586 | if($document_author_email != $obj->email_address && $logged_info->email_address != $document_author_email) |
587 | 587 | { |
@@ -160,7 +160,6 @@ discard block |
||
160 | 160 | |
161 | 161 | /** |
162 | 162 | * Check if module is using comment validation system |
163 | - * @param int $document_srl |
|
164 | 163 | * @param int $module_srl |
165 | 164 | * @return bool |
166 | 165 | */ |
@@ -1151,7 +1150,7 @@ discard block |
||
1151 | 1150 | |
1152 | 1151 | /** |
1153 | 1152 | * Report a blamed comment |
1154 | - * @param $comment_srl |
|
1153 | + * @param string $comment_srl |
|
1155 | 1154 | * @return void |
1156 | 1155 | */ |
1157 | 1156 | function declaredComment($comment_srl) |
@@ -1356,7 +1355,7 @@ discard block |
||
1356 | 1355 | /** |
1357 | 1356 | * Comment module config setting |
1358 | 1357 | * @param int $srl |
1359 | - * @param object $comment_config |
|
1358 | + * @param stdClass $comment_config |
|
1360 | 1359 | * @return BaseObject |
1361 | 1360 | */ |
1362 | 1361 | function setCommentModuleConfig($srl, $comment_config) |
@@ -1368,7 +1367,7 @@ discard block |
||
1368 | 1367 | |
1369 | 1368 | /** |
1370 | 1369 | * Get comment all list |
1371 | - * @return void |
|
1370 | + * @return BaseObject|null |
|
1372 | 1371 | */ |
1373 | 1372 | function procCommentGetList() |
1374 | 1373 | { |
@@ -27,13 +27,13 @@ discard block |
||
27 | 27 | */ |
28 | 28 | function procCommentVoteUp() |
29 | 29 | { |
30 | - if(!Context::get('is_logged')) |
|
30 | + if (!Context::get('is_logged')) |
|
31 | 31 | { |
32 | 32 | return new BaseObject(-1, 'msg_invalid_request'); |
33 | 33 | } |
34 | 34 | |
35 | 35 | $comment_srl = Context::get('target_srl'); |
36 | - if(!$comment_srl) |
|
36 | + if (!$comment_srl) |
|
37 | 37 | { |
38 | 38 | return new BaseObject(-1, 'msg_invalid_request'); |
39 | 39 | } |
@@ -41,14 +41,14 @@ discard block |
||
41 | 41 | $oCommentModel = getModel('comment'); |
42 | 42 | $oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE); |
43 | 43 | $module_srl = $oComment->get('module_srl'); |
44 | - if(!$module_srl) |
|
44 | + if (!$module_srl) |
|
45 | 45 | { |
46 | 46 | return new BaseObject(-1, 'msg_invalid_request'); |
47 | 47 | } |
48 | 48 | |
49 | 49 | $oModuleModel = getModel('module'); |
50 | 50 | $comment_config = $oModuleModel->getModulePartConfig('comment', $module_srl); |
51 | - if($comment_config->use_vote_up == 'N') |
|
51 | + if ($comment_config->use_vote_up == 'N') |
|
52 | 52 | { |
53 | 53 | return new BaseObject(-1, 'msg_invalid_request'); |
54 | 54 | } |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | */ |
66 | 66 | function procCommentVoteDown() |
67 | 67 | { |
68 | - if(!Context::get('is_logged')) |
|
68 | + if (!Context::get('is_logged')) |
|
69 | 69 | { |
70 | 70 | return new BaseObject(-1, 'msg_invalid_request'); |
71 | 71 | } |
72 | 72 | |
73 | 73 | $comment_srl = Context::get('target_srl'); |
74 | - if(!$comment_srl) |
|
74 | + if (!$comment_srl) |
|
75 | 75 | { |
76 | 76 | return new BaseObject(-1, 'msg_invalid_request'); |
77 | 77 | } |
@@ -79,14 +79,14 @@ discard block |
||
79 | 79 | $oCommentModel = getModel('comment'); |
80 | 80 | $oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE); |
81 | 81 | $module_srl = $oComment->get('module_srl'); |
82 | - if(!$module_srl) |
|
82 | + if (!$module_srl) |
|
83 | 83 | { |
84 | 84 | return new BaseObject(-1, 'msg_invalid_request'); |
85 | 85 | } |
86 | 86 | |
87 | 87 | $oModuleModel = getModel('module'); |
88 | 88 | $comment_config = $oModuleModel->getModulePartConfig('comment', $module_srl); |
89 | - if($comment_config->use_vote_down == 'N') |
|
89 | + if ($comment_config->use_vote_down == 'N') |
|
90 | 90 | { |
91 | 91 | return new BaseObject(-1, 'msg_invalid_request'); |
92 | 92 | } |
@@ -103,13 +103,13 @@ discard block |
||
103 | 103 | */ |
104 | 104 | function procCommentDeclare() |
105 | 105 | { |
106 | - if(!Context::get('is_logged')) |
|
106 | + if (!Context::get('is_logged')) |
|
107 | 107 | { |
108 | 108 | return new BaseObject(-1, 'msg_invalid_request'); |
109 | 109 | } |
110 | 110 | |
111 | 111 | $comment_srl = Context::get('target_srl'); |
112 | - if(!$comment_srl) |
|
112 | + if (!$comment_srl) |
|
113 | 113 | { |
114 | 114 | return new BaseObject(-1, 'msg_invalid_request'); |
115 | 115 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | function triggerDeleteDocumentComments(&$obj) |
125 | 125 | { |
126 | 126 | $document_srl = $obj->document_srl; |
127 | - if(!$document_srl) |
|
127 | + if (!$document_srl) |
|
128 | 128 | { |
129 | 129 | return new BaseObject(); |
130 | 130 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | function triggerDeleteModuleComments(&$obj) |
140 | 140 | { |
141 | 141 | $module_srl = $obj->module_srl; |
142 | - if(!$module_srl) |
|
142 | + if (!$module_srl) |
|
143 | 143 | { |
144 | 144 | return new BaseObject(); |
145 | 145 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | */ |
167 | 167 | function isModuleUsingPublishValidation($module_srl = NULL) |
168 | 168 | { |
169 | - if($module_srl == NULL) |
|
169 | + if ($module_srl == NULL) |
|
170 | 170 | { |
171 | 171 | return FALSE; |
172 | 172 | } |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); |
176 | 176 | $module_part_config = $oModuleModel->getModulePartConfig('comment', $module_info->module_srl); |
177 | 177 | $use_validation = FALSE; |
178 | - if(isset($module_part_config->use_comment_validation) && $module_part_config->use_comment_validation == "Y") |
|
178 | + if (isset($module_part_config->use_comment_validation) && $module_part_config->use_comment_validation == "Y") |
|
179 | 179 | { |
180 | 180 | $use_validation = TRUE; |
181 | 181 | } |
@@ -190,12 +190,12 @@ discard block |
||
190 | 190 | */ |
191 | 191 | function insertComment($obj, $manual_inserted = FALSE) |
192 | 192 | { |
193 | - if(!$manual_inserted && !checkCSRF()) |
|
193 | + if (!$manual_inserted && !checkCSRF()) |
|
194 | 194 | { |
195 | 195 | return new BaseObject(-1, 'msg_invalid_request'); |
196 | 196 | } |
197 | 197 | |
198 | - if(!is_object($obj)) |
|
198 | + if (!is_object($obj)) |
|
199 | 199 | { |
200 | 200 | $obj = new stdClass(); |
201 | 201 | } |
@@ -203,12 +203,12 @@ discard block |
||
203 | 203 | // check if comment's module is using comment validation and set the publish status to 0 (false) |
204 | 204 | // for inserting query, otherwise default is 1 (true - means comment is published) |
205 | 205 | $using_validation = $this->isModuleUsingPublishValidation($obj->module_srl); |
206 | - if(!$manual_inserted) |
|
206 | + if (!$manual_inserted) |
|
207 | 207 | { |
208 | - if(Context::get('is_logged')) |
|
208 | + if (Context::get('is_logged')) |
|
209 | 209 | { |
210 | 210 | $logged_info = Context::get('logged_info'); |
211 | - if($logged_info->is_admin == 'Y') |
|
211 | + if ($logged_info->is_admin == 'Y') |
|
212 | 212 | { |
213 | 213 | $is_admin = TRUE; |
214 | 214 | } |
@@ -223,13 +223,13 @@ discard block |
||
223 | 223 | $is_admin = FALSE; |
224 | 224 | } |
225 | 225 | |
226 | - if(!$using_validation) |
|
226 | + if (!$using_validation) |
|
227 | 227 | { |
228 | 228 | $obj->status = 1; |
229 | 229 | } |
230 | 230 | else |
231 | 231 | { |
232 | - if($is_admin) |
|
232 | + if ($is_admin) |
|
233 | 233 | { |
234 | 234 | $obj->status = 1; |
235 | 235 | } |
@@ -242,14 +242,14 @@ discard block |
||
242 | 242 | |
243 | 243 | // call a trigger (before) |
244 | 244 | $output = ModuleHandler::triggerCall('comment.insertComment', 'before', $obj); |
245 | - if(!$output->toBool()) |
|
245 | + if (!$output->toBool()) |
|
246 | 246 | { |
247 | 247 | return $output; |
248 | 248 | } |
249 | 249 | |
250 | 250 | // check if a posting of the corresponding document_srl exists |
251 | 251 | $document_srl = $obj->document_srl; |
252 | - if(!$document_srl) |
|
252 | + if (!$document_srl) |
|
253 | 253 | { |
254 | 254 | return new BaseObject(-1, 'msg_invalid_document'); |
255 | 255 | } |
@@ -258,36 +258,36 @@ discard block |
||
258 | 258 | $oDocumentModel = getModel('document'); |
259 | 259 | |
260 | 260 | // even for manual_inserted if password exists, hash it. |
261 | - if($obj->password) |
|
261 | + if ($obj->password) |
|
262 | 262 | { |
263 | 263 | $obj->password = getModel('member')->hashPassword($obj->password); |
264 | 264 | } |
265 | 265 | |
266 | 266 | // get the original posting |
267 | - if(!$manual_inserted) |
|
267 | + if (!$manual_inserted) |
|
268 | 268 | { |
269 | 269 | $oDocument = $oDocumentModel->getDocument($document_srl); |
270 | 270 | |
271 | - if($document_srl != $oDocument->document_srl) |
|
271 | + if ($document_srl != $oDocument->document_srl) |
|
272 | 272 | { |
273 | 273 | return new BaseObject(-1, 'msg_invalid_document'); |
274 | 274 | } |
275 | - if($oDocument->isLocked()) |
|
275 | + if ($oDocument->isLocked()) |
|
276 | 276 | { |
277 | 277 | return new BaseObject(-1, 'msg_invalid_request'); |
278 | 278 | } |
279 | 279 | |
280 | - if($obj->homepage) |
|
280 | + if ($obj->homepage) |
|
281 | 281 | { |
282 | 282 | $obj->homepage = removeHackTag($obj->homepage); |
283 | - if(!preg_match('/^[a-z]+:\/\//i',$obj->homepage)) |
|
283 | + if (!preg_match('/^[a-z]+:\/\//i', $obj->homepage)) |
|
284 | 284 | { |
285 | 285 | $obj->homepage = 'http://'.$obj->homepage; |
286 | 286 | } |
287 | 287 | } |
288 | 288 | |
289 | 289 | // input the member's information if logged-in |
290 | - if(Context::get('is_logged')) |
|
290 | + if (Context::get('is_logged')) |
|
291 | 291 | { |
292 | 292 | $logged_info = Context::get('logged_info'); |
293 | 293 | $obj->member_srl = $logged_info->member_srl; |
@@ -302,16 +302,16 @@ discard block |
||
302 | 302 | } |
303 | 303 | |
304 | 304 | // error display if neither of log-in info and user name exist. |
305 | - if(!$logged_info->member_srl && !$obj->nick_name) |
|
305 | + if (!$logged_info->member_srl && !$obj->nick_name) |
|
306 | 306 | { |
307 | 307 | return new BaseObject(-1, 'msg_invalid_request'); |
308 | 308 | } |
309 | 309 | |
310 | - if(!$obj->comment_srl) |
|
310 | + if (!$obj->comment_srl) |
|
311 | 311 | { |
312 | 312 | $obj->comment_srl = getNextSequence(); |
313 | 313 | } |
314 | - elseif(!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl)) |
|
314 | + elseif (!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl)) |
|
315 | 315 | { |
316 | 316 | return new BaseObject(-1, 'msg_not_permitted'); |
317 | 317 | } |
@@ -322,32 +322,32 @@ discard block |
||
322 | 322 | // remove XE's own tags from the contents |
323 | 323 | $obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content); |
324 | 324 | |
325 | - if(Mobile::isFromMobilePhone() && $obj->use_editor != 'Y') |
|
325 | + if (Mobile::isFromMobilePhone() && $obj->use_editor != 'Y') |
|
326 | 326 | { |
327 | - if($obj->use_html != 'Y') |
|
327 | + if ($obj->use_html != 'Y') |
|
328 | 328 | { |
329 | 329 | $obj->content = htmlspecialchars($obj->content, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
330 | 330 | } |
331 | 331 | $obj->content = nl2br($obj->content); |
332 | 332 | } |
333 | 333 | |
334 | - if(!$obj->regdate) |
|
334 | + if (!$obj->regdate) |
|
335 | 335 | { |
336 | 336 | $obj->regdate = date("YmdHis"); |
337 | 337 | } |
338 | 338 | |
339 | 339 | // remove iframe and script if not a top administrator on the session. |
340 | - if($logged_info->is_admin != 'Y') |
|
340 | + if ($logged_info->is_admin != 'Y') |
|
341 | 341 | { |
342 | 342 | $obj->content = removeHackTag($obj->content); |
343 | 343 | } |
344 | 344 | |
345 | - if(!$obj->notify_message) |
|
345 | + if (!$obj->notify_message) |
|
346 | 346 | { |
347 | 347 | $obj->notify_message = 'N'; |
348 | 348 | } |
349 | 349 | |
350 | - if(!$obj->is_secret) |
|
350 | + if (!$obj->is_secret) |
|
351 | 351 | { |
352 | 352 | $obj->is_secret = 'N'; |
353 | 353 | } |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | $list_args->regdate = $obj->regdate; |
365 | 365 | |
366 | 366 | // If parent comment doesn't exist, set data directly |
367 | - if(!$obj->parent_srl) |
|
367 | + if (!$obj->parent_srl) |
|
368 | 368 | { |
369 | 369 | $list_args->head = $list_args->arrange = $obj->comment_srl; |
370 | 370 | $list_args->depth = 0; |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | $parent_output = executeQuery('comment.getCommentListItem', $parent_args); |
379 | 379 | |
380 | 380 | // return if no parent comment exists |
381 | - if(!$parent_output->toBool() || !$parent_output->data) |
|
381 | + if (!$parent_output->toBool() || !$parent_output->data) |
|
382 | 382 | { |
383 | 383 | return; |
384 | 384 | } |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | $list_args->depth = $parent->depth + 1; |
390 | 390 | |
391 | 391 | // if the depth of comments is less than 2, execute insert. |
392 | - if($list_args->depth < 2) |
|
392 | + if ($list_args->depth < 2) |
|
393 | 393 | { |
394 | 394 | $list_args->arrange = $obj->comment_srl; |
395 | 395 | // if the depth of comments is greater than 2, execute update. |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | $p_args->depth = $parent->depth; |
404 | 404 | $output = executeQuery('comment.getCommentParentNextSibling', $p_args); |
405 | 405 | |
406 | - if($output->data->arrange) |
|
406 | + if ($output->data->arrange) |
|
407 | 407 | { |
408 | 408 | $list_args->arrange = $output->data->arrange; |
409 | 409 | $output = executeQuery('comment.updateCommentListArrange', $list_args); |
@@ -416,14 +416,14 @@ discard block |
||
416 | 416 | } |
417 | 417 | |
418 | 418 | $output = executeQuery('comment.insertCommentList', $list_args); |
419 | - if(!$output->toBool()) |
|
419 | + if (!$output->toBool()) |
|
420 | 420 | { |
421 | 421 | return $output; |
422 | 422 | } |
423 | 423 | |
424 | 424 | // insert comment |
425 | 425 | $output = executeQuery('comment.insertComment', $obj); |
426 | - if(!$output->toBool()) |
|
426 | + if (!$output->toBool()) |
|
427 | 427 | { |
428 | 428 | $oDB->rollback(); |
429 | 429 | return $output; |
@@ -439,29 +439,29 @@ discard block |
||
439 | 439 | $oDocumentController = getController('document'); |
440 | 440 | |
441 | 441 | // Update the number of comments in the post |
442 | - if(!$using_validation) |
|
442 | + if (!$using_validation) |
|
443 | 443 | { |
444 | 444 | $output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, TRUE); |
445 | 445 | } |
446 | 446 | else |
447 | 447 | { |
448 | - if($is_admin) |
|
448 | + if ($is_admin) |
|
449 | 449 | { |
450 | 450 | $output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, TRUE); |
451 | 451 | } |
452 | 452 | } |
453 | 453 | |
454 | 454 | // grant autority of the comment |
455 | - if(!$manual_inserted) |
|
455 | + if (!$manual_inserted) |
|
456 | 456 | { |
457 | 457 | $this->addGrant($obj->comment_srl); |
458 | 458 | } |
459 | 459 | |
460 | 460 | // call a trigger(after) |
461 | - if($output->toBool()) |
|
461 | + if ($output->toBool()) |
|
462 | 462 | { |
463 | 463 | $trigger_output = ModuleHandler::triggerCall('comment.insertComment', 'after', $obj); |
464 | - if(!$trigger_output->toBool()) |
|
464 | + if (!$trigger_output->toBool()) |
|
465 | 465 | { |
466 | 466 | $oDB->rollback(); |
467 | 467 | return $trigger_output; |
@@ -471,16 +471,16 @@ discard block |
||
471 | 471 | // commit |
472 | 472 | $oDB->commit(); |
473 | 473 | |
474 | - if(!$manual_inserted) |
|
474 | + if (!$manual_inserted) |
|
475 | 475 | { |
476 | 476 | // send a message if notify_message option in enabled in the original article |
477 | 477 | $oDocument->notify(Context::getLang('comment'), $obj->content); |
478 | 478 | |
479 | 479 | // send a message if notify_message option in enabled in the original comment |
480 | - if($obj->parent_srl) |
|
480 | + if ($obj->parent_srl) |
|
481 | 481 | { |
482 | 482 | $oParent = $oCommentModel->getComment($obj->parent_srl); |
483 | - if($oParent->get('member_srl') != $oDocument->get('member_srl')) |
|
483 | + if ($oParent->get('member_srl') != $oDocument->get('member_srl')) |
|
484 | 484 | { |
485 | 485 | $oParent->notify(Context::getLang('comment'), $obj->content); |
486 | 486 | } |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | $oDocument = $oDocumentModel->getDocument($obj->document_srl); |
509 | 509 | |
510 | 510 | $oMemberModel = getModel("member"); |
511 | - if(isset($obj->member_srl) && !is_null($obj->member_srl)) |
|
511 | + if (isset($obj->member_srl) && !is_null($obj->member_srl)) |
|
512 | 512 | { |
513 | 513 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($obj->member_srl); |
514 | 514 | } |
@@ -528,47 +528,47 @@ discard block |
||
528 | 528 | $module_info = $oModuleModel->getModuleInfoByDocumentSrl($obj->document_srl); |
529 | 529 | |
530 | 530 | // If there is no problem to register comment then send an email to all admin were set in module admin panel |
531 | - if($module_info->admin_mail && $member_info->is_admin != 'Y') |
|
531 | + if ($module_info->admin_mail && $member_info->is_admin != 'Y') |
|
532 | 532 | { |
533 | 533 | $oMail = new Mail(); |
534 | 534 | $oMail->setSender($obj->email_address, $obj->email_address); |
535 | - $mail_title = "[XE - " . Context::get('mid') . "] A new comment was posted on document: \"" . $oDocument->getTitleText() . "\""; |
|
535 | + $mail_title = "[XE - ".Context::get('mid')."] A new comment was posted on document: \"".$oDocument->getTitleText()."\""; |
|
536 | 536 | $oMail->setTitle($mail_title); |
537 | - $url_comment = getFullUrl('','document_srl',$obj->document_srl).'#comment_'.$obj->comment_srl; |
|
538 | - if($using_validation) |
|
537 | + $url_comment = getFullUrl('', 'document_srl', $obj->document_srl).'#comment_'.$obj->comment_srl; |
|
538 | + if ($using_validation) |
|
539 | 539 | { |
540 | 540 | $url_approve = getFullUrl('', 'module', 'admin', 'act', 'procCommentAdminChangePublishedStatusChecked', 'cart[]', $obj->comment_srl, 'will_publish', '1', 'search_target', 'is_published', 'search_keyword', 'N'); |
541 | 541 | $url_trash = getFullUrl('', 'module', 'admin', 'act', 'procCommentAdminDeleteChecked', 'cart[]', $obj->comment_srl, 'search_target', 'is_trash', 'search_keyword', 'true'); |
542 | 542 | $mail_content = " |
543 | - A new comment on the document \"" . $oDocument->getTitleText() . "\" is waiting for your approval. |
|
543 | + A new comment on the document \"" . $oDocument->getTitleText()."\" is waiting for your approval. |
|
544 | 544 | <br /> |
545 | 545 | <br /> |
546 | - Author: " . $member_info->nick_name . " |
|
547 | - <br />Author e-mail: " . $member_info->email_address . " |
|
548 | - <br />From : <a href=\"" . $url_comment . "\">" . $url_comment . "</a> |
|
546 | + Author: " . $member_info->nick_name." |
|
547 | + <br />Author e-mail: " . $member_info->email_address." |
|
548 | + <br />From : <a href=\"" . $url_comment."\">".$url_comment."</a> |
|
549 | 549 | <br />Comment: |
550 | - <br />\"" . $obj->content . "\" |
|
550 | + <br />\"" . $obj->content."\" |
|
551 | 551 | <br />Document: |
552 | - <br />\"" . $oDocument->getContentText(). "\" |
|
552 | + <br />\"" . $oDocument->getContentText()."\" |
|
553 | 553 | <br /> |
554 | 554 | <br /> |
555 | - Approve it: <a href=\"" . $url_approve . "\">" . $url_approve . "</a> |
|
556 | - <br />Trash it: <a href=\"" . $url_trash . "\">" . $url_trash . "</a> |
|
557 | - <br />Currently " . $nr_comments_not_approved . " comments on \"" . Context::get('mid') . "\" module are waiting for approval. Please visit the moderation panel: |
|
558 | - <br /><a href=\"" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl) . "\">" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl) . "</a> |
|
555 | + Approve it: <a href=\"" . $url_approve."\">".$url_approve."</a> |
|
556 | + <br />Trash it: <a href=\"" . $url_trash."\">".$url_trash."</a> |
|
557 | + <br />Currently " . $nr_comments_not_approved." comments on \"".Context::get('mid')."\" module are waiting for approval. Please visit the moderation panel: |
|
558 | + <br /><a href=\"" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl)."\">".getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl)."</a> |
|
559 | 559 | "; |
560 | 560 | $oMail->setContent($mail_content); |
561 | 561 | } |
562 | 562 | else |
563 | 563 | { |
564 | 564 | $mail_content = " |
565 | - Author: " . $member_info->nick_name . " |
|
566 | - <br />Author e-mail: " . $member_info->email_address . " |
|
567 | - <br />From : <a href=\"" . $url_comment . "\">" . $url_comment . "</a> |
|
565 | + Author: " . $member_info->nick_name." |
|
566 | + <br />Author e-mail: " . $member_info->email_address." |
|
567 | + <br />From : <a href=\"" . $url_comment."\">".$url_comment."</a> |
|
568 | 568 | <br />Comment: |
569 | - <br />\"" . $obj->content . "\" |
|
569 | + <br />\"" . $obj->content."\" |
|
570 | 570 | <br />Document: |
571 | - <br />\"" . $oDocument->getContentText(). "\" |
|
571 | + <br />\"" . $oDocument->getContentText()."\" |
|
572 | 572 | "; |
573 | 573 | $oMail->setContent($mail_content); |
574 | 574 | |
@@ -597,10 +597,10 @@ discard block |
||
597 | 597 | $target_mail = explode(',', $admins_emails); |
598 | 598 | |
599 | 599 | // send email to all admins - START |
600 | - for($i = 0; $i < count($target_mail); $i++) |
|
600 | + for ($i = 0; $i < count($target_mail); $i++) |
|
601 | 601 | { |
602 | 602 | $email_address = trim($target_mail[$i]); |
603 | - if(!$email_address) |
|
603 | + if (!$email_address) |
|
604 | 604 | { |
605 | 605 | continue; |
606 | 606 | } |
@@ -646,12 +646,12 @@ discard block |
||
646 | 646 | */ |
647 | 647 | function updateComment($obj, $is_admin = FALSE, $manual_updated = FALSE) |
648 | 648 | { |
649 | - if(!$manual_updated && !checkCSRF()) |
|
649 | + if (!$manual_updated && !checkCSRF()) |
|
650 | 650 | { |
651 | 651 | return new BaseObject(-1, 'msg_invalid_request'); |
652 | 652 | } |
653 | 653 | |
654 | - if(!is_object($obj)) |
|
654 | + if (!is_object($obj)) |
|
655 | 655 | { |
656 | 656 | $obj = new stdClass(); |
657 | 657 | } |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | |
661 | 661 | // call a trigger (before) |
662 | 662 | $output = ModuleHandler::triggerCall('comment.updateComment', 'before', $obj); |
663 | - if(!$output->toBool()) |
|
663 | + if (!$output->toBool()) |
|
664 | 664 | { |
665 | 665 | return $output; |
666 | 666 | } |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | |
671 | 671 | // get the original data |
672 | 672 | $source_obj = $oCommentModel->getComment($obj->comment_srl); |
673 | - if(!$source_obj->getMemberSrl()) |
|
673 | + if (!$source_obj->getMemberSrl()) |
|
674 | 674 | { |
675 | 675 | $obj->member_srl = $source_obj->get('member_srl'); |
676 | 676 | $obj->user_name = $source_obj->get('user_name'); |
@@ -680,30 +680,30 @@ discard block |
||
680 | 680 | } |
681 | 681 | |
682 | 682 | // check if permission is granted |
683 | - if(!$is_admin && !$source_obj->isGranted()) |
|
683 | + if (!$is_admin && !$source_obj->isGranted()) |
|
684 | 684 | { |
685 | 685 | return new BaseObject(-1, 'msg_not_permitted'); |
686 | 686 | } |
687 | 687 | |
688 | - if($obj->password) |
|
688 | + if ($obj->password) |
|
689 | 689 | { |
690 | 690 | $obj->password = getModel('member')->hashPassword($obj->password); |
691 | 691 | } |
692 | 692 | |
693 | - if($obj->homepage) |
|
693 | + if ($obj->homepage) |
|
694 | 694 | { |
695 | 695 | $obj->homepage = removeHackTag($obj->homepage); |
696 | - if(!preg_match('/^[a-z]+:\/\//i',$obj->homepage)) |
|
696 | + if (!preg_match('/^[a-z]+:\/\//i', $obj->homepage)) |
|
697 | 697 | { |
698 | 698 | $obj->homepage = 'http://'.$obj->homepage; |
699 | 699 | } |
700 | 700 | } |
701 | 701 | |
702 | 702 | // set modifier's information if logged-in and posting author and modifier are matched. |
703 | - if(Context::get('is_logged')) |
|
703 | + if (Context::get('is_logged')) |
|
704 | 704 | { |
705 | 705 | $logged_info = Context::get('logged_info'); |
706 | - if($source_obj->member_srl == $logged_info->member_srl) |
|
706 | + if ($source_obj->member_srl == $logged_info->member_srl) |
|
707 | 707 | { |
708 | 708 | $obj->member_srl = $logged_info->member_srl; |
709 | 709 | $obj->user_name = $logged_info->user_name; |
@@ -714,7 +714,7 @@ discard block |
||
714 | 714 | } |
715 | 715 | |
716 | 716 | // if nick_name of the logged-in author doesn't exist |
717 | - if($source_obj->get('member_srl') && !$obj->nick_name) |
|
717 | + if ($source_obj->get('member_srl') && !$obj->nick_name) |
|
718 | 718 | { |
719 | 719 | $obj->member_srl = $source_obj->get('member_srl'); |
720 | 720 | $obj->user_name = $source_obj->get('user_name'); |
@@ -723,7 +723,7 @@ discard block |
||
723 | 723 | $obj->homepage = $source_obj->get('homepage'); |
724 | 724 | } |
725 | 725 | |
726 | - if(!$obj->content) |
|
726 | + if (!$obj->content) |
|
727 | 727 | { |
728 | 728 | $obj->content = $source_obj->get('content'); |
729 | 729 | } |
@@ -731,9 +731,9 @@ discard block |
||
731 | 731 | // remove XE's wn tags from contents |
732 | 732 | $obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content); |
733 | 733 | |
734 | - if(Mobile::isFromMobilePhone() && $obj->use_editor != 'Y') |
|
734 | + if (Mobile::isFromMobilePhone() && $obj->use_editor != 'Y') |
|
735 | 735 | { |
736 | - if($obj->use_html != 'Y') |
|
736 | + if ($obj->use_html != 'Y') |
|
737 | 737 | { |
738 | 738 | $obj->content = htmlspecialchars($obj->content, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
739 | 739 | } |
@@ -741,7 +741,7 @@ discard block |
||
741 | 741 | } |
742 | 742 | |
743 | 743 | // remove iframe and script if not a top administrator on the session |
744 | - if($logged_info->is_admin != 'Y') |
|
744 | + if ($logged_info->is_admin != 'Y') |
|
745 | 745 | { |
746 | 746 | $obj->content = removeHackTag($obj->content); |
747 | 747 | } |
@@ -752,17 +752,17 @@ discard block |
||
752 | 752 | |
753 | 753 | // Update |
754 | 754 | $output = executeQuery('comment.updateComment', $obj); |
755 | - if(!$output->toBool()) |
|
755 | + if (!$output->toBool()) |
|
756 | 756 | { |
757 | 757 | $oDB->rollback(); |
758 | 758 | return $output; |
759 | 759 | } |
760 | 760 | |
761 | 761 | // call a trigger (after) |
762 | - if($output->toBool()) |
|
762 | + if ($output->toBool()) |
|
763 | 763 | { |
764 | 764 | $trigger_output = ModuleHandler::triggerCall('comment.updateComment', 'after', $obj); |
765 | - if(!$trigger_output->toBool()) |
|
765 | + if (!$trigger_output->toBool()) |
|
766 | 766 | { |
767 | 767 | $oDB->rollback(); |
768 | 768 | return $trigger_output; |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | |
792 | 792 | // check if comment already exists |
793 | 793 | $comment = $oCommentModel->getComment($comment_srl); |
794 | - if($comment->comment_srl != $comment_srl) |
|
794 | + if ($comment->comment_srl != $comment_srl) |
|
795 | 795 | { |
796 | 796 | return new BaseObject(-1, 'msg_invalid_request'); |
797 | 797 | } |
@@ -800,28 +800,28 @@ discard block |
||
800 | 800 | |
801 | 801 | // call a trigger (before) |
802 | 802 | $output = ModuleHandler::triggerCall('comment.deleteComment', 'before', $comment); |
803 | - if(!$output->toBool()) |
|
803 | + if (!$output->toBool()) |
|
804 | 804 | { |
805 | 805 | return $output; |
806 | 806 | } |
807 | 807 | |
808 | 808 | // check if permission is granted |
809 | - if(!$is_admin && !$comment->isGranted()) |
|
809 | + if (!$is_admin && !$comment->isGranted()) |
|
810 | 810 | { |
811 | 811 | return new BaseObject(-1, 'msg_not_permitted'); |
812 | 812 | } |
813 | 813 | |
814 | 814 | // check if child comment exists on the comment |
815 | 815 | $childs = $oCommentModel->getChildComments($comment_srl); |
816 | - if(count($childs) > 0) |
|
816 | + if (count($childs) > 0) |
|
817 | 817 | { |
818 | 818 | $deleteAllComment = TRUE; |
819 | - if(!$is_admin) |
|
819 | + if (!$is_admin) |
|
820 | 820 | { |
821 | 821 | $logged_info = Context::get('logged_info'); |
822 | - foreach($childs as $val) |
|
822 | + foreach ($childs as $val) |
|
823 | 823 | { |
824 | - if($val->member_srl != $logged_info->member_srl) |
|
824 | + if ($val->member_srl != $logged_info->member_srl) |
|
825 | 825 | { |
826 | 826 | $deleteAllComment = FALSE; |
827 | 827 | break; |
@@ -829,16 +829,16 @@ discard block |
||
829 | 829 | } |
830 | 830 | } |
831 | 831 | |
832 | - if(!$deleteAllComment) |
|
832 | + if (!$deleteAllComment) |
|
833 | 833 | { |
834 | 834 | return new BaseObject(-1, 'fail_to_delete_have_children'); |
835 | 835 | } |
836 | 836 | else |
837 | 837 | { |
838 | - foreach($childs as $val) |
|
838 | + foreach ($childs as $val) |
|
839 | 839 | { |
840 | 840 | $output = $this->deleteComment($val->comment_srl, $is_admin, $isMoveToTrash); |
841 | - if(!$output->toBool()) |
|
841 | + if (!$output->toBool()) |
|
842 | 842 | { |
843 | 843 | return $output; |
844 | 844 | } |
@@ -854,7 +854,7 @@ discard block |
||
854 | 854 | $args = new stdClass(); |
855 | 855 | $args->comment_srl = $comment_srl; |
856 | 856 | $output = executeQuery('comment.deleteComment', $args); |
857 | - if(!$output->toBool()) |
|
857 | + if (!$output->toBool()) |
|
858 | 858 | { |
859 | 859 | $oDB->rollback(); |
860 | 860 | return $output; |
@@ -866,14 +866,14 @@ discard block |
||
866 | 866 | $comment_count = $oCommentModel->getCommentCount($document_srl); |
867 | 867 | |
868 | 868 | // only document is exists |
869 | - if(isset($comment_count)) |
|
869 | + if (isset($comment_count)) |
|
870 | 870 | { |
871 | 871 | // create the controller object of the document |
872 | 872 | $oDocumentController = getController('document'); |
873 | 873 | |
874 | 874 | // update comment count of the article posting |
875 | 875 | $output = $oDocumentController->updateCommentCount($document_srl, $comment_count, NULL, FALSE); |
876 | - if(!$output->toBool()) |
|
876 | + if (!$output->toBool()) |
|
877 | 877 | { |
878 | 878 | $oDB->rollback(); |
879 | 879 | return $output; |
@@ -881,11 +881,11 @@ discard block |
||
881 | 881 | } |
882 | 882 | |
883 | 883 | // call a trigger (after) |
884 | - if($output->toBool()) |
|
884 | + if ($output->toBool()) |
|
885 | 885 | { |
886 | 886 | $comment->isMoveToTrash = $isMoveToTrash; |
887 | 887 | $trigger_output = ModuleHandler::triggerCall('comment.deleteComment', 'after', $comment); |
888 | - if(!$trigger_output->toBool()) |
|
888 | + if (!$trigger_output->toBool()) |
|
889 | 889 | { |
890 | 890 | $oDB->rollback(); |
891 | 891 | return $trigger_output; |
@@ -893,7 +893,7 @@ discard block |
||
893 | 893 | unset($comment->isMoveToTrash); |
894 | 894 | } |
895 | 895 | |
896 | - if(!$isMoveToTrash) |
|
896 | + if (!$isMoveToTrash) |
|
897 | 897 | { |
898 | 898 | $this->_deleteDeclaredComments($args); |
899 | 899 | $this->_deleteVotedComments($args); |
@@ -937,7 +937,7 @@ discard block |
||
937 | 937 | $oCommentModel = getModel('comment'); |
938 | 938 | |
939 | 939 | // check if permission is granted |
940 | - if(is_object($obj)) |
|
940 | + if (is_object($obj)) |
|
941 | 941 | { |
942 | 942 | $oDocument = new documentItem(); |
943 | 943 | $oDocument->setAttribute($obj); |
@@ -947,7 +947,7 @@ discard block |
||
947 | 947 | $oDocument = $oDocumentModel->getDocument($document_srl); |
948 | 948 | } |
949 | 949 | |
950 | - if(!$oDocument->isExists() || !$oDocument->isGranted()) |
|
950 | + if (!$oDocument->isExists() || !$oDocument->isGranted()) |
|
951 | 951 | { |
952 | 952 | return new BaseObject(-1, 'msg_not_permitted'); |
953 | 953 | } |
@@ -956,23 +956,23 @@ discard block |
||
956 | 956 | $args = new stdClass(); |
957 | 957 | $args->document_srl = $document_srl; |
958 | 958 | $comments = executeQueryArray('comment.getAllComments', $args); |
959 | - if($comments->data) |
|
959 | + if ($comments->data) |
|
960 | 960 | { |
961 | 961 | $commentSrlList = array(); |
962 | - foreach($comments->data as $comment) |
|
962 | + foreach ($comments->data as $comment) |
|
963 | 963 | { |
964 | 964 | $commentSrlList[] = $comment->comment_srl; |
965 | 965 | |
966 | 966 | // call a trigger (before) |
967 | 967 | $output = ModuleHandler::triggerCall('comment.deleteComment', 'before', $comment); |
968 | - if(!$output->toBool()) |
|
968 | + if (!$output->toBool()) |
|
969 | 969 | { |
970 | 970 | continue; |
971 | 971 | } |
972 | 972 | |
973 | 973 | // call a trigger (after) |
974 | 974 | $output = ModuleHandler::triggerCall('comment.deleteComment', 'after', $comment); |
975 | - if(!$output->toBool()) |
|
975 | + if (!$output->toBool()) |
|
976 | 976 | { |
977 | 977 | continue; |
978 | 978 | } |
@@ -982,7 +982,7 @@ discard block |
||
982 | 982 | // delete the comment |
983 | 983 | $args->document_srl = $document_srl; |
984 | 984 | $output = executeQuery('comment.deleteComments', $args); |
985 | - if(!$output->toBool()) |
|
985 | + if (!$output->toBool()) |
|
986 | 986 | { |
987 | 987 | return $output; |
988 | 988 | } |
@@ -991,7 +991,7 @@ discard block |
||
991 | 991 | $output = executeQuery('comment.deleteCommentsList', $args); |
992 | 992 | |
993 | 993 | //delete declared, declared_log, voted_log |
994 | - if(is_array($commentSrlList) && count($commentSrlList) > 0) |
|
994 | + if (is_array($commentSrlList) && count($commentSrlList) > 0) |
|
995 | 995 | { |
996 | 996 | $args = new stdClass(); |
997 | 997 | $args->comment_srl = join(',', $commentSrlList); |
@@ -1031,7 +1031,7 @@ discard block |
||
1031 | 1031 | */ |
1032 | 1032 | function updateVotedCount($comment_srl, $point = 1) |
1033 | 1033 | { |
1034 | - if($point > 0) |
|
1034 | + if ($point > 0) |
|
1035 | 1035 | { |
1036 | 1036 | $failed_voted = 'failed_voted'; |
1037 | 1037 | $success_message = 'success_voted'; |
@@ -1043,7 +1043,7 @@ discard block |
||
1043 | 1043 | } |
1044 | 1044 | |
1045 | 1045 | // invalid vote if vote info exists in the session info. |
1046 | - if($_SESSION['voted_comment'][$comment_srl]) |
|
1046 | + if ($_SESSION['voted_comment'][$comment_srl]) |
|
1047 | 1047 | { |
1048 | 1048 | return new BaseObject(-1, $failed_voted); |
1049 | 1049 | } |
@@ -1052,21 +1052,21 @@ discard block |
||
1052 | 1052 | $oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE); |
1053 | 1053 | |
1054 | 1054 | // invalid vote if both ip addresses between author's and the current user are same. |
1055 | - if($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR']) |
|
1055 | + if ($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR']) |
|
1056 | 1056 | { |
1057 | 1057 | $_SESSION['voted_comment'][$comment_srl] = TRUE; |
1058 | 1058 | return new BaseObject(-1, $failed_voted); |
1059 | 1059 | } |
1060 | 1060 | |
1061 | 1061 | // if the comment author is a member |
1062 | - if($oComment->get('member_srl')) |
|
1062 | + if ($oComment->get('member_srl')) |
|
1063 | 1063 | { |
1064 | 1064 | // create the member model object |
1065 | 1065 | $oMemberModel = getModel('member'); |
1066 | 1066 | $member_srl = $oMemberModel->getLoggedMemberSrl(); |
1067 | 1067 | |
1068 | 1068 | // session registered if the author information matches to the current logged-in user's. |
1069 | - if($member_srl && $member_srl == abs($oComment->get('member_srl'))) |
|
1069 | + if ($member_srl && $member_srl == abs($oComment->get('member_srl'))) |
|
1070 | 1070 | { |
1071 | 1071 | $_SESSION['voted_comment'][$comment_srl] = TRUE; |
1072 | 1072 | return new BaseObject(-1, $failed_voted); |
@@ -1076,7 +1076,7 @@ discard block |
||
1076 | 1076 | $args = new stdClass(); |
1077 | 1077 | |
1078 | 1078 | // If logged-in, use the member_srl. otherwise use the ipaddress. |
1079 | - if($member_srl) |
|
1079 | + if ($member_srl) |
|
1080 | 1080 | { |
1081 | 1081 | $args->member_srl = $member_srl; |
1082 | 1082 | } |
@@ -1089,7 +1089,7 @@ discard block |
||
1089 | 1089 | $output = executeQuery('comment.getCommentVotedLogInfo', $args); |
1090 | 1090 | |
1091 | 1091 | // session registered if log info contains recommendation vote log. |
1092 | - if($output->data->count) |
|
1092 | + if ($output->data->count) |
|
1093 | 1093 | { |
1094 | 1094 | $_SESSION['voted_comment'][$comment_srl] = TRUE; |
1095 | 1095 | return new BaseObject(-1, $failed_voted); |
@@ -1100,7 +1100,7 @@ discard block |
||
1100 | 1100 | $oDB->begin(); |
1101 | 1101 | |
1102 | 1102 | // update the number of votes |
1103 | - if($point < 0) |
|
1103 | + if ($point < 0) |
|
1104 | 1104 | { |
1105 | 1105 | $args->blamed_count = $oComment->get('blamed_count') + $point; |
1106 | 1106 | $output = executeQuery('comment.updateBlamedCount', $args); |
@@ -1124,7 +1124,7 @@ discard block |
||
1124 | 1124 | $obj->before_point = ($point < 0) ? $oComment->get('blamed_count') : $oComment->get('voted_count'); |
1125 | 1125 | $obj->after_point = ($point < 0) ? $args->blamed_count : $args->voted_count; |
1126 | 1126 | $trigger_output = ModuleHandler::triggerCall('comment.updateVotedCount', 'after', $obj); |
1127 | - if(!$trigger_output->toBool()) |
|
1127 | + if (!$trigger_output->toBool()) |
|
1128 | 1128 | { |
1129 | 1129 | $oDB->rollback(); |
1130 | 1130 | return $trigger_output; |
@@ -1137,7 +1137,7 @@ discard block |
||
1137 | 1137 | |
1138 | 1138 | // Return the result |
1139 | 1139 | $output = new BaseObject(0, $success_message); |
1140 | - if($point > 0) |
|
1140 | + if ($point > 0) |
|
1141 | 1141 | { |
1142 | 1142 | $output->add('voted_count', $obj->after_point); |
1143 | 1143 | } |
@@ -1157,7 +1157,7 @@ discard block |
||
1157 | 1157 | function declaredComment($comment_srl) |
1158 | 1158 | { |
1159 | 1159 | // Fail if session information already has a reported document |
1160 | - if($_SESSION['declared_comment'][$comment_srl]) |
|
1160 | + if ($_SESSION['declared_comment'][$comment_srl]) |
|
1161 | 1161 | { |
1162 | 1162 | return new BaseObject(-1, 'failed_declared'); |
1163 | 1163 | } |
@@ -1166,7 +1166,7 @@ discard block |
||
1166 | 1166 | $args = new stdClass(); |
1167 | 1167 | $args->comment_srl = $comment_srl; |
1168 | 1168 | $output = executeQuery('comment.getDeclaredComment', $args); |
1169 | - if(!$output->toBool()) |
|
1169 | + if (!$output->toBool()) |
|
1170 | 1170 | { |
1171 | 1171 | return $output; |
1172 | 1172 | } |
@@ -1178,7 +1178,7 @@ discard block |
||
1178 | 1178 | |
1179 | 1179 | // Call a trigger (before) |
1180 | 1180 | $trigger_output = ModuleHandler::triggerCall('comment.declaredComment', 'before', $trigger_obj); |
1181 | - if(!$trigger_output->toBool()) |
|
1181 | + if (!$trigger_output->toBool()) |
|
1182 | 1182 | { |
1183 | 1183 | return $trigger_output; |
1184 | 1184 | } |
@@ -1188,21 +1188,21 @@ discard block |
||
1188 | 1188 | $oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE); |
1189 | 1189 | |
1190 | 1190 | // failed if both ip addresses between author's and the current user are same. |
1191 | - if($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR']) |
|
1191 | + if ($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR']) |
|
1192 | 1192 | { |
1193 | 1193 | $_SESSION['declared_comment'][$comment_srl] = TRUE; |
1194 | 1194 | return new BaseObject(-1, 'failed_declared'); |
1195 | 1195 | } |
1196 | 1196 | |
1197 | 1197 | // if the comment author is a member |
1198 | - if($oComment->get('member_srl')) |
|
1198 | + if ($oComment->get('member_srl')) |
|
1199 | 1199 | { |
1200 | 1200 | // create the member model object |
1201 | 1201 | $oMemberModel = getModel('member'); |
1202 | 1202 | $member_srl = $oMemberModel->getLoggedMemberSrl(); |
1203 | 1203 | |
1204 | 1204 | // session registered if the author information matches to the current logged-in user's. |
1205 | - if($member_srl && $member_srl == abs($oComment->get('member_srl'))) |
|
1205 | + if ($member_srl && $member_srl == abs($oComment->get('member_srl'))) |
|
1206 | 1206 | { |
1207 | 1207 | $_SESSION['declared_comment'][$comment_srl] = TRUE; |
1208 | 1208 | return new BaseObject(-1, 'failed_declared'); |
@@ -1210,7 +1210,7 @@ discard block |
||
1210 | 1210 | } |
1211 | 1211 | |
1212 | 1212 | // If logged-in, use the member_srl. otherwise use the ipaddress. |
1213 | - if($member_srl) |
|
1213 | + if ($member_srl) |
|
1214 | 1214 | { |
1215 | 1215 | $args->member_srl = $member_srl; |
1216 | 1216 | } |
@@ -1222,7 +1222,7 @@ discard block |
||
1222 | 1222 | $log_output = executeQuery('comment.getCommentDeclaredLogInfo', $args); |
1223 | 1223 | |
1224 | 1224 | // session registered if log info contains report log. |
1225 | - if($log_output->data->count) |
|
1225 | + if ($log_output->data->count) |
|
1226 | 1226 | { |
1227 | 1227 | $_SESSION['declared_comment'][$comment_srl] = TRUE; |
1228 | 1228 | return new BaseObject(-1, 'failed_declared'); |
@@ -1233,7 +1233,7 @@ discard block |
||
1233 | 1233 | $oDB->begin(); |
1234 | 1234 | |
1235 | 1235 | // execute insert |
1236 | - if($output->data->declared_count > 0) |
|
1236 | + if ($output->data->declared_count > 0) |
|
1237 | 1237 | { |
1238 | 1238 | $output = executeQuery('comment.updateDeclaredComment', $args); |
1239 | 1239 | } |
@@ -1242,7 +1242,7 @@ discard block |
||
1242 | 1242 | $output = executeQuery('comment.insertDeclaredComment', $args); |
1243 | 1243 | } |
1244 | 1244 | |
1245 | - if(!$output->toBool()) |
|
1245 | + if (!$output->toBool()) |
|
1246 | 1246 | { |
1247 | 1247 | $oDB->rollback(); |
1248 | 1248 | return $output; |
@@ -1254,7 +1254,7 @@ discard block |
||
1254 | 1254 | // Call a trigger (after) |
1255 | 1255 | $trigger_obj->declared_count = $declared_count + 1; |
1256 | 1256 | $trigger_output = ModuleHandler::triggerCall('comment.declaredComment', 'after', $trigger_obj); |
1257 | - if(!$trigger_output->toBool()) |
|
1257 | + if (!$trigger_output->toBool()) |
|
1258 | 1258 | { |
1259 | 1259 | $oDB->rollback(); |
1260 | 1260 | return $trigger_output; |
@@ -1279,7 +1279,7 @@ discard block |
||
1279 | 1279 | function addCommentPopupMenu($url, $str, $icon = '', $target = 'self') |
1280 | 1280 | { |
1281 | 1281 | $comment_popup_menu_list = Context::get('comment_popup_menu_list'); |
1282 | - if(!is_array($comment_popup_menu_list)) |
|
1282 | + if (!is_array($comment_popup_menu_list)) |
|
1283 | 1283 | { |
1284 | 1284 | $comment_popup_menu_list = array(); |
1285 | 1285 | } |
@@ -1301,7 +1301,7 @@ discard block |
||
1301 | 1301 | function procCommentInsertModuleConfig() |
1302 | 1302 | { |
1303 | 1303 | $module_srl = Context::get('target_module_srl'); |
1304 | - if(preg_match('/^([0-9,]+)$/', $module_srl)) |
|
1304 | + if (preg_match('/^([0-9,]+)$/', $module_srl)) |
|
1305 | 1305 | { |
1306 | 1306 | $module_srl = explode(',', $module_srl); |
1307 | 1307 | } |
@@ -1312,33 +1312,33 @@ discard block |
||
1312 | 1312 | |
1313 | 1313 | $comment_config = new stdClass(); |
1314 | 1314 | $comment_config->comment_count = (int) Context::get('comment_count'); |
1315 | - if(!$comment_config->comment_count) |
|
1315 | + if (!$comment_config->comment_count) |
|
1316 | 1316 | { |
1317 | 1317 | $comment_config->comment_count = 50; |
1318 | 1318 | } |
1319 | 1319 | |
1320 | 1320 | $comment_config->use_vote_up = Context::get('use_vote_up'); |
1321 | - if(!$comment_config->use_vote_up) |
|
1321 | + if (!$comment_config->use_vote_up) |
|
1322 | 1322 | { |
1323 | 1323 | $comment_config->use_vote_up = 'Y'; |
1324 | 1324 | } |
1325 | 1325 | |
1326 | 1326 | $comment_config->use_vote_down = Context::get('use_vote_down'); |
1327 | - if(!$comment_config->use_vote_down) |
|
1327 | + if (!$comment_config->use_vote_down) |
|
1328 | 1328 | { |
1329 | 1329 | $comment_config->use_vote_down = 'Y'; |
1330 | 1330 | } |
1331 | 1331 | |
1332 | 1332 | $comment_config->use_comment_validation = Context::get('use_comment_validation'); |
1333 | - if(!$comment_config->use_comment_validation) |
|
1333 | + if (!$comment_config->use_comment_validation) |
|
1334 | 1334 | { |
1335 | 1335 | $comment_config->use_comment_validation = 'N'; |
1336 | 1336 | } |
1337 | 1337 | |
1338 | - for($i = 0; $i < count($module_srl); $i++) |
|
1338 | + for ($i = 0; $i < count($module_srl); $i++) |
|
1339 | 1339 | { |
1340 | 1340 | $srl = trim($module_srl[$i]); |
1341 | - if(!$srl) |
|
1341 | + if (!$srl) |
|
1342 | 1342 | { |
1343 | 1343 | continue; |
1344 | 1344 | } |
@@ -1372,25 +1372,25 @@ discard block |
||
1372 | 1372 | */ |
1373 | 1373 | function procCommentGetList() |
1374 | 1374 | { |
1375 | - if(!Context::get('is_logged')) |
|
1375 | + if (!Context::get('is_logged')) |
|
1376 | 1376 | { |
1377 | 1377 | return new BaseObject(-1, 'msg_not_permitted'); |
1378 | 1378 | } |
1379 | 1379 | |
1380 | 1380 | $commentSrls = Context::get('comment_srls'); |
1381 | - if($commentSrls) |
|
1381 | + if ($commentSrls) |
|
1382 | 1382 | { |
1383 | 1383 | $commentSrlList = explode(',', $commentSrls); |
1384 | 1384 | } |
1385 | 1385 | |
1386 | - if(count($commentSrlList) > 0) |
|
1386 | + if (count($commentSrlList) > 0) |
|
1387 | 1387 | { |
1388 | 1388 | $oCommentModel = getModel('comment'); |
1389 | 1389 | $commentList = $oCommentModel->getComments($commentSrlList); |
1390 | 1390 | |
1391 | - if(is_array($commentList)) |
|
1391 | + if (is_array($commentList)) |
|
1392 | 1392 | { |
1393 | - foreach($commentList as $value) |
|
1393 | + foreach ($commentList as $value) |
|
1394 | 1394 | { |
1395 | 1395 | $value->content = strip_tags($value->content); |
1396 | 1396 | } |
@@ -1415,9 +1415,9 @@ discard block |
||
1415 | 1415 | $commentConfig = $oModuleModel->getModulePartConfig('comment', $obj->originModuleSrl); |
1416 | 1416 | |
1417 | 1417 | $oModuleController = getController('module'); |
1418 | - if(is_array($obj->moduleSrlList)) |
|
1418 | + if (is_array($obj->moduleSrlList)) |
|
1419 | 1419 | { |
1420 | - foreach($obj->moduleSrlList as $moduleSrl) |
|
1420 | + foreach ($obj->moduleSrlList as $moduleSrl) |
|
1421 | 1421 | { |
1422 | 1422 | $oModuleController->insertModulePartConfig('comment', $moduleSrl, $commentConfig); |
1423 | 1423 | } |
@@ -211,14 +211,12 @@ discard block |
||
211 | 211 | if($logged_info->is_admin == 'Y') |
212 | 212 | { |
213 | 213 | $is_admin = TRUE; |
214 | - } |
|
215 | - else |
|
214 | + } else |
|
216 | 215 | { |
217 | 216 | $is_admin = FALSE; |
218 | 217 | } |
219 | 218 | } |
220 | - } |
|
221 | - else |
|
219 | + } else |
|
222 | 220 | { |
223 | 221 | $is_admin = FALSE; |
224 | 222 | } |
@@ -226,14 +224,12 @@ discard block |
||
226 | 224 | if(!$using_validation) |
227 | 225 | { |
228 | 226 | $obj->status = 1; |
229 | - } |
|
230 | - else |
|
227 | + } else |
|
231 | 228 | { |
232 | 229 | if($is_admin) |
233 | 230 | { |
234 | 231 | $obj->status = 1; |
235 | - } |
|
236 | - else |
|
232 | + } else |
|
237 | 233 | { |
238 | 234 | $obj->status = 0; |
239 | 235 | } |
@@ -310,8 +306,7 @@ discard block |
||
310 | 306 | if(!$obj->comment_srl) |
311 | 307 | { |
312 | 308 | $obj->comment_srl = getNextSequence(); |
313 | - } |
|
314 | - elseif(!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl)) |
|
309 | + } elseif(!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl)) |
|
315 | 310 | { |
316 | 311 | return new BaseObject(-1, 'msg_not_permitted'); |
317 | 312 | } |
@@ -369,8 +364,7 @@ discard block |
||
369 | 364 | $list_args->head = $list_args->arrange = $obj->comment_srl; |
370 | 365 | $list_args->depth = 0; |
371 | 366 | // If parent comment exists, get information of the parent comment |
372 | - } |
|
373 | - else |
|
367 | + } else |
|
374 | 368 | { |
375 | 369 | // get information of the parent comment posting |
376 | 370 | $parent_args = new stdClass(); |
@@ -393,8 +387,7 @@ discard block |
||
393 | 387 | { |
394 | 388 | $list_args->arrange = $obj->comment_srl; |
395 | 389 | // if the depth of comments is greater than 2, execute update. |
396 | - } |
|
397 | - else |
|
390 | + } else |
|
398 | 391 | { |
399 | 392 | // get the top listed comment among those in lower depth and same head with parent's. |
400 | 393 | $p_args = new stdClass(); |
@@ -407,8 +400,7 @@ discard block |
||
407 | 400 | { |
408 | 401 | $list_args->arrange = $output->data->arrange; |
409 | 402 | $output = executeQuery('comment.updateCommentListArrange', $list_args); |
410 | - } |
|
411 | - else |
|
403 | + } else |
|
412 | 404 | { |
413 | 405 | $list_args->arrange = $obj->comment_srl; |
414 | 406 | } |
@@ -442,8 +434,7 @@ discard block |
||
442 | 434 | if(!$using_validation) |
443 | 435 | { |
444 | 436 | $output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, TRUE); |
445 | - } |
|
446 | - else |
|
437 | + } else |
|
447 | 438 | { |
448 | 439 | if($is_admin) |
449 | 440 | { |
@@ -511,8 +502,7 @@ discard block |
||
511 | 502 | if(isset($obj->member_srl) && !is_null($obj->member_srl)) |
512 | 503 | { |
513 | 504 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($obj->member_srl); |
514 | - } |
|
515 | - else |
|
505 | + } else |
|
516 | 506 | { |
517 | 507 | $member_info = new stdClass(); |
518 | 508 | $member_info->is_admin = "N"; |
@@ -558,8 +548,7 @@ discard block |
||
558 | 548 | <br /><a href=\"" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl) . "\">" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl) . "</a> |
559 | 549 | "; |
560 | 550 | $oMail->setContent($mail_content); |
561 | - } |
|
562 | - else |
|
551 | + } else |
|
563 | 552 | { |
564 | 553 | $mail_content = " |
565 | 554 | Author: " . $member_info->nick_name . " |
@@ -832,8 +821,7 @@ discard block |
||
832 | 821 | if(!$deleteAllComment) |
833 | 822 | { |
834 | 823 | return new BaseObject(-1, 'fail_to_delete_have_children'); |
835 | - } |
|
836 | - else |
|
824 | + } else |
|
837 | 825 | { |
838 | 826 | foreach($childs as $val) |
839 | 827 | { |
@@ -897,8 +885,7 @@ discard block |
||
897 | 885 | { |
898 | 886 | $this->_deleteDeclaredComments($args); |
899 | 887 | $this->_deleteVotedComments($args); |
900 | - } |
|
901 | - else |
|
888 | + } else |
|
902 | 889 | { |
903 | 890 | $args = new stdClass(); |
904 | 891 | $args->upload_target_srl = $comment_srl; |
@@ -941,8 +928,7 @@ discard block |
||
941 | 928 | { |
942 | 929 | $oDocument = new documentItem(); |
943 | 930 | $oDocument->setAttribute($obj); |
944 | - } |
|
945 | - else |
|
931 | + } else |
|
946 | 932 | { |
947 | 933 | $oDocument = $oDocumentModel->getDocument($document_srl); |
948 | 934 | } |
@@ -1035,8 +1021,7 @@ discard block |
||
1035 | 1021 | { |
1036 | 1022 | $failed_voted = 'failed_voted'; |
1037 | 1023 | $success_message = 'success_voted'; |
1038 | - } |
|
1039 | - else |
|
1024 | + } else |
|
1040 | 1025 | { |
1041 | 1026 | $failed_voted = 'failed_blamed'; |
1042 | 1027 | $success_message = 'success_blamed'; |
@@ -1079,8 +1064,7 @@ discard block |
||
1079 | 1064 | if($member_srl) |
1080 | 1065 | { |
1081 | 1066 | $args->member_srl = $member_srl; |
1082 | - } |
|
1083 | - else |
|
1067 | + } else |
|
1084 | 1068 | { |
1085 | 1069 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
1086 | 1070 | } |
@@ -1104,8 +1088,7 @@ discard block |
||
1104 | 1088 | { |
1105 | 1089 | $args->blamed_count = $oComment->get('blamed_count') + $point; |
1106 | 1090 | $output = executeQuery('comment.updateBlamedCount', $args); |
1107 | - } |
|
1108 | - else |
|
1091 | + } else |
|
1109 | 1092 | { |
1110 | 1093 | $args->voted_count = $oComment->get('voted_count') + $point; |
1111 | 1094 | $output = executeQuery('comment.updateVotedCount', $args); |
@@ -1140,8 +1123,7 @@ discard block |
||
1140 | 1123 | if($point > 0) |
1141 | 1124 | { |
1142 | 1125 | $output->add('voted_count', $obj->after_point); |
1143 | - } |
|
1144 | - else |
|
1126 | + } else |
|
1145 | 1127 | { |
1146 | 1128 | $output->add('blamed_count', $obj->after_point); |
1147 | 1129 | } |
@@ -1213,8 +1195,7 @@ discard block |
||
1213 | 1195 | if($member_srl) |
1214 | 1196 | { |
1215 | 1197 | $args->member_srl = $member_srl; |
1216 | - } |
|
1217 | - else |
|
1198 | + } else |
|
1218 | 1199 | { |
1219 | 1200 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
1220 | 1201 | } |
@@ -1236,8 +1217,7 @@ discard block |
||
1236 | 1217 | if($output->data->declared_count > 0) |
1237 | 1218 | { |
1238 | 1219 | $output = executeQuery('comment.updateDeclaredComment', $args); |
1239 | - } |
|
1240 | - else |
|
1220 | + } else |
|
1241 | 1221 | { |
1242 | 1222 | $output = executeQuery('comment.insertDeclaredComment', $args); |
1243 | 1223 | } |
@@ -1304,8 +1284,7 @@ discard block |
||
1304 | 1284 | if(preg_match('/^([0-9,]+)$/', $module_srl)) |
1305 | 1285 | { |
1306 | 1286 | $module_srl = explode(',', $module_srl); |
1307 | - } |
|
1308 | - else |
|
1287 | + } else |
|
1309 | 1288 | { |
1310 | 1289 | $module_srl = array($module_srl); |
1311 | 1290 | } |
@@ -1395,8 +1374,7 @@ discard block |
||
1395 | 1374 | $value->content = strip_tags($value->content); |
1396 | 1375 | } |
1397 | 1376 | } |
1398 | - } |
|
1399 | - else |
|
1377 | + } else |
|
1400 | 1378 | { |
1401 | 1379 | global $lang; |
1402 | 1380 | $commentList = array(); |
@@ -308,14 +308,12 @@ discard block |
||
308 | 308 | { |
309 | 309 | $args->status = 1; |
310 | 310 | } |
311 | - } |
|
312 | - else |
|
311 | + } else |
|
313 | 312 | { |
314 | 313 | if($published) |
315 | 314 | { |
316 | 315 | $args->status = 1; |
317 | - } |
|
318 | - else |
|
316 | + } else |
|
319 | 317 | { |
320 | 318 | $args->status = 0; |
321 | 319 | } |
@@ -379,8 +377,7 @@ discard block |
||
379 | 377 | if(is_array($obj->module_srl)) |
380 | 378 | { |
381 | 379 | $args->module_srl = implode(',', $obj->module_srl); |
382 | - } |
|
383 | - else |
|
380 | + } else |
|
384 | 381 | { |
385 | 382 | $args->module_srl = $obj->module_srl; |
386 | 383 | } |
@@ -481,8 +478,7 @@ discard block |
||
481 | 478 | { |
482 | 479 | $comment_count = 50; |
483 | 480 | } |
484 | - } |
|
485 | - else |
|
481 | + } else |
|
486 | 482 | { |
487 | 483 | $comment_count = $count; |
488 | 484 | } |
@@ -591,8 +587,7 @@ discard block |
||
591 | 587 | if($parent_srl) |
592 | 588 | { |
593 | 589 | $list[$parent_srl]->child[] = &$list[$comment_srl]; |
594 | - } |
|
595 | - else |
|
590 | + } else |
|
596 | 591 | { |
597 | 592 | $root->child[] = &$list[$comment_srl]; |
598 | 593 | } |
@@ -641,8 +636,7 @@ discard block |
||
641 | 636 | if($parent) |
642 | 637 | { |
643 | 638 | $val->head = $parent->head; |
644 | - } |
|
645 | - else |
|
639 | + } else |
|
646 | 640 | { |
647 | 641 | $val->head = $val->comment_srl; |
648 | 642 | } |
@@ -655,8 +649,7 @@ discard block |
||
655 | 649 | $comment_list[$val->comment_srl] = $val; |
656 | 650 | $this->_arrangeComment($comment_list, $val->child, $depth + 1, $val); |
657 | 651 | unset($val->child); |
658 | - } |
|
659 | - else |
|
652 | + } else |
|
660 | 653 | { |
661 | 654 | $val->depth = $depth; |
662 | 655 | $comment_list[$val->comment_srl] = $val; |
@@ -984,8 +977,7 @@ discard block |
||
984 | 977 | } |
985 | 978 | |
986 | 979 | $args->below_point = 0; |
987 | - } |
|
988 | - else |
|
980 | + } else |
|
989 | 981 | { |
990 | 982 | if($comment_config->use_vote_up != 'S') |
991 | 983 | { |
@@ -1026,8 +1018,7 @@ discard block |
||
1026 | 1018 | if(!isset($lang->secret_name_list)) |
1027 | 1019 | { |
1028 | 1020 | return array('Y' => 'Secret', 'N' => 'Public'); |
1029 | - } |
|
1030 | - else |
|
1021 | + } else |
|
1031 | 1022 | { |
1032 | 1023 | return $lang->secret_name_list; |
1033 | 1024 | } |
@@ -1064,8 +1055,12 @@ discard block |
||
1064 | 1055 | $output = executeQuery('comment.getCommentListByMemberSrl', $args, $columnList); |
1065 | 1056 | $comment_list = $output->data; |
1066 | 1057 | |
1067 | - if(!$comment_list) return array(); |
|
1068 | - if(!is_array($comment_list)) $comment_list = array($comment_list); |
|
1058 | + if(!$comment_list) { |
|
1059 | + return array(); |
|
1060 | + } |
|
1061 | + if(!is_array($comment_list)) { |
|
1062 | + $comment_list = array($comment_list); |
|
1063 | + } |
|
1069 | 1064 | |
1070 | 1065 | return $comment_list; |
1071 | 1066 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $oCommentController = getController('comment'); |
44 | 44 | |
45 | 45 | // feature that only member can do |
46 | - if($logged_info->member_srl) |
|
46 | + if ($logged_info->member_srl) |
|
47 | 47 | { |
48 | 48 | $oCommentModel = getModel('comment'); |
49 | 49 | $columnList = array('comment_srl', 'module_srl', 'member_srl', 'ipaddress'); |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | $oModuleModel = getModel('module'); |
55 | 55 | $comment_config = $oModuleModel->getModulePartConfig('document', $module_srl); |
56 | 56 | |
57 | - if($comment_config->use_vote_up != 'N' && $member_srl != $logged_info->member_srl) |
|
57 | + if ($comment_config->use_vote_up != 'N' && $member_srl != $logged_info->member_srl) |
|
58 | 58 | { |
59 | 59 | // Add a vote-up button for positive feedback |
60 | 60 | $url = sprintf("doCallModuleAction('comment','procCommentVoteUp','%s')", $comment_srl); |
61 | 61 | $oCommentController->addCommentPopupMenu($url, 'cmd_vote', '', 'javascript'); |
62 | 62 | } |
63 | 63 | |
64 | - if($comment_config->use_vote_down != 'N' && $member_srl != $logged_info->member_srl) |
|
64 | + if ($comment_config->use_vote_down != 'N' && $member_srl != $logged_info->member_srl) |
|
65 | 65 | { |
66 | 66 | // Add a vote-down button for negative feedback |
67 | 67 | $url = sprintf("doCallModuleAction('comment','procCommentVoteDown','%s')", $comment_srl); |
@@ -76,20 +76,20 @@ discard block |
||
76 | 76 | // call a trigger (after) |
77 | 77 | ModuleHandler::triggerCall('comment.getCommentMenu', 'after', $menu_list); |
78 | 78 | |
79 | - if($this->grant->manager){ |
|
79 | + if ($this->grant->manager) { |
|
80 | 80 | $str_confirm = Context::getLang('confirm_move'); |
81 | 81 | $url = sprintf("if(!confirm('%s')) return; var params = new Array(); params['comment_srl']='%s'; params['mid']=current_mid;params['cur_url']=current_url; exec_xml('comment', 'procCommentAdminMoveToTrash', params)", $str_confirm, $comment_srl); |
82 | - $oCommentController->addCommentPopupMenu($url,'cmd_trash','','javascript'); |
|
82 | + $oCommentController->addCommentPopupMenu($url, 'cmd_trash', '', 'javascript'); |
|
83 | 83 | |
84 | 84 | } |
85 | 85 | |
86 | 86 | // find a comment by IP matching if an administrator. |
87 | - if($logged_info->is_admin == 'Y') |
|
87 | + if ($logged_info->is_admin == 'Y') |
|
88 | 88 | { |
89 | 89 | $oCommentModel = getModel('comment'); |
90 | 90 | $oComment = $oCommentModel->getComment($comment_srl); |
91 | 91 | |
92 | - if($oComment->isExists()) |
|
92 | + if ($oComment->isExists()) |
|
93 | 93 | { |
94 | 94 | // Find a post of the corresponding ip address |
95 | 95 | $url = getUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'ipaddress', 'search_keyword', $oComment->getIpAddress()); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $menus = Context::get('comment_popup_menu_list'); |
105 | 105 | $menus_count = count($menus); |
106 | 106 | |
107 | - for($i = 0; $i < $menus_count; $i++) |
|
107 | + for ($i = 0; $i < $menus_count; $i++) |
|
108 | 108 | { |
109 | 109 | $menus[$i]->str = Context::getLang($menus[$i]->str); |
110 | 110 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | function getComment($comment_srl = 0, $is_admin = FALSE, $columnList = array()) |
161 | 161 | { |
162 | 162 | $oComment = new commentItem($comment_srl, $columnList); |
163 | - if($is_admin) |
|
163 | + if ($is_admin) |
|
164 | 164 | { |
165 | 165 | $oComment->setGrant(); |
166 | 166 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | function getComments($comment_srl_list, $columnList = array()) |
178 | 178 | { |
179 | - if(is_array($comment_srl_list)) |
|
179 | + if (is_array($comment_srl_list)) |
|
180 | 180 | { |
181 | 181 | $comment_srls = implode(',', $comment_srl_list); |
182 | 182 | } |
@@ -185,25 +185,25 @@ discard block |
||
185 | 185 | $args = new stdClass(); |
186 | 186 | $args->comment_srls = $comment_srls; |
187 | 187 | $output = executeQuery('comment.getComments', $args, $columnList); |
188 | - if(!$output->toBool()) |
|
188 | + if (!$output->toBool()) |
|
189 | 189 | { |
190 | 190 | return; |
191 | 191 | } |
192 | 192 | |
193 | 193 | $comment_list = $output->data; |
194 | - if(!$comment_list) |
|
194 | + if (!$comment_list) |
|
195 | 195 | { |
196 | 196 | return; |
197 | 197 | } |
198 | - if(!is_array($comment_list)) |
|
198 | + if (!is_array($comment_list)) |
|
199 | 199 | { |
200 | 200 | $comment_list = array($comment_list); |
201 | 201 | } |
202 | 202 | |
203 | 203 | $comment_count = count($comment_list); |
204 | - foreach($comment_list as $key => $attribute) |
|
204 | + foreach ($comment_list as $key => $attribute) |
|
205 | 205 | { |
206 | - if(!$attribute->comment_srl) |
|
206 | + if (!$attribute->comment_srl) |
|
207 | 207 | { |
208 | 208 | continue; |
209 | 209 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $oComment = NULL; |
212 | 212 | $oComment = new commentItem(); |
213 | 213 | $oComment->setAttribute($attribute); |
214 | - if($is_admin) |
|
214 | + if ($is_admin) |
|
215 | 215 | { |
216 | 216 | $oComment->setGrant(); |
217 | 217 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | $oDocument = $oDocumentModel->getDocument($document_srl, FALSE, TRUE, $columnList); |
239 | 239 | |
240 | 240 | // return if no doc exists. |
241 | - if(!$oDocument->isExists()) |
|
241 | + if (!$oDocument->isExists()) |
|
242 | 242 | { |
243 | 243 | return; |
244 | 244 | } |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | $oCommentController = getController('comment'); |
251 | 251 | |
252 | 252 | $using_validation = $oCommentController->isModuleUsingPublishValidation($module_srl); |
253 | - if($using_validation) |
|
253 | + if ($using_validation) |
|
254 | 254 | { |
255 | 255 | $args->status = 1; |
256 | 256 | } |
@@ -269,18 +269,18 @@ discard block |
||
269 | 269 | */ |
270 | 270 | function getCommentCountByDate($date = '', $moduleSrlList = array()) |
271 | 271 | { |
272 | - if($date) |
|
272 | + if ($date) |
|
273 | 273 | { |
274 | 274 | $args->regDate = date('Ymd', strtotime($date)); |
275 | 275 | } |
276 | 276 | |
277 | - if(count($moduleSrlList) > 0) |
|
277 | + if (count($moduleSrlList) > 0) |
|
278 | 278 | { |
279 | 279 | $args->module_srl = $moduleSrlList; |
280 | 280 | } |
281 | 281 | |
282 | 282 | $output = executeQuery('comment.getCommentCount', $args); |
283 | - if(!$output->toBool()) |
|
283 | + if (!$output->toBool()) |
|
284 | 284 | { |
285 | 285 | return 0; |
286 | 286 | } |
@@ -299,19 +299,19 @@ discard block |
||
299 | 299 | $args = new stdClass(); |
300 | 300 | $args->module_srl = $module_srl; |
301 | 301 | |
302 | - if(is_null($published)) |
|
302 | + if (is_null($published)) |
|
303 | 303 | { |
304 | 304 | // check if module is using comment validation system |
305 | 305 | $oCommentController = getController("comment"); |
306 | 306 | $is_using_validation = $oCommentController->isModuleUsingPublishValidation($module_srl); |
307 | - if($is_using_validation) |
|
307 | + if ($is_using_validation) |
|
308 | 308 | { |
309 | 309 | $args->status = 1; |
310 | 310 | } |
311 | 311 | } |
312 | 312 | else |
313 | 313 | { |
314 | - if($published) |
|
314 | + if ($published) |
|
315 | 315 | { |
316 | 316 | $args->status = 1; |
317 | 317 | } |
@@ -363,12 +363,12 @@ discard block |
||
363 | 363 | { |
364 | 364 | $args = new stdClass(); |
365 | 365 | |
366 | - if(!is_object($obj)) |
|
366 | + if (!is_object($obj)) |
|
367 | 367 | { |
368 | 368 | $obj = new stdClass(); |
369 | 369 | } |
370 | 370 | |
371 | - if($obj->mid) |
|
371 | + if ($obj->mid) |
|
372 | 372 | { |
373 | 373 | $oModuleModel = getModel('module'); |
374 | 374 | $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid); |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | } |
377 | 377 | |
378 | 378 | // check if module_srl is an arrary. |
379 | - if(is_array($obj->module_srl)) |
|
379 | + if (is_array($obj->module_srl)) |
|
380 | 380 | { |
381 | 381 | $args->module_srl = implode(',', $obj->module_srl); |
382 | 382 | } |
@@ -388,14 +388,14 @@ discard block |
||
388 | 388 | $args->document_srl = $obj->document_srl; |
389 | 389 | $args->list_count = $obj->list_count; |
390 | 390 | |
391 | - if(strpos($args->module_srl, ",") === false) |
|
391 | + if (strpos($args->module_srl, ",") === false) |
|
392 | 392 | { |
393 | - if($args->module_srl) |
|
393 | + if ($args->module_srl) |
|
394 | 394 | { |
395 | 395 | // check if module is using comment validation system |
396 | 396 | $oCommentController = getController("comment"); |
397 | 397 | $is_using_validation = $oCommentController->isModuleUsingPublishValidation($obj->module_srl); |
398 | - if($is_using_validation) |
|
398 | + if ($is_using_validation) |
|
399 | 399 | { |
400 | 400 | $args->status = 1; |
401 | 401 | } |
@@ -404,24 +404,24 @@ discard block |
||
404 | 404 | |
405 | 405 | $output = executeQuery('comment.getNewestCommentList', $args, $columnList); |
406 | 406 | |
407 | - if(!$output->toBool()) |
|
407 | + if (!$output->toBool()) |
|
408 | 408 | { |
409 | 409 | return $output; |
410 | 410 | } |
411 | 411 | |
412 | 412 | $comment_list = $output->data; |
413 | - if($comment_list) |
|
413 | + if ($comment_list) |
|
414 | 414 | { |
415 | - if(!is_array($comment_list)) |
|
415 | + if (!is_array($comment_list)) |
|
416 | 416 | { |
417 | 417 | $comment_list = array($comment_list); |
418 | 418 | } |
419 | 419 | |
420 | 420 | $comment_count = count($comment_list); |
421 | 421 | |
422 | - foreach($comment_list as $key => $attribute) |
|
422 | + foreach ($comment_list as $key => $attribute) |
|
423 | 423 | { |
424 | - if(!$attribute->comment_srl) |
|
424 | + if (!$attribute->comment_srl) |
|
425 | 425 | { |
426 | 426 | continue; |
427 | 427 | } |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | */ |
449 | 449 | function getCommentList($document_srl, $page = 0, $is_admin = FALSE, $count = 0) |
450 | 450 | { |
451 | - if(!isset($document_srl)) |
|
451 | + if (!isset($document_srl)) |
|
452 | 452 | { |
453 | 453 | return; |
454 | 454 | } |
@@ -459,13 +459,13 @@ discard block |
||
459 | 459 | $oDocument = $oDocumentModel->getDocument($document_srl, FALSE, TRUE, $columnList); |
460 | 460 | |
461 | 461 | // return if no doc exists. |
462 | - if(!$oDocument->isExists()) |
|
462 | + if (!$oDocument->isExists()) |
|
463 | 463 | { |
464 | 464 | return; |
465 | 465 | } |
466 | 466 | |
467 | 467 | // return if no comment exists |
468 | - if($oDocument->getCommentCount() < 1) |
|
468 | + if ($oDocument->getCommentCount() < 1) |
|
469 | 469 | { |
470 | 470 | return; |
471 | 471 | } |
@@ -473,11 +473,11 @@ discard block |
||
473 | 473 | // get a list of comments |
474 | 474 | $module_srl = $oDocument->get('module_srl'); |
475 | 475 | |
476 | - if(!$count) |
|
476 | + if (!$count) |
|
477 | 477 | { |
478 | 478 | $comment_config = $this->getCommentConfig($module_srl); |
479 | 479 | $comment_count = $comment_config->comment_count; |
480 | - if(!$comment_count) |
|
480 | + if (!$comment_count) |
|
481 | 481 | { |
482 | 482 | $comment_count = 50; |
483 | 483 | } |
@@ -488,9 +488,9 @@ discard block |
||
488 | 488 | } |
489 | 489 | |
490 | 490 | // get a very last page if no page exists |
491 | - if(!$page) |
|
491 | + if (!$page) |
|
492 | 492 | { |
493 | - $page = (int) ( ($oDocument->getCommentCount() - 1) / $comment_count) + 1; |
|
493 | + $page = (int) (($oDocument->getCommentCount() - 1) / $comment_count) + 1; |
|
494 | 494 | } |
495 | 495 | |
496 | 496 | // get a list of comments |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | //check if module is using validation system |
504 | 504 | $oCommentController = getController('comment'); |
505 | 505 | $using_validation = $oCommentController->isModuleUsingPublishValidation($module_srl); |
506 | - if($using_validation) |
|
506 | + if ($using_validation) |
|
507 | 507 | { |
508 | 508 | $args->status = 1; |
509 | 509 | } |
@@ -511,17 +511,17 @@ discard block |
||
511 | 511 | $output = executeQueryArray('comment.getCommentPageList', $args); |
512 | 512 | |
513 | 513 | // return if an error occurs in the query results |
514 | - if(!$output->toBool()) |
|
514 | + if (!$output->toBool()) |
|
515 | 515 | { |
516 | 516 | return; |
517 | 517 | } |
518 | 518 | |
519 | 519 | // insert data into CommentPageList table if the number of results is different from stored comments |
520 | - if(!$output->data) |
|
520 | + if (!$output->data) |
|
521 | 521 | { |
522 | 522 | $this->fixCommentList($oDocument->get('module_srl'), $document_srl); |
523 | 523 | $output = executeQueryArray('comment.getCommentPageList', $args); |
524 | - if(!$output->toBool()) |
|
524 | + if (!$output->toBool()) |
|
525 | 525 | { |
526 | 526 | return; |
527 | 527 | } |
@@ -540,9 +540,9 @@ discard block |
||
540 | 540 | function fixCommentList($module_srl, $document_srl) |
541 | 541 | { |
542 | 542 | // create a lock file to prevent repeated work when performing a batch job |
543 | - $lock_file = "./files/cache/tmp/lock." . $document_srl; |
|
543 | + $lock_file = "./files/cache/tmp/lock.".$document_srl; |
|
544 | 544 | |
545 | - if(file_exists($lock_file) && filemtime($lock_file) + 60 * 60 * 10 < $_SERVER['REQUEST_TIME']) |
|
545 | + if (file_exists($lock_file) && filemtime($lock_file) + 60 * 60 * 10 < $_SERVER['REQUEST_TIME']) |
|
546 | 546 | { |
547 | 547 | return; |
548 | 548 | } |
@@ -554,13 +554,13 @@ discard block |
||
554 | 554 | $args->document_srl = $document_srl; |
555 | 555 | $args->list_order = 'list_order'; |
556 | 556 | $output = executeQuery('comment.getCommentList', $args); |
557 | - if(!$output->toBool()) |
|
557 | + if (!$output->toBool()) |
|
558 | 558 | { |
559 | 559 | return $output; |
560 | 560 | } |
561 | 561 | |
562 | 562 | $source_list = $output->data; |
563 | - if(!is_array($source_list)) |
|
563 | + if (!is_array($source_list)) |
|
564 | 564 | { |
565 | 565 | $source_list = array($source_list); |
566 | 566 | } |
@@ -576,11 +576,11 @@ discard block |
||
576 | 576 | $logged_info = Context::get('logged_info'); |
577 | 577 | |
578 | 578 | // generate a hierarchical structure of comments for loop |
579 | - for($i = $comment_count - 1; $i >= 0; $i--) |
|
579 | + for ($i = $comment_count - 1; $i >= 0; $i--) |
|
580 | 580 | { |
581 | 581 | $comment_srl = $source_list[$i]->comment_srl; |
582 | 582 | $parent_srl = $source_list[$i]->parent_srl; |
583 | - if(!$comment_srl) |
|
583 | + if (!$comment_srl) |
|
584 | 584 | { |
585 | 585 | continue; |
586 | 586 | } |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | // generate a list |
589 | 589 | $list[$comment_srl] = $source_list[$i]; |
590 | 590 | |
591 | - if($parent_srl) |
|
591 | + if ($parent_srl) |
|
592 | 592 | { |
593 | 593 | $list[$parent_srl]->child[] = &$list[$comment_srl]; |
594 | 594 | } |
@@ -600,9 +600,9 @@ discard block |
||
600 | 600 | $this->_arrangeComment($comment_list, $root->child, 0, NULL); |
601 | 601 | |
602 | 602 | // insert values to the database |
603 | - if(count($comment_list)) |
|
603 | + if (count($comment_list)) |
|
604 | 604 | { |
605 | - foreach($comment_list as $comment_srl => $item) |
|
605 | + foreach ($comment_list as $comment_srl => $item) |
|
606 | 606 | { |
607 | 607 | $comment_args = new stdClass(); |
608 | 608 | $comment_args->comment_srl = $comment_srl; |
@@ -631,14 +631,14 @@ discard block |
||
631 | 631 | */ |
632 | 632 | function _arrangeComment(&$comment_list, $list, $depth, $parent = NULL) |
633 | 633 | { |
634 | - if(!count($list)) |
|
634 | + if (!count($list)) |
|
635 | 635 | { |
636 | 636 | return; |
637 | 637 | } |
638 | 638 | |
639 | - foreach($list as $key => $val) |
|
639 | + foreach ($list as $key => $val) |
|
640 | 640 | { |
641 | - if($parent) |
|
641 | + if ($parent) |
|
642 | 642 | { |
643 | 643 | $val->head = $parent->head; |
644 | 644 | } |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | |
650 | 650 | $val->arrange = count($comment_list) + 1; |
651 | 651 | |
652 | - if($val->child) |
|
652 | + if ($val->child) |
|
653 | 653 | { |
654 | 654 | $val->depth = $depth; |
655 | 655 | $comment_list[$val->comment_srl] = $val; |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | // check if module is using comment validation system |
687 | 687 | $oCommentController = getController("comment"); |
688 | 688 | $is_using_validation = $oCommentController->isModuleUsingPublishValidation($obj->module_srl); |
689 | - if($is_using_validation) |
|
689 | + if ($is_using_validation) |
|
690 | 690 | { |
691 | 691 | $args->s_is_published = 1; |
692 | 692 | } |
@@ -694,12 +694,12 @@ discard block |
||
694 | 694 | // Search options |
695 | 695 | $search_target = $obj->search_target ? $obj->search_target : trim(Context::get('search_target')); |
696 | 696 | $search_keyword = $obj->search_keyword ? $obj->search_keyword : trim(Context::get('search_keyword')); |
697 | - if($search_target && $search_keyword) |
|
697 | + if ($search_target && $search_keyword) |
|
698 | 698 | { |
699 | - switch($search_target) |
|
699 | + switch ($search_target) |
|
700 | 700 | { |
701 | 701 | case 'content' : |
702 | - if($search_keyword) |
|
702 | + if ($search_keyword) |
|
703 | 703 | { |
704 | 704 | $search_keyword = str_replace(' ', '%', $search_keyword); |
705 | 705 | } |
@@ -708,7 +708,7 @@ discard block |
||
708 | 708 | break; |
709 | 709 | |
710 | 710 | case 'user_id' : |
711 | - if($search_keyword) |
|
711 | + if ($search_keyword) |
|
712 | 712 | { |
713 | 713 | $search_keyword = str_replace(' ', '%', $search_keyword); |
714 | 714 | } |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | break; |
720 | 720 | |
721 | 721 | case 'user_name' : |
722 | - if($search_keyword) |
|
722 | + if ($search_keyword) |
|
723 | 723 | { |
724 | 724 | $search_keyword = str_replace(' ', '%', $search_keyword); |
725 | 725 | } |
@@ -728,7 +728,7 @@ discard block |
||
728 | 728 | break; |
729 | 729 | |
730 | 730 | case 'nick_name' : |
731 | - if($search_keyword) |
|
731 | + if ($search_keyword) |
|
732 | 732 | { |
733 | 733 | $search_keyword = str_replace(' ', '%', $search_keyword); |
734 | 734 | } |
@@ -737,7 +737,7 @@ discard block |
||
737 | 737 | break; |
738 | 738 | |
739 | 739 | case 'email_address' : |
740 | - if($search_keyword) |
|
740 | + if ($search_keyword) |
|
741 | 741 | { |
742 | 742 | $search_keyword = str_replace(' ', '%', $search_keyword); |
743 | 743 | } |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | break; |
747 | 747 | |
748 | 748 | case 'homepage' : |
749 | - if($search_keyword) |
|
749 | + if ($search_keyword) |
|
750 | 750 | { |
751 | 751 | $search_keyword = str_replace(' ', '%', $search_keyword); |
752 | 752 | } |
@@ -771,12 +771,12 @@ discard block |
||
771 | 771 | break; |
772 | 772 | |
773 | 773 | case 'is_published' : |
774 | - if($search_keyword == 'Y') |
|
774 | + if ($search_keyword == 'Y') |
|
775 | 775 | { |
776 | 776 | $args->s_is_published = 1; |
777 | 777 | } |
778 | 778 | |
779 | - if($search_keyword == 'N') |
|
779 | + if ($search_keyword == 'N') |
|
780 | 780 | { |
781 | 781 | $args->s_is_published = 0; |
782 | 782 | } |
@@ -788,7 +788,7 @@ discard block |
||
788 | 788 | break; |
789 | 789 | |
790 | 790 | case 'member_srl' : |
791 | - $args->{"s_" . $search_target} = (int) $search_keyword; |
|
791 | + $args->{"s_".$search_target} = (int) $search_keyword; |
|
792 | 792 | break; |
793 | 793 | } |
794 | 794 | } |
@@ -797,12 +797,12 @@ discard block |
||
797 | 797 | $output = executeQueryArray($query_id, $args, $columnList); |
798 | 798 | |
799 | 799 | // return when no result or error occurance |
800 | - if(!$output->toBool() || !count($output->data)) |
|
800 | + if (!$output->toBool() || !count($output->data)) |
|
801 | 801 | { |
802 | 802 | return $output; |
803 | 803 | } |
804 | 804 | |
805 | - foreach($output->data as $key => $val) |
|
805 | + foreach ($output->data as $key => $val) |
|
806 | 806 | { |
807 | 807 | unset($_oComment); |
808 | 808 | $_oComment = new CommentItem(0); |
@@ -831,12 +831,12 @@ discard block |
||
831 | 831 | $search_target = $obj->search_target ? $obj->search_target : trim(Context::get('search_target')); |
832 | 832 | $search_keyword = $obj->search_keyword ? $obj->search_keyword : trim(Context::get('search_keyword')); |
833 | 833 | |
834 | - if($search_target && $search_keyword) |
|
834 | + if ($search_target && $search_keyword) |
|
835 | 835 | { |
836 | - switch($search_target) |
|
836 | + switch ($search_target) |
|
837 | 837 | { |
838 | 838 | case 'content' : |
839 | - if($search_keyword) |
|
839 | + if ($search_keyword) |
|
840 | 840 | { |
841 | 841 | $search_keyword = str_replace(' ', '%', $search_keyword); |
842 | 842 | } |
@@ -845,7 +845,7 @@ discard block |
||
845 | 845 | break; |
846 | 846 | |
847 | 847 | case 'user_id' : |
848 | - if($search_keyword) |
|
848 | + if ($search_keyword) |
|
849 | 849 | { |
850 | 850 | $search_keyword = str_replace(' ', '%', $search_keyword); |
851 | 851 | } |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | break; |
856 | 856 | |
857 | 857 | case 'user_name' : |
858 | - if($search_keyword) |
|
858 | + if ($search_keyword) |
|
859 | 859 | { |
860 | 860 | $search_keyword = str_replace(' ', '%', $search_keyword); |
861 | 861 | } |
@@ -864,7 +864,7 @@ discard block |
||
864 | 864 | break; |
865 | 865 | |
866 | 866 | case 'nick_name' : |
867 | - if($search_keyword) |
|
867 | + if ($search_keyword) |
|
868 | 868 | { |
869 | 869 | $search_keyword = str_replace(' ', '%', $search_keyword); |
870 | 870 | } |
@@ -873,7 +873,7 @@ discard block |
||
873 | 873 | break; |
874 | 874 | |
875 | 875 | case 'email_address' : |
876 | - if($search_keyword) |
|
876 | + if ($search_keyword) |
|
877 | 877 | { |
878 | 878 | $search_keyword = str_replace(' ', '%', $search_keyword); |
879 | 879 | } |
@@ -882,7 +882,7 @@ discard block |
||
882 | 882 | break; |
883 | 883 | |
884 | 884 | case 'homepage' : |
885 | - if($search_keyword) |
|
885 | + if ($search_keyword) |
|
886 | 886 | { |
887 | 887 | $search_keyword = str_replace(' ', '%', $search_keyword); |
888 | 888 | } |
@@ -907,7 +907,7 @@ discard block |
||
907 | 907 | break; |
908 | 908 | |
909 | 909 | case 'member_srl' : |
910 | - $args->{"s_" . $search_target} = (int) $search_keyword; |
|
910 | + $args->{"s_".$search_target} = (int) $search_keyword; |
|
911 | 911 | break; |
912 | 912 | } |
913 | 913 | } |
@@ -915,7 +915,7 @@ discard block |
||
915 | 915 | $output = executeQueryArray($query_id, $args); |
916 | 916 | |
917 | 917 | // return when no result or error occurance |
918 | - if(!$output->toBool() || !count($output->data)) |
|
918 | + if (!$output->toBool() || !count($output->data)) |
|
919 | 919 | { |
920 | 920 | return $output; |
921 | 921 | } |
@@ -932,12 +932,12 @@ discard block |
||
932 | 932 | { |
933 | 933 | $oModuleModel = getModel('module'); |
934 | 934 | $comment_config = $oModuleModel->getModulePartConfig('comment', $module_srl); |
935 | - if(!is_object($comment_config)) |
|
935 | + if (!is_object($comment_config)) |
|
936 | 936 | { |
937 | 937 | $comment_config = new stdClass(); |
938 | 938 | } |
939 | 939 | |
940 | - if(!isset($comment_config->comment_count)) |
|
940 | + if (!isset($comment_config->comment_count)) |
|
941 | 941 | { |
942 | 942 | $comment_config->comment_count = 50; |
943 | 943 | } |
@@ -952,13 +952,13 @@ discard block |
||
952 | 952 | function getCommentVotedMemberList() |
953 | 953 | { |
954 | 954 | $comment_srl = Context::get('comment_srl'); |
955 | - if(!$comment_srl) |
|
955 | + if (!$comment_srl) |
|
956 | 956 | { |
957 | 957 | return new BaseObject(-1, 'msg_invalid_request'); |
958 | 958 | } |
959 | 959 | |
960 | 960 | $point = Context::get('point'); |
961 | - if($point != -1) |
|
961 | + if ($point != -1) |
|
962 | 962 | { |
963 | 963 | $point = 1; |
964 | 964 | } |
@@ -966,7 +966,7 @@ discard block |
||
966 | 966 | $oCommentModel = getModel('comment'); |
967 | 967 | $oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE); |
968 | 968 | $module_srl = $oComment->get('module_srl'); |
969 | - if(!$module_srl) |
|
969 | + if (!$module_srl) |
|
970 | 970 | { |
971 | 971 | return new BaseObject(-1, 'msg_invalid_request'); |
972 | 972 | } |
@@ -976,9 +976,9 @@ discard block |
||
976 | 976 | |
977 | 977 | $args = new stdClass(); |
978 | 978 | |
979 | - if($point == -1) |
|
979 | + if ($point == -1) |
|
980 | 980 | { |
981 | - if($comment_config->use_vote_down != 'S') |
|
981 | + if ($comment_config->use_vote_down != 'S') |
|
982 | 982 | { |
983 | 983 | return new BaseObject(-1, 'msg_invalid_request'); |
984 | 984 | } |
@@ -987,7 +987,7 @@ discard block |
||
987 | 987 | } |
988 | 988 | else |
989 | 989 | { |
990 | - if($comment_config->use_vote_up != 'S') |
|
990 | + if ($comment_config->use_vote_up != 'S') |
|
991 | 991 | { |
992 | 992 | return new BaseObject(-1, 'msg_invalid_request'); |
993 | 993 | } |
@@ -997,15 +997,15 @@ discard block |
||
997 | 997 | |
998 | 998 | $args->comment_srl = $comment_srl; |
999 | 999 | $output = executeQueryArray('comment.getVotedMemberList', $args); |
1000 | - if(!$output->toBool()) |
|
1000 | + if (!$output->toBool()) |
|
1001 | 1001 | { |
1002 | 1002 | return $output; |
1003 | 1003 | } |
1004 | 1004 | |
1005 | 1005 | $oMemberModel = getModel('member'); |
1006 | - if($output->data) |
|
1006 | + if ($output->data) |
|
1007 | 1007 | { |
1008 | - foreach($output->data as $k => $d) |
|
1008 | + foreach ($output->data as $k => $d) |
|
1009 | 1009 | { |
1010 | 1010 | $profile_image = $oMemberModel->getProfileImage($d->member_srl); |
1011 | 1011 | $output->data[$k]->src = $profile_image->src; |
@@ -1023,7 +1023,7 @@ discard block |
||
1023 | 1023 | { |
1024 | 1024 | global $lang; |
1025 | 1025 | |
1026 | - if(!isset($lang->secret_name_list)) |
|
1026 | + if (!isset($lang->secret_name_list)) |
|
1027 | 1027 | { |
1028 | 1028 | return array('Y' => 'Secret', 'N' => 'Public'); |
1029 | 1029 | } |
@@ -1064,8 +1064,8 @@ discard block |
||
1064 | 1064 | $output = executeQuery('comment.getCommentListByMemberSrl', $args, $columnList); |
1065 | 1065 | $comment_list = $output->data; |
1066 | 1066 | |
1067 | - if(!$comment_list) return array(); |
|
1068 | - if(!is_array($comment_list)) $comment_list = array($comment_list); |
|
1067 | + if (!$comment_list) return array(); |
|
1068 | + if (!is_array($comment_list)) $comment_list = array($comment_list); |
|
1069 | 1069 | |
1070 | 1070 | return $comment_list; |
1071 | 1071 |
@@ -24,31 +24,31 @@ |
||
24 | 24 | function procCommunicationAdminInsertConfig() |
25 | 25 | { |
26 | 26 | // get the default information |
27 | - $args = Context::gets('skin', 'colorset', 'editor_skin', 'sel_editor_colorset', 'mskin', 'mcolorset', 'layout_srl', 'mlayout_srl', 'grant_write_default','grant_write_group'); |
|
27 | + $args = Context::gets('skin', 'colorset', 'editor_skin', 'sel_editor_colorset', 'mskin', 'mcolorset', 'layout_srl', 'mlayout_srl', 'grant_write_default', 'grant_write_group'); |
|
28 | 28 | $args->editor_colorset = $args->sel_editor_colorset; |
29 | 29 | unset($args->sel_editor_colorset); |
30 | 30 | |
31 | - if(!$args->skin) |
|
31 | + if (!$args->skin) |
|
32 | 32 | { |
33 | 33 | $args->skin = 'default'; |
34 | 34 | } |
35 | 35 | |
36 | - if(!$args->colorset) |
|
36 | + if (!$args->colorset) |
|
37 | 37 | { |
38 | 38 | $args->colorset = 'white'; |
39 | 39 | } |
40 | 40 | |
41 | - if(!$args->editor_skin) |
|
41 | + if (!$args->editor_skin) |
|
42 | 42 | { |
43 | 43 | $args->editor_skin = 'default'; |
44 | 44 | } |
45 | 45 | |
46 | - if(!$args->mskin) |
|
46 | + if (!$args->mskin) |
|
47 | 47 | { |
48 | 48 | $args->mskin = 'default'; |
49 | 49 | } |
50 | 50 | |
51 | - if(!$args->layout_srl) |
|
51 | + if (!$args->layout_srl) |
|
52 | 52 | { |
53 | 53 | $args->layout_srl = NULL; |
54 | 54 | } |
@@ -30,8 +30,7 @@ discard block |
||
30 | 30 | if($type == 'P') |
31 | 31 | { |
32 | 32 | $dir = 'skins'; |
33 | - } |
|
34 | - else |
|
33 | + } else |
|
35 | 34 | { |
36 | 35 | $dir = 'm.skins'; |
37 | 36 | } |
@@ -39,8 +38,7 @@ discard block |
||
39 | 38 | if(!$skin) |
40 | 39 | { |
41 | 40 | $tpl = ""; |
42 | - } |
|
43 | - else |
|
41 | + } else |
|
44 | 42 | { |
45 | 43 | $oModuleModel = getModel('module'); |
46 | 44 | $skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin, $dir); |
@@ -48,7 +46,9 @@ discard block |
||
48 | 46 | |
49 | 47 | $oModuleModel = getModel('module'); |
50 | 48 | $communication_config = $oModuleModel->getModuleConfig('communication'); |
51 | - if(!is_object($communication_config)) $communication_config = new stdClass; |
|
49 | + if(!is_object($communication_config)) { |
|
50 | + $communication_config = new stdClass; |
|
51 | + } |
|
52 | 52 | if(!$communication_config->colorset) |
53 | 53 | { |
54 | 54 | $communication_config->colorset = "white"; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $type = Context::get('type') == 'P' ? 'P' : 'M'; |
28 | 28 | Context::set('type', $type); |
29 | 29 | |
30 | - if($type == 'P') |
|
30 | + if ($type == 'P') |
|
31 | 31 | { |
32 | 32 | $dir = 'skins'; |
33 | 33 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $dir = 'm.skins'; |
37 | 37 | } |
38 | 38 | |
39 | - if(!$skin) |
|
39 | + if (!$skin) |
|
40 | 40 | { |
41 | 41 | $tpl = ""; |
42 | 42 | } |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | |
49 | 49 | $oModuleModel = getModel('module'); |
50 | 50 | $communication_config = $oModuleModel->getModuleConfig('communication'); |
51 | - if(!is_object($communication_config)) $communication_config = new stdClass; |
|
52 | - if(!$communication_config->colorset) |
|
51 | + if (!is_object($communication_config)) $communication_config = new stdClass; |
|
52 | + if (!$communication_config->colorset) |
|
53 | 53 | { |
54 | 54 | $communication_config->colorset = "white"; |
55 | 55 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $security->encodeHTML('skin_info.colorset..name'); |
61 | 61 | |
62 | 62 | $oTemplate = TemplateHandler::getInstance(); |
63 | - $tpl = $oTemplate->compile($this->module_path . 'tpl', 'colorset_list'); |
|
63 | + $tpl = $oTemplate->compile($this->module_path.'tpl', 'colorset_list'); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | $this->add('tpl', $tpl); |
@@ -96,8 +96,7 @@ |
||
96 | 96 | stripEmbedTagForAdmin($message->content, $message->sender_srl); |
97 | 97 | Context::set('message', $message); |
98 | 98 | } |
99 | - } |
|
100 | - else |
|
99 | + } else |
|
101 | 100 | { |
102 | 101 | $templateFile = 'messages'; |
103 | 102 | } |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
3 | 3 | |
4 | -require_once(_XE_PATH_ . 'modules/communication/communication.view.php'); |
|
4 | +require_once(_XE_PATH_.'modules/communication/communication.view.php'); |
|
5 | 5 | |
6 | 6 | /** |
7 | 7 | * @class communicationMobile |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | $oLayoutModel = getModel('layout'); |
27 | 27 | $layout_info = $oLayoutModel->getLayout($this->communication_config->mlayout_srl); |
28 | - if($layout_info) |
|
28 | + if ($layout_info) |
|
29 | 29 | { |
30 | 30 | $this->module_info->mlayout_srl = $this->communication_config->mlayout_srl; |
31 | 31 | $this->setLayoutPath($layout_info->path); |
@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | function dispCommunicationMessages() |
40 | 40 | { |
41 | 41 | // Error appears if not logged-in |
42 | - if(!Context::get('is_logged')) |
|
42 | + if (!Context::get('is_logged')) |
|
43 | 43 | { |
44 | 44 | return $this->stop('msg_not_logged'); |
45 | 45 | } |
46 | 46 | |
47 | 47 | $logged_info = Context::get('logged_info'); |
48 | - if(!array_key_exists('dispCommunicationMessages', $logged_info->menu_list)) |
|
48 | + if (!array_key_exists('dispCommunicationMessages', $logged_info->menu_list)) |
|
49 | 49 | { |
50 | 50 | return $this->stop('msg_invalid_request'); |
51 | 51 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | // Set the variables |
54 | 54 | $message_srl = Context::get('message_srl'); |
55 | 55 | $message_type = Context::get('message_type'); |
56 | - if(!in_array($message_type, array('R', 'S', 'T'))) |
|
56 | + if (!in_array($message_type, array('R', 'S', 'T'))) |
|
57 | 57 | { |
58 | 58 | $message_type = 'R'; |
59 | 59 | Context::set('message_type', $message_type); |
@@ -61,37 +61,37 @@ discard block |
||
61 | 61 | $oCommunicationModel = getModel('communication'); |
62 | 62 | |
63 | 63 | // extract contents if message_srl exists |
64 | - if($message_srl) |
|
64 | + if ($message_srl) |
|
65 | 65 | { |
66 | 66 | $templateFile = 'read_message'; |
67 | 67 | $columnList = array('message_srl', 'sender_srl', 'receiver_srl', 'message_type', 'title', 'content', 'readed', 'regdate'); |
68 | 68 | $message = $oCommunicationModel->getSelectedMessage($message_srl, $columnList); |
69 | 69 | |
70 | - switch($message->message_type) |
|
70 | + switch ($message->message_type) |
|
71 | 71 | { |
72 | 72 | case 'R': |
73 | - if($message->receiver_srl != $logged_info->member_srl) |
|
73 | + if ($message->receiver_srl != $logged_info->member_srl) |
|
74 | 74 | { |
75 | 75 | return $this->stop('msg_invalid_request'); |
76 | 76 | } |
77 | 77 | break; |
78 | 78 | |
79 | 79 | case 'S': |
80 | - if($message->sender_srl != $logged_info->member_srl) |
|
80 | + if ($message->sender_srl != $logged_info->member_srl) |
|
81 | 81 | { |
82 | 82 | return $this->stop('msg_invalid_request'); |
83 | 83 | } |
84 | 84 | break; |
85 | 85 | |
86 | 86 | case 'T': |
87 | - if($message->receiver_srl != $logged_info->member_srl && $message->sender_srl != $logged_info->member_srl) |
|
87 | + if ($message->receiver_srl != $logged_info->member_srl && $message->sender_srl != $logged_info->member_srl) |
|
88 | 88 | { |
89 | 89 | return $this->stop('msg_invalid_request'); |
90 | 90 | } |
91 | 91 | break; |
92 | 92 | } |
93 | 93 | |
94 | - if($message->message_srl == $message_srl && ($message->receiver_srl == $logged_info->member_srl || $message->sender_srl == $logged_info->member_srl)) |
|
94 | + if ($message->message_srl == $message_srl && ($message->receiver_srl == $logged_info->member_srl || $message->sender_srl == $logged_info->member_srl)) |
|
95 | 95 | { |
96 | 96 | stripEmbedTagForAdmin($message->content, $message->sender_srl); |
97 | 97 | Context::set('message', $message); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $oMemberModel = getModel('member'); |
139 | 139 | |
140 | 140 | // Error appears if not logged-in |
141 | - if(!Context::get('is_logged')) |
|
141 | + if (!Context::get('is_logged')) |
|
142 | 142 | { |
143 | 143 | return $this->stop('msg_not_logged'); |
144 | 144 | } |
@@ -148,32 +148,32 @@ discard block |
||
148 | 148 | // get receipient's information |
149 | 149 | // check inalid request |
150 | 150 | $receiver_srl = Context::get('receiver_srl'); |
151 | - if(!$receiver_srl) |
|
151 | + if (!$receiver_srl) |
|
152 | 152 | { |
153 | 153 | return $this->stop('msg_invalid_request'); |
154 | 154 | } |
155 | 155 | |
156 | 156 | // check receiver and sender are same |
157 | - if($logged_info->member_srl == $receiver_srl) |
|
157 | + if ($logged_info->member_srl == $receiver_srl) |
|
158 | 158 | { |
159 | 159 | return $this->stop('msg_cannot_send_to_yourself'); |
160 | 160 | } |
161 | 161 | |
162 | 162 | // get message_srl of the original message if it is a reply |
163 | 163 | $message_srl = Context::get('message_srl'); |
164 | - if($message_srl) |
|
164 | + if ($message_srl) |
|
165 | 165 | { |
166 | 166 | $source_message = $oCommunicationModel->getSelectedMessage($message_srl); |
167 | - if($source_message->message_srl == $message_srl && $source_message->sender_srl == $receiver_srl) |
|
167 | + if ($source_message->message_srl == $message_srl && $source_message->sender_srl == $receiver_srl) |
|
168 | 168 | { |
169 | - $source_message->title = "[re] " . $source_message->title; |
|
170 | - $source_message->content = "\r\n<br />\r\n<br /><div style=\"padding-left:5px; border-left:5px solid #DDDDDD;\">" . trim($source_message->content) . "</div>"; |
|
169 | + $source_message->title = "[re] ".$source_message->title; |
|
170 | + $source_message->content = "\r\n<br />\r\n<br /><div style=\"padding-left:5px; border-left:5px solid #DDDDDD;\">".trim($source_message->content)."</div>"; |
|
171 | 171 | Context::set('source_message', $source_message); |
172 | 172 | } |
173 | 173 | } |
174 | 174 | |
175 | 175 | $receiver_info = $oMemberModel->getMemberInfoByMemberSrl($receiver_srl); |
176 | - if(!$receiver_info) |
|
176 | + if (!$receiver_info) |
|
177 | 177 | { |
178 | 178 | return $this->stop('msg_invalid_request'); |
179 | 179 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | /** |
36 | 36 | * Display message box |
37 | - * @return void|BaseObject (void : success, BaseObject : fail) |
|
37 | + * @return ModuleObject|null (void : success, BaseObject : fail) |
|
38 | 38 | */ |
39 | 39 | function dispCommunicationMessages() |
40 | 40 | { |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | /** |
132 | 132 | * Display message sending |
133 | - * @return void|BaseObject (void : success, BaseObject : fail) |
|
133 | + * @return ModuleObject|null (void : success, BaseObject : fail) |
|
134 | 134 | */ |
135 | 135 | function dispCommunicationSendMessage() |
136 | 136 | { |
@@ -27,8 +27,7 @@ |
||
27 | 27 | if(count($config_parse) > 1) |
28 | 28 | { |
29 | 29 | $tpl_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]); |
30 | - } |
|
31 | - else |
|
30 | + } else |
|
32 | 31 | { |
33 | 32 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $skin); |
34 | 33 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | $config_parse = explode('|@|', $skin); |
26 | 26 | |
27 | - if(count($config_parse) > 1) |
|
27 | + if (count($config_parse) > 1) |
|
28 | 28 | { |
29 | 29 | $tpl_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]); |
30 | 30 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | $oLayoutModel = getModel('layout'); |
39 | 39 | $layout_info = $oLayoutModel->getLayout($this->communication_config->layout_srl); |
40 | - if($layout_info) |
|
40 | + if ($layout_info) |
|
41 | 41 | { |
42 | 42 | $this->module_info->layout_srl = $this->communication_config->layout_srl; |
43 | 43 | $this->setLayoutPath($layout_info->path); |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | function dispCommunicationMessages() |
52 | 52 | { |
53 | 53 | // Error appears if not logged-in |
54 | - if(!Context::get('is_logged')) |
|
54 | + if (!Context::get('is_logged')) |
|
55 | 55 | { |
56 | 56 | return $this->stop('msg_not_logged'); |
57 | 57 | } |
58 | 58 | |
59 | 59 | $logged_info = Context::get('logged_info'); |
60 | 60 | |
61 | - if(!array_key_exists('dispCommunicationMessages', $logged_info->menu_list)) |
|
61 | + if (!array_key_exists('dispCommunicationMessages', $logged_info->menu_list)) |
|
62 | 62 | { |
63 | 63 | return $this->stop('msg_invalid_request'); |
64 | 64 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $message_srl = Context::get('message_srl'); |
68 | 68 | $message_type = Context::get('message_type'); |
69 | 69 | |
70 | - if(!in_array($message_type, array('R', 'S', 'T'))) |
|
70 | + if (!in_array($message_type, array('R', 'S', 'T'))) |
|
71 | 71 | { |
72 | 72 | $message_type = 'R'; |
73 | 73 | Context::set('message_type', $message_type); |
@@ -76,36 +76,36 @@ discard block |
||
76 | 76 | $oCommunicationModel = getModel('communication'); |
77 | 77 | |
78 | 78 | // extract contents if message_srl exists |
79 | - if($message_srl) |
|
79 | + if ($message_srl) |
|
80 | 80 | { |
81 | 81 | $columnList = array('message_srl', 'sender_srl', 'receiver_srl', 'message_type', 'title', 'content', 'readed', 'regdate'); |
82 | 82 | $message = $oCommunicationModel->getSelectedMessage($message_srl, $columnList); |
83 | 83 | |
84 | - switch($message->message_type) |
|
84 | + switch ($message->message_type) |
|
85 | 85 | { |
86 | 86 | case 'R': |
87 | - if($message->receiver_srl != $logged_info->member_srl) |
|
87 | + if ($message->receiver_srl != $logged_info->member_srl) |
|
88 | 88 | { |
89 | 89 | return $this->stop('msg_invalid_request'); |
90 | 90 | } |
91 | 91 | break; |
92 | 92 | |
93 | 93 | case 'S': |
94 | - if($message->sender_srl != $logged_info->member_srl) |
|
94 | + if ($message->sender_srl != $logged_info->member_srl) |
|
95 | 95 | { |
96 | 96 | return $this->stop('msg_invalid_request'); |
97 | 97 | } |
98 | 98 | break; |
99 | 99 | |
100 | 100 | case 'T': |
101 | - if($message->receiver_srl != $logged_info->member_srl && $message->sender_srl != $logged_info->member_srl) |
|
101 | + if ($message->receiver_srl != $logged_info->member_srl && $message->sender_srl != $logged_info->member_srl) |
|
102 | 102 | { |
103 | 103 | return $this->stop('msg_invalid_request'); |
104 | 104 | } |
105 | 105 | break; |
106 | 106 | } |
107 | 107 | |
108 | - if($message->message_srl == $message_srl && ($message->receiver_srl == $logged_info->member_srl || $message->sender_srl == $logged_info->member_srl)) |
|
108 | + if ($message->message_srl == $message_srl && ($message->receiver_srl == $logged_info->member_srl || $message->sender_srl == $logged_info->member_srl)) |
|
109 | 109 | { |
110 | 110 | stripEmbedTagForAdmin($message->content, $message->sender_srl); |
111 | 111 | Context::set('message', $message); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $this->setLayoutFile('popup_layout'); |
140 | 140 | |
141 | 141 | // Error appears if not logged-in |
142 | - if(!Context::get('is_logged')) |
|
142 | + if (!Context::get('is_logged')) |
|
143 | 143 | { |
144 | 144 | return $this->stop('msg_not_logged'); |
145 | 145 | } |
@@ -151,14 +151,14 @@ discard block |
||
151 | 151 | // get a new message |
152 | 152 | $columnList = array('message_srl', 'member_srl', 'nick_name', 'title', 'content', 'sender_srl'); |
153 | 153 | $message = $oCommunicationModel->getNewMessage($columnList); |
154 | - if($message) |
|
154 | + if ($message) |
|
155 | 155 | { |
156 | 156 | stripEmbedTagForAdmin($message->content, $message->sender_srl); |
157 | 157 | Context::set('message', $message); |
158 | 158 | } |
159 | 159 | |
160 | 160 | // Delete a flag |
161 | - $flag_path = './files/communication_extra_info/new_message_flags/' . getNumberingPath($logged_info->member_srl); |
|
161 | + $flag_path = './files/communication_extra_info/new_message_flags/'.getNumberingPath($logged_info->member_srl); |
|
162 | 162 | $flag_file = sprintf('%s%s', $flag_path, $logged_info->member_srl); |
163 | 163 | FileHandler::removeFile($flag_file); |
164 | 164 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $oMemberModel = getModel('member'); |
179 | 179 | |
180 | 180 | // Error appears if not logged-in |
181 | - if(!Context::get('is_logged')) |
|
181 | + if (!Context::get('is_logged')) |
|
182 | 182 | { |
183 | 183 | return $this->stop('msg_not_logged'); |
184 | 184 | } |
@@ -188,32 +188,32 @@ discard block |
||
188 | 188 | // get receipient's information |
189 | 189 | // check inalid request |
190 | 190 | $receiver_srl = Context::get('receiver_srl'); |
191 | - if(!$receiver_srl) |
|
191 | + if (!$receiver_srl) |
|
192 | 192 | { |
193 | 193 | return $this->stop('msg_invalid_request'); |
194 | 194 | } |
195 | 195 | |
196 | 196 | // check receiver and sender are same |
197 | - if($logged_info->member_srl == $receiver_srl) |
|
197 | + if ($logged_info->member_srl == $receiver_srl) |
|
198 | 198 | { |
199 | 199 | return $this->stop('msg_cannot_send_to_yourself'); |
200 | 200 | } |
201 | 201 | |
202 | 202 | // get message_srl of the original message if it is a reply |
203 | 203 | $message_srl = Context::get('message_srl'); |
204 | - if($message_srl) |
|
204 | + if ($message_srl) |
|
205 | 205 | { |
206 | 206 | $source_message = $oCommunicationModel->getSelectedMessage($message_srl); |
207 | - if($source_message->message_srl == $message_srl && $source_message->sender_srl == $receiver_srl) |
|
207 | + if ($source_message->message_srl == $message_srl && $source_message->sender_srl == $receiver_srl) |
|
208 | 208 | { |
209 | - $source_message->title = "[re] " . $source_message->title; |
|
210 | - $source_message->content = "\r\n<br />\r\n<br /><div style=\"padding-left:5px; border-left:5px solid #DDDDDD;\">" . trim($source_message->content) . "</div>"; |
|
209 | + $source_message->title = "[re] ".$source_message->title; |
|
210 | + $source_message->content = "\r\n<br />\r\n<br /><div style=\"padding-left:5px; border-left:5px solid #DDDDDD;\">".trim($source_message->content)."</div>"; |
|
211 | 211 | Context::set('source_message', $source_message); |
212 | 212 | } |
213 | 213 | } |
214 | 214 | |
215 | 215 | $receiver_info = $oMemberModel->getMemberInfoByMemberSrl($receiver_srl); |
216 | - if(!$receiver_info) |
|
216 | + if (!$receiver_info) |
|
217 | 217 | { |
218 | 218 | return $this->stop('msg_invalid_request'); |
219 | 219 | } |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | function dispCommunicationFriend() |
248 | 248 | { |
249 | 249 | // Error appears if not logged-in |
250 | - if(!Context::get('is_logged')) |
|
250 | + if (!Context::get('is_logged')) |
|
251 | 251 | { |
252 | 252 | return $this->stop('msg_not_logged'); |
253 | 253 | } |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | $tmp_group_list = $oCommunicationModel->getFriendGroups(); |
259 | 259 | $group_count = count($tmp_group_list); |
260 | 260 | |
261 | - for($i = 0; $i < $group_count; $i++) |
|
261 | + for ($i = 0; $i < $group_count; $i++) |
|
262 | 262 | { |
263 | 263 | $friend_group_list[$tmp_group_list[$i]->friend_group_srl] = $tmp_group_list[$i]; |
264 | 264 | } |
@@ -272,13 +272,13 @@ discard block |
||
272 | 272 | $output = $oCommunicationModel->getFriends($friend_group_srl, $columnList); |
273 | 273 | $friend_count = count($output->data); |
274 | 274 | |
275 | - if($friend_count) |
|
275 | + if ($friend_count) |
|
276 | 276 | { |
277 | - foreach($output->data as $key => $val) |
|
277 | + foreach ($output->data as $key => $val) |
|
278 | 278 | { |
279 | 279 | $group_srl = $val->friend_group_srl; |
280 | 280 | $group_title = $friend_group_list[$group_srl]->title; |
281 | - if(!$group_title) |
|
281 | + if (!$group_title) |
|
282 | 282 | { |
283 | 283 | $group_title = Context::get('default_friend_group'); |
284 | 284 | } |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | $this->setLayoutFile("popup_layout"); |
307 | 307 | |
308 | 308 | // error appears if not logged-in |
309 | - if(!Context::get('is_logged')) |
|
309 | + if (!Context::get('is_logged')) |
|
310 | 310 | { |
311 | 311 | return $this->stop('msg_not_logged'); |
312 | 312 | } |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | $logged_info = Context::get('logged_info'); |
315 | 315 | $target_srl = Context::get('target_srl'); |
316 | 316 | |
317 | - if(!$target_srl) |
|
317 | + if (!$target_srl) |
|
318 | 318 | { |
319 | 319 | return $this->stop('msg_invalid_request'); |
320 | 320 | } |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | $oCommunicationModel = getModel('communication'); |
325 | 325 | $communication_info = $oMemberModel->getMemberInfoByMemberSrl($target_srl); |
326 | 326 | |
327 | - if($communication_info->member_srl != $target_srl) |
|
327 | + if ($communication_info->member_srl != $target_srl) |
|
328 | 328 | { |
329 | 329 | return $this->stop('msg_invalid_request'); |
330 | 330 | } |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | $this->setLayoutFile("popup_layout"); |
349 | 349 | |
350 | 350 | // error apprears if not logged-in |
351 | - if(!Context::get('is_logged')) |
|
351 | + if (!Context::get('is_logged')) |
|
352 | 352 | { |
353 | 353 | return $this->stop('msg_not_logged'); |
354 | 354 | } |
@@ -357,11 +357,11 @@ discard block |
||
357 | 357 | |
358 | 358 | // change to edit mode when getting the group_srl |
359 | 359 | $friend_group_srl = Context::get('friend_group_srl'); |
360 | - if($friend_group_srl) |
|
360 | + if ($friend_group_srl) |
|
361 | 361 | { |
362 | 362 | $oCommunicationModel = getModel('communication'); |
363 | 363 | $friend_group = $oCommunicationModel->getFriendGroupInfo($friend_group_srl); |
364 | - if($friend_group->friend_group_srl == $friend_group_srl) |
|
364 | + if ($friend_group->friend_group_srl == $friend_group_srl) |
|
365 | 365 | { |
366 | 366 | Context::set('friend_group', $friend_group); |
367 | 367 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | /** |
48 | 48 | * Display message box |
49 | - * @return void|BaseObject (void : success, BaseObject : fail) |
|
49 | + * @return ModuleObject|null (void : success, BaseObject : fail) |
|
50 | 50 | */ |
51 | 51 | function dispCommunicationMessages() |
52 | 52 | { |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | |
132 | 132 | /** |
133 | 133 | * display a new message |
134 | - * @return void|BaseObject (void : success, BaseObject : fail) |
|
134 | + * @return ModuleObject|null (void : success, BaseObject : fail) |
|
135 | 135 | */ |
136 | 136 | function dispCommunicationNewMessage() |
137 | 137 | { |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | |
168 | 168 | /** |
169 | 169 | * Display message sending |
170 | - * @return void|BaseObject (void : success, BaseObject : fail) |
|
170 | + * @return ModuleObject|null (void : success, BaseObject : fail) |
|
171 | 171 | */ |
172 | 172 | function dispCommunicationSendMessage() |
173 | 173 | { |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | |
243 | 243 | /** |
244 | 244 | * display a list of friends |
245 | - * @return void|BaseObject (void : success, BaseObject : fail) |
|
245 | + * @return ModuleObject|null (void : success, BaseObject : fail) |
|
246 | 246 | */ |
247 | 247 | function dispCommunicationFriend() |
248 | 248 | { |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | |
299 | 299 | /** |
300 | 300 | * display Add a friend |
301 | - * @return void|BaseObject (void : success, BaseObject : fail) |
|
301 | + * @return ModuleObject|null (void : success, BaseObject : fail) |
|
302 | 302 | */ |
303 | 303 | function dispCommunicationAddFriend() |
304 | 304 | { |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | |
341 | 341 | /** |
342 | 342 | * display add a group of friends |
343 | - * @return void|BaseObject (void : success, BaseObject : fail) |
|
343 | + * @return ModuleObject|null (void : success, BaseObject : fail) |
|
344 | 344 | */ |
345 | 345 | function dispCommunicationAddFriendGroup() |
346 | 346 | { |