@@ -27,37 +27,37 @@ discard block |
||
27 | 27 | $args = Context::getRequestVars(); |
28 | 28 | $args->module = 'board'; |
29 | 29 | $args->mid = $args->board_name; |
30 | - if(is_array($args->use_status)) $args->use_status = implode('|@|', $args->use_status); |
|
30 | + if (is_array($args->use_status)) $args->use_status = implode('|@|', $args->use_status); |
|
31 | 31 | unset($args->board_name); |
32 | 32 | |
33 | 33 | // setup extra_order_target |
34 | 34 | $extra_order_target = array(); |
35 | - if($args->module_srl) |
|
35 | + if ($args->module_srl) |
|
36 | 36 | { |
37 | 37 | $oDocumentModel = getModel('document'); |
38 | 38 | $module_extra_vars = $oDocumentModel->getExtraKeys($args->module_srl); |
39 | - foreach($module_extra_vars as $oExtraItem) |
|
39 | + foreach ($module_extra_vars as $oExtraItem) |
|
40 | 40 | { |
41 | 41 | $extra_order_target[$oExtraItem->eid] = $oExtraItem->name; |
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
45 | 45 | // setup other variables |
46 | - if($args->except_notice != 'Y') $args->except_notice = 'N'; |
|
47 | - if($args->use_anonymous != 'Y') $args->use_anonymous = 'N'; |
|
48 | - if($args->consultation != 'Y') $args->consultation = 'N'; |
|
49 | - if($args->protect_content!= 'Y') $args->protect_content = 'N'; |
|
50 | - if(!in_array($args->order_target,$this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) $args->order_target = 'list_order'; |
|
51 | - if(!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc'; |
|
46 | + if ($args->except_notice != 'Y') $args->except_notice = 'N'; |
|
47 | + if ($args->use_anonymous != 'Y') $args->use_anonymous = 'N'; |
|
48 | + if ($args->consultation != 'Y') $args->consultation = 'N'; |
|
49 | + if ($args->protect_content != 'Y') $args->protect_content = 'N'; |
|
50 | + if (!in_array($args->order_target, $this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) $args->order_target = 'list_order'; |
|
51 | + if (!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc'; |
|
52 | 52 | |
53 | 53 | // if there is an existed module |
54 | - if($args->module_srl) { |
|
54 | + if ($args->module_srl) { |
|
55 | 55 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl); |
56 | - if($module_info->module_srl != $args->module_srl) unset($args->module_srl); |
|
56 | + if ($module_info->module_srl != $args->module_srl) unset($args->module_srl); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | // insert/update the board module based on module_srl |
60 | - if(!$args->module_srl) { |
|
60 | + if (!$args->module_srl) { |
|
61 | 61 | $args->hide_category = 'N'; |
62 | 62 | $output = $oModuleController->insertModule($args); |
63 | 63 | $msg_code = 'success_registed'; |
@@ -67,18 +67,18 @@ discard block |
||
67 | 67 | $msg_code = 'success_updated'; |
68 | 68 | } |
69 | 69 | |
70 | - if(!$output->toBool()) return $output; |
|
70 | + if (!$output->toBool()) return $output; |
|
71 | 71 | |
72 | 72 | // setup list config |
73 | - $list = explode(',',Context::get('list')); |
|
74 | - if(count($list)) |
|
73 | + $list = explode(',', Context::get('list')); |
|
74 | + if (count($list)) |
|
75 | 75 | { |
76 | 76 | $list_arr = array(); |
77 | - foreach($list as $val) |
|
77 | + foreach ($list as $val) |
|
78 | 78 | { |
79 | 79 | $val = trim($val); |
80 | - if(!$val) continue; |
|
81 | - if(substr($val,0,10)=='extra_vars') $val = substr($val,10); |
|
80 | + if (!$val) continue; |
|
81 | + if (substr($val, 0, 10) == 'extra_vars') $val = substr($val, 10); |
|
82 | 82 | $list_arr[] = $val; |
83 | 83 | } |
84 | 84 | $oModuleController = getController('module'); |
@@ -86,10 +86,10 @@ discard block |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | $this->setMessage($msg_code); |
89 | - if (Context::get('success_return_url')){ |
|
89 | + if (Context::get('success_return_url')) { |
|
90 | 90 | changeValueInUrl('mid', $args->mid, $module_info->mid); |
91 | 91 | $this->setRedirectUrl(Context::get('success_return_url')); |
92 | - }else{ |
|
92 | + } else { |
|
93 | 93 | $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminBoardInfo', 'module_srl', $output->get('module_srl'))); |
94 | 94 | } |
95 | 95 | } |
@@ -105,17 +105,17 @@ discard block |
||
105 | 105 | // for board info |
106 | 106 | $args->module = 'board'; |
107 | 107 | $args->mid = $args->board_name; |
108 | - if(is_array($args->use_status)) |
|
108 | + if (is_array($args->use_status)) |
|
109 | 109 | { |
110 | 110 | $args->use_status = implode('|@|', $args->use_status); |
111 | 111 | } |
112 | 112 | unset($args->board_name); |
113 | 113 | |
114 | - if(!in_array($args->order_target, $this->order_target)) |
|
114 | + if (!in_array($args->order_target, $this->order_target)) |
|
115 | 115 | { |
116 | 116 | $args->order_target = 'list_order'; |
117 | 117 | } |
118 | - if(!in_array($args->order_type, array('asc', 'desc'))) |
|
118 | + if (!in_array($args->order_type, array('asc', 'desc'))) |
|
119 | 119 | { |
120 | 120 | $args->order_type = 'asc'; |
121 | 121 | } |
@@ -125,13 +125,13 @@ discard block |
||
125 | 125 | |
126 | 126 | // for grant info, Register Admin ID |
127 | 127 | $oModuleController->deleteAdminId($args->module_srl); |
128 | - if($args->admin_member) |
|
128 | + if ($args->admin_member) |
|
129 | 129 | { |
130 | - $admin_members = explode(',',$args->admin_member); |
|
131 | - for($i=0;$i<count($admin_members);$i++) |
|
130 | + $admin_members = explode(',', $args->admin_member); |
|
131 | + for ($i = 0; $i < count($admin_members); $i++) |
|
132 | 132 | { |
133 | 133 | $admin_id = trim($admin_members[$i]); |
134 | - if(!$admin_id) continue; |
|
134 | + if (!$admin_id) continue; |
|
135 | 135 | $oModuleController->insertAdminId($args->module_srl, $admin_id); |
136 | 136 | } |
137 | 137 | } |
@@ -146,10 +146,10 @@ discard block |
||
146 | 146 | // get the current module |
147 | 147 | $oModuleController = getController('module'); |
148 | 148 | $output = $oModuleController->deleteModule($module_srl); |
149 | - if(!$output->toBool()) return $output; |
|
149 | + if (!$output->toBool()) return $output; |
|
150 | 150 | |
151 | - $this->add('module','board'); |
|
152 | - $this->add('page',Context::get('page')); |
|
151 | + $this->add('module', 'board'); |
|
152 | + $this->add('page', Context::get('page')); |
|
153 | 153 | $this->setMessage('success_deleted'); |
154 | 154 | } |
155 | 155 | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | |
161 | 161 | $oModuleModel = getModel('module'); |
162 | 162 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); |
163 | - if($module_info->mid != $mid) |
|
163 | + if ($module_info->mid != $mid) |
|
164 | 164 | { |
165 | 165 | return new Object(-1, 'msg_invalid_request'); |
166 | 166 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $module_info->hide_category = Context::get('hide_category') == 'Y' ? 'Y' : 'N'; |
169 | 169 | $oModuleController = getController('module'); /* @var $oModuleController moduleController */ |
170 | 170 | $output = $oModuleController->updateModule($module_info); |
171 | - if(!$output->toBool()) |
|
171 | + if (!$output->toBool()) |
|
172 | 172 | { |
173 | 173 | return $output; |
174 | 174 | } |
@@ -27,7 +27,9 @@ discard block |
||
27 | 27 | $args = Context::getRequestVars(); |
28 | 28 | $args->module = 'board'; |
29 | 29 | $args->mid = $args->board_name; |
30 | - if(is_array($args->use_status)) $args->use_status = implode('|@|', $args->use_status); |
|
30 | + if(is_array($args->use_status)) { |
|
31 | + $args->use_status = implode('|@|', $args->use_status); |
|
32 | + } |
|
31 | 33 | unset($args->board_name); |
32 | 34 | |
33 | 35 | // setup extra_order_target |
@@ -43,17 +45,31 @@ discard block |
||
43 | 45 | } |
44 | 46 | |
45 | 47 | // setup other variables |
46 | - if($args->except_notice != 'Y') $args->except_notice = 'N'; |
|
47 | - if($args->use_anonymous != 'Y') $args->use_anonymous = 'N'; |
|
48 | - if($args->consultation != 'Y') $args->consultation = 'N'; |
|
49 | - if($args->protect_content!= 'Y') $args->protect_content = 'N'; |
|
50 | - if(!in_array($args->order_target,$this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) $args->order_target = 'list_order'; |
|
51 | - if(!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc'; |
|
48 | + if($args->except_notice != 'Y') { |
|
49 | + $args->except_notice = 'N'; |
|
50 | + } |
|
51 | + if($args->use_anonymous != 'Y') { |
|
52 | + $args->use_anonymous = 'N'; |
|
53 | + } |
|
54 | + if($args->consultation != 'Y') { |
|
55 | + $args->consultation = 'N'; |
|
56 | + } |
|
57 | + if($args->protect_content!= 'Y') { |
|
58 | + $args->protect_content = 'N'; |
|
59 | + } |
|
60 | + if(!in_array($args->order_target,$this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) { |
|
61 | + $args->order_target = 'list_order'; |
|
62 | + } |
|
63 | + if(!in_array($args->order_type, array('asc', 'desc'))) { |
|
64 | + $args->order_type = 'asc'; |
|
65 | + } |
|
52 | 66 | |
53 | 67 | // if there is an existed module |
54 | 68 | if($args->module_srl) { |
55 | 69 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl); |
56 | - if($module_info->module_srl != $args->module_srl) unset($args->module_srl); |
|
70 | + if($module_info->module_srl != $args->module_srl) { |
|
71 | + unset($args->module_srl); |
|
72 | + } |
|
57 | 73 | } |
58 | 74 | |
59 | 75 | // insert/update the board module based on module_srl |
@@ -67,7 +83,9 @@ discard block |
||
67 | 83 | $msg_code = 'success_updated'; |
68 | 84 | } |
69 | 85 | |
70 | - if(!$output->toBool()) return $output; |
|
86 | + if(!$output->toBool()) { |
|
87 | + return $output; |
|
88 | + } |
|
71 | 89 | |
72 | 90 | // setup list config |
73 | 91 | $list = explode(',',Context::get('list')); |
@@ -77,8 +95,12 @@ discard block |
||
77 | 95 | foreach($list as $val) |
78 | 96 | { |
79 | 97 | $val = trim($val); |
80 | - if(!$val) continue; |
|
81 | - if(substr($val,0,10)=='extra_vars') $val = substr($val,10); |
|
98 | + if(!$val) { |
|
99 | + continue; |
|
100 | + } |
|
101 | + if(substr($val,0,10)=='extra_vars') { |
|
102 | + $val = substr($val,10); |
|
103 | + } |
|
82 | 104 | $list_arr[] = $val; |
83 | 105 | } |
84 | 106 | $oModuleController = getController('module'); |
@@ -89,7 +111,7 @@ discard block |
||
89 | 111 | if (Context::get('success_return_url')){ |
90 | 112 | changeValueInUrl('mid', $args->mid, $module_info->mid); |
91 | 113 | $this->setRedirectUrl(Context::get('success_return_url')); |
92 | - }else{ |
|
114 | + } else{ |
|
93 | 115 | $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminBoardInfo', 'module_srl', $output->get('module_srl'))); |
94 | 116 | } |
95 | 117 | } |
@@ -131,7 +153,9 @@ discard block |
||
131 | 153 | for($i=0;$i<count($admin_members);$i++) |
132 | 154 | { |
133 | 155 | $admin_id = trim($admin_members[$i]); |
134 | - if(!$admin_id) continue; |
|
156 | + if(!$admin_id) { |
|
157 | + continue; |
|
158 | + } |
|
135 | 159 | $oModuleController->insertAdminId($args->module_srl, $admin_id); |
136 | 160 | } |
137 | 161 | } |
@@ -146,7 +170,9 @@ discard block |
||
146 | 170 | // get the current module |
147 | 171 | $oModuleController = getController('module'); |
148 | 172 | $output = $oModuleController->deleteModule($module_srl); |
149 | - if(!$output->toBool()) return $output; |
|
173 | + if(!$output->toBool()) { |
|
174 | + return $output; |
|
175 | + } |
|
150 | 176 | |
151 | 177 | $this->add('module','board'); |
152 | 178 | $this->add('page',Context::get('page')); |
@@ -177,8 +203,7 @@ discard block |
||
177 | 203 | if (Context::get('success_return_url')) |
178 | 204 | { |
179 | 205 | $this->setRedirectUrl(Context::get('success_return_url')); |
180 | - } |
|
181 | - else |
|
206 | + } else |
|
182 | 207 | { |
183 | 208 | $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminCategoryInfo', 'module_srl', $output->get('module_srl'))); |
184 | 209 | } |
@@ -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 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | class board extends ModuleObject |
11 | 11 | { |
12 | - var $search_option = array('title_content','title','content','comment','user_name','nick_name','user_id','tag'); ///< 검색 옵션 |
|
12 | + var $search_option = array('title_content', 'title', 'content', 'comment', 'user_name', 'nick_name', 'user_id', 'tag'); ///< 검색 옵션 |
|
13 | 13 | |
14 | 14 | var $order_target = array('list_order', 'update_order', 'regdate', 'voted_count', 'blamed_count', 'readed_count', 'comment_count', 'title', 'nick_name', 'user_name', 'user_id'); // 정렬 옵션 |
15 | 15 | |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | */ |
26 | 26 | function board() |
27 | 27 | { |
28 | - if(!Context::isInstalled()) return; |
|
28 | + if (!Context::isInstalled()) return; |
|
29 | 29 | |
30 | - if(!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional') |
|
30 | + if (!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional') |
|
31 | 31 | { |
32 | 32 | $ssl_actions = array('dispBoardWrite', 'dispBoardWriteComment', 'dispBoardReplyComment', 'dispBoardModifyComment', 'dispBoardDelete', 'dispBoardDeleteComment', 'procBoardInsertDocument', 'procBoardDeleteDocument', 'procBoardInsertComment', 'procBoardDeleteComment', 'procBoardVerificationPassword'); |
33 | 33 | Context::addSSLActions($ssl_actions); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $args = new stdClass; |
51 | 51 | $args->site_srl = 0; |
52 | 52 | $output = executeQuery('module.getSite', $args); |
53 | - if(!$output->data->index_module_srl) |
|
53 | + if (!$output->data->index_module_srl) |
|
54 | 54 | { |
55 | 55 | $args->mid = 'board'; |
56 | 56 | $args->module = 'board'; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $args->site_srl = 0; |
60 | 60 | $output = $oModuleController->insertModule($args); |
61 | 61 | |
62 | - if($output->toBool()) |
|
62 | + if ($output->toBool()) |
|
63 | 63 | { |
64 | 64 | $module_srl = $output->get('module_srl'); |
65 | 65 | |
@@ -83,10 +83,10 @@ discard block |
||
83 | 83 | $oModuleModel = getModel('module'); |
84 | 84 | |
85 | 85 | // 2007. 10. 17 get the member menu trigger |
86 | - if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true; |
|
86 | + if (!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true; |
|
87 | 87 | |
88 | 88 | // 2011. 09. 20 when add new menu in sitemap, custom menu add |
89 | - if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true; |
|
89 | + if (!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true; |
|
90 | 90 | return false; |
91 | 91 | } |
92 | 92 | |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | $oModuleController = getController('module'); |
100 | 100 | |
101 | 101 | // 2007. 10. 17 check the member menu trigger, if it is not existed then insert |
102 | - if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) |
|
102 | + if (!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) |
|
103 | 103 | { |
104 | 104 | $oModuleController->insertTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after'); |
105 | 105 | } |
106 | 106 | |
107 | 107 | // 2011. 09. 20 when add new menu in sitemap, custom menu add |
108 | - if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) |
|
108 | + if (!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) |
|
109 | 109 | { |
110 | 110 | $oModuleController->insertTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after'); |
111 | 111 | } |
@@ -116,12 +116,12 @@ discard block |
||
116 | 116 | function moduleUninstall() |
117 | 117 | { |
118 | 118 | $output = executeQueryArray("board.getAllBoard"); |
119 | - if(!$output->data) return new Object(); |
|
119 | + if (!$output->data) return new Object(); |
|
120 | 120 | @set_time_limit(0); |
121 | 121 | |
122 | 122 | $oModuleController = getController('module'); |
123 | 123 | |
124 | - foreach($output->data as $board) |
|
124 | + foreach ($output->data as $board) |
|
125 | 125 | { |
126 | 126 | $oModuleController->deleteModule($board->module_srl); |
127 | 127 | } |
@@ -25,7 +25,9 @@ discard block |
||
25 | 25 | */ |
26 | 26 | function board() |
27 | 27 | { |
28 | - if(!Context::isInstalled()) return; |
|
28 | + if(!Context::isInstalled()) { |
|
29 | + return; |
|
30 | + } |
|
29 | 31 | |
30 | 32 | if(!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional') |
31 | 33 | { |
@@ -83,10 +85,14 @@ discard block |
||
83 | 85 | $oModuleModel = getModel('module'); |
84 | 86 | |
85 | 87 | // 2007. 10. 17 get the member menu trigger |
86 | - if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true; |
|
88 | + if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) { |
|
89 | + return true; |
|
90 | + } |
|
87 | 91 | |
88 | 92 | // 2011. 09. 20 when add new menu in sitemap, custom menu add |
89 | - if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true; |
|
93 | + if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) { |
|
94 | + return true; |
|
95 | + } |
|
90 | 96 | return false; |
91 | 97 | } |
92 | 98 | |
@@ -116,7 +122,9 @@ discard block |
||
116 | 122 | function moduleUninstall() |
117 | 123 | { |
118 | 124 | $output = executeQueryArray("board.getAllBoard"); |
119 | - if(!$output->data) return new Object(); |
|
125 | + if(!$output->data) { |
|
126 | + return new Object(); |
|
127 | + } |
|
120 | 128 | @set_time_limit(0); |
121 | 129 | |
122 | 130 | $oModuleController = getController('module'); |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | function procBoardInsertDocument() |
24 | 24 | { |
25 | 25 | // check grant |
26 | - if($this->module_info->module != "board") |
|
26 | + if ($this->module_info->module != "board") |
|
27 | 27 | { |
28 | 28 | return new Object(-1, "msg_invalid_request"); |
29 | 29 | } |
30 | - if(!$this->grant->write_document) |
|
30 | + if (!$this->grant->write_document) |
|
31 | 31 | { |
32 | 32 | return new Object(-1, 'msg_not_permitted'); |
33 | 33 | } |
@@ -36,16 +36,16 @@ discard block |
||
36 | 36 | // setup variables |
37 | 37 | $obj = Context::getRequestVars(); |
38 | 38 | $obj->module_srl = $this->module_srl; |
39 | - if($obj->is_notice!='Y'||!$this->grant->manager) $obj->is_notice = 'N'; |
|
39 | + if ($obj->is_notice != 'Y' || !$this->grant->manager) $obj->is_notice = 'N'; |
|
40 | 40 | $obj->commentStatus = $obj->comment_status; |
41 | 41 | |
42 | 42 | settype($obj->title, "string"); |
43 | - if($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...'); |
|
43 | + if ($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))), 20, '...'); |
|
44 | 44 | //setup dpcument title tp 'Untitled' |
45 | - if($obj->title == '') $obj->title = 'Untitled'; |
|
45 | + if ($obj->title == '') $obj->title = 'Untitled'; |
|
46 | 46 | |
47 | 47 | // unset document style if the user is not the document manager |
48 | - if(!$this->grant->manager) |
|
48 | + if (!$this->grant->manager) |
|
49 | 49 | { |
50 | 50 | unset($obj->title_color); |
51 | 51 | unset($obj->title_bold); |
@@ -62,24 +62,24 @@ discard block |
||
62 | 62 | |
63 | 63 | // update the document if it is existed |
64 | 64 | $is_update = false; |
65 | - if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) |
|
65 | + if ($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) |
|
66 | 66 | { |
67 | 67 | $is_update = true; |
68 | 68 | } |
69 | 69 | |
70 | 70 | // if use anonymous is true |
71 | - if($this->module_info->use_anonymous == 'Y') |
|
71 | + if ($this->module_info->use_anonymous == 'Y') |
|
72 | 72 | { |
73 | 73 | $this->module_info->admin_mail = ''; |
74 | 74 | $obj->notify_message = 'N'; |
75 | - if($is_update===false) |
|
75 | + if ($is_update === false) |
|
76 | 76 | { |
77 | - $obj->member_srl = -1*$logged_info->member_srl; |
|
77 | + $obj->member_srl = -1 * $logged_info->member_srl; |
|
78 | 78 | } |
79 | 79 | $obj->email_address = $obj->homepage = $obj->user_id = ''; |
80 | 80 | $obj->user_name = $obj->nick_name = 'anonymous'; |
81 | 81 | $bAnonymous = true; |
82 | - if($is_update===false) |
|
82 | + if ($is_update === false) |
|
83 | 83 | { |
84 | 84 | $oDocument->add('member_srl', $obj->member_srl); |
85 | 85 | } |
@@ -89,10 +89,10 @@ discard block |
||
89 | 89 | $bAnonymous = false; |
90 | 90 | } |
91 | 91 | |
92 | - if($obj->is_secret == 'Y' || strtoupper($obj->status == 'SECRET')) |
|
92 | + if ($obj->is_secret == 'Y' || strtoupper($obj->status == 'SECRET')) |
|
93 | 93 | { |
94 | 94 | $use_status = explode('|@|', $this->module_info->use_status); |
95 | - if(!is_array($use_status) || !in_array('SECRET', $use_status)) |
|
95 | + if (!is_array($use_status) || !in_array('SECRET', $use_status)) |
|
96 | 96 | { |
97 | 97 | unset($obj->is_secret); |
98 | 98 | $obj->status = 'PUBLIC'; |
@@ -100,19 +100,19 @@ discard block |
||
100 | 100 | } |
101 | 101 | |
102 | 102 | // update the document if it is existed |
103 | - if($is_update) |
|
103 | + if ($is_update) |
|
104 | 104 | { |
105 | - if(!$oDocument->isGranted()) |
|
105 | + if (!$oDocument->isGranted()) |
|
106 | 106 | { |
107 | - return new Object(-1,'msg_not_permitted'); |
|
107 | + return new Object(-1, 'msg_not_permitted'); |
|
108 | 108 | } |
109 | 109 | |
110 | - if($this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false) |
|
110 | + if ($this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false) |
|
111 | 111 | { |
112 | - return new Object(-1,'msg_protect_content'); |
|
112 | + return new Object(-1, 'msg_protect_content'); |
|
113 | 113 | } |
114 | 114 | |
115 | - if(!$this->grant->manager) |
|
115 | + if (!$this->grant->manager) |
|
116 | 116 | { |
117 | 117 | // notice & document style same as before if not manager |
118 | 118 | $obj->is_notice = $oDocument->get('is_notice'); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | // modify list_order if document status is temp |
124 | - if($oDocument->get('status') == 'TEMP') |
|
124 | + if ($oDocument->get('status') == 'TEMP') |
|
125 | 125 | { |
126 | 126 | $obj->last_update = $obj->regdate = date('YmdHis'); |
127 | 127 | $obj->update_order = $obj->list_order = (getNextSequence() * -1); |
@@ -137,18 +137,18 @@ discard block |
||
137 | 137 | $obj->document_srl = $output->get('document_srl'); |
138 | 138 | |
139 | 139 | // send an email to admin user |
140 | - if($output->toBool() && $this->module_info->admin_mail) |
|
140 | + if ($output->toBool() && $this->module_info->admin_mail) |
|
141 | 141 | { |
142 | 142 | $oMail = new Mail(); |
143 | 143 | $oMail->setTitle($obj->title); |
144 | - $oMail->setContent( sprintf("From : <a href=\"%s\">%s</a><br/>\r\n%s", getFullUrl('','document_srl',$obj->document_srl), getFullUrl('','document_srl',$obj->document_srl), $obj->content)); |
|
144 | + $oMail->setContent(sprintf("From : <a href=\"%s\">%s</a><br/>\r\n%s", getFullUrl('', 'document_srl', $obj->document_srl), getFullUrl('', 'document_srl', $obj->document_srl), $obj->content)); |
|
145 | 145 | $oMail->setSender($obj->user_name, $obj->email_address); |
146 | 146 | |
147 | - $target_mail = explode(',',$this->module_info->admin_mail); |
|
148 | - for($i=0;$i<count($target_mail);$i++) |
|
147 | + $target_mail = explode(',', $this->module_info->admin_mail); |
|
148 | + for ($i = 0; $i < count($target_mail); $i++) |
|
149 | 149 | { |
150 | 150 | $email_address = trim($target_mail[$i]); |
151 | - if(!$email_address) continue; |
|
151 | + if (!$email_address) continue; |
|
152 | 152 | $oMail->setReceiptor($email_address, $email_address); |
153 | 153 | $oMail->send(); |
154 | 154 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | } |
157 | 157 | |
158 | 158 | // if there is an error |
159 | - if(!$output->toBool()) |
|
159 | + if (!$output->toBool()) |
|
160 | 160 | { |
161 | 161 | return $output; |
162 | 162 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $document_srl = Context::get('document_srl'); |
179 | 179 | |
180 | 180 | // if the document is not existed |
181 | - if(!$document_srl) |
|
181 | + if (!$document_srl) |
|
182 | 182 | { |
183 | 183 | return $this->doError('msg_invalid_document'); |
184 | 184 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $oDocumentModel = &getModel('document'); |
187 | 187 | $oDocument = $oDocumentModel->getDocument($document_srl); |
188 | 188 | // check protect content |
189 | - if($this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false) |
|
189 | + if ($this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false) |
|
190 | 190 | { |
191 | 191 | return new Object(-1, 'msg_protect_content'); |
192 | 192 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | |
197 | 197 | // delete the document |
198 | 198 | $output = $oDocumentController->deleteDocument($document_srl, $this->grant->manager); |
199 | - if(!$output->toBool()) |
|
199 | + if (!$output->toBool()) |
|
200 | 200 | { |
201 | 201 | return $output; |
202 | 202 | } |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | function procBoardInsertComment() |
227 | 227 | { |
228 | 228 | // check grant |
229 | - if(!$this->grant->write_comment) |
|
229 | + if (!$this->grant->write_comment) |
|
230 | 230 | { |
231 | 231 | return new Object(-1, 'msg_not_permitted'); |
232 | 232 | } |
@@ -236,13 +236,13 @@ discard block |
||
236 | 236 | $obj = Context::getRequestVars(); |
237 | 237 | $obj->module_srl = $this->module_srl; |
238 | 238 | |
239 | - if(!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC'; |
|
240 | - if(!is_array($this->module_info->use_status)) |
|
239 | + if (!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC'; |
|
240 | + if (!is_array($this->module_info->use_status)) |
|
241 | 241 | { |
242 | 242 | $this->module_info->use_status = explode('|@|', $this->module_info->use_status); |
243 | 243 | } |
244 | 244 | |
245 | - if(in_array('SECRET', $this->module_info->use_status)) |
|
245 | + if (in_array('SECRET', $this->module_info->use_status)) |
|
246 | 246 | { |
247 | 247 | $this->module_info->secret = 'Y'; |
248 | 248 | } |
@@ -255,17 +255,17 @@ discard block |
||
255 | 255 | // check if the doument is existed |
256 | 256 | $oDocumentModel = getModel('document'); |
257 | 257 | $oDocument = $oDocumentModel->getDocument($obj->document_srl); |
258 | - if(!$oDocument->isExists()) |
|
258 | + if (!$oDocument->isExists()) |
|
259 | 259 | { |
260 | - return new Object(-1,'msg_not_founded'); |
|
260 | + return new Object(-1, 'msg_not_founded'); |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | // For anonymous use, remove writer's information and notifying information |
264 | - if($this->module_info->use_anonymous == 'Y') |
|
264 | + if ($this->module_info->use_anonymous == 'Y') |
|
265 | 265 | { |
266 | 266 | $this->module_info->admin_mail = ''; |
267 | 267 | $obj->notify_message = 'N'; |
268 | - $obj->member_srl = -1*$logged_info->member_srl; |
|
268 | + $obj->member_srl = -1 * $logged_info->member_srl; |
|
269 | 269 | $obj->email_address = $obj->homepage = $obj->user_id = ''; |
270 | 270 | $obj->user_name = $obj->nick_name = 'anonymous'; |
271 | 271 | $bAnonymous = true; |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | |
284 | 284 | // check the comment is existed |
285 | 285 | // if the comment is not existed, then generate a new sequence |
286 | - if(!$obj->comment_srl) |
|
286 | + if (!$obj->comment_srl) |
|
287 | 287 | { |
288 | 288 | $obj->comment_srl = getNextSequence(); |
289 | 289 | } else { |
@@ -291,14 +291,14 @@ discard block |
||
291 | 291 | } |
292 | 292 | |
293 | 293 | // if comment_srl is not existed, then insert the comment |
294 | - if($comment->comment_srl != $obj->comment_srl) |
|
294 | + if ($comment->comment_srl != $obj->comment_srl) |
|
295 | 295 | { |
296 | 296 | |
297 | 297 | // parent_srl is existed |
298 | - if($obj->parent_srl) |
|
298 | + if ($obj->parent_srl) |
|
299 | 299 | { |
300 | 300 | $parent_comment = $oCommentModel->getComment($obj->parent_srl); |
301 | - if(!$parent_comment->comment_srl) |
|
301 | + if (!$parent_comment->comment_srl) |
|
302 | 302 | { |
303 | 303 | return new Object(-1, 'msg_invalid_request'); |
304 | 304 | } |
@@ -312,9 +312,9 @@ discard block |
||
312 | 312 | // update the comment if it is not existed |
313 | 313 | } else { |
314 | 314 | // check the grant |
315 | - if(!$comment->isGranted()) |
|
315 | + if (!$comment->isGranted()) |
|
316 | 316 | { |
317 | - return new Object(-1,'msg_not_permitted'); |
|
317 | + return new Object(-1, 'msg_not_permitted'); |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | $obj->parent_srl = $comment->parent_srl; |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | $comment_srl = $obj->comment_srl; |
323 | 323 | } |
324 | 324 | |
325 | - if(!$output->toBool()) |
|
325 | + if (!$output->toBool()) |
|
326 | 326 | { |
327 | 327 | return $output; |
328 | 328 | } |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | { |
341 | 341 | // get the comment_srl |
342 | 342 | $comment_srl = Context::get('comment_srl'); |
343 | - if(!$comment_srl) |
|
343 | + if (!$comment_srl) |
|
344 | 344 | { |
345 | 345 | return $this->doError('msg_invalid_request'); |
346 | 346 | } |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | $oCommentController = getController('comment'); |
350 | 350 | |
351 | 351 | $output = $oCommentController->deleteComment($comment_srl, $this->grant->manager); |
352 | - if(!$output->toBool()) |
|
352 | + if (!$output->toBool()) |
|
353 | 353 | { |
354 | 354 | return $output; |
355 | 355 | } |
@@ -370,10 +370,10 @@ discard block |
||
370 | 370 | // generate trackback module controller object |
371 | 371 | $oTrackbackController = getController('trackback'); |
372 | 372 | |
373 | - if(!$oTrackbackController) return; |
|
373 | + if (!$oTrackbackController) return; |
|
374 | 374 | |
375 | 375 | $output = $oTrackbackController->deleteTrackback($trackback_srl, $this->grant->manager); |
376 | - if(!$output->toBool()) |
|
376 | + if (!$output->toBool()) |
|
377 | 377 | { |
378 | 378 | return $output; |
379 | 379 | } |
@@ -397,18 +397,18 @@ discard block |
||
397 | 397 | $oMemberModel = getModel('member'); |
398 | 398 | |
399 | 399 | // if the comment exists |
400 | - if($comment_srl) |
|
400 | + if ($comment_srl) |
|
401 | 401 | { |
402 | 402 | // get the comment information |
403 | 403 | $oCommentModel = getModel('comment'); |
404 | 404 | $oComment = $oCommentModel->getComment($comment_srl); |
405 | - if(!$oComment->isExists()) |
|
405 | + if (!$oComment->isExists()) |
|
406 | 406 | { |
407 | 407 | return new Object(-1, 'msg_invalid_request'); |
408 | 408 | } |
409 | 409 | |
410 | 410 | // compare the comment password and the user input password |
411 | - if(!$oMemberModel->isValidPassword($oComment->get('password'),$password)) |
|
411 | + if (!$oMemberModel->isValidPassword($oComment->get('password'), $password)) |
|
412 | 412 | { |
413 | 413 | return new Object(-1, 'msg_invalid_password'); |
414 | 414 | } |
@@ -418,13 +418,13 @@ discard block |
||
418 | 418 | // get the document information |
419 | 419 | $oDocumentModel = getModel('document'); |
420 | 420 | $oDocument = $oDocumentModel->getDocument($document_srl); |
421 | - if(!$oDocument->isExists()) |
|
421 | + if (!$oDocument->isExists()) |
|
422 | 422 | { |
423 | 423 | return new Object(-1, 'msg_invalid_request'); |
424 | 424 | } |
425 | 425 | |
426 | 426 | // compare the document password and the user input password |
427 | - if(!$oMemberModel->isValidPassword($oDocument->get('password'),$password)) |
|
427 | + if (!$oMemberModel->isValidPassword($oDocument->get('password'), $password)) |
|
428 | 428 | { |
429 | 429 | return new Object(-1, 'msg_invalid_password'); |
430 | 430 | } |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | $member_srl = Context::get('target_srl'); |
442 | 442 | $mid = Context::get('cur_mid'); |
443 | 443 | |
444 | - if(!$member_srl || !$mid) |
|
444 | + if (!$member_srl || !$mid) |
|
445 | 445 | { |
446 | 446 | return new Object(); |
447 | 447 | } |
@@ -453,13 +453,13 @@ discard block |
||
453 | 453 | $columnList = array('module'); |
454 | 454 | $cur_module_info = $oModuleModel->getModuleInfoByMid($mid, 0, $columnList); |
455 | 455 | |
456 | - if($cur_module_info->module != 'board') |
|
456 | + if ($cur_module_info->module != 'board') |
|
457 | 457 | { |
458 | 458 | return new Object(); |
459 | 459 | } |
460 | 460 | |
461 | 461 | // get the member information |
462 | - if($member_srl == $logged_info->member_srl) |
|
462 | + if ($member_srl == $logged_info->member_srl) |
|
463 | 463 | { |
464 | 464 | $member_info = $logged_info; |
465 | 465 | } else { |
@@ -467,13 +467,13 @@ discard block |
||
467 | 467 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); |
468 | 468 | } |
469 | 469 | |
470 | - if(!$member_info->user_id) |
|
470 | + if (!$member_info->user_id) |
|
471 | 471 | { |
472 | 472 | return new Object(); |
473 | 473 | } |
474 | 474 | |
475 | 475 | //search |
476 | - $url = getUrl('','mid',$mid,'search_target','nick_name','search_keyword',$member_info->nick_name); |
|
476 | + $url = getUrl('', 'mid', $mid, 'search_target', 'nick_name', 'search_keyword', $member_info->nick_name); |
|
477 | 477 | $oMemberController = getController('member'); |
478 | 478 | $oMemberController->addMemberPopupMenu($url, 'cmd_view_own_document', ''); |
479 | 479 |
@@ -36,13 +36,19 @@ discard block |
||
36 | 36 | // setup variables |
37 | 37 | $obj = Context::getRequestVars(); |
38 | 38 | $obj->module_srl = $this->module_srl; |
39 | - if($obj->is_notice!='Y'||!$this->grant->manager) $obj->is_notice = 'N'; |
|
39 | + if($obj->is_notice!='Y'||!$this->grant->manager) { |
|
40 | + $obj->is_notice = 'N'; |
|
41 | + } |
|
40 | 42 | $obj->commentStatus = $obj->comment_status; |
41 | 43 | |
42 | 44 | settype($obj->title, "string"); |
43 | - if($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...'); |
|
45 | + if($obj->title == '') { |
|
46 | + $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...'); |
|
47 | + } |
|
44 | 48 | //setup dpcument title tp 'Untitled' |
45 | - if($obj->title == '') $obj->title = 'Untitled'; |
|
49 | + if($obj->title == '') { |
|
50 | + $obj->title = 'Untitled'; |
|
51 | + } |
|
46 | 52 | |
47 | 53 | // unset document style if the user is not the document manager |
48 | 54 | if(!$this->grant->manager) |
@@ -83,8 +89,7 @@ discard block |
||
83 | 89 | { |
84 | 90 | $oDocument->add('member_srl', $obj->member_srl); |
85 | 91 | } |
86 | - } |
|
87 | - else |
|
92 | + } else |
|
88 | 93 | { |
89 | 94 | $bAnonymous = false; |
90 | 95 | } |
@@ -148,7 +153,9 @@ discard block |
||
148 | 153 | for($i=0;$i<count($target_mail);$i++) |
149 | 154 | { |
150 | 155 | $email_address = trim($target_mail[$i]); |
151 | - if(!$email_address) continue; |
|
156 | + if(!$email_address) { |
|
157 | + continue; |
|
158 | + } |
|
152 | 159 | $oMail->setReceiptor($email_address, $email_address); |
153 | 160 | $oMail->send(); |
154 | 161 | } |
@@ -236,7 +243,9 @@ discard block |
||
236 | 243 | $obj = Context::getRequestVars(); |
237 | 244 | $obj->module_srl = $this->module_srl; |
238 | 245 | |
239 | - if(!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC'; |
|
246 | + if(!$this->module_info->use_status) { |
|
247 | + $this->module_info->use_status = 'PUBLIC'; |
|
248 | + } |
|
240 | 249 | if(!is_array($this->module_info->use_status)) |
241 | 250 | { |
242 | 251 | $this->module_info->use_status = explode('|@|', $this->module_info->use_status); |
@@ -245,8 +254,7 @@ discard block |
||
245 | 254 | if(in_array('SECRET', $this->module_info->use_status)) |
246 | 255 | { |
247 | 256 | $this->module_info->secret = 'Y'; |
248 | - } |
|
249 | - else |
|
257 | + } else |
|
250 | 258 | { |
251 | 259 | unset($obj->is_secret); |
252 | 260 | $this->module_info->secret = 'N'; |
@@ -269,8 +277,7 @@ discard block |
||
269 | 277 | $obj->email_address = $obj->homepage = $obj->user_id = ''; |
270 | 278 | $obj->user_name = $obj->nick_name = 'anonymous'; |
271 | 279 | $bAnonymous = true; |
272 | - } |
|
273 | - else |
|
280 | + } else |
|
274 | 281 | { |
275 | 282 | $bAnonymous = false; |
276 | 283 | } |
@@ -370,7 +377,9 @@ discard block |
||
370 | 377 | // generate trackback module controller object |
371 | 378 | $oTrackbackController = getController('trackback'); |
372 | 379 | |
373 | - if(!$oTrackbackController) return; |
|
380 | + if(!$oTrackbackController) { |
|
381 | + return; |
|
382 | + } |
|
374 | 383 | |
375 | 384 | $output = $oTrackbackController->deleteTrackback($trackback_srl, $this->grant->manager); |
376 | 385 | if(!$output->toBool()) |
@@ -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/board/board.view.php'); |
|
4 | +require_once(_XE_PATH_ . 'modules/board/board.view.php'); |
|
5 | 5 | |
6 | 6 | class boardMobile extends boardView |
7 | 7 | { |
@@ -10,32 +10,32 @@ discard block |
||
10 | 10 | $oSecurity = new Security(); |
11 | 11 | $oSecurity->encodeHTML('document_srl', 'comment_srl', 'vid', 'mid', 'page', 'category', 'search_target', 'search_keyword', 'sort_index', 'order_type', 'trackback_srl'); |
12 | 12 | |
13 | - if($this->module_info->list_count) $this->list_count = $this->module_info->list_count; |
|
14 | - if($this->module_info->mobile_list_count) $this->list_count = $this->module_info->mobile_list_count; |
|
15 | - if($this->module_info->search_list_count) $this->search_list_count = $this->module_info->search_list_count; |
|
16 | - if($this->module_info->mobile_search_list_count) $this->list_count = $this->module_info->mobile_search_list_count; |
|
17 | - if($this->module_info->page_count) $this->page_count = $this->module_info->page_count; |
|
18 | - if($this->module_info->mobile_page_count) $this->page_count = $this->module_info->mobile_page_count; |
|
13 | + if ($this->module_info->list_count) $this->list_count = $this->module_info->list_count; |
|
14 | + if ($this->module_info->mobile_list_count) $this->list_count = $this->module_info->mobile_list_count; |
|
15 | + if ($this->module_info->search_list_count) $this->search_list_count = $this->module_info->search_list_count; |
|
16 | + if ($this->module_info->mobile_search_list_count) $this->list_count = $this->module_info->mobile_search_list_count; |
|
17 | + if ($this->module_info->page_count) $this->page_count = $this->module_info->page_count; |
|
18 | + if ($this->module_info->mobile_page_count) $this->page_count = $this->module_info->mobile_page_count; |
|
19 | 19 | $this->except_notice = $this->module_info->except_notice == 'N' ? false : true; |
20 | 20 | |
21 | 21 | // $this->_getStatusNameListecret option backward compatibility |
22 | 22 | $oDocumentModel = getModel('document'); |
23 | 23 | |
24 | 24 | $statusList = $this->_getStatusNameList($oDocumentModel); |
25 | - if(isset($statusList['SECRET'])) |
|
25 | + if (isset($statusList['SECRET'])) |
|
26 | 26 | { |
27 | 27 | $this->module_info->secret = 'Y'; |
28 | 28 | } |
29 | 29 | |
30 | 30 | // use_category <=1.5.x, hide_category >=1.7.x |
31 | 31 | $count_category = count($oDocumentModel->getCategoryList($this->module_info->module_srl)); |
32 | - if($count_category) |
|
32 | + if ($count_category) |
|
33 | 33 | { |
34 | - if($this->module_info->hide_category) |
|
34 | + if ($this->module_info->hide_category) |
|
35 | 35 | { |
36 | 36 | $this->module_info->use_category = ($this->module_info->hide_category == 'Y') ? 'N' : 'Y'; |
37 | 37 | } |
38 | - else if($this->module_info->use_category) |
|
38 | + else if ($this->module_info->use_category) |
|
39 | 39 | { |
40 | 40 | $this->module_info->hide_category = ($this->module_info->use_category == 'Y') ? 'N' : 'Y'; |
41 | 41 | } |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | * check the consultation function, if the user is admin then swich off consultation function |
56 | 56 | * if the user is not logged, then disppear write document/write comment./ view document |
57 | 57 | **/ |
58 | - if($this->module_info->consultation == 'Y' && !$this->grant->manager) |
|
58 | + if ($this->module_info->consultation == 'Y' && !$this->grant->manager) |
|
59 | 59 | { |
60 | 60 | $this->consultation = true; |
61 | - if(!Context::get('is_logged')) $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false; |
|
61 | + if (!Context::get('is_logged')) $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false; |
|
62 | 62 | } else { |
63 | 63 | $this->consultation = false; |
64 | 64 | } |
@@ -67,14 +67,14 @@ discard block |
||
67 | 67 | $extra_keys = $oDocumentModel->getExtraKeys($this->module_info->module_srl); |
68 | 68 | Context::set('extra_keys', $extra_keys); |
69 | 69 | |
70 | - $template_path = sprintf("%sm.skins/%s/",$this->module_path, $this->module_info->mskin); |
|
71 | - if(!is_dir($template_path)||!$this->module_info->mskin) |
|
70 | + $template_path = sprintf("%sm.skins/%s/", $this->module_path, $this->module_info->mskin); |
|
71 | + if (!is_dir($template_path) || !$this->module_info->mskin) |
|
72 | 72 | { |
73 | 73 | $this->module_info->mskin = 'default'; |
74 | - $template_path = sprintf("%sm.skins/%s/",$this->module_path, $this->module_info->mskin); |
|
74 | + $template_path = sprintf("%sm.skins/%s/", $this->module_path, $this->module_info->mskin); |
|
75 | 75 | } |
76 | 76 | $this->setTemplatePath($template_path); |
77 | - Context::addJsFilter($this->module_path.'tpl/filter', 'input_password.xml'); |
|
77 | + Context::addJsFilter($this->module_path . 'tpl/filter', 'input_password.xml'); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | function dispBoardCategory() |
@@ -87,13 +87,13 @@ discard block |
||
87 | 87 | function getBoardCommentPage() |
88 | 88 | { |
89 | 89 | $document_srl = Context::get('document_srl'); |
90 | - $oDocumentModel =& getModel('document'); |
|
91 | - if(!$document_srl) |
|
90 | + $oDocumentModel = & getModel('document'); |
|
91 | + if (!$document_srl) |
|
92 | 92 | { |
93 | 93 | return new Object(-1, "msg_invalid_request"); |
94 | 94 | } |
95 | 95 | $oDocument = $oDocumentModel->getDocument($document_srl); |
96 | - if(!$oDocument->isExists()) |
|
96 | + if (!$oDocument->isExists()) |
|
97 | 97 | { |
98 | 98 | return new Object(-1, "msg_invalid_request"); |
99 | 99 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | function dispBoardMessage($msg_code) |
107 | 107 | { |
108 | 108 | $msg = Context::getLang($msg_code); |
109 | - $oMessageObject = &ModuleHandler::getModuleInstance('message','mobile'); |
|
109 | + $oMessageObject = &ModuleHandler::getModuleInstance('message', 'mobile'); |
|
110 | 110 | $oMessageObject->setError(-1); |
111 | 111 | $oMessageObject->setMessage($msg); |
112 | 112 | $oMessageObject->dispMessage(); |
@@ -10,12 +10,24 @@ discard block |
||
10 | 10 | $oSecurity = new Security(); |
11 | 11 | $oSecurity->encodeHTML('document_srl', 'comment_srl', 'vid', 'mid', 'page', 'category', 'search_target', 'search_keyword', 'sort_index', 'order_type', 'trackback_srl'); |
12 | 12 | |
13 | - if($this->module_info->list_count) $this->list_count = $this->module_info->list_count; |
|
14 | - if($this->module_info->mobile_list_count) $this->list_count = $this->module_info->mobile_list_count; |
|
15 | - if($this->module_info->search_list_count) $this->search_list_count = $this->module_info->search_list_count; |
|
16 | - if($this->module_info->mobile_search_list_count) $this->list_count = $this->module_info->mobile_search_list_count; |
|
17 | - if($this->module_info->page_count) $this->page_count = $this->module_info->page_count; |
|
18 | - if($this->module_info->mobile_page_count) $this->page_count = $this->module_info->mobile_page_count; |
|
13 | + if($this->module_info->list_count) { |
|
14 | + $this->list_count = $this->module_info->list_count; |
|
15 | + } |
|
16 | + if($this->module_info->mobile_list_count) { |
|
17 | + $this->list_count = $this->module_info->mobile_list_count; |
|
18 | + } |
|
19 | + if($this->module_info->search_list_count) { |
|
20 | + $this->search_list_count = $this->module_info->search_list_count; |
|
21 | + } |
|
22 | + if($this->module_info->mobile_search_list_count) { |
|
23 | + $this->list_count = $this->module_info->mobile_search_list_count; |
|
24 | + } |
|
25 | + if($this->module_info->page_count) { |
|
26 | + $this->page_count = $this->module_info->page_count; |
|
27 | + } |
|
28 | + if($this->module_info->mobile_page_count) { |
|
29 | + $this->page_count = $this->module_info->mobile_page_count; |
|
30 | + } |
|
19 | 31 | $this->except_notice = $this->module_info->except_notice == 'N' ? false : true; |
20 | 32 | |
21 | 33 | // $this->_getStatusNameListecret option backward compatibility |
@@ -34,18 +46,15 @@ discard block |
||
34 | 46 | if($this->module_info->hide_category) |
35 | 47 | { |
36 | 48 | $this->module_info->use_category = ($this->module_info->hide_category == 'Y') ? 'N' : 'Y'; |
37 | - } |
|
38 | - else if($this->module_info->use_category) |
|
49 | + } else if($this->module_info->use_category) |
|
39 | 50 | { |
40 | 51 | $this->module_info->hide_category = ($this->module_info->use_category == 'Y') ? 'N' : 'Y'; |
41 | - } |
|
42 | - else |
|
52 | + } else |
|
43 | 53 | { |
44 | 54 | $this->module_info->hide_category = 'N'; |
45 | 55 | $this->module_info->use_category = 'Y'; |
46 | 56 | } |
47 | - } |
|
48 | - else |
|
57 | + } else |
|
49 | 58 | { |
50 | 59 | $this->module_info->hide_category = 'Y'; |
51 | 60 | $this->module_info->use_category = 'N'; |
@@ -58,7 +67,9 @@ discard block |
||
58 | 67 | if($this->module_info->consultation == 'Y' && !$this->grant->manager) |
59 | 68 | { |
60 | 69 | $this->consultation = true; |
61 | - if(!Context::get('is_logged')) $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false; |
|
70 | + if(!Context::get('is_logged')) { |
|
71 | + $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false; |
|
72 | + } |
|
62 | 73 | } else { |
63 | 74 | $this->consultation = false; |
64 | 75 | } |
@@ -25,21 +25,21 @@ 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 | - $output['extra_vars'.$key] = $inserted_extra_vars[$key]; |
|
42 | + $output['extra_vars' . $key] = $inserted_extra_vars[$key]; |
|
43 | 43 | } |
44 | 44 | else |
45 | 45 | { |
@@ -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,11 +71,11 @@ 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 | - $extra_vars['extra_vars'.$obj->idx] = $obj; |
|
78 | + $extra_vars['extra_vars' . $obj->idx] = $obj; |
|
79 | 79 | } |
80 | 80 | } |
81 | 81 |
@@ -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 | } |
@@ -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; |
|
78 | - $content = '<b>'.$oDocument->getNickName().'</b> ('.$oDocument->getRegdate("Y-m-d").")<br>\r\n".$content; |
|
77 | + $content = Context::getLang('replies') . ' : <a href="' . getUrl('act', 'dispBoardContentCommentList') . '">' . $oDocument->getCommentCount() . '</a><br>' . "\r\n" . $content; |
|
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,44 +92,44 @@ 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().']'; |
|
114 | - $obj['link'] = $obj['text'] = '['.$val->getNickName().'] '.$title; |
|
113 | + if ($val->getCommentCount()) $title .= ' [' . $val->getCommentCount() . ']'; |
|
114 | + $obj['link'] = $obj['text'] = '[' . $val->getNickName() . '] ' . $title; |
|
115 | 115 | $childs[] = $obj; |
116 | 116 | } |
117 | 117 | $oMobile->setChilds($childs); |
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; |
@@ -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) |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | // get a list by using comment->getCommentList. |
53 | 53 | $oCommentModel = getModel('comment'); |
54 | 54 | $secretNameList = $oCommentModel->getSecretNameList(); |
55 | - $columnList = array('comment_srl', 'document_srl','module_srl','is_secret', 'status', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress', 'voted_count', 'blamed_count'); |
|
55 | + $columnList = array('comment_srl', 'document_srl', 'module_srl', 'is_secret', 'status', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress', 'voted_count', 'blamed_count'); |
|
56 | 56 | $output = $oCommentModel->getTotalCommentList($args, $columnList); |
57 | 57 | |
58 | 58 | // $modules = $oCommentModel->getDistinctModules(); |
@@ -70,20 +70,20 @@ discard block |
||
70 | 70 | $oModuleModel = getModel('module'); |
71 | 71 | $module_list = array(); |
72 | 72 | $mod_srls = array(); |
73 | - foreach($output->data as $val) |
|
73 | + foreach ($output->data as $val) |
|
74 | 74 | { |
75 | 75 | $mod_srls[] = $val->module_srl; |
76 | 76 | } |
77 | 77 | $mod_srls = array_unique($mod_srls); |
78 | 78 | // Module List |
79 | 79 | $mod_srls_count = count($mod_srls); |
80 | - if($mod_srls_count) |
|
80 | + if ($mod_srls_count) |
|
81 | 81 | { |
82 | 82 | $columnList = array('module_srl', 'mid', 'browser_title'); |
83 | 83 | $module_output = $oModuleModel->getModulesInfo($mod_srls, $columnList); |
84 | - if($module_output && is_array($module_output)) |
|
84 | + if ($module_output && is_array($module_output)) |
|
85 | 85 | { |
86 | - foreach($module_output as $module) |
|
86 | + foreach ($module_output as $module) |
|
87 | 87 | { |
88 | 88 | $module_list[$module->module_srl] = $module; |
89 | 89 | } |
@@ -114,11 +114,11 @@ discard block |
||
114 | 114 | $declared_output = executeQuery('comment.getDeclaredList', $args); |
115 | 115 | $oCommentModel = getModel('comment'); |
116 | 116 | |
117 | - if($declared_output->data && count($declared_output->data)) |
|
117 | + if ($declared_output->data && count($declared_output->data)) |
|
118 | 118 | { |
119 | 119 | $comment_list = array(); |
120 | 120 | |
121 | - foreach($declared_output->data as $key => $comment) |
|
121 | + foreach ($declared_output->data as $key => $comment) |
|
122 | 122 | { |
123 | 123 | $comment_list[$key] = new commentItem(); |
124 | 124 | $comment_list[$key]->setAttribute($comment); |
@@ -48,55 +48,55 @@ discard block |
||
48 | 48 | $oDB = DB::getInstance(); |
49 | 49 | $oModuleModel = getModel('module'); |
50 | 50 | // 2007. 10. 17 add a trigger to delete comments together with posting deleted |
51 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after')) |
|
51 | + if (!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after')) |
|
52 | 52 | { |
53 | 53 | return TRUE; |
54 | 54 | } |
55 | 55 | // 2007. 10. 17 add a trigger to delete all of comments together with module deleted |
56 | - if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after')) |
|
56 | + if (!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after')) |
|
57 | 57 | { |
58 | 58 | return TRUE; |
59 | 59 | } |
60 | 60 | // 2007. 10. 23 add a column for recommendation votes or notification of the comments |
61 | - if(!$oDB->isColumnExists("comments", "voted_count")) |
|
61 | + if (!$oDB->isColumnExists("comments", "voted_count")) |
|
62 | 62 | { |
63 | 63 | return TRUE; |
64 | 64 | } |
65 | - if(!$oDB->isColumnExists("comments", "notify_message")) |
|
65 | + if (!$oDB->isColumnExists("comments", "notify_message")) |
|
66 | 66 | { |
67 | 67 | return TRUE; |
68 | 68 | } |
69 | 69 | // 2008. 02. 22 add comment setting when a new module added |
70 | - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before')) |
|
70 | + if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before')) |
|
71 | 71 | { |
72 | 72 | return TRUE; |
73 | 73 | } |
74 | 74 | // 2008. 05. 14 add a column for blamed count |
75 | - if(!$oDB->isColumnExists("comments", "blamed_count")) |
|
75 | + if (!$oDB->isColumnExists("comments", "blamed_count")) |
|
76 | 76 | { |
77 | 77 | return TRUE; |
78 | 78 | } |
79 | - if(!$oDB->isColumnExists("comment_voted_log", "point")) |
|
79 | + if (!$oDB->isColumnExists("comment_voted_log", "point")) |
|
80 | 80 | { |
81 | 81 | return TRUE; |
82 | 82 | } |
83 | 83 | |
84 | - if(!$oDB->isIndexExists("comments", "idx_module_list_order")) |
|
84 | + if (!$oDB->isIndexExists("comments", "idx_module_list_order")) |
|
85 | 85 | { |
86 | 86 | return TRUE; |
87 | 87 | } |
88 | 88 | //2012. 02. 24 add comment published status column and index |
89 | - if(!$oDB->isColumnExists("comments", "status")) |
|
89 | + if (!$oDB->isColumnExists("comments", "status")) |
|
90 | 90 | { |
91 | 91 | return TRUE; |
92 | 92 | } |
93 | - if(!$oDB->isIndexExists("comments", "idx_status")) |
|
93 | + if (!$oDB->isIndexExists("comments", "idx_status")) |
|
94 | 94 | { |
95 | 95 | return TRUE; |
96 | 96 | } |
97 | 97 | |
98 | 98 | // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied |
99 | - if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after')) |
|
99 | + if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after')) |
|
100 | 100 | { |
101 | 101 | return TRUE; |
102 | 102 | } |
@@ -114,43 +114,43 @@ discard block |
||
114 | 114 | $oModuleModel = getModel('module'); |
115 | 115 | $oModuleController = getController('module'); |
116 | 116 | // 2007. 10. 17 add a trigger to delete comments together with posting deleted |
117 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after')) |
|
117 | + if (!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after')) |
|
118 | 118 | { |
119 | 119 | $oModuleController->insertTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'); |
120 | 120 | } |
121 | 121 | // 2007. 10. 17 add a trigger to delete all of comments together with module deleted |
122 | - if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after')) |
|
122 | + if (!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after')) |
|
123 | 123 | { |
124 | 124 | $oModuleController->insertTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'); |
125 | 125 | } |
126 | 126 | // 2007. 10. 23 add a column for recommendation votes or notification of the comments |
127 | - if(!$oDB->isColumnExists("comments", "voted_count")) |
|
127 | + if (!$oDB->isColumnExists("comments", "voted_count")) |
|
128 | 128 | { |
129 | 129 | $oDB->addColumn("comments", "voted_count", "number", "11"); |
130 | 130 | $oDB->addIndex("comments", "idx_voted_count", array("voted_count")); |
131 | 131 | } |
132 | 132 | |
133 | - if(!$oDB->isColumnExists("comments", "notify_message")) |
|
133 | + if (!$oDB->isColumnExists("comments", "notify_message")) |
|
134 | 134 | { |
135 | 135 | $oDB->addColumn("comments", "notify_message", "char", "1"); |
136 | 136 | } |
137 | 137 | // 2008. 02. 22 add comment setting when a new module added |
138 | - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before')) |
|
138 | + if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before')) |
|
139 | 139 | { |
140 | 140 | $oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'); |
141 | 141 | } |
142 | 142 | // 2008. 05. 14 add a column for blamed count |
143 | - if(!$oDB->isColumnExists("comments", "blamed_count")) |
|
143 | + if (!$oDB->isColumnExists("comments", "blamed_count")) |
|
144 | 144 | { |
145 | 145 | $oDB->addColumn('comments', 'blamed_count', 'number', 11, 0, TRUE); |
146 | 146 | $oDB->addIndex('comments', 'idx_blamed_count', array('blamed_count')); |
147 | 147 | } |
148 | - if(!$oDB->isColumnExists("comment_voted_log", "point")) |
|
148 | + if (!$oDB->isColumnExists("comment_voted_log", "point")) |
|
149 | 149 | { |
150 | 150 | $oDB->addColumn('comment_voted_log', 'point', 'number', 11, 0, TRUE); |
151 | 151 | } |
152 | 152 | |
153 | - if(!$oDB->isIndexExists("comments", "idx_module_list_order")) |
|
153 | + if (!$oDB->isIndexExists("comments", "idx_module_list_order")) |
|
154 | 154 | { |
155 | 155 | $oDB->addIndex( |
156 | 156 | "comments", "idx_module_list_order", array("module_srl", "list_order"), TRUE |
@@ -158,11 +158,11 @@ discard block |
||
158 | 158 | } |
159 | 159 | |
160 | 160 | //2012. 02. 24 add comment published status column and index |
161 | - if(!$oDB->isColumnExists("comments", "status")) |
|
161 | + if (!$oDB->isColumnExists("comments", "status")) |
|
162 | 162 | { |
163 | 163 | $oDB->addColumn("comments", "status", "number", 1, 1, TRUE); |
164 | 164 | } |
165 | - if(!$oDB->isIndexExists("comments", "idx_status")) |
|
165 | + if (!$oDB->isIndexExists("comments", "idx_status")) |
|
166 | 166 | { |
167 | 167 | $oDB->addIndex( |
168 | 168 | "comments", "idx_status", array("status", "comment_srl", "module_srl", "document_srl"), TRUE |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | } |
171 | 171 | |
172 | 172 | // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied |
173 | - if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after')) |
|
173 | + if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after')) |
|
174 | 174 | { |
175 | 175 | $oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'); |
176 | 176 | } |