@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | * @brief notice list |
| 19 | 19 | **/ |
| 20 | 20 | function dispBoardNoticeList(&$oModule) {
|
| 21 | - $oModule->add('notice_list',$this->arrangeContentList(Context::get('notice_list')));
|
|
| 21 | + $oModule->add('notice_list', $this->arrangeContentList(Context::get('notice_list')));
|
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | |
@@ -29,11 +29,11 @@ discard block |
||
| 29 | 29 | $api_type = Context::get('api_type');
|
| 30 | 30 | $document_list = $this->arrangeContentList(Context::get('document_list'));
|
| 31 | 31 | |
| 32 | - if($api_type =='summary') |
|
| 32 | + if ($api_type == 'summary') |
|
| 33 | 33 | {
|
| 34 | 34 | $content_cut_size = Context::get('content_cut_size');
|
| 35 | - $content_cut_size = $content_cut_size?$content_cut_size:50; |
|
| 36 | - foreach($document_list as $k=>$v) |
|
| 35 | + $content_cut_size = $content_cut_size ? $content_cut_size : 50; |
|
| 36 | + foreach ($document_list as $k=>$v) |
|
| 37 | 37 | {
|
| 38 | 38 | $oDocument = new documentItem(); |
| 39 | 39 | $oDocument->setAttribute($v, false); |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - $oModule->add('document_list',$document_list);
|
|
| 46 | - $oModule->add('page_navigation',Context::get('page_navigation'));
|
|
| 45 | + $oModule->add('document_list', $document_list);
|
|
| 46 | + $oModule->add('page_navigation', Context::get('page_navigation'));
|
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | * @brief category list |
| 52 | 52 | **/ |
| 53 | 53 | function dispBoardCategoryList(&$oModule) {
|
| 54 | - $oModule->add('category_list',Context::get('category_list'));
|
|
| 54 | + $oModule->add('category_list', Context::get('category_list'));
|
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
@@ -60,11 +60,11 @@ discard block |
||
| 60 | 60 | function dispBoardContentView(&$oModule) {
|
| 61 | 61 | $oDocument = Context::get('oDocument');
|
| 62 | 62 | $extra_vars = $oDocument->getExtraVars(); |
| 63 | - if($oDocument->isGranted()) |
|
| 63 | + if ($oDocument->isGranted()) |
|
| 64 | 64 | {
|
| 65 | - $oDocument->add('extra_vars',$this->arrangeExtraVars($extra_vars)); |
|
| 65 | + $oDocument->add('extra_vars', $this->arrangeExtraVars($extra_vars)); |
|
| 66 | 66 | } |
| 67 | - $oModule->add('oDocument',$this->arrangeContent($oDocument));
|
|
| 67 | + $oModule->add('oDocument', $this->arrangeContent($oDocument));
|
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | **/ |
| 74 | 74 | function dispBoardContentFileList(&$oModule) {
|
| 75 | 75 | $oDocument = Context::get('oDocument'); |
| 76 | - if($oDocument->isAccessible()) |
|
| 76 | + if ($oDocument->isAccessible()) |
|
| 77 | 77 | { |
| 78 | 78 | $oModule->add('file_list', $this->arrangeFile(Context::get('file_list'))); |
| 79 | 79 | } |
@@ -88,20 +88,20 @@ discard block |
||
| 88 | 88 | * @brief tag list |
| 89 | 89 | **/ |
| 90 | 90 | function dispBoardTagList(&$oModule) {
|
| 91 | - $oModule->add('tag_list',Context::get('tag_list'));
|
|
| 91 | + $oModule->add('tag_list', Context::get('tag_list'));
|
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
| 95 | 95 | * @brief comments list |
| 96 | 96 | **/ |
| 97 | 97 | function dispBoardContentCommentList(&$oModule) {
|
| 98 | - $oModule->add('comment_list',$this->arrangeComment(Context::get('comment_list')));
|
|
| 98 | + $oModule->add('comment_list', $this->arrangeComment(Context::get('comment_list')));
|
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | function arrangeContentList($content_list) {
|
| 102 | 102 | $output = array(); |
| 103 | - if(count($content_list)) {
|
|
| 104 | - foreach($content_list as $key => $val) $output[] = $this->arrangeContent($val); |
|
| 103 | + if (count($content_list)) {
|
|
| 104 | + foreach ($content_list as $key => $val) $output[] = $this->arrangeContent($val); |
|
| 105 | 105 | } |
| 106 | 106 | return $output; |
| 107 | 107 | } |
@@ -110,16 +110,16 @@ discard block |
||
| 110 | 110 | function arrangeContent($content) {
|
| 111 | 111 | $oBoardView = getView('board');
|
| 112 | 112 | $output = new stdClass; |
| 113 | - if($content){
|
|
| 114 | - $output = $content->gets('document_srl','category_srl','member_srl','nick_name','title','content','tags','readed_count','voted_count','blamed_count','comment_count','regdate','last_update','extra_vars','status');
|
|
| 113 | + if ($content) {
|
|
| 114 | + $output = $content->gets('document_srl', 'category_srl', 'member_srl', 'nick_name', 'title', 'content', 'tags', 'readed_count', 'voted_count', 'blamed_count', 'comment_count', 'regdate', 'last_update', 'extra_vars', 'status');
|
|
| 115 | 115 | |
| 116 | - if(!$oBoardView->grant->view) |
|
| 116 | + if (!$oBoardView->grant->view) |
|
| 117 | 117 | {
|
| 118 | 118 | unset($output->content); |
| 119 | 119 | unset($output->tags); |
| 120 | 120 | unset($output->extra_vars); |
| 121 | 121 | } |
| 122 | - if(!$content->isAccessible()) |
|
| 122 | + if (!$content->isAccessible()) |
|
| 123 | 123 | { |
| 124 | 124 | $output->content = Context::getLang('msg_is_secret'); |
| 125 | 125 | } |
@@ -137,11 +137,11 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | function arrangeComment($comment_list) {
|
| 139 | 139 | $output = array(); |
| 140 | - if(count($comment_list) > 0 ) {
|
|
| 141 | - foreach($comment_list as $key => $val){
|
|
| 140 | + if (count($comment_list) > 0) {
|
|
| 141 | + foreach ($comment_list as $key => $val) {
|
|
| 142 | 142 | $item = null; |
| 143 | - $item = $val->gets('comment_srl','parent_srl','depth','nick_name','content','is_secret','voted_count','blamed_count','regdate','last_update');
|
|
| 144 | - if(!$val->isAccessible()) |
|
| 143 | + $item = $val->gets('comment_srl', 'parent_srl', 'depth', 'nick_name', 'content', 'is_secret', 'voted_count', 'blamed_count', 'regdate', 'last_update');
|
|
| 144 | + if (!$val->isAccessible()) |
|
| 145 | 145 | { |
| 146 | 146 | $item->content = Context::getLang('msg_is_secret'); |
| 147 | 147 | } |
@@ -154,8 +154,8 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | function arrangeFile($file_list) {
|
| 156 | 156 | $output = array(); |
| 157 | - if(count($file_list) > 0) {
|
|
| 158 | - foreach($file_list as $key => $val){
|
|
| 157 | + if (count($file_list) > 0) {
|
|
| 158 | + foreach ($file_list as $key => $val) {
|
|
| 159 | 159 | $item = new stdClass; |
| 160 | 160 | $item->download_count = $val->download_count; |
| 161 | 161 | $item->source_filename = $val->source_filename; |
@@ -169,8 +169,8 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | function arrangeExtraVars($list) {
|
| 171 | 171 | $output = array(); |
| 172 | - if(count($list)) {
|
|
| 173 | - foreach($list as $key => $val){
|
|
| 172 | + if (count($list)) {
|
|
| 173 | + foreach ($list as $key => $val) {
|
|
| 174 | 174 | $item = new stdClass; |
| 175 | 175 | $item->name = $val->name; |
| 176 | 176 | $item->type = $val->type; |
@@ -76,8 +76,7 @@ discard block |
||
| 76 | 76 | if($oDocument->isAccessible()) |
| 77 | 77 | { |
| 78 | 78 | $oModule->add('file_list', $this->arrangeFile(Context::get('file_list'))); |
| 79 | - } |
|
| 80 | - else |
|
| 79 | + } else |
|
| 81 | 80 | { |
| 82 | 81 | $oModule->add('file_list', array()); |
| 83 | 82 | } |
@@ -101,7 +100,9 @@ discard block |
||
| 101 | 100 | function arrangeContentList($content_list) {
|
| 102 | 101 | $output = array(); |
| 103 | 102 | if(count($content_list)) {
|
| 104 | - foreach($content_list as $key => $val) $output[] = $this->arrangeContent($val); |
|
| 103 | + foreach($content_list as $key => $val) { |
|
| 104 | + $output[] = $this->arrangeContent($val); |
|
| 105 | + } |
|
| 105 | 106 | } |
| 106 | 107 | return $output; |
| 107 | 108 | } |
@@ -23,15 +23,15 @@ discard block |
||
| 23 | 23 | /** |
| 24 | 24 | * setup the module general information |
| 25 | 25 | **/ |
| 26 | - if($this->module_info->list_count) |
|
| 26 | + if ($this->module_info->list_count) |
|
| 27 | 27 | { |
| 28 | 28 | $this->list_count = $this->module_info->list_count; |
| 29 | 29 | } |
| 30 | - if($this->module_info->search_list_count) |
|
| 30 | + if ($this->module_info->search_list_count) |
|
| 31 | 31 | { |
| 32 | 32 | $this->search_list_count = $this->module_info->search_list_count; |
| 33 | 33 | } |
| 34 | - if($this->module_info->page_count) |
|
| 34 | + if ($this->module_info->page_count) |
|
| 35 | 35 | { |
| 36 | 36 | $this->page_count = $this->module_info->page_count; |
| 37 | 37 | } |
@@ -41,20 +41,20 @@ discard block |
||
| 41 | 41 | $oDocumentModel = getModel('document'); |
| 42 | 42 | |
| 43 | 43 | $statusList = $this->_getStatusNameList($oDocumentModel); |
| 44 | - if(isset($statusList['SECRET'])) |
|
| 44 | + if (isset($statusList['SECRET'])) |
|
| 45 | 45 | { |
| 46 | 46 | $this->module_info->secret = 'Y'; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | // use_category <=1.5.x, hide_category >=1.7.x |
| 50 | 50 | $count_category = count($oDocumentModel->getCategoryList($this->module_info->module_srl)); |
| 51 | - if($count_category) |
|
| 51 | + if ($count_category) |
|
| 52 | 52 | { |
| 53 | - if($this->module_info->hide_category) |
|
| 53 | + if ($this->module_info->hide_category) |
|
| 54 | 54 | { |
| 55 | 55 | $this->module_info->use_category = ($this->module_info->hide_category == 'Y') ? 'N' : 'Y'; |
| 56 | 56 | } |
| 57 | - else if($this->module_info->use_category) |
|
| 57 | + else if ($this->module_info->use_category) |
|
| 58 | 58 | { |
| 59 | 59 | $this->module_info->hide_category = ($this->module_info->use_category == 'Y') ? 'N' : 'Y'; |
| 60 | 60 | } |
@@ -74,10 +74,10 @@ discard block |
||
| 74 | 74 | * check the consultation function, if the user is admin then swich off consultation function |
| 75 | 75 | * if the user is not logged, then disppear write document/write comment./ view document |
| 76 | 76 | **/ |
| 77 | - if($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read) |
|
| 77 | + if ($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read) |
|
| 78 | 78 | { |
| 79 | 79 | $this->consultation = TRUE; |
| 80 | - if(!Context::get('is_logged')) |
|
| 80 | + if (!Context::get('is_logged')) |
|
| 81 | 81 | { |
| 82 | 82 | $this->grant->list = FALSE; |
| 83 | 83 | $this->grant->write_document = FALSE; |
@@ -94,11 +94,11 @@ discard block |
||
| 94 | 94 | * setup the template path based on the skin |
| 95 | 95 | * the default skin is default |
| 96 | 96 | **/ |
| 97 | - $template_path = sprintf("%sskins/%s/",$this->module_path, $this->module_info->skin); |
|
| 98 | - if(!is_dir($template_path)||!$this->module_info->skin) |
|
| 97 | + $template_path = sprintf("%sskins/%s/", $this->module_path, $this->module_info->skin); |
|
| 98 | + if (!is_dir($template_path) || !$this->module_info->skin) |
|
| 99 | 99 | { |
| 100 | 100 | $this->module_info->skin = 'default'; |
| 101 | - $template_path = sprintf("%sskins/%s/",$this->module_path, $this->module_info->skin); |
|
| 101 | + $template_path = sprintf("%sskins/%s/", $this->module_path, $this->module_info->skin); |
|
| 102 | 102 | } |
| 103 | 103 | $this->setTemplatePath($template_path); |
| 104 | 104 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | **/ |
| 115 | 115 | if (is_array($extra_keys)) |
| 116 | 116 | { |
| 117 | - foreach($extra_keys as $val) |
|
| 117 | + foreach ($extra_keys as $val) |
|
| 118 | 118 | { |
| 119 | 119 | $this->order_target[] = $val->eid; |
| 120 | 120 | } |
@@ -127,9 +127,9 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | // remove [document_srl]_cpage from get_vars |
| 129 | 129 | $args = Context::getRequestVars(); |
| 130 | - foreach($args as $name => $value) |
|
| 130 | + foreach ($args as $name => $value) |
|
| 131 | 131 | { |
| 132 | - if(preg_match('/[0-9]+_cpage/', $name)) |
|
| 132 | + if (preg_match('/[0-9]+_cpage/', $name)) |
|
| 133 | 133 | { |
| 134 | 134 | Context::set($name, '', TRUE); |
| 135 | 135 | Context::set($name, $value); |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | /** |
| 146 | 146 | * check the access grant (all the grant has been set by the module object) |
| 147 | 147 | **/ |
| 148 | - if(!$this->grant->access || !$this->grant->list) |
|
| 148 | + if (!$this->grant->access || !$this->grant->list) |
|
| 149 | 149 | { |
| 150 | 150 | return $this->dispBoardMessage('msg_not_permitted'); |
| 151 | 151 | } |
@@ -160,22 +160,22 @@ discard block |
||
| 160 | 160 | * add extra vaiables to the search options |
| 161 | 161 | **/ |
| 162 | 162 | // use search options on the template (the search options key has been declared, based on the language selected) |
| 163 | - foreach($this->search_option as $opt) $search_option[$opt] = Context::getLang($opt); |
|
| 163 | + foreach ($this->search_option as $opt) $search_option[$opt] = Context::getLang($opt); |
|
| 164 | 164 | $extra_keys = Context::get('extra_keys'); |
| 165 | - if($extra_keys) |
|
| 165 | + if ($extra_keys) |
|
| 166 | 166 | { |
| 167 | - foreach($extra_keys as $key => $val) |
|
| 167 | + foreach ($extra_keys as $key => $val) |
|
| 168 | 168 | { |
| 169 | - if($val->search == 'Y') $search_option['extra_vars'.$val->idx] = $val->name; |
|
| 169 | + if ($val->search == 'Y') $search_option['extra_vars'.$val->idx] = $val->name; |
|
| 170 | 170 | } |
| 171 | 171 | } |
| 172 | 172 | // remove a search option that is not public in member config |
| 173 | 173 | $memberConfig = getModel('module')->getModuleConfig('member'); |
| 174 | - foreach($memberConfig->signupForm as $signupFormElement) |
|
| 174 | + foreach ($memberConfig->signupForm as $signupFormElement) |
|
| 175 | 175 | { |
| 176 | - if(in_array($signupFormElement->title, $search_option)) |
|
| 176 | + if (in_array($signupFormElement->title, $search_option)) |
|
| 177 | 177 | { |
| 178 | - if($signupFormElement->isPublic == 'N') |
|
| 178 | + if ($signupFormElement->isPublic == 'N') |
|
| 179 | 179 | unset($search_option[$signupFormElement->name]); |
| 180 | 180 | } |
| 181 | 181 | } |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | |
| 184 | 184 | $oDocumentModel = getModel('document'); |
| 185 | 185 | $statusNameList = $this->_getStatusNameList($oDocumentModel); |
| 186 | - if(count($statusNameList) > 0) |
|
| 186 | + if (count($statusNameList) > 0) |
|
| 187 | 187 | { |
| 188 | 188 | Context::set('status_list', $statusNameList); |
| 189 | 189 | } |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | // list config, columnList setting |
| 195 | 195 | $oBoardModel = getModel('board'); |
| 196 | 196 | $this->listConfig = $oBoardModel->getListConfig($this->module_info->module_srl); |
| 197 | - if(!$this->listConfig) $this->listConfig = array(); |
|
| 197 | + if (!$this->listConfig) $this->listConfig = array(); |
|
| 198 | 198 | $this->_makeListColumnList(); |
| 199 | 199 | |
| 200 | 200 | // display the notice list |
@@ -218,12 +218,12 @@ discard block |
||
| 218 | 218 | /** |
| 219 | 219 | * @brief display the category list |
| 220 | 220 | **/ |
| 221 | - function dispBoardCategoryList(){ |
|
| 221 | + function dispBoardCategoryList() { |
|
| 222 | 222 | // check if the use_category option is enabled |
| 223 | - if($this->module_info->use_category=='Y') |
|
| 223 | + if ($this->module_info->use_category == 'Y') |
|
| 224 | 224 | { |
| 225 | 225 | // check the grant |
| 226 | - if(!$this->grant->list) |
|
| 226 | + if (!$this->grant->list) |
|
| 227 | 227 | { |
| 228 | 228 | Context::set('category_list', array()); |
| 229 | 229 | return; |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | /** |
| 241 | 241 | * @brief display the board conent view |
| 242 | 242 | **/ |
| 243 | - function dispBoardContentView(){ |
|
| 243 | + function dispBoardContentView() { |
|
| 244 | 244 | // get the variable value |
| 245 | 245 | $document_srl = Context::get('document_srl'); |
| 246 | 246 | $page = Context::get('page'); |
@@ -251,36 +251,36 @@ discard block |
||
| 251 | 251 | /** |
| 252 | 252 | * if the document exists, then get the document information |
| 253 | 253 | **/ |
| 254 | - if($document_srl) |
|
| 254 | + if ($document_srl) |
|
| 255 | 255 | { |
| 256 | 256 | $oDocument = $oDocumentModel->getDocument($document_srl, false, true); |
| 257 | 257 | |
| 258 | 258 | // if the document is existed |
| 259 | - if($oDocument->isExists()) |
|
| 259 | + if ($oDocument->isExists()) |
|
| 260 | 260 | { |
| 261 | 261 | // if the module srl is not consistent |
| 262 | - if($oDocument->get('module_srl')!=$this->module_info->module_srl ) |
|
| 262 | + if ($oDocument->get('module_srl') != $this->module_info->module_srl) |
|
| 263 | 263 | { |
| 264 | 264 | return $this->stop('msg_invalid_request'); |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | // check the manage grant |
| 268 | - if($this->grant->manager) $oDocument->setGrant(); |
|
| 268 | + if ($this->grant->manager) $oDocument->setGrant(); |
|
| 269 | 269 | |
| 270 | 270 | // if the consultation function is enabled, and the document is not a notice |
| 271 | - if($this->consultation && !$oDocument->isNotice()) |
|
| 271 | + if ($this->consultation && !$oDocument->isNotice()) |
|
| 272 | 272 | { |
| 273 | 273 | $logged_info = Context::get('logged_info'); |
| 274 | - if($oDocument->get('member_srl')!=$logged_info->member_srl) |
|
| 274 | + if ($oDocument->get('member_srl') != $logged_info->member_srl) |
|
| 275 | 275 | { |
| 276 | 276 | $oDocument = $oDocumentModel->getDocument(0); |
| 277 | 277 | } |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | // if the document is TEMP saved, check Grant |
| 281 | - if($oDocument->getStatus() == 'TEMP') |
|
| 281 | + if ($oDocument->getStatus() == 'TEMP') |
|
| 282 | 282 | { |
| 283 | - if(!$oDocument->isGranted()) |
|
| 283 | + if (!$oDocument->isGranted()) |
|
| 284 | 284 | { |
| 285 | 285 | $oDocument = $oDocumentModel->getDocument(0); |
| 286 | 286 | } |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | else |
| 291 | 291 | { |
| 292 | 292 | // if the document is not existed, then alert a warning message |
| 293 | - Context::set('document_srl','',true); |
|
| 293 | + Context::set('document_srl', '', true); |
|
| 294 | 294 | $this->alertMessage('msg_not_founded'); |
| 295 | 295 | } |
| 296 | 296 | |
@@ -306,12 +306,12 @@ discard block |
||
| 306 | 306 | /** |
| 307 | 307 | *check the document view grant |
| 308 | 308 | **/ |
| 309 | - if($oDocument->isExists()) |
|
| 309 | + if ($oDocument->isExists()) |
|
| 310 | 310 | { |
| 311 | - if(!$this->grant->view && !$oDocument->isGranted()) |
|
| 311 | + if (!$this->grant->view && !$oDocument->isGranted()) |
|
| 312 | 312 | { |
| 313 | 313 | $oDocument = $oDocumentModel->getDocument(0); |
| 314 | - Context::set('document_srl','',true); |
|
| 314 | + Context::set('document_srl', '', true); |
|
| 315 | 315 | $this->alertMessage('msg_not_permitted'); |
| 316 | 316 | } |
| 317 | 317 | else |
@@ -320,15 +320,15 @@ discard block |
||
| 320 | 320 | Context::addBrowserTitle($oDocument->getTitleText()); |
| 321 | 321 | |
| 322 | 322 | // update the document view count (if the document is not secret) |
| 323 | - if(!$oDocument->isSecret() || $oDocument->isGranted()) |
|
| 323 | + if (!$oDocument->isSecret() || $oDocument->isGranted()) |
|
| 324 | 324 | { |
| 325 | 325 | $oDocument->updateReadedCount(); |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | // disappear the document if it is secret |
| 329 | - if($oDocument->isSecret() && !$oDocument->isGranted()) |
|
| 329 | + if ($oDocument->isSecret() && !$oDocument->isGranted()) |
|
| 330 | 330 | { |
| 331 | - $oDocument->add('content',Context::getLang('thisissecret')); |
|
| 331 | + $oDocument->add('content', Context::getLang('thisissecret')); |
|
| 332 | 332 | } |
| 333 | 333 | } |
| 334 | 334 | } |
@@ -348,11 +348,11 @@ discard block |
||
| 348 | 348 | /** |
| 349 | 349 | * @brief display the document file list (can be used by API) |
| 350 | 350 | **/ |
| 351 | - function dispBoardContentFileList(){ |
|
| 351 | + function dispBoardContentFileList() { |
|
| 352 | 352 | /** |
| 353 | 353 | * check the access grant (all the grant has been set by the module object) |
| 354 | 354 | **/ |
| 355 | - if(!$this->grant->access) |
|
| 355 | + if (!$this->grant->access) |
|
| 356 | 356 | { |
| 357 | 357 | return $this->dispBoardMessage('msg_not_permitted'); |
| 358 | 358 | } |
@@ -363,41 +363,41 @@ discard block |
||
| 363 | 363 | // Check if a permission for file download is granted |
| 364 | 364 | // Get configurations (using module model object) |
| 365 | 365 | $oModuleModel = getModel('module'); |
| 366 | - $file_module_config = $oModuleModel->getModulePartConfig('file',$this->module_srl); |
|
| 366 | + $file_module_config = $oModuleModel->getModulePartConfig('file', $this->module_srl); |
|
| 367 | 367 | |
| 368 | 368 | $downloadGrantCount = 0; |
| 369 | - if(is_array($file_module_config->download_grant)) |
|
| 369 | + if (is_array($file_module_config->download_grant)) |
|
| 370 | 370 | { |
| 371 | - foreach($file_module_config->download_grant AS $value) |
|
| 372 | - if($value) $downloadGrantCount++; |
|
| 371 | + foreach ($file_module_config->download_grant AS $value) |
|
| 372 | + if ($value) $downloadGrantCount++; |
|
| 373 | 373 | } |
| 374 | 374 | |
| 375 | - if(is_array($file_module_config->download_grant) && $downloadGrantCount>0) |
|
| 375 | + if (is_array($file_module_config->download_grant) && $downloadGrantCount > 0) |
|
| 376 | 376 | { |
| 377 | - if(!Context::get('is_logged')) return $this->stop('msg_not_permitted_download'); |
|
| 377 | + if (!Context::get('is_logged')) return $this->stop('msg_not_permitted_download'); |
|
| 378 | 378 | $logged_info = Context::get('logged_info'); |
| 379 | - if($logged_info->is_admin != 'Y') |
|
| 379 | + if ($logged_info->is_admin != 'Y') |
|
| 380 | 380 | { |
| 381 | - $oModuleModel =& getModel('module'); |
|
| 381 | + $oModuleModel = & getModel('module'); |
|
| 382 | 382 | $columnList = array('module_srl', 'site_srl'); |
| 383 | 383 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($this->module_srl, $columnList); |
| 384 | 384 | |
| 385 | - if(!$oModuleModel->isSiteAdmin($logged_info, $module_info->site_srl)) |
|
| 385 | + if (!$oModuleModel->isSiteAdmin($logged_info, $module_info->site_srl)) |
|
| 386 | 386 | { |
| 387 | - $oMemberModel =& getModel('member'); |
|
| 387 | + $oMemberModel = & getModel('member'); |
|
| 388 | 388 | $member_groups = $oMemberModel->getMemberGroups($logged_info->member_srl, $module_info->site_srl); |
| 389 | 389 | |
| 390 | 390 | $is_permitted = false; |
| 391 | - for($i=0;$i<count($file_module_config->download_grant);$i++) |
|
| 391 | + for ($i = 0; $i < count($file_module_config->download_grant); $i++) |
|
| 392 | 392 | { |
| 393 | 393 | $group_srl = $file_module_config->download_grant[$i]; |
| 394 | - if($member_groups[$group_srl]) |
|
| 394 | + if ($member_groups[$group_srl]) |
|
| 395 | 395 | { |
| 396 | 396 | $is_permitted = true; |
| 397 | 397 | break; |
| 398 | 398 | } |
| 399 | 399 | } |
| 400 | - if(!$is_permitted) return $this->stop('msg_not_permitted_download'); |
|
| 400 | + if (!$is_permitted) return $this->stop('msg_not_permitted_download'); |
|
| 401 | 401 | } |
| 402 | 402 | } |
| 403 | 403 | } |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | $document_srl = Context::get('document_srl'); |
| 407 | 407 | $oDocument = $oDocumentModel->getDocument($document_srl); |
| 408 | 408 | Context::set('oDocument', $oDocument); |
| 409 | - Context::set('file_list',$oDocument->getUploadedFiles()); |
|
| 409 | + Context::set('file_list', $oDocument->getUploadedFiles()); |
|
| 410 | 410 | |
| 411 | 411 | $oSecurity = new Security(); |
| 412 | 412 | $oSecurity->encodeHTML('file_list..source_filename'); |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | /** |
| 416 | 416 | * @brief display the document comment list (can be used by API) |
| 417 | 417 | **/ |
| 418 | - function dispBoardContentCommentList(){ |
|
| 418 | + function dispBoardContentCommentList() { |
|
| 419 | 419 | // check document view grant |
| 420 | 420 | $this->dispBoardContentView(); |
| 421 | 421 | |
@@ -425,26 +425,26 @@ discard block |
||
| 425 | 425 | $comment_list = $oDocument->getComments(); |
| 426 | 426 | |
| 427 | 427 | // setup the comment list |
| 428 | - if(is_array($comment_list)) |
|
| 428 | + if (is_array($comment_list)) |
|
| 429 | 429 | { |
| 430 | - foreach($comment_list as $key => $val) |
|
| 430 | + foreach ($comment_list as $key => $val) |
|
| 431 | 431 | { |
| 432 | - if(!$val->isAccessible()) |
|
| 432 | + if (!$val->isAccessible()) |
|
| 433 | 433 | { |
| 434 | - $val->add('content',Context::getLang('thisissecret')); |
|
| 434 | + $val->add('content', Context::getLang('thisissecret')); |
|
| 435 | 435 | } |
| 436 | 436 | } |
| 437 | 437 | } |
| 438 | - Context::set('comment_list',$comment_list); |
|
| 438 | + Context::set('comment_list', $comment_list); |
|
| 439 | 439 | |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | /** |
| 443 | 443 | * @brief display notice list (can be used by API) |
| 444 | 444 | **/ |
| 445 | - function dispBoardNoticeList(){ |
|
| 445 | + function dispBoardNoticeList() { |
|
| 446 | 446 | // check the grant |
| 447 | - if(!$this->grant->list) |
|
| 447 | + if (!$this->grant->list) |
|
| 448 | 448 | { |
| 449 | 449 | Context::set('notice_list', array()); |
| 450 | 450 | return; |
@@ -460,15 +460,15 @@ discard block |
||
| 460 | 460 | /** |
| 461 | 461 | * @brief display board content list |
| 462 | 462 | **/ |
| 463 | - function dispBoardContentList(){ |
|
| 463 | + function dispBoardContentList() { |
|
| 464 | 464 | // check the grant |
| 465 | - if(!$this->grant->list) |
|
| 465 | + if (!$this->grant->list) |
|
| 466 | 466 | { |
| 467 | 467 | Context::set('document_list', array()); |
| 468 | 468 | Context::set('total_count', 0); |
| 469 | 469 | Context::set('total_page', 1); |
| 470 | 470 | Context::set('page', 1); |
| 471 | - Context::set('page_navigation', new PageHandler(0,0,1,10)); |
|
| 471 | + Context::set('page_navigation', new PageHandler(0, 0, 1, 10)); |
|
| 472 | 472 | return; |
| 473 | 473 | } |
| 474 | 474 | |
@@ -486,17 +486,17 @@ discard block |
||
| 486 | 486 | $args->search_keyword = Context::get('search_keyword'); |
| 487 | 487 | |
| 488 | 488 | $search_option = Context::get('search_option'); |
| 489 | - if($search_option==FALSE) |
|
| 489 | + if ($search_option == FALSE) |
|
| 490 | 490 | { |
| 491 | 491 | $search_option = $this->search_option; |
| 492 | 492 | } |
| 493 | - if(isset($search_option[$args->search_target])==FALSE) |
|
| 493 | + if (isset($search_option[$args->search_target]) == FALSE) |
|
| 494 | 494 | { |
| 495 | 495 | $args->search_target = ''; |
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 | // if the category is enabled, then get the category |
| 499 | - if($this->module_info->use_category=='Y') |
|
| 499 | + if ($this->module_info->use_category == 'Y') |
|
| 500 | 500 | { |
| 501 | 501 | $args->category_srl = Context::get('category'); |
| 502 | 502 | } |
@@ -504,21 +504,21 @@ discard block |
||
| 504 | 504 | // setup the sort index and order index |
| 505 | 505 | $args->sort_index = Context::get('sort_index'); |
| 506 | 506 | $args->order_type = Context::get('order_type'); |
| 507 | - if(!in_array($args->sort_index, $this->order_target)) |
|
| 507 | + if (!in_array($args->sort_index, $this->order_target)) |
|
| 508 | 508 | { |
| 509 | - $args->sort_index = $this->module_info->order_target?$this->module_info->order_target:'list_order'; |
|
| 509 | + $args->sort_index = $this->module_info->order_target ? $this->module_info->order_target : 'list_order'; |
|
| 510 | 510 | } |
| 511 | - if(!in_array($args->order_type, array('asc','desc'))) |
|
| 511 | + if (!in_array($args->order_type, array('asc', 'desc'))) |
|
| 512 | 512 | { |
| 513 | - $args->order_type = $this->module_info->order_type?$this->module_info->order_type:'asc'; |
|
| 513 | + $args->order_type = $this->module_info->order_type ? $this->module_info->order_type : 'asc'; |
|
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | // set the current page of documents |
| 517 | 517 | $document_srl = Context::get('document_srl'); |
| 518 | - if(!$args->page && $document_srl) |
|
| 518 | + if (!$args->page && $document_srl) |
|
| 519 | 519 | { |
| 520 | 520 | $oDocument = $oDocumentModel->getDocument($document_srl); |
| 521 | - if($oDocument->isExists() && !$oDocument->isNotice()) |
|
| 521 | + if ($oDocument->isExists() && !$oDocument->isNotice()) |
|
| 522 | 522 | { |
| 523 | 523 | $page = $oDocumentModel->getDocumentPage($oDocument, $args); |
| 524 | 524 | Context::set('page', $page); |
@@ -527,13 +527,13 @@ discard block |
||
| 527 | 527 | } |
| 528 | 528 | |
| 529 | 529 | // setup the list count to be serach list count, if the category or search keyword has been set |
| 530 | - if($args->category_srl || $args->search_keyword) |
|
| 530 | + if ($args->category_srl || $args->search_keyword) |
|
| 531 | 531 | { |
| 532 | 532 | $args->list_count = $this->search_list_count; |
| 533 | 533 | } |
| 534 | 534 | |
| 535 | 535 | // if the consultation function is enabled, the get the logged user information |
| 536 | - if($this->consultation) |
|
| 536 | + if ($this->consultation) |
|
| 537 | 537 | { |
| 538 | 538 | $logged_info = Context::get('logged_info'); |
| 539 | 539 | $args->member_srl = $logged_info->member_srl; |
@@ -561,18 +561,18 @@ discard block |
||
| 561 | 561 | 'allow_trackback', 'notify_message', 'status', 'comment_status'); |
| 562 | 562 | $this->columnList = array_intersect($configColumList, $tableColumnList); |
| 563 | 563 | |
| 564 | - if(in_array('summary', $configColumList)) array_push($this->columnList, 'content'); |
|
| 564 | + if (in_array('summary', $configColumList)) array_push($this->columnList, 'content'); |
|
| 565 | 565 | |
| 566 | 566 | // default column list add |
| 567 | 567 | $defaultColumn = array('document_srl', 'module_srl', 'category_srl', 'lang_code', 'member_srl', 'last_update', 'comment_count', 'trackback_count', 'uploaded_count', 'status', 'regdate', 'title_bold', 'title_color'); |
| 568 | 568 | |
| 569 | 569 | //TODO guestbook, blog style supports legacy codes. |
| 570 | - if($this->module_info->skin == 'xe_guestbook' || $this->module_info->default_style == 'blog') |
|
| 570 | + if ($this->module_info->skin == 'xe_guestbook' || $this->module_info->default_style == 'blog') |
|
| 571 | 571 | { |
| 572 | 572 | $defaultColumn = $tableColumnList; |
| 573 | 573 | } |
| 574 | 574 | |
| 575 | - if (in_array('last_post', $configColumList)){ |
|
| 575 | + if (in_array('last_post', $configColumList)) { |
|
| 576 | 576 | array_push($this->columnList, 'last_updater'); |
| 577 | 577 | } |
| 578 | 578 | |
@@ -584,9 +584,9 @@ discard block |
||
| 584 | 584 | $this->columnList = array_unique(array_merge($this->columnList, $defaultColumn)); |
| 585 | 585 | |
| 586 | 586 | // add table name |
| 587 | - foreach($this->columnList as $no => $value) |
|
| 587 | + foreach ($this->columnList as $no => $value) |
|
| 588 | 588 | { |
| 589 | - $this->columnList[$no] = 'documents.' . $value; |
|
| 589 | + $this->columnList[$no] = 'documents.'.$value; |
|
| 590 | 590 | } |
| 591 | 591 | } |
| 592 | 592 | |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | function dispBoardTagList() |
| 597 | 597 | { |
| 598 | 598 | // check if there is not grant fot view list, then alert an warning message |
| 599 | - if(!$this->grant->list) |
|
| 599 | + if (!$this->grant->list) |
|
| 600 | 600 | { |
| 601 | 601 | return $this->dispBoardMessage('msg_not_permitted'); |
| 602 | 602 | } |
@@ -610,14 +610,14 @@ discard block |
||
| 610 | 610 | $output = $oTagModel->getTagList($obj); |
| 611 | 611 | |
| 612 | 612 | // automatically order |
| 613 | - if(count($output->data)) |
|
| 613 | + if (count($output->data)) |
|
| 614 | 614 | { |
| 615 | 615 | $numbers = array_keys($output->data); |
| 616 | 616 | shuffle($numbers); |
| 617 | 617 | |
| 618 | - if(count($output->data)) |
|
| 618 | + if (count($output->data)) |
|
| 619 | 619 | { |
| 620 | - foreach($numbers as $k => $v) |
|
| 620 | + foreach ($numbers as $k => $v) |
|
| 621 | 621 | { |
| 622 | 622 | $tag_list[] = $output->data[$v]; |
| 623 | 623 | } |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | function dispBoardWrite() |
| 639 | 639 | { |
| 640 | 640 | // check grant |
| 641 | - if(!$this->grant->write_document) |
|
| 641 | + if (!$this->grant->write_document) |
|
| 642 | 642 | { |
| 643 | 643 | return $this->dispBoardMessage('msg_not_permitted'); |
| 644 | 644 | } |
@@ -648,10 +648,10 @@ discard block |
||
| 648 | 648 | /** |
| 649 | 649 | * check if the category option is enabled not not |
| 650 | 650 | **/ |
| 651 | - if($this->module_info->use_category=='Y') |
|
| 651 | + if ($this->module_info->use_category == 'Y') |
|
| 652 | 652 | { |
| 653 | 653 | // get the user group information |
| 654 | - if(Context::get('is_logged')) |
|
| 654 | + if (Context::get('is_logged')) |
|
| 655 | 655 | { |
| 656 | 656 | $logged_info = Context::get('logged_info'); |
| 657 | 657 | $group_srls = array_keys($logged_info->group_list); |
@@ -664,19 +664,19 @@ discard block |
||
| 664 | 664 | |
| 665 | 665 | // check the grant after obtained the category list |
| 666 | 666 | $normal_category_list = $oDocumentModel->getCategoryList($this->module_srl); |
| 667 | - if(count($normal_category_list)) |
|
| 667 | + if (count($normal_category_list)) |
|
| 668 | 668 | { |
| 669 | - foreach($normal_category_list as $category_srl => $category) |
|
| 669 | + foreach ($normal_category_list as $category_srl => $category) |
|
| 670 | 670 | { |
| 671 | 671 | $is_granted = TRUE; |
| 672 | - if($category->group_srls) |
|
| 672 | + if ($category->group_srls) |
|
| 673 | 673 | { |
| 674 | - $category_group_srls = explode(',',$category->group_srls); |
|
| 674 | + $category_group_srls = explode(',', $category->group_srls); |
|
| 675 | 675 | $is_granted = FALSE; |
| 676 | - if(count(array_intersect($group_srls, $category_group_srls))) $is_granted = TRUE; |
|
| 676 | + if (count(array_intersect($group_srls, $category_group_srls))) $is_granted = TRUE; |
|
| 677 | 677 | |
| 678 | 678 | } |
| 679 | - if($is_granted) $category_list[$category_srl] = $category; |
|
| 679 | + if ($is_granted) $category_list[$category_srl] = $category; |
|
| 680 | 680 | } |
| 681 | 681 | } |
| 682 | 682 | Context::set('category_list', $category_list); |
@@ -687,46 +687,46 @@ discard block |
||
| 687 | 687 | $oDocument = $oDocumentModel->getDocument(0, $this->grant->manager); |
| 688 | 688 | $oDocument->setDocument($document_srl); |
| 689 | 689 | |
| 690 | - if($oDocument->get('module_srl') == $oDocument->get('member_srl')) $savedDoc = TRUE; |
|
| 690 | + if ($oDocument->get('module_srl') == $oDocument->get('member_srl')) $savedDoc = TRUE; |
|
| 691 | 691 | $oDocument->add('module_srl', $this->module_srl); |
| 692 | 692 | |
| 693 | - if($oDocument->isExists() && $this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false) |
|
| 693 | + if ($oDocument->isExists() && $this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false) |
|
| 694 | 694 | { |
| 695 | 695 | return new Object(-1, 'msg_protect_content'); |
| 696 | 696 | } |
| 697 | 697 | |
| 698 | 698 | // if the document is not granted, then back to the password input form |
| 699 | 699 | $oModuleModel = getModel('module'); |
| 700 | - if($oDocument->isExists()&&!$oDocument->isGranted()) |
|
| 700 | + if ($oDocument->isExists() && !$oDocument->isGranted()) |
|
| 701 | 701 | { |
| 702 | 702 | return $this->setTemplateFile('input_password_form'); |
| 703 | 703 | } |
| 704 | 704 | |
| 705 | - if(!$oDocument->isExists()) |
|
| 705 | + if (!$oDocument->isExists()) |
|
| 706 | 706 | { |
| 707 | - $point_config = $oModuleModel->getModulePartConfig('point',$this->module_srl); |
|
| 707 | + $point_config = $oModuleModel->getModulePartConfig('point', $this->module_srl); |
|
| 708 | 708 | $logged_info = Context::get('logged_info'); |
| 709 | 709 | $oPointModel = getModel('point'); |
| 710 | 710 | $pointForInsert = $point_config["insert_document"]; |
| 711 | - if($pointForInsert < 0) |
|
| 711 | + if ($pointForInsert < 0) |
|
| 712 | 712 | { |
| 713 | - if( !$logged_info ) |
|
| 713 | + if (!$logged_info) |
|
| 714 | 714 | { |
| 715 | 715 | return $this->dispBoardMessage('msg_not_permitted'); |
| 716 | 716 | } |
| 717 | - else if (($oPointModel->getPoint($logged_info->member_srl) + $pointForInsert )< 0 ) |
|
| 717 | + else if (($oPointModel->getPoint($logged_info->member_srl) + $pointForInsert) < 0) |
|
| 718 | 718 | { |
| 719 | 719 | return $this->dispBoardMessage('msg_not_enough_point'); |
| 720 | 720 | } |
| 721 | 721 | } |
| 722 | 722 | } |
| 723 | - if(!$oDocument->get('status')) $oDocument->add('status', $oDocumentModel->getDefaultStatus()); |
|
| 723 | + if (!$oDocument->get('status')) $oDocument->add('status', $oDocumentModel->getDefaultStatus()); |
|
| 724 | 724 | |
| 725 | 725 | $statusList = $this->_getStatusNameList($oDocumentModel); |
| 726 | - if(count($statusList) > 0) Context::set('status_list', $statusList); |
|
| 726 | + if (count($statusList) > 0) Context::set('status_list', $statusList); |
|
| 727 | 727 | |
| 728 | 728 | // get Document status config value |
| 729 | - Context::set('document_srl',$document_srl); |
|
| 729 | + Context::set('document_srl', $document_srl); |
|
| 730 | 730 | Context::set('oDocument', $oDocument); |
| 731 | 731 | |
| 732 | 732 | // apply xml_js_filter on header |
@@ -734,12 +734,12 @@ discard block |
||
| 734 | 734 | $oDocumentController->addXmlJsFilter($this->module_info->module_srl); |
| 735 | 735 | |
| 736 | 736 | // if the document exists, then setup extra variabels on context |
| 737 | - if($oDocument->isExists() && !$savedDoc) Context::set('extra_keys', $oDocument->getExtraVars()); |
|
| 737 | + if ($oDocument->isExists() && !$savedDoc) Context::set('extra_keys', $oDocument->getExtraVars()); |
|
| 738 | 738 | |
| 739 | 739 | /** |
| 740 | 740 | * add JS filters |
| 741 | 741 | **/ |
| 742 | - if(Context::get('logged_info')->is_admin=='Y') Context::addJsFilter($this->module_path.'tpl/filter', 'insert_admin.xml'); |
|
| 742 | + if (Context::get('logged_info')->is_admin == 'Y') Context::addJsFilter($this->module_path.'tpl/filter', 'insert_admin.xml'); |
|
| 743 | 743 | else Context::addJsFilter($this->module_path.'tpl/filter', 'insert.xml'); |
| 744 | 744 | |
| 745 | 745 | $oSecurity = new Security(); |
@@ -751,14 +751,14 @@ discard block |
||
| 751 | 751 | function _getStatusNameList(&$oDocumentModel) |
| 752 | 752 | { |
| 753 | 753 | $resultList = array(); |
| 754 | - if(!empty($this->module_info->use_status)) |
|
| 754 | + if (!empty($this->module_info->use_status)) |
|
| 755 | 755 | { |
| 756 | 756 | $statusNameList = $oDocumentModel->getStatusNameList(); |
| 757 | 757 | $statusList = explode('|@|', $this->module_info->use_status); |
| 758 | 758 | |
| 759 | - if(is_array($statusList)) |
|
| 759 | + if (is_array($statusList)) |
|
| 760 | 760 | { |
| 761 | - foreach($statusList as $key => $value) |
|
| 761 | + foreach ($statusList as $key => $value) |
|
| 762 | 762 | { |
| 763 | 763 | $resultList[$value] = $statusNameList[$value]; |
| 764 | 764 | } |
@@ -773,7 +773,7 @@ discard block |
||
| 773 | 773 | function dispBoardDelete() |
| 774 | 774 | { |
| 775 | 775 | // check grant |
| 776 | - if(!$this->grant->write_document) |
|
| 776 | + if (!$this->grant->write_document) |
|
| 777 | 777 | { |
| 778 | 778 | return $this->dispBoardMessage('msg_not_permitted'); |
| 779 | 779 | } |
@@ -782,30 +782,30 @@ discard block |
||
| 782 | 782 | $document_srl = Context::get('document_srl'); |
| 783 | 783 | |
| 784 | 784 | // if document exists, get the document information |
| 785 | - if($document_srl) |
|
| 785 | + if ($document_srl) |
|
| 786 | 786 | { |
| 787 | 787 | $oDocumentModel = getModel('document'); |
| 788 | 788 | $oDocument = $oDocumentModel->getDocument($document_srl); |
| 789 | 789 | } |
| 790 | 790 | |
| 791 | 791 | // if the document is not existed, then back to the board content page |
| 792 | - if(!$oDocument || !$oDocument->isExists()) |
|
| 792 | + if (!$oDocument || !$oDocument->isExists()) |
|
| 793 | 793 | { |
| 794 | 794 | return $this->dispBoardContent(); |
| 795 | 795 | } |
| 796 | 796 | |
| 797 | 797 | // if the document is not granted, then back to the password input form |
| 798 | - if(!$oDocument->isGranted()) |
|
| 798 | + if (!$oDocument->isGranted()) |
|
| 799 | 799 | { |
| 800 | 800 | return $this->setTemplateFile('input_password_form'); |
| 801 | 801 | } |
| 802 | 802 | |
| 803 | - if($this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false) |
|
| 803 | + if ($this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false) |
|
| 804 | 804 | { |
| 805 | 805 | return $this->dispBoardMessage('msg_protect_content'); |
| 806 | 806 | } |
| 807 | 807 | |
| 808 | - Context::set('oDocument',$oDocument); |
|
| 808 | + Context::set('oDocument', $oDocument); |
|
| 809 | 809 | |
| 810 | 810 | /** |
| 811 | 811 | * add JS filters |
@@ -823,7 +823,7 @@ discard block |
||
| 823 | 823 | $document_srl = Context::get('document_srl'); |
| 824 | 824 | |
| 825 | 825 | // check grant |
| 826 | - if(!$this->grant->write_comment) |
|
| 826 | + if (!$this->grant->write_comment) |
|
| 827 | 827 | { |
| 828 | 828 | return $this->dispBoardMessage('msg_not_permitted'); |
| 829 | 829 | } |
@@ -831,13 +831,13 @@ discard block |
||
| 831 | 831 | // get the document information |
| 832 | 832 | $oDocumentModel = getModel('document'); |
| 833 | 833 | $oDocument = $oDocumentModel->getDocument($document_srl); |
| 834 | - if(!$oDocument->isExists()) |
|
| 834 | + if (!$oDocument->isExists()) |
|
| 835 | 835 | { |
| 836 | 836 | return $this->dispBoardMessage('msg_invalid_request'); |
| 837 | 837 | } |
| 838 | 838 | |
| 839 | 839 | // Check allow comment |
| 840 | - if(!$oDocument->allowComment()) |
|
| 840 | + if (!$oDocument->allowComment()) |
|
| 841 | 841 | { |
| 842 | 842 | return $this->dispBoardMessage('msg_not_allow_comment'); |
| 843 | 843 | } |
@@ -849,9 +849,9 @@ discard block |
||
| 849 | 849 | $oComment->add('module_srl', $this->module_srl); |
| 850 | 850 | |
| 851 | 851 | // setup document variables on context |
| 852 | - Context::set('oDocument',$oDocument); |
|
| 853 | - Context::set('oSourceComment',$oSourceComment); |
|
| 854 | - Context::set('oComment',$oComment); |
|
| 852 | + Context::set('oDocument', $oDocument); |
|
| 853 | + Context::set('oSourceComment', $oSourceComment); |
|
| 854 | + Context::set('oComment', $oComment); |
|
| 855 | 855 | |
| 856 | 856 | /** |
| 857 | 857 | * add JS filter |
@@ -867,7 +867,7 @@ discard block |
||
| 867 | 867 | function dispBoardReplyComment() |
| 868 | 868 | { |
| 869 | 869 | // check grant |
| 870 | - if(!$this->grant->write_comment) |
|
| 870 | + if (!$this->grant->write_comment) |
|
| 871 | 871 | { |
| 872 | 872 | return $this->dispBoardMessage('msg_not_permitted'); |
| 873 | 873 | } |
@@ -876,7 +876,7 @@ discard block |
||
| 876 | 876 | $parent_srl = Context::get('comment_srl'); |
| 877 | 877 | |
| 878 | 878 | // if the parent comment is not existed |
| 879 | - if(!$parent_srl) |
|
| 879 | + if (!$parent_srl) |
|
| 880 | 880 | { |
| 881 | 881 | return new Object(-1, 'msg_invalid_request'); |
| 882 | 882 | } |
@@ -886,11 +886,11 @@ discard block |
||
| 886 | 886 | $oSourceComment = $oCommentModel->getComment($parent_srl, $this->grant->manager); |
| 887 | 887 | |
| 888 | 888 | // if the comment is not existed, opoup an error message |
| 889 | - if(!$oSourceComment->isExists()) |
|
| 889 | + if (!$oSourceComment->isExists()) |
|
| 890 | 890 | { |
| 891 | 891 | return $this->dispBoardMessage('msg_invalid_request'); |
| 892 | 892 | } |
| 893 | - if(Context::get('document_srl') && $oSourceComment->get('document_srl') != Context::get('document_srl')) |
|
| 893 | + if (Context::get('document_srl') && $oSourceComment->get('document_srl') != Context::get('document_srl')) |
|
| 894 | 894 | { |
| 895 | 895 | return $this->dispBoardMessage('msg_invalid_request'); |
| 896 | 896 | } |
@@ -898,7 +898,7 @@ discard block |
||
| 898 | 898 | // Check allow comment |
| 899 | 899 | $oDocumentModel = getModel('document'); |
| 900 | 900 | $oDocument = $oDocumentModel->getDocument($oSourceComment->get('document_srl')); |
| 901 | - if(!$oDocument->allowComment()) |
|
| 901 | + if (!$oDocument->allowComment()) |
|
| 902 | 902 | { |
| 903 | 903 | return $this->dispBoardMessage('msg_not_allow_comment'); |
| 904 | 904 | } |
@@ -909,9 +909,9 @@ discard block |
||
| 909 | 909 | $oComment->add('document_srl', $oSourceComment->get('document_srl')); |
| 910 | 910 | |
| 911 | 911 | // setup comment variables |
| 912 | - Context::set('oSourceComment',$oSourceComment); |
|
| 913 | - Context::set('oComment',$oComment); |
|
| 914 | - Context::set('module_srl',$this->module_info->module_srl); |
|
| 912 | + Context::set('oSourceComment', $oSourceComment); |
|
| 913 | + Context::set('oComment', $oComment); |
|
| 914 | + Context::set('module_srl', $this->module_info->module_srl); |
|
| 915 | 915 | |
| 916 | 916 | /** |
| 917 | 917 | * add JS filters |
@@ -927,7 +927,7 @@ discard block |
||
| 927 | 927 | function dispBoardModifyComment() |
| 928 | 928 | { |
| 929 | 929 | // check grant |
| 930 | - if(!$this->grant->write_comment) |
|
| 930 | + if (!$this->grant->write_comment) |
|
| 931 | 931 | { |
| 932 | 932 | return $this->dispBoardMessage('msg_not_permitted'); |
| 933 | 933 | } |
@@ -937,7 +937,7 @@ discard block |
||
| 937 | 937 | $comment_srl = Context::get('comment_srl'); |
| 938 | 938 | |
| 939 | 939 | // if the comment is not existed |
| 940 | - if(!$comment_srl) |
|
| 940 | + if (!$comment_srl) |
|
| 941 | 941 | { |
| 942 | 942 | return new Object(-1, 'msg_invalid_request'); |
| 943 | 943 | } |
@@ -947,13 +947,13 @@ discard block |
||
| 947 | 947 | $oComment = $oCommentModel->getComment($comment_srl, $this->grant->manager); |
| 948 | 948 | |
| 949 | 949 | // if the comment is not exited, alert an error message |
| 950 | - if(!$oComment->isExists()) |
|
| 950 | + if (!$oComment->isExists()) |
|
| 951 | 951 | { |
| 952 | 952 | return $this->dispBoardMessage('msg_invalid_request'); |
| 953 | 953 | } |
| 954 | 954 | |
| 955 | 955 | // if the comment is not granted, then back to the password input form |
| 956 | - if(!$oComment->isGranted()) |
|
| 956 | + if (!$oComment->isGranted()) |
|
| 957 | 957 | { |
| 958 | 958 | return $this->setTemplateFile('input_password_form'); |
| 959 | 959 | } |
@@ -976,7 +976,7 @@ discard block |
||
| 976 | 976 | function dispBoardDeleteComment() |
| 977 | 977 | { |
| 978 | 978 | // check grant |
| 979 | - if(!$this->grant->write_comment) |
|
| 979 | + if (!$this->grant->write_comment) |
|
| 980 | 980 | { |
| 981 | 981 | return $this->dispBoardMessage('msg_not_permitted'); |
| 982 | 982 | } |
@@ -985,25 +985,25 @@ discard block |
||
| 985 | 985 | $comment_srl = Context::get('comment_srl'); |
| 986 | 986 | |
| 987 | 987 | // if the comment exists, then get the comment information |
| 988 | - if($comment_srl) |
|
| 988 | + if ($comment_srl) |
|
| 989 | 989 | { |
| 990 | 990 | $oCommentModel = getModel('comment'); |
| 991 | 991 | $oComment = $oCommentModel->getComment($comment_srl, $this->grant->manager); |
| 992 | 992 | } |
| 993 | 993 | |
| 994 | 994 | // if the comment is not existed, then back to the board content page |
| 995 | - if(!$oComment->isExists() ) |
|
| 995 | + if (!$oComment->isExists()) |
|
| 996 | 996 | { |
| 997 | 997 | return $this->dispBoardContent(); |
| 998 | 998 | } |
| 999 | 999 | |
| 1000 | 1000 | // if the comment is not granted, then back to the password input form |
| 1001 | - if(!$oComment->isGranted()) |
|
| 1001 | + if (!$oComment->isGranted()) |
|
| 1002 | 1002 | { |
| 1003 | 1003 | return $this->setTemplateFile('input_password_form'); |
| 1004 | 1004 | } |
| 1005 | 1005 | |
| 1006 | - Context::set('oComment',$oComment); |
|
| 1006 | + Context::set('oComment', $oComment); |
|
| 1007 | 1007 | |
| 1008 | 1008 | /** |
| 1009 | 1009 | * add JS filters |
@@ -1020,7 +1020,7 @@ discard block |
||
| 1020 | 1020 | { |
| 1021 | 1021 | $oTrackbackModel = getModel('trackback'); |
| 1022 | 1022 | |
| 1023 | - if(!$oTrackbackModel) |
|
| 1023 | + if (!$oTrackbackModel) |
|
| 1024 | 1024 | { |
| 1025 | 1025 | return; |
| 1026 | 1026 | } |
@@ -1034,7 +1034,7 @@ discard block |
||
| 1034 | 1034 | $trackback = $output->data; |
| 1035 | 1035 | |
| 1036 | 1036 | // if no trackback, then display the board content |
| 1037 | - if(!$trackback) |
|
| 1037 | + if (!$trackback) |
|
| 1038 | 1038 | { |
| 1039 | 1039 | return $this->dispBoardContent(); |
| 1040 | 1040 | } |
@@ -1055,7 +1055,7 @@ discard block |
||
| 1055 | 1055 | function dispBoardMessage($msg_code) |
| 1056 | 1056 | { |
| 1057 | 1057 | $msg = Context::getLang($msg_code); |
| 1058 | - if(!$msg) $msg = $msg_code; |
|
| 1058 | + if (!$msg) $msg = $msg_code; |
|
| 1059 | 1059 | Context::set('message', $msg); |
| 1060 | 1060 | $this->setTemplateFile('message'); |
| 1061 | 1061 | } |
@@ -1066,8 +1066,8 @@ discard block |
||
| 1066 | 1066 | **/ |
| 1067 | 1067 | function alertMessage($message) |
| 1068 | 1068 | { |
| 1069 | - $script = sprintf('<script> jQuery(function(){ alert("%s"); } );</script>', Context::getLang($message)); |
|
| 1070 | - Context::addHtmlFooter( $script ); |
|
| 1069 | + $script = sprintf('<script> jQuery(function(){ alert("%s"); } );</script>', Context::getLang($message)); |
|
| 1070 | + Context::addHtmlFooter($script); |
|
| 1071 | 1071 | } |
| 1072 | 1072 | |
| 1073 | 1073 | } |