@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | $type = Context::get('type') == 'P' ? 'P' : 'M'; |
| 28 | 28 | Context::set('type', $type); |
| 29 | 29 | |
| 30 | - if($type == 'P') |
|
| 30 | + if ($type == 'P') |
|
| 31 | 31 | { |
| 32 | 32 | $dir = 'skins'; |
| 33 | 33 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $dir = 'm.skins'; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - if(!$skin) |
|
| 39 | + if (!$skin) |
|
| 40 | 40 | { |
| 41 | 41 | $tpl = ""; |
| 42 | 42 | } |
@@ -48,8 +48,8 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | $oModuleModel = getModel('module'); |
| 50 | 50 | $communication_config = $oModuleModel->getModuleConfig('communication'); |
| 51 | - if(!is_object($communication_config)) $communication_config = new stdClass; |
|
| 52 | - if(!$communication_config->colorset) |
|
| 51 | + if (!is_object($communication_config)) $communication_config = new stdClass; |
|
| 52 | + if (!$communication_config->colorset) |
|
| 53 | 53 | { |
| 54 | 54 | $communication_config->colorset = "white"; |
| 55 | 55 | } |
@@ -30,8 +30,7 @@ discard block |
||
| 30 | 30 | if($type == 'P') |
| 31 | 31 | { |
| 32 | 32 | $dir = 'skins'; |
| 33 | - } |
|
| 34 | - else |
|
| 33 | + } else |
|
| 35 | 34 | { |
| 36 | 35 | $dir = 'm.skins'; |
| 37 | 36 | } |
@@ -39,8 +38,7 @@ discard block |
||
| 39 | 38 | if(!$skin) |
| 40 | 39 | { |
| 41 | 40 | $tpl = ""; |
| 42 | - } |
|
| 43 | - else |
|
| 41 | + } else |
|
| 44 | 42 | { |
| 45 | 43 | $oModuleModel = getModel('module'); |
| 46 | 44 | $skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin, $dir); |
@@ -48,7 +46,9 @@ discard block |
||
| 48 | 46 | |
| 49 | 47 | $oModuleModel = getModel('module'); |
| 50 | 48 | $communication_config = $oModuleModel->getModuleConfig('communication'); |
| 51 | - if(!is_object($communication_config)) $communication_config = new stdClass; |
|
| 49 | + if(!is_object($communication_config)) { |
|
| 50 | + $communication_config = new stdClass; |
|
| 51 | + } |
|
| 52 | 52 | if(!$communication_config->colorset) |
| 53 | 53 | { |
| 54 | 54 | $communication_config->colorset = "white"; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | function checkUpdate() |
| 28 | 28 | { |
| 29 | - if(!is_dir("./files/member_extra_info/new_message_flags")) |
|
| 29 | + if (!is_dir("./files/member_extra_info/new_message_flags")) |
|
| 30 | 30 | { |
| 31 | 31 | return TRUE; |
| 32 | 32 | } |
@@ -34,13 +34,13 @@ discard block |
||
| 34 | 34 | $oModuleModel = getModel('module'); |
| 35 | 35 | $config = $oModuleModel->getModuleConfig('message'); |
| 36 | 36 | |
| 37 | - if($config->skin) |
|
| 37 | + if ($config->skin) |
|
| 38 | 38 | { |
| 39 | 39 | $config_parse = explode('.', $config->skin); |
| 40 | - if(count($config_parse) > 1) |
|
| 40 | + if (count($config_parse) > 1) |
|
| 41 | 41 | { |
| 42 | 42 | $template_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]); |
| 43 | - if(is_dir($template_path)) |
|
| 43 | + if (is_dir($template_path)) |
|
| 44 | 44 | { |
| 45 | 45 | return TRUE; |
| 46 | 46 | } |
@@ -55,25 +55,25 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | function moduleUpdate() |
| 57 | 57 | { |
| 58 | - if(!is_dir("./files/member_extra_info/new_message_flags")) |
|
| 58 | + if (!is_dir("./files/member_extra_info/new_message_flags")) |
|
| 59 | 59 | { |
| 60 | 60 | FileHandler::makeDir('./files/member_extra_info/new_message_flags'); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | $oModuleModel = getModel('module'); |
| 64 | 64 | $config = $oModuleModel->getModuleConfig('message'); |
| 65 | - if(!is_object($config)) |
|
| 65 | + if (!is_object($config)) |
|
| 66 | 66 | { |
| 67 | 67 | $config = new stdClass(); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - if($config->skin) |
|
| 70 | + if ($config->skin) |
|
| 71 | 71 | { |
| 72 | 72 | $config_parse = explode('.', $config->skin); |
| 73 | - if(count($config_parse) > 1) |
|
| 73 | + if (count($config_parse) > 1) |
|
| 74 | 74 | { |
| 75 | 75 | $template_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]); |
| 76 | - if(is_dir($template_path)) |
|
| 76 | + if (is_dir($template_path)) |
|
| 77 | 77 | { |
| 78 | 78 | $config->skin = implode('|@|', $config_parse); |
| 79 | 79 | $oModuleController = getController('module'); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | function procCommunicationUpdateAllowMessage() |
| 25 | 25 | { |
| 26 | - if(!Context::get('is_logged')) |
|
| 26 | + if (!Context::get('is_logged')) |
|
| 27 | 27 | { |
| 28 | 28 | return new Object(-1, 'msg_not_logged'); |
| 29 | 29 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $args = new stdClass(); |
| 32 | 32 | $args->allow_message = Context::get('allow_message'); |
| 33 | 33 | |
| 34 | - if(!in_array($args->allow_message, array('Y', 'N', 'F'))) |
|
| 34 | + if (!in_array($args->allow_message, array('Y', 'N', 'F'))) |
|
| 35 | 35 | { |
| 36 | 36 | $args->allow_message = 'Y'; |
| 37 | 37 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | function procCommunicationSendMessage() |
| 54 | 54 | { |
| 55 | 55 | // Check login information |
| 56 | - if(!Context::get('is_logged')) |
|
| 56 | + if (!Context::get('is_logged')) |
|
| 57 | 57 | { |
| 58 | 58 | return new Object(-1, 'msg_not_logged'); |
| 59 | 59 | } |
@@ -62,25 +62,25 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | // Check variables |
| 64 | 64 | $receiver_srl = Context::get('receiver_srl'); |
| 65 | - if(!$receiver_srl) |
|
| 65 | + if (!$receiver_srl) |
|
| 66 | 66 | { |
| 67 | 67 | return new Object(-1, 'msg_not_exists_member'); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | $title = trim(Context::get('title')); |
| 71 | - if(!$title) |
|
| 71 | + if (!$title) |
|
| 72 | 72 | { |
| 73 | 73 | return new Object(-1, 'msg_title_is_null'); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | $content = trim(Context::get('content')); |
| 77 | - if(!$content) |
|
| 77 | + if (!$content) |
|
| 78 | 78 | { |
| 79 | 79 | return new Object(-1, 'msg_content_is_null'); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | $send_mail = Context::get('send_mail'); |
| 83 | - if($send_mail != 'Y') |
|
| 83 | + if ($send_mail != 'Y') |
|
| 84 | 84 | { |
| 85 | 85 | $send_mail = 'N'; |
| 86 | 86 | } |
@@ -90,28 +90,28 @@ discard block |
||
| 90 | 90 | $oCommunicationModel = getModel('communication'); |
| 91 | 91 | $config = $oCommunicationModel->getConfig(); |
| 92 | 92 | |
| 93 | - if(!$oCommunicationModel->checkGrant($config->grant_write)) |
|
| 93 | + if (!$oCommunicationModel->checkGrant($config->grant_write)) |
|
| 94 | 94 | { |
| 95 | 95 | return new Object(-1, 'msg_not_permitted'); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | $receiver_member_info = $oMemberModel->getMemberInfoByMemberSrl($receiver_srl); |
| 99 | - if($receiver_member_info->member_srl != $receiver_srl) |
|
| 99 | + if ($receiver_member_info->member_srl != $receiver_srl) |
|
| 100 | 100 | { |
| 101 | 101 | return new Object(-1, 'msg_not_exists_member'); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | // check whether to allow to receive the message(pass if a top-administrator) |
| 105 | - if($logged_info->is_admin != 'Y') |
|
| 105 | + if ($logged_info->is_admin != 'Y') |
|
| 106 | 106 | { |
| 107 | - if($receiver_member_info->allow_message == 'F') |
|
| 107 | + if ($receiver_member_info->allow_message == 'F') |
|
| 108 | 108 | { |
| 109 | - if(!$oCommunicationModel->isFriend($receiver_member_info->member_srl)) |
|
| 109 | + if (!$oCommunicationModel->isFriend($receiver_member_info->member_srl)) |
|
| 110 | 110 | { |
| 111 | 111 | return new object(-1, 'msg_allow_message_to_friend'); |
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | - else if($receiver_member_info->allow_message == 'N') |
|
| 114 | + else if ($receiver_member_info->allow_message == 'N') |
|
| 115 | 115 | { |
| 116 | 116 | return new object(-1, 'msg_disallow_message'); |
| 117 | 117 | } |
@@ -120,13 +120,13 @@ discard block |
||
| 120 | 120 | // send a message |
| 121 | 121 | $output = $this->sendMessage($logged_info->member_srl, $receiver_srl, $title, $content); |
| 122 | 122 | |
| 123 | - if(!$output->toBool()) |
|
| 123 | + if (!$output->toBool()) |
|
| 124 | 124 | { |
| 125 | 125 | return $output; |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | // send an e-mail |
| 129 | - if($send_mail == 'Y') |
|
| 129 | + if ($send_mail == 'Y') |
|
| 130 | 130 | { |
| 131 | 131 | $view_url = Context::getRequestUri(); |
| 132 | 132 | $content = sprintf("%s<br /><br />From : <a href=\"%s\" target=\"_blank\">%s</a>", $content, $view_url, $view_url); |
@@ -138,9 +138,9 @@ discard block |
||
| 138 | 138 | $oMail->send(); |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | - if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
| 141 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
| 142 | 142 | { |
| 143 | - if(Context::get('is_popup') != 'Y') |
|
| 143 | + if (Context::get('is_popup') != 'Y') |
|
| 144 | 144 | { |
| 145 | 145 | global $lang; |
| 146 | 146 | htmlHeader(); |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | else |
| 154 | 154 | { |
| 155 | 155 | $this->setMessage('success_sended'); |
| 156 | - $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('','act', 'dispCommunicationMessages', 'message_type', 'S', 'receiver_srl', $receiver_srl, 'message_srl', ''); |
|
| 156 | + $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'act', 'dispCommunicationMessages', 'message_type', 'S', 'receiver_srl', $receiver_srl, 'message_srl', ''); |
|
| 157 | 157 | $this->setRedirectUrl($returnUrl); |
| 158 | 158 | } |
| 159 | 159 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | $receiver_args->related_srl = 0; |
| 198 | 198 | $receiver_args->list_order = $related_srl * -1; |
| 199 | 199 | $receiver_args->sender_srl = $sender_srl; |
| 200 | - if(!$receiver_args->sender_srl) |
|
| 200 | + if (!$receiver_args->sender_srl) |
|
| 201 | 201 | { |
| 202 | 202 | $receiver_args->sender_srl = $receiver_srl; |
| 203 | 203 | } |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | $trigger_obj->content = $content; |
| 219 | 219 | $trigger_obj->sender_log = $sender_log; |
| 220 | 220 | $triggerOutput = ModuleHandler::triggerCall('communication.sendMessage', 'before', $trigger_obj); |
| 221 | - if(!$triggerOutput->toBool()) |
|
| 221 | + if (!$triggerOutput->toBool()) |
|
| 222 | 222 | { |
| 223 | 223 | return $triggerOutput; |
| 224 | 224 | } |
@@ -227,10 +227,10 @@ discard block |
||
| 227 | 227 | $oDB->begin(); |
| 228 | 228 | |
| 229 | 229 | // messages to save in the sendor's message box |
| 230 | - if($sender_srl && $sender_log) |
|
| 230 | + if ($sender_srl && $sender_log) |
|
| 231 | 231 | { |
| 232 | 232 | $output = executeQuery('communication.sendMessage', $sender_args); |
| 233 | - if(!$output->toBool()) |
|
| 233 | + if (!$output->toBool()) |
|
| 234 | 234 | { |
| 235 | 235 | $oDB->rollback(); |
| 236 | 236 | return $output; |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | |
| 240 | 240 | // messages to save in the receiver's message box |
| 241 | 241 | $output = executeQuery('communication.sendMessage', $receiver_args); |
| 242 | - if(!$output->toBool()) |
|
| 242 | + if (!$output->toBool()) |
|
| 243 | 243 | { |
| 244 | 244 | $oDB->rollback(); |
| 245 | 245 | return $output; |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | |
| 248 | 248 | // Call a trigger (after) |
| 249 | 249 | $trigger_output = ModuleHandler::triggerCall('communication.sendMessage', 'after', $trigger_obj); |
| 250 | - if(!$trigger_output->toBool()) |
|
| 250 | + if (!$trigger_output->toBool()) |
|
| 251 | 251 | { |
| 252 | 252 | $oDB->rollback(); |
| 253 | 253 | return $trigger_output; |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | function procCommunicationStoreMessage() |
| 273 | 273 | { |
| 274 | 274 | // Check login information |
| 275 | - if(!Context::get('is_logged')) |
|
| 275 | + if (!Context::get('is_logged')) |
|
| 276 | 276 | { |
| 277 | 277 | return new Object(-1, 'msg_not_logged'); |
| 278 | 278 | } |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | |
| 281 | 281 | // Check variable |
| 282 | 282 | $message_srl = Context::get('message_srl'); |
| 283 | - if(!$message_srl) |
|
| 283 | + if (!$message_srl) |
|
| 284 | 284 | { |
| 285 | 285 | return new Object(-1, 'msg_invalid_request'); |
| 286 | 286 | } |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | // get the message |
| 289 | 289 | $oCommunicationModel = getModel('communication'); |
| 290 | 290 | $message = $oCommunicationModel->getSelectedMessage($message_srl); |
| 291 | - if(!$message || $message->message_type != 'R') |
|
| 291 | + if (!$message || $message->message_type != 'R') |
|
| 292 | 292 | { |
| 293 | 293 | return new Object(-1, 'msg_invalid_request'); |
| 294 | 294 | } |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | $args->message_srl = $message_srl; |
| 298 | 298 | $args->receiver_srl = $logged_info->member_srl; |
| 299 | 299 | $output = executeQuery('communication.setMessageStored', $args); |
| 300 | - if(!$output->toBool()) |
|
| 300 | + if (!$output->toBool()) |
|
| 301 | 301 | { |
| 302 | 302 | return $output; |
| 303 | 303 | } |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | function procCommunicationDeleteMessage() |
| 313 | 313 | { |
| 314 | 314 | // Check login information |
| 315 | - if(!Context::get('is_logged')) |
|
| 315 | + if (!Context::get('is_logged')) |
|
| 316 | 316 | { |
| 317 | 317 | return new Object(-1, 'msg_not_logged'); |
| 318 | 318 | } |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | |
| 323 | 323 | // Check the variable |
| 324 | 324 | $message_srl = Context::get('message_srl'); |
| 325 | - if(!$message_srl) |
|
| 325 | + if (!$message_srl) |
|
| 326 | 326 | { |
| 327 | 327 | return new Object(-1, 'msg_invalid_request'); |
| 328 | 328 | } |
@@ -330,23 +330,23 @@ discard block |
||
| 330 | 330 | // Get the message |
| 331 | 331 | $oCommunicationModel = getModel('communication'); |
| 332 | 332 | $message = $oCommunicationModel->getSelectedMessage($message_srl); |
| 333 | - if(!$message) |
|
| 333 | + if (!$message) |
|
| 334 | 334 | { |
| 335 | 335 | return new Object(-1, 'msg_invalid_request'); |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | // Check the grant |
| 339 | - switch($message->message_type) |
|
| 339 | + switch ($message->message_type) |
|
| 340 | 340 | { |
| 341 | 341 | case 'S': |
| 342 | - if($message->sender_srl != $member_srl) |
|
| 342 | + if ($message->sender_srl != $member_srl) |
|
| 343 | 343 | { |
| 344 | 344 | return new Object(-1, 'msg_invalid_request'); |
| 345 | 345 | } |
| 346 | 346 | break; |
| 347 | 347 | |
| 348 | 348 | case 'R': |
| 349 | - if($message->receiver_srl != $member_srl) |
|
| 349 | + if ($message->receiver_srl != $member_srl) |
|
| 350 | 350 | { |
| 351 | 351 | return new Object(-1, 'msg_invalid_request'); |
| 352 | 352 | } |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | $args = new stdClass(); |
| 358 | 358 | $args->message_srl = $message_srl; |
| 359 | 359 | $output = executeQuery('communication.deleteMessage', $args); |
| 360 | - if(!$output->toBool()) |
|
| 360 | + if (!$output->toBool()) |
|
| 361 | 361 | { |
| 362 | 362 | return $output; |
| 363 | 363 | } |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | function procCommunicationDeleteMessages() |
| 373 | 373 | { |
| 374 | 374 | // Check login information |
| 375 | - if(!Context::get('is_logged')) |
|
| 375 | + if (!Context::get('is_logged')) |
|
| 376 | 376 | { |
| 377 | 377 | return new Object(-1, 'msg_not_logged'); |
| 378 | 378 | } |
@@ -381,41 +381,41 @@ discard block |
||
| 381 | 381 | $member_srl = $logged_info->member_srl; |
| 382 | 382 | |
| 383 | 383 | // check variables |
| 384 | - if(!Context::get('message_srl_list')) |
|
| 384 | + if (!Context::get('message_srl_list')) |
|
| 385 | 385 | { |
| 386 | 386 | return new Object(-1, 'msg_cart_is_null'); |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | 389 | $message_srl_list = Context::get('message_srl_list'); |
| 390 | - if(!is_array($message_srl_list)) |
|
| 390 | + if (!is_array($message_srl_list)) |
|
| 391 | 391 | { |
| 392 | 392 | $message_srl_list = explode('|@|', trim($message_srl_list)); |
| 393 | 393 | } |
| 394 | 394 | |
| 395 | - if(!count($message_srl_list)) |
|
| 395 | + if (!count($message_srl_list)) |
|
| 396 | 396 | { |
| 397 | 397 | return new Object(-1, 'msg_cart_is_null'); |
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | $message_type = Context::get('message_type'); |
| 401 | - if(!$message_type || !in_array($message_type, array('R', 'S', 'T'))) |
|
| 401 | + if (!$message_type || !in_array($message_type, array('R', 'S', 'T'))) |
|
| 402 | 402 | { |
| 403 | 403 | return new Object(-1, 'msg_invalid_request'); |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | $message_count = count($message_srl_list); |
| 407 | 407 | $target = array(); |
| 408 | - for($i = 0; $i < $message_count; $i++) |
|
| 408 | + for ($i = 0; $i < $message_count; $i++) |
|
| 409 | 409 | { |
| 410 | 410 | $message_srl = (int) trim($message_srl_list[$i]); |
| 411 | - if(!$message_srl) |
|
| 411 | + if (!$message_srl) |
|
| 412 | 412 | { |
| 413 | 413 | continue; |
| 414 | 414 | } |
| 415 | 415 | |
| 416 | 416 | $target[] = $message_srl; |
| 417 | 417 | } |
| 418 | - if(!count($target)) |
|
| 418 | + if (!count($target)) |
|
| 419 | 419 | { |
| 420 | 420 | return new Object(-1, 'msg_cart_is_null'); |
| 421 | 421 | } |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | $args->message_srls = implode(',', $target); |
| 426 | 426 | $args->message_type = $message_type; |
| 427 | 427 | |
| 428 | - if($message_type == 'S') |
|
| 428 | + if ($message_type == 'S') |
|
| 429 | 429 | { |
| 430 | 430 | $args->sender_srl = $member_srl; |
| 431 | 431 | } |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | } |
| 436 | 436 | |
| 437 | 437 | $output = executeQuery('communication.deleteMessages', $args); |
| 438 | - if(!$output->toBool()) |
|
| 438 | + if (!$output->toBool()) |
|
| 439 | 439 | { |
| 440 | 440 | return $output; |
| 441 | 441 | } |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | function procCommunicationAddFriend() |
| 454 | 454 | { |
| 455 | 455 | // Check login information |
| 456 | - if(!Context::get('is_logged')) |
|
| 456 | + if (!Context::get('is_logged')) |
|
| 457 | 457 | { |
| 458 | 458 | return new Object(-1, 'msg_not_logged'); |
| 459 | 459 | } |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | $logged_info = Context::get('logged_info'); |
| 462 | 462 | |
| 463 | 463 | $target_srl = (int) trim(Context::get('target_srl')); |
| 464 | - if(!$target_srl) |
|
| 464 | + if (!$target_srl) |
|
| 465 | 465 | { |
| 466 | 466 | return new Object(-1, 'msg_invalid_request'); |
| 467 | 467 | } |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | $args->member_srl = $logged_info->member_srl; |
| 475 | 475 | $args->target_srl = $target_srl; |
| 476 | 476 | $output = executeQuery('communication.addFriend', $args); |
| 477 | - if(!$output->toBool()) |
|
| 477 | + if (!$output->toBool()) |
|
| 478 | 478 | { |
| 479 | 479 | return $output; |
| 480 | 480 | } |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | $this->add('member_srl', $target_srl); |
| 483 | 483 | $this->setMessage('success_registed'); |
| 484 | 484 | |
| 485 | - if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
| 485 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
| 486 | 486 | { |
| 487 | 487 | global $lang; |
| 488 | 488 | htmlHeader(); |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | function procCommunicationMoveFriend() |
| 502 | 502 | { |
| 503 | 503 | // Check login information |
| 504 | - if(!Context::get('is_logged')) |
|
| 504 | + if (!Context::get('is_logged')) |
|
| 505 | 505 | { |
| 506 | 506 | return new Object(-1, 'msg_not_logged'); |
| 507 | 507 | } |
@@ -510,27 +510,27 @@ discard block |
||
| 510 | 510 | |
| 511 | 511 | // Check variables |
| 512 | 512 | $friend_srl_list = Context::get('friend_srl_list'); |
| 513 | - if(!$friend_srl_list) |
|
| 513 | + if (!$friend_srl_list) |
|
| 514 | 514 | { |
| 515 | 515 | return new Object(-1, 'msg_cart_is_null'); |
| 516 | 516 | } |
| 517 | 517 | |
| 518 | - if(!is_array($friend_srl_list)) |
|
| 518 | + if (!is_array($friend_srl_list)) |
|
| 519 | 519 | { |
| 520 | 520 | $friend_srl_list = explode('|@|', $friend_srl_list); |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | - if(!count($friend_srl_list)) |
|
| 523 | + if (!count($friend_srl_list)) |
|
| 524 | 524 | { |
| 525 | 525 | return new Object(-1, 'msg_cart_is_null'); |
| 526 | 526 | } |
| 527 | 527 | |
| 528 | 528 | $friend_count = count($friend_srl_list); |
| 529 | 529 | $target = array(); |
| 530 | - for($i = 0; $i < $friend_count; $i++) |
|
| 530 | + for ($i = 0; $i < $friend_count; $i++) |
|
| 531 | 531 | { |
| 532 | 532 | $friend_srl = (int) trim($friend_srl_list[$i]); |
| 533 | - if(!$friend_srl) |
|
| 533 | + if (!$friend_srl) |
|
| 534 | 534 | { |
| 535 | 535 | continue; |
| 536 | 536 | } |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | $target[] = $friend_srl; |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | - if(!count($target)) |
|
| 541 | + if (!count($target)) |
|
| 542 | 542 | { |
| 543 | 543 | return new Object(-1, 'msg_cart_is_null'); |
| 544 | 544 | } |
@@ -550,7 +550,7 @@ discard block |
||
| 550 | 550 | $args->friend_group_srl = Context::get('target_friend_group_srl'); |
| 551 | 551 | |
| 552 | 552 | $output = executeQuery('communication.moveFriend', $args); |
| 553 | - if(!$output->toBool()) |
|
| 553 | + if (!$output->toBool()) |
|
| 554 | 554 | { |
| 555 | 555 | return $output; |
| 556 | 556 | } |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | function procCommunicationDeleteFriend() |
| 569 | 569 | { |
| 570 | 570 | // Check login information |
| 571 | - if(!Context::get('is_logged')) |
|
| 571 | + if (!Context::get('is_logged')) |
|
| 572 | 572 | { |
| 573 | 573 | return new Object(-1, 'msg_not_logged'); |
| 574 | 574 | } |
@@ -579,12 +579,12 @@ discard block |
||
| 579 | 579 | // Check variables |
| 580 | 580 | $friend_srl_list = Context::get('friend_srl_list'); |
| 581 | 581 | |
| 582 | - if(!is_array($friend_srl_list)) |
|
| 582 | + if (!is_array($friend_srl_list)) |
|
| 583 | 583 | { |
| 584 | 584 | $friend_srl_list = explode('|@|', $friend_srl_list); |
| 585 | 585 | } |
| 586 | 586 | |
| 587 | - if(!count($friend_srl_list)) |
|
| 587 | + if (!count($friend_srl_list)) |
|
| 588 | 588 | { |
| 589 | 589 | return new Object(-1, 'msg_cart_is_null'); |
| 590 | 590 | } |
@@ -592,10 +592,10 @@ discard block |
||
| 592 | 592 | $friend_count = count($friend_srl_list); |
| 593 | 593 | $target = array(); |
| 594 | 594 | |
| 595 | - for($i = 0; $i < $friend_count; $i++) |
|
| 595 | + for ($i = 0; $i < $friend_count; $i++) |
|
| 596 | 596 | { |
| 597 | 597 | $friend_srl = (int) trim($friend_srl_list[$i]); |
| 598 | - if(!$friend_srl) |
|
| 598 | + if (!$friend_srl) |
|
| 599 | 599 | { |
| 600 | 600 | continue; |
| 601 | 601 | } |
@@ -603,7 +603,7 @@ discard block |
||
| 603 | 603 | $target[] = $friend_srl; |
| 604 | 604 | } |
| 605 | 605 | |
| 606 | - if(!count($target)) |
|
| 606 | + if (!count($target)) |
|
| 607 | 607 | { |
| 608 | 608 | return new Object(-1, 'msg_cart_is_null'); |
| 609 | 609 | } |
@@ -613,7 +613,7 @@ discard block |
||
| 613 | 613 | $args->friend_srls = implode(',', $target); |
| 614 | 614 | $args->member_srl = $logged_info->member_srl; |
| 615 | 615 | $output = executeQuery('communication.deleteFriend', $args); |
| 616 | - if(!$output->toBool()) |
|
| 616 | + if (!$output->toBool()) |
|
| 617 | 617 | { |
| 618 | 618 | return $output; |
| 619 | 619 | } |
@@ -631,7 +631,7 @@ discard block |
||
| 631 | 631 | function procCommunicationAddFriendGroup() |
| 632 | 632 | { |
| 633 | 633 | // Check login information |
| 634 | - if(!Context::get('is_logged')) |
|
| 634 | + if (!Context::get('is_logged')) |
|
| 635 | 635 | { |
| 636 | 636 | return new Object(-1, 'msg_not_logged'); |
| 637 | 637 | } |
@@ -645,13 +645,13 @@ discard block |
||
| 645 | 645 | $args->title = Context::get('title'); |
| 646 | 646 | $args->title = htmlspecialchars($args->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 647 | 647 | |
| 648 | - if(!$args->title) |
|
| 648 | + if (!$args->title) |
|
| 649 | 649 | { |
| 650 | 650 | return new Object(-1, 'msg_invalid_request'); |
| 651 | 651 | } |
| 652 | 652 | |
| 653 | 653 | // modify if friend_group_srl exists. |
| 654 | - if($args->friend_group_srl) |
|
| 654 | + if ($args->friend_group_srl) |
|
| 655 | 655 | { |
| 656 | 656 | $output = executeQuery('communication.renameFriendGroup', $args); |
| 657 | 657 | $msg_code = 'success_updated'; |
@@ -663,9 +663,9 @@ discard block |
||
| 663 | 663 | $msg_code = 'success_registed'; |
| 664 | 664 | } |
| 665 | 665 | |
| 666 | - if(!$output->toBool()) |
|
| 666 | + if (!$output->toBool()) |
|
| 667 | 667 | { |
| 668 | - if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
| 668 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
| 669 | 669 | { |
| 670 | 670 | global $lang; |
| 671 | 671 | htmlHeader(); |
@@ -682,7 +682,7 @@ discard block |
||
| 682 | 682 | } |
| 683 | 683 | else |
| 684 | 684 | { |
| 685 | - if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
| 685 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
| 686 | 686 | { |
| 687 | 687 | global $lang; |
| 688 | 688 | htmlHeader(); |
@@ -707,7 +707,7 @@ discard block |
||
| 707 | 707 | function procCommunicationRenameFriendGroup() |
| 708 | 708 | { |
| 709 | 709 | // Check login information |
| 710 | - if(!Context::get('is_logged')) |
|
| 710 | + if (!Context::get('is_logged')) |
|
| 711 | 711 | { |
| 712 | 712 | return new Object(-1, 'msg_not_logged'); |
| 713 | 713 | } |
@@ -721,13 +721,13 @@ discard block |
||
| 721 | 721 | $args->title = Context::get('title'); |
| 722 | 722 | $args->title = htmlspecialchars($args->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 723 | 723 | |
| 724 | - if(!$args->title) |
|
| 724 | + if (!$args->title) |
|
| 725 | 725 | { |
| 726 | 726 | return new Object(-1, 'msg_invalid_request'); |
| 727 | 727 | } |
| 728 | 728 | |
| 729 | 729 | $output = executeQuery('communication.renameFriendGroup', $args); |
| 730 | - if(!$output->toBool()) |
|
| 730 | + if (!$output->toBool()) |
|
| 731 | 731 | { |
| 732 | 732 | return $output; |
| 733 | 733 | } |
@@ -742,7 +742,7 @@ discard block |
||
| 742 | 742 | function procCommunicationDeleteFriendGroup() |
| 743 | 743 | { |
| 744 | 744 | // Check login information |
| 745 | - if(!Context::get('is_logged')) |
|
| 745 | + if (!Context::get('is_logged')) |
|
| 746 | 746 | { |
| 747 | 747 | return new Object(-1, 'msg_not_logged'); |
| 748 | 748 | } |
@@ -754,7 +754,7 @@ discard block |
||
| 754 | 754 | $args->friend_group_srl = Context::get('friend_group_srl'); |
| 755 | 755 | $args->member_srl = $logged_info->member_srl; |
| 756 | 756 | $output = executeQuery('communication.deleteFriendGroup', $args); |
| 757 | - if(!$output->toBool()) |
|
| 757 | + if (!$output->toBool()) |
|
| 758 | 758 | { |
| 759 | 759 | return $output; |
| 760 | 760 | } |
@@ -110,8 +110,7 @@ discard block |
||
| 110 | 110 | { |
| 111 | 111 | return new object(-1, 'msg_allow_message_to_friend'); |
| 112 | 112 | } |
| 113 | - } |
|
| 114 | - else if($receiver_member_info->allow_message == 'N') |
|
| 113 | + } else if($receiver_member_info->allow_message == 'N') |
|
| 115 | 114 | { |
| 116 | 115 | return new object(-1, 'msg_disallow_message'); |
| 117 | 116 | } |
@@ -149,8 +148,7 @@ discard block |
||
| 149 | 148 | htmlFooter(); |
| 150 | 149 | Context::close(); |
| 151 | 150 | exit; |
| 152 | - } |
|
| 153 | - else |
|
| 151 | + } else |
|
| 154 | 152 | { |
| 155 | 153 | $this->setMessage('success_sended'); |
| 156 | 154 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('','act', 'dispCommunicationMessages', 'message_type', 'S', 'receiver_srl', $receiver_srl, 'message_srl', ''); |
@@ -428,8 +426,7 @@ discard block |
||
| 428 | 426 | if($message_type == 'S') |
| 429 | 427 | { |
| 430 | 428 | $args->sender_srl = $member_srl; |
| 431 | - } |
|
| 432 | - else |
|
| 429 | + } else |
|
| 433 | 430 | { |
| 434 | 431 | $args->receiver_srl = $member_srl; |
| 435 | 432 | } |
@@ -656,8 +653,7 @@ discard block |
||
| 656 | 653 | $output = executeQuery('communication.renameFriendGroup', $args); |
| 657 | 654 | $msg_code = 'success_updated'; |
| 658 | 655 | // add if not exists |
| 659 | - } |
|
| 660 | - else |
|
| 656 | + } else |
|
| 661 | 657 | { |
| 662 | 658 | $output = executeQuery('communication.addFriendGroup', $args); |
| 663 | 659 | $msg_code = 'success_registed'; |
@@ -674,13 +670,11 @@ discard block |
||
| 674 | 670 | htmlFooter(); |
| 675 | 671 | Context::close(); |
| 676 | 672 | exit; |
| 677 | - } |
|
| 678 | - else |
|
| 673 | + } else |
|
| 679 | 674 | { |
| 680 | 675 | return $output; |
| 681 | 676 | } |
| 682 | - } |
|
| 683 | - else |
|
| 677 | + } else |
|
| 684 | 678 | { |
| 685 | 679 | if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
| 686 | 680 | { |
@@ -692,8 +686,7 @@ discard block |
||
| 692 | 686 | htmlFooter(); |
| 693 | 687 | Context::close(); |
| 694 | 688 | exit; |
| 695 | - } |
|
| 696 | - else |
|
| 689 | + } else |
|
| 697 | 690 | { |
| 698 | 691 | $this->setMessage($msg_code); |
| 699 | 692 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | // set today's if no date is given |
| 31 | 31 | $selected_date = Context::get('selected_date'); |
| 32 | 32 | |
| 33 | - if(!$selected_date) |
|
| 33 | + if (!$selected_date) |
|
| 34 | 34 | { |
| 35 | 35 | $selected_date = date("Ymd"); |
| 36 | 36 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | // get data by time, day, month, and year |
| 51 | 51 | $type = Context::get('type'); |
| 52 | 52 | |
| 53 | - if(!$type) |
|
| 53 | + if (!$type) |
|
| 54 | 54 | { |
| 55 | 55 | $type = 'day'; |
| 56 | 56 | Context::set('type', $type); |
@@ -35,12 +35,12 @@ discard block |
||
| 35 | 35 | { |
| 36 | 36 | // Add site_srl to the counter |
| 37 | 37 | $oDB = DB::getInstance(); |
| 38 | - if(!$oDB->isColumnExists('counter_log', 'site_srl')) |
|
| 38 | + if (!$oDB->isColumnExists('counter_log', 'site_srl')) |
|
| 39 | 39 | { |
| 40 | 40 | return TRUE; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - if(!$oDB->isIndexExists('counter_log', 'idx_site_counter_log')) |
|
| 43 | + if (!$oDB->isIndexExists('counter_log', 'idx_site_counter_log')) |
|
| 44 | 44 | { |
| 45 | 45 | return TRUE; |
| 46 | 46 | } |
@@ -58,12 +58,12 @@ discard block |
||
| 58 | 58 | // Add site_srl to the counter |
| 59 | 59 | $oDB = DB::getInstance(); |
| 60 | 60 | |
| 61 | - if(!$oDB->isColumnExists('counter_log', 'site_srl')) |
|
| 61 | + if (!$oDB->isColumnExists('counter_log', 'site_srl')) |
|
| 62 | 62 | { |
| 63 | 63 | $oDB->addColumn('counter_log', 'site_srl', 'number', 11, 0, TRUE); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - if(!$oDB->isIndexExists('counter_log', 'idx_site_counter_log')) |
|
| 66 | + if (!$oDB->isIndexExists('counter_log', 'idx_site_counter_log')) |
|
| 67 | 67 | { |
| 68 | 68 | $oDB->addIndex('counter_log', 'idx_site_counter_log', array('site_srl', 'ipaddress'), FALSE); |
| 69 | 69 | } |
@@ -46,9 +46,9 @@ discard block |
||
| 46 | 46 | // Check the logs |
| 47 | 47 | $oCounterModel = getModel('counter'); |
| 48 | 48 | |
| 49 | - if($oCounterModel->isInsertedTodayStatus($site_srl)) |
|
| 49 | + if ($oCounterModel->isInsertedTodayStatus($site_srl)) |
|
| 50 | 50 | { |
| 51 | - if($oCounterModel->isLogged($site_srl)) |
|
| 51 | + if ($oCounterModel->isLogged($site_srl)) |
|
| 52 | 52 | { |
| 53 | 53 | // Register pageview |
| 54 | 54 | $this->insertPageView($site_srl); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $args = new stdClass(); |
| 98 | 98 | $args->regdate = '0,' . date('Ymd'); |
| 99 | 99 | |
| 100 | - if($site_srl) |
|
| 100 | + if ($site_srl) |
|
| 101 | 101 | { |
| 102 | 102 | $args->site_srl = $site_srl; |
| 103 | 103 | $output = executeQuery('counter.updateSiteCounterUnique', $args); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $args = new stdClass; |
| 120 | 120 | $args->regdate = '0,' . date('Ymd'); |
| 121 | 121 | |
| 122 | - if($site_srl) |
|
| 122 | + if ($site_srl) |
|
| 123 | 123 | { |
| 124 | 124 | $args->site_srl = $site_srl; |
| 125 | 125 | executeQuery('counter.updateSiteCounterPageview', $args); |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $args = new stdClass(); |
| 142 | 142 | $args->regdate = 0; |
| 143 | 143 | |
| 144 | - if($site_srl) |
|
| 144 | + if ($site_srl) |
|
| 145 | 145 | { |
| 146 | 146 | $args->site_srl = $site_srl; |
| 147 | 147 | executeQuery('counter.insertSiteTodayStatus', $args); |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | function insertTodayStatus($regdate = 0, $site_srl = 0) |
| 163 | 163 | { |
| 164 | 164 | $args = new stdClass(); |
| 165 | - if($regdate) |
|
| 165 | + if ($regdate) |
|
| 166 | 166 | { |
| 167 | 167 | $args->regdate = $regdate; |
| 168 | 168 | } |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | $args->regdate = date("Ymd"); |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | - if($site_srl) |
|
| 174 | + if ($site_srl) |
|
| 175 | 175 | { |
| 176 | 176 | $args->site_srl = $site_srl; |
| 177 | 177 | $query_id = 'counter.insertSiteTodayStatus'; |
@@ -52,16 +52,14 @@ discard block |
||
| 52 | 52 | { |
| 53 | 53 | // Register pageview |
| 54 | 54 | $this->insertPageView($site_srl); |
| 55 | - } |
|
| 56 | - else // If unregistered IP |
|
| 55 | + } else // If unregistered IP |
|
| 57 | 56 | { |
| 58 | 57 | // Leave logs |
| 59 | 58 | $this->insertLog($site_srl); |
| 60 | 59 | // Register unique and pageview |
| 61 | 60 | $this->insertUniqueVisitor($site_srl); |
| 62 | 61 | } |
| 63 | - } |
|
| 64 | - else // Register today's row if not exist |
|
| 62 | + } else // Register today's row if not exist |
|
| 65 | 63 | { |
| 66 | 64 | $this->insertTodayStatus(0, $site_srl); |
| 67 | 65 | // check user if the previous row exists |
@@ -101,8 +99,7 @@ discard block |
||
| 101 | 99 | { |
| 102 | 100 | $args->site_srl = $site_srl; |
| 103 | 101 | $output = executeQuery('counter.updateSiteCounterUnique', $args); |
| 104 | - } |
|
| 105 | - else |
|
| 102 | + } else |
|
| 106 | 103 | { |
| 107 | 104 | $output = executeQuery('counter.updateCounterUnique', $args); |
| 108 | 105 | } |
@@ -123,8 +120,7 @@ discard block |
||
| 123 | 120 | { |
| 124 | 121 | $args->site_srl = $site_srl; |
| 125 | 122 | executeQuery('counter.updateSiteCounterPageview', $args); |
| 126 | - } |
|
| 127 | - else |
|
| 123 | + } else |
|
| 128 | 124 | { |
| 129 | 125 | executeQuery('counter.updateCounterPageview', $args); |
| 130 | 126 | } |
@@ -145,8 +141,7 @@ discard block |
||
| 145 | 141 | { |
| 146 | 142 | $args->site_srl = $site_srl; |
| 147 | 143 | executeQuery('counter.insertSiteTodayStatus', $args); |
| 148 | - } |
|
| 149 | - else |
|
| 144 | + } else |
|
| 150 | 145 | { |
| 151 | 146 | executeQuery('counter.insertTodayStatus', $args); |
| 152 | 147 | } |
@@ -165,8 +160,7 @@ discard block |
||
| 165 | 160 | if($regdate) |
| 166 | 161 | { |
| 167 | 162 | $args->regdate = $regdate; |
| 168 | - } |
|
| 169 | - else |
|
| 163 | + } else |
|
| 170 | 164 | { |
| 171 | 165 | $args->regdate = date("Ymd"); |
| 172 | 166 | } |
@@ -178,8 +172,7 @@ discard block |
||
| 178 | 172 | |
| 179 | 173 | $u_args->site_srl = $site_srl; // /< when inserting a daily row, attempt to inser total rows(where regdate=0) together |
| 180 | 174 | executeQuery($query_id, $u_args); |
| 181 | - } |
|
| 182 | - else |
|
| 175 | + } else |
|
| 183 | 176 | { |
| 184 | 177 | $query_id = 'counter.insertTodayStatus'; |
| 185 | 178 | executeQuery($query_id); // /< when inserting a daily row, attempt to inser total rows(where regdate=0) together |
@@ -32,20 +32,20 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | $iplogged = false; |
| 34 | 34 | $oCacheHandler = CacheHandler::getInstance('object'); |
| 35 | - if($oCacheHandler->isSupport()) |
|
| 35 | + if ($oCacheHandler->isSupport()) |
|
| 36 | 36 | { |
| 37 | 37 | $object_key = 'counter:' . $site_srl . '_' . str_replace(array('.', ':'), '-', $args->ipaddress); |
| 38 | 38 | $cache_key = $oCacheHandler->getGroupKey('counterIpLogged_' . $args->regdate, $object_key); |
| 39 | 39 | $iplogged = $oCacheHandler->get($cache_key); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - if($iplogged === false) |
|
| 42 | + if ($iplogged === false) |
|
| 43 | 43 | { |
| 44 | 44 | $output = executeQuery('counter.getCounterLog', $args); |
| 45 | - if($output->data->count) $iplogged = TRUE; |
|
| 45 | + if ($output->data->count) $iplogged = TRUE; |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - if($iplogged && $oCacheHandler->isSupport()) |
|
| 48 | + if ($iplogged && $oCacheHandler->isSupport()) |
|
| 49 | 49 | { |
| 50 | 50 | $oCacheHandler->put($cache_key, $iplogged); |
| 51 | 51 | } |
@@ -66,15 +66,15 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | $insertedTodayStatus = false; |
| 68 | 68 | $oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE); |
| 69 | - if($oCacheHandler->isSupport()) |
|
| 69 | + if ($oCacheHandler->isSupport()) |
|
| 70 | 70 | { |
| 71 | 71 | $cache_key = 'counter:insertedTodayStatus:' . $site_srl . '_' . $args->regdate; |
| 72 | 72 | $insertedTodayStatus = $oCacheHandler->get($cache_key); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - if($insertedTodayStatus === false) |
|
| 75 | + if ($insertedTodayStatus === false) |
|
| 76 | 76 | { |
| 77 | - if($site_srl) |
|
| 77 | + if ($site_srl) |
|
| 78 | 78 | { |
| 79 | 79 | $args->site_srl = $site_srl; |
| 80 | 80 | $output = executeQuery('counter.getSiteTodayStatus', $args); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | $insertedTodayStatus = !!$output->data->count; |
| 88 | 88 | |
| 89 | - if($insertedTodayStatus && $oCacheHandler->isSupport()) |
|
| 89 | + if ($insertedTodayStatus && $oCacheHandler->isSupport()) |
|
| 90 | 90 | { |
| 91 | 91 | $oCacheHandler->put($cache_key, TRUE); |
| 92 | 92 | $_old_date = date('Ymd', strtotime('-1 day')); |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | // If more than one date logs are selected |
| 110 | 110 | $args = new stdClass(); |
| 111 | 111 | $args->regdate = is_array($selected_date) ? join(',', $selected_date) : $selected_date; |
| 112 | - if($site_srl) |
|
| 112 | + if ($site_srl) |
|
| 113 | 113 | { |
| 114 | 114 | $args->site_srl = $site_srl; |
| 115 | 115 | $output = executeQuery('counter.getSiteCounterStatusDays', $args); |
@@ -120,14 +120,14 @@ discard block |
||
| 120 | 120 | } |
| 121 | 121 | $status = $output->data; |
| 122 | 122 | |
| 123 | - if(!is_array($selected_date)) |
|
| 123 | + if (!is_array($selected_date)) |
|
| 124 | 124 | { |
| 125 | 125 | return $status; |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - if(!is_array($status)) $status = array($status); |
|
| 128 | + if (!is_array($status)) $status = array($status); |
|
| 129 | 129 | $output = array(); |
| 130 | - foreach($status as $val) |
|
| 130 | + foreach ($status as $val) |
|
| 131 | 131 | { |
| 132 | 132 | $output[substr($val->regdate, 0, 8)] = $val; |
| 133 | 133 | } |
@@ -148,11 +148,11 @@ discard block |
||
| 148 | 148 | $max = 0; |
| 149 | 149 | $sum = 0; |
| 150 | 150 | |
| 151 | - switch($type) |
|
| 151 | + switch ($type) |
|
| 152 | 152 | { |
| 153 | 153 | case 'year' : |
| 154 | 154 | // Get a date to start counting |
| 155 | - if($site_srl) |
|
| 155 | + if ($site_srl) |
|
| 156 | 156 | { |
| 157 | 157 | $args = new stdClass(); |
| 158 | 158 | $args->site_srl = $site_srl; |
@@ -163,18 +163,18 @@ discard block |
||
| 163 | 163 | $output = executeQuery('counter.getStartLogDate'); |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | - if(!($start_year = substr($output->data->regdate, 0, 4))) |
|
| 166 | + if (!($start_year = substr($output->data->regdate, 0, 4))) |
|
| 167 | 167 | { |
| 168 | 168 | $start_year = date("Y"); |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | - for($i = $start_year, $y = date("Y"); $i <= $y; $i++) |
|
| 171 | + for ($i = $start_year, $y = date("Y"); $i <= $y; $i++) |
|
| 172 | 172 | { |
| 173 | 173 | $args = new stdClass(); |
| 174 | 174 | $args->start_date = sprintf('%04d0000', $i); |
| 175 | 175 | $args->end_date = sprintf('%04d1231', $i); |
| 176 | 176 | |
| 177 | - if($site_srl) |
|
| 177 | + if ($site_srl) |
|
| 178 | 178 | { |
| 179 | 179 | $args->site_srl = $site_srl; |
| 180 | 180 | $output = executeQuery('counter.getSiteCounterStatus', $args); |
@@ -184,10 +184,10 @@ discard block |
||
| 184 | 184 | $output = executeQuery('counter.getCounterStatus', $args); |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | - $count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
|
| 187 | + $count = (int) ($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
|
| 188 | 188 | $status->list[$i] = $count; |
| 189 | 189 | |
| 190 | - if($count > $max) $max = $count; |
|
| 190 | + if ($count > $max) $max = $count; |
|
| 191 | 191 | |
| 192 | 192 | $sum += $count; |
| 193 | 193 | } |
@@ -197,14 +197,14 @@ discard block |
||
| 197 | 197 | $time = strtotime($selected_date); |
| 198 | 198 | $w = date("D"); |
| 199 | 199 | |
| 200 | - while(date("D", $time) != "Sun") |
|
| 200 | + while (date("D", $time) != "Sun") |
|
| 201 | 201 | { |
| 202 | 202 | $time += 60 * 60 * 24; |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | $time -= 60 * 60 * 24; |
| 206 | 206 | |
| 207 | - while(date("D", $time) != "Sun") |
|
| 207 | + while (date("D", $time) != "Sun") |
|
| 208 | 208 | { |
| 209 | 209 | $thisWeek[] = date("Ymd", $time); |
| 210 | 210 | $time -= 60 * 60 * 24; |
@@ -214,13 +214,13 @@ discard block |
||
| 214 | 214 | |
| 215 | 215 | asort($thisWeek); |
| 216 | 216 | |
| 217 | - foreach($thisWeek as $day) |
|
| 217 | + foreach ($thisWeek as $day) |
|
| 218 | 218 | { |
| 219 | 219 | $args = new stdClass(); |
| 220 | 220 | $args->start_date = $day; |
| 221 | 221 | $args->end_date = $day; |
| 222 | 222 | |
| 223 | - if($site_srl) |
|
| 223 | + if ($site_srl) |
|
| 224 | 224 | { |
| 225 | 225 | $args->site_srl = $site_srl; |
| 226 | 226 | $output = executeQuery('counter.getSiteCounterStatus', $args); |
@@ -230,10 +230,10 @@ discard block |
||
| 230 | 230 | $output = executeQuery('counter.getCounterStatus', $args); |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | - $count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
|
| 233 | + $count = (int) ($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
|
| 234 | 234 | $status->list[$day] = $count; |
| 235 | 235 | |
| 236 | - if($count > $max) $max = $count; |
|
| 236 | + if ($count > $max) $max = $count; |
|
| 237 | 237 | |
| 238 | 238 | $sum += $count; |
| 239 | 239 | } |
@@ -241,13 +241,13 @@ discard block |
||
| 241 | 241 | |
| 242 | 242 | case 'month' : |
| 243 | 243 | $year = substr($selected_date, 0, 4); |
| 244 | - for($i = 1; $i <= 12; $i++) |
|
| 244 | + for ($i = 1; $i <= 12; $i++) |
|
| 245 | 245 | { |
| 246 | 246 | $args = new stdClass(); |
| 247 | 247 | $args->start_date = sprintf('%04d%02d00', $year, $i); |
| 248 | 248 | $args->end_date = sprintf('%04d%02d31', $year, $i); |
| 249 | 249 | |
| 250 | - if($site_srl) |
|
| 250 | + if ($site_srl) |
|
| 251 | 251 | { |
| 252 | 252 | $args->site_srl = $site_srl; |
| 253 | 253 | $output = executeQuery('counter.getSiteCounterStatus', $args); |
@@ -257,23 +257,23 @@ discard block |
||
| 257 | 257 | $output = executeQuery('counter.getCounterStatus', $args); |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | - $count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
|
| 260 | + $count = (int) ($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
|
| 261 | 261 | $status->list[$i] = $count; |
| 262 | 262 | |
| 263 | - if($count > $max) $max = $count; |
|
| 263 | + if ($count > $max) $max = $count; |
|
| 264 | 264 | |
| 265 | 265 | $sum += $count; |
| 266 | 266 | } |
| 267 | 267 | break; |
| 268 | 268 | |
| 269 | 269 | case 'hour' : |
| 270 | - for($i = 0; $i < 24; $i++) |
|
| 270 | + for ($i = 0; $i < 24; $i++) |
|
| 271 | 271 | { |
| 272 | 272 | $args = new stdClass(); |
| 273 | 273 | $args->start_date = sprintf('%08d%02d0000', $selected_date, $i); |
| 274 | 274 | $args->end_date = sprintf('%08d%02d5959', $selected_date, $i); |
| 275 | 275 | |
| 276 | - if($site_srl) |
|
| 276 | + if ($site_srl) |
|
| 277 | 277 | { |
| 278 | 278 | $args->site_srl = $site_srl; |
| 279 | 279 | $output = executeQuery('counter.getSiteCounterLogStatus', $args); |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | $count = (int) $output->data->count; |
| 288 | 288 | $status->list[$i] = $count; |
| 289 | 289 | |
| 290 | - if($count > $max) $max = $count; |
|
| 290 | + if ($count > $max) $max = $count; |
|
| 291 | 291 | |
| 292 | 292 | $sum += $count; |
| 293 | 293 | } |
@@ -298,13 +298,13 @@ discard block |
||
| 298 | 298 | $month = substr($selected_date, 4, 2); |
| 299 | 299 | $end_day = date('t', mktime(0, 0, 0, $month, 1, $year)); |
| 300 | 300 | |
| 301 | - for($i = 1; $i <= $end_day; $i++) |
|
| 301 | + for ($i = 1; $i <= $end_day; $i++) |
|
| 302 | 302 | { |
| 303 | 303 | $args = new stdClass(); |
| 304 | 304 | $args->start_date = sprintf('%04d%02d%02d', $year, $month, $i); |
| 305 | 305 | $args->end_date = sprintf('%04d%02d%02d', $year, $month, $i); |
| 306 | 306 | |
| 307 | - if($site_srl) |
|
| 307 | + if ($site_srl) |
|
| 308 | 308 | { |
| 309 | 309 | $args->site_srl = $site_srl; |
| 310 | 310 | $output = executeQuery('counter.getSiteCounterStatus', $args); |
@@ -314,10 +314,10 @@ discard block |
||
| 314 | 314 | $output = executeQuery('counter.getCounterStatus', $args); |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | - $count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
|
| 317 | + $count = (int) ($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
|
| 318 | 318 | $status->list[$i] = $count; |
| 319 | 319 | |
| 320 | - if($count > $max) $max = $count; |
|
| 320 | + if ($count > $max) $max = $count; |
|
| 321 | 321 | |
| 322 | 322 | $sum += $count; |
| 323 | 323 | } |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | $output1 = $this->getHourlyStatus('week', $date1); |
| 338 | 338 | |
| 339 | 339 | $tmp = array(); |
| 340 | - foreach($output1->list as $key => $value) |
|
| 340 | + foreach ($output1->list as $key => $value) |
|
| 341 | 341 | { |
| 342 | 342 | $tmp["'" . $key . "'"] = $value; |
| 343 | 343 | } |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | $output2 = $this->getHourlyStatus('week', $date2); |
| 349 | 349 | |
| 350 | 350 | $tmp = array(); |
| 351 | - foreach($output2->list as $key => $value) |
|
| 351 | + foreach ($output2->list as $key => $value) |
|
| 352 | 352 | { |
| 353 | 353 | $tmp["'" . $key . "'"] = $value; |
| 354 | 354 | } |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | $output1 = $this->getHourlyStatus('week', $date1, 0, TRUE); |
| 366 | 366 | |
| 367 | 367 | $tmp = array(); |
| 368 | - foreach($output1->list as $key => $value) |
|
| 368 | + foreach ($output1->list as $key => $value) |
|
| 369 | 369 | { |
| 370 | 370 | $tmp["'" . $key . "'"] = $value; |
| 371 | 371 | } |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | $output2 = $this->getHourlyStatus('week', $date2, 0, TRUE); |
| 377 | 377 | |
| 378 | 378 | $tmp = array(); |
| 379 | - foreach($output2->list as $key => $value) |
|
| 379 | + foreach ($output2->list as $key => $value) |
|
| 380 | 380 | { |
| 381 | 381 | $tmp["'" . $key . "'"] = $value; |
| 382 | 382 | } |
@@ -42,7 +42,9 @@ discard block |
||
| 42 | 42 | if($iplogged === false) |
| 43 | 43 | { |
| 44 | 44 | $output = executeQuery('counter.getCounterLog', $args); |
| 45 | - if($output->data->count) $iplogged = TRUE; |
|
| 45 | + if($output->data->count) { |
|
| 46 | + $iplogged = TRUE; |
|
| 47 | + } |
|
| 46 | 48 | } |
| 47 | 49 | |
| 48 | 50 | if($iplogged && $oCacheHandler->isSupport()) |
@@ -78,8 +80,7 @@ discard block |
||
| 78 | 80 | { |
| 79 | 81 | $args->site_srl = $site_srl; |
| 80 | 82 | $output = executeQuery('counter.getSiteTodayStatus', $args); |
| 81 | - } |
|
| 82 | - else |
|
| 83 | + } else |
|
| 83 | 84 | { |
| 84 | 85 | $output = executeQuery('counter.getTodayStatus', $args); |
| 85 | 86 | } |
@@ -113,8 +114,7 @@ discard block |
||
| 113 | 114 | { |
| 114 | 115 | $args->site_srl = $site_srl; |
| 115 | 116 | $output = executeQuery('counter.getSiteCounterStatusDays', $args); |
| 116 | - } |
|
| 117 | - else |
|
| 117 | + } else |
|
| 118 | 118 | { |
| 119 | 119 | $output = executeQuery('counter.getCounterStatusDays', $args); |
| 120 | 120 | } |
@@ -125,7 +125,9 @@ discard block |
||
| 125 | 125 | return $status; |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - if(!is_array($status)) $status = array($status); |
|
| 128 | + if(!is_array($status)) { |
|
| 129 | + $status = array($status); |
|
| 130 | + } |
|
| 129 | 131 | $output = array(); |
| 130 | 132 | foreach($status as $val) |
| 131 | 133 | { |
@@ -157,8 +159,7 @@ discard block |
||
| 157 | 159 | $args = new stdClass(); |
| 158 | 160 | $args->site_srl = $site_srl; |
| 159 | 161 | $output = executeQuery('counter.getSiteStartLogDate', $args); |
| 160 | - } |
|
| 161 | - else |
|
| 162 | + } else |
|
| 162 | 163 | { |
| 163 | 164 | $output = executeQuery('counter.getStartLogDate'); |
| 164 | 165 | } |
@@ -178,8 +179,7 @@ discard block |
||
| 178 | 179 | { |
| 179 | 180 | $args->site_srl = $site_srl; |
| 180 | 181 | $output = executeQuery('counter.getSiteCounterStatus', $args); |
| 181 | - } |
|
| 182 | - else |
|
| 182 | + } else |
|
| 183 | 183 | { |
| 184 | 184 | $output = executeQuery('counter.getCounterStatus', $args); |
| 185 | 185 | } |
@@ -187,7 +187,9 @@ discard block |
||
| 187 | 187 | $count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
| 188 | 188 | $status->list[$i] = $count; |
| 189 | 189 | |
| 190 | - if($count > $max) $max = $count; |
|
| 190 | + if($count > $max) { |
|
| 191 | + $max = $count; |
|
| 192 | + } |
|
| 191 | 193 | |
| 192 | 194 | $sum += $count; |
| 193 | 195 | } |
@@ -224,8 +226,7 @@ discard block |
||
| 224 | 226 | { |
| 225 | 227 | $args->site_srl = $site_srl; |
| 226 | 228 | $output = executeQuery('counter.getSiteCounterStatus', $args); |
| 227 | - } |
|
| 228 | - else |
|
| 229 | + } else |
|
| 229 | 230 | { |
| 230 | 231 | $output = executeQuery('counter.getCounterStatus', $args); |
| 231 | 232 | } |
@@ -233,7 +234,9 @@ discard block |
||
| 233 | 234 | $count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
| 234 | 235 | $status->list[$day] = $count; |
| 235 | 236 | |
| 236 | - if($count > $max) $max = $count; |
|
| 237 | + if($count > $max) { |
|
| 238 | + $max = $count; |
|
| 239 | + } |
|
| 237 | 240 | |
| 238 | 241 | $sum += $count; |
| 239 | 242 | } |
@@ -251,8 +254,7 @@ discard block |
||
| 251 | 254 | { |
| 252 | 255 | $args->site_srl = $site_srl; |
| 253 | 256 | $output = executeQuery('counter.getSiteCounterStatus', $args); |
| 254 | - } |
|
| 255 | - else |
|
| 257 | + } else |
|
| 256 | 258 | { |
| 257 | 259 | $output = executeQuery('counter.getCounterStatus', $args); |
| 258 | 260 | } |
@@ -260,7 +262,9 @@ discard block |
||
| 260 | 262 | $count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
| 261 | 263 | $status->list[$i] = $count; |
| 262 | 264 | |
| 263 | - if($count > $max) $max = $count; |
|
| 265 | + if($count > $max) { |
|
| 266 | + $max = $count; |
|
| 267 | + } |
|
| 264 | 268 | |
| 265 | 269 | $sum += $count; |
| 266 | 270 | } |
@@ -277,8 +281,7 @@ discard block |
||
| 277 | 281 | { |
| 278 | 282 | $args->site_srl = $site_srl; |
| 279 | 283 | $output = executeQuery('counter.getSiteCounterLogStatus', $args); |
| 280 | - } |
|
| 281 | - else |
|
| 284 | + } else |
|
| 282 | 285 | { |
| 283 | 286 | $args->site_srl = 0; |
| 284 | 287 | $output = executeQuery('counter.getCounterLogStatus', $args); |
@@ -287,7 +290,9 @@ discard block |
||
| 287 | 290 | $count = (int) $output->data->count; |
| 288 | 291 | $status->list[$i] = $count; |
| 289 | 292 | |
| 290 | - if($count > $max) $max = $count; |
|
| 293 | + if($count > $max) { |
|
| 294 | + $max = $count; |
|
| 295 | + } |
|
| 291 | 296 | |
| 292 | 297 | $sum += $count; |
| 293 | 298 | } |
@@ -308,8 +313,7 @@ discard block |
||
| 308 | 313 | { |
| 309 | 314 | $args->site_srl = $site_srl; |
| 310 | 315 | $output = executeQuery('counter.getSiteCounterStatus', $args); |
| 311 | - } |
|
| 312 | - else |
|
| 316 | + } else |
|
| 313 | 317 | { |
| 314 | 318 | $output = executeQuery('counter.getCounterStatus', $args); |
| 315 | 319 | } |
@@ -317,7 +321,9 @@ discard block |
||
| 317 | 321 | $count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
| 318 | 322 | $status->list[$i] = $count; |
| 319 | 323 | |
| 320 | - if($count > $max) $max = $count; |
|
| 324 | + if($count > $max) { |
|
| 325 | + $max = $count; |
|
| 326 | + } |
|
| 321 | 327 | |
| 322 | 328 | $sum += $count; |
| 323 | 329 | } |
@@ -27,31 +27,31 @@ discard block |
||
| 27 | 27 | function getDocumentTrashList($obj) |
| 28 | 28 | { |
| 29 | 29 | // check a list and its order |
| 30 | - if(!in_array($obj->sort_index, array('list_order','delete_date','title'))) $obj->sort_index = 'list_order'; |
|
| 31 | - if(!in_array($obj->order_type, array('desc','asc'))) $obj->order_type = 'asc'; |
|
| 30 | + if (!in_array($obj->sort_index, array('list_order', 'delete_date', 'title'))) $obj->sort_index = 'list_order'; |
|
| 31 | + if (!in_array($obj->order_type, array('desc', 'asc'))) $obj->order_type = 'asc'; |
|
| 32 | 32 | // get a module_srl if mid is returned instead of modul_srl |
| 33 | - if($obj->mid) |
|
| 33 | + if ($obj->mid) |
|
| 34 | 34 | { |
| 35 | 35 | $oModuleModel = getModel('module'); |
| 36 | 36 | $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid); |
| 37 | 37 | unset($obj->mid); |
| 38 | 38 | } |
| 39 | 39 | // check if the module_srl is an array |
| 40 | - if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); |
|
| 40 | + if (is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); |
|
| 41 | 41 | else $args->module_srl = $obj->module_srl; |
| 42 | 42 | // Variable check |
| 43 | 43 | $args->sort_index = $obj->sort_index; |
| 44 | 44 | $args->order_type = $obj->order_type; |
| 45 | - $args->page = $obj->page?$obj->page:1; |
|
| 46 | - $args->list_count = $obj->list_count?$obj->list_count:20; |
|
| 47 | - $args->page_count = $obj->page_count?$obj->page_count:10; |
|
| 45 | + $args->page = $obj->page ? $obj->page : 1; |
|
| 46 | + $args->list_count = $obj->list_count ? $obj->list_count : 20; |
|
| 47 | + $args->page_count = $obj->page_count ? $obj->page_count : 10; |
|
| 48 | 48 | $args->member_srl = $obj->member_srl; |
| 49 | 49 | // Specify query_id |
| 50 | 50 | $query_id = 'document.getTrashList'; |
| 51 | 51 | // Execute a query |
| 52 | 52 | $output = executeQueryArray($query_id, $args); |
| 53 | 53 | // Return if no result or an error occurs |
| 54 | - if(!$output->toBool() || !count($output->data)) return $output; |
|
| 54 | + if (!$output->toBool() || !count($output->data)) return $output; |
|
| 55 | 55 | |
| 56 | 56 | $idx = 0; |
| 57 | 57 | $data = $output->data; |
@@ -60,12 +60,12 @@ discard block |
||
| 60 | 60 | $keys = array_keys($data); |
| 61 | 61 | $virtual_number = $keys[0]; |
| 62 | 62 | |
| 63 | - foreach($data as $key => $attribute) |
|
| 63 | + foreach ($data as $key => $attribute) |
|
| 64 | 64 | { |
| 65 | 65 | $oDocument = null; |
| 66 | 66 | $oDocument = new documentItem(); |
| 67 | 67 | $oDocument->setAttribute($attribute, false); |
| 68 | - if($is_admin) $oDocument->setGrant(); |
|
| 68 | + if ($is_admin) $oDocument->setGrant(); |
|
| 69 | 69 | |
| 70 | 70 | $output->data[$virtual_number] = $oDocument; |
| 71 | 71 | $virtual_number--; |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $output = executeQuery('document.getTrash', $args); |
| 86 | 86 | |
| 87 | 87 | $node = $output->data; |
| 88 | - if(!$node) return; |
|
| 88 | + if (!$node) return; |
|
| 89 | 89 | |
| 90 | 90 | return $node; |
| 91 | 91 | } |
@@ -100,12 +100,12 @@ discard block |
||
| 100 | 100 | function getDocumentCountByDate($date = '', $moduleSrlList = array(), $statusList = array()) |
| 101 | 101 | { |
| 102 | 102 | $args = new stdClass(); |
| 103 | - if($date) $args->regDate = date('Ymd', strtotime($date)); |
|
| 104 | - if(count($moduleSrlList)>0) $args->moduleSrlList = $moduleSrlList; |
|
| 105 | - if(count($statusList)>0) $args->statusList = $statusList; |
|
| 103 | + if ($date) $args->regDate = date('Ymd', strtotime($date)); |
|
| 104 | + if (count($moduleSrlList) > 0) $args->moduleSrlList = $moduleSrlList; |
|
| 105 | + if (count($statusList) > 0) $args->statusList = $statusList; |
|
| 106 | 106 | |
| 107 | 107 | $output = executeQuery('document.getDocumentCountByDate', $args); |
| 108 | - if(!$output->toBool()) return 0; |
|
| 108 | + if (!$output->toBool()) return 0; |
|
| 109 | 109 | |
| 110 | 110 | return $output->data->count; |
| 111 | 111 | } |
@@ -27,8 +27,12 @@ discard block |
||
| 27 | 27 | function getDocumentTrashList($obj) |
| 28 | 28 | { |
| 29 | 29 | // check a list and its order |
| 30 | - if(!in_array($obj->sort_index, array('list_order','delete_date','title'))) $obj->sort_index = 'list_order'; |
|
| 31 | - if(!in_array($obj->order_type, array('desc','asc'))) $obj->order_type = 'asc'; |
|
| 30 | + if(!in_array($obj->sort_index, array('list_order','delete_date','title'))) { |
|
| 31 | + $obj->sort_index = 'list_order'; |
|
| 32 | + } |
|
| 33 | + if(!in_array($obj->order_type, array('desc','asc'))) { |
|
| 34 | + $obj->order_type = 'asc'; |
|
| 35 | + } |
|
| 32 | 36 | // get a module_srl if mid is returned instead of modul_srl |
| 33 | 37 | if($obj->mid) |
| 34 | 38 | { |
@@ -37,8 +41,11 @@ discard block |
||
| 37 | 41 | unset($obj->mid); |
| 38 | 42 | } |
| 39 | 43 | // check if the module_srl is an array |
| 40 | - if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); |
|
| 41 | - else $args->module_srl = $obj->module_srl; |
|
| 44 | + if(is_array($obj->module_srl)) { |
|
| 45 | + $args->module_srl = implode(',', $obj->module_srl); |
|
| 46 | + } else { |
|
| 47 | + $args->module_srl = $obj->module_srl; |
|
| 48 | + } |
|
| 42 | 49 | // Variable check |
| 43 | 50 | $args->sort_index = $obj->sort_index; |
| 44 | 51 | $args->order_type = $obj->order_type; |
@@ -51,7 +58,9 @@ discard block |
||
| 51 | 58 | // Execute a query |
| 52 | 59 | $output = executeQueryArray($query_id, $args); |
| 53 | 60 | // Return if no result or an error occurs |
| 54 | - if(!$output->toBool() || !count($output->data)) return $output; |
|
| 61 | + if(!$output->toBool() || !count($output->data)) { |
|
| 62 | + return $output; |
|
| 63 | + } |
|
| 55 | 64 | |
| 56 | 65 | $idx = 0; |
| 57 | 66 | $data = $output->data; |
@@ -65,7 +74,9 @@ discard block |
||
| 65 | 74 | $oDocument = null; |
| 66 | 75 | $oDocument = new documentItem(); |
| 67 | 76 | $oDocument->setAttribute($attribute, false); |
| 68 | - if($is_admin) $oDocument->setGrant(); |
|
| 77 | + if($is_admin) { |
|
| 78 | + $oDocument->setGrant(); |
|
| 79 | + } |
|
| 69 | 80 | |
| 70 | 81 | $output->data[$virtual_number] = $oDocument; |
| 71 | 82 | $virtual_number--; |
@@ -85,7 +96,9 @@ discard block |
||
| 85 | 96 | $output = executeQuery('document.getTrash', $args); |
| 86 | 97 | |
| 87 | 98 | $node = $output->data; |
| 88 | - if(!$node) return; |
|
| 99 | + if(!$node) { |
|
| 100 | + return; |
|
| 101 | + } |
|
| 89 | 102 | |
| 90 | 103 | return $node; |
| 91 | 104 | } |
@@ -100,12 +113,20 @@ discard block |
||
| 100 | 113 | function getDocumentCountByDate($date = '', $moduleSrlList = array(), $statusList = array()) |
| 101 | 114 | { |
| 102 | 115 | $args = new stdClass(); |
| 103 | - if($date) $args->regDate = date('Ymd', strtotime($date)); |
|
| 104 | - if(count($moduleSrlList)>0) $args->moduleSrlList = $moduleSrlList; |
|
| 105 | - if(count($statusList)>0) $args->statusList = $statusList; |
|
| 116 | + if($date) { |
|
| 117 | + $args->regDate = date('Ymd', strtotime($date)); |
|
| 118 | + } |
|
| 119 | + if(count($moduleSrlList)>0) { |
|
| 120 | + $args->moduleSrlList = $moduleSrlList; |
|
| 121 | + } |
|
| 122 | + if(count($statusList)>0) { |
|
| 123 | + $args->statusList = $statusList; |
|
| 124 | + } |
|
| 106 | 125 | |
| 107 | 126 | $output = executeQuery('document.getDocumentCountByDate', $args); |
| 108 | - if(!$output->toBool()) return 0; |
|
| 127 | + if(!$output->toBool()) { |
|
| 128 | + return 0; |
|
| 129 | + } |
|
| 109 | 130 | |
| 110 | 131 | return $output->data->count; |
| 111 | 132 | } |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
| 3 | 3 | /** |
| 4 | - * documentAdminView class |
|
| 5 | - * Document admin view of the module class |
|
| 6 | - * |
|
| 7 | - * @author NAVER ([email protected]) |
|
| 8 | - * @package /modules/document |
|
| 9 | - * @version 0.1 |
|
| 10 | - */ |
|
| 4 | + * documentAdminView class |
|
| 5 | + * Document admin view of the module class |
|
| 6 | + * |
|
| 7 | + * @author NAVER ([email protected]) |
|
| 8 | + * @package /modules/document |
|
| 9 | + * @version 0.1 |
|
| 10 | + */ |
|
| 11 | 11 | class documentAdminView extends document |
| 12 | 12 | { |
| 13 | 13 | /** |
@@ -19,9 +19,9 @@ discard block |
||
| 19 | 19 | // check current location in admin menu |
| 20 | 20 | $oModuleModel = getModel('module'); |
| 21 | 21 | $info = $oModuleModel->getModuleActionXml('document'); |
| 22 | - foreach($info->menu AS $key => $menu) |
|
| 22 | + foreach ($info->menu AS $key => $menu) |
|
| 23 | 23 | { |
| 24 | - if(in_array($this->act, $menu->acts)) |
|
| 24 | + if (in_array($this->act, $menu->acts)) |
|
| 25 | 25 | { |
| 26 | 26 | Context::set('currentMenu', $key); |
| 27 | 27 | break; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | // set a search option used in the template |
| 68 | 68 | $count_search_option = count($this->search_option); |
| 69 | - for($i=0;$i<$count_search_option;$i++) |
|
| 69 | + for ($i = 0; $i < $count_search_option; $i++) |
|
| 70 | 70 | { |
| 71 | 71 | $search_option[$this->search_option[$i]] = Context::getLang($this->search_option[$i]); |
| 72 | 72 | } |
@@ -75,20 +75,20 @@ discard block |
||
| 75 | 75 | $oModuleModel = getModel('module'); |
| 76 | 76 | $module_list = array(); |
| 77 | 77 | $mod_srls = array(); |
| 78 | - foreach($output->data as $oDocument) |
|
| 78 | + foreach ($output->data as $oDocument) |
|
| 79 | 79 | { |
| 80 | 80 | $mod_srls[] = $oDocument->get('module_srl'); |
| 81 | 81 | } |
| 82 | 82 | $mod_srls = array_unique($mod_srls); |
| 83 | 83 | // Module List |
| 84 | 84 | $mod_srls_count = count($mod_srls); |
| 85 | - if($mod_srls_count) |
|
| 85 | + if ($mod_srls_count) |
|
| 86 | 86 | { |
| 87 | 87 | $columnList = array('module_srl', 'mid', 'browser_title'); |
| 88 | 88 | $module_output = $oModuleModel->getModulesInfo($mod_srls, $columnList); |
| 89 | - if($module_output && is_array($module_output)) |
|
| 89 | + if ($module_output && is_array($module_output)) |
|
| 90 | 90 | { |
| 91 | - foreach($module_output as $module) |
|
| 91 | + foreach ($module_output as $module) |
|
| 92 | 92 | { |
| 93 | 93 | $module_list[$module->module_srl] = $module; |
| 94 | 94 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | Context::set('module_list', $module_list); |
| 98 | 98 | |
| 99 | 99 | // Specify a template |
| 100 | - $this->setTemplatePath($this->module_path.'tpl'); |
|
| 100 | + $this->setTemplatePath($this->module_path . 'tpl'); |
|
| 101 | 101 | $this->setTemplateFile('document_list'); |
| 102 | 102 | } |
| 103 | 103 | |
@@ -109,10 +109,10 @@ discard block |
||
| 109 | 109 | { |
| 110 | 110 | $oDocumentModel = getModel('document'); |
| 111 | 111 | $config = $oDocumentModel->getDocumentConfig(); |
| 112 | - Context::set('config',$config); |
|
| 112 | + Context::set('config', $config); |
|
| 113 | 113 | |
| 114 | 114 | // Set the template file |
| 115 | - $this->setTemplatePath($this->module_path.'tpl'); |
|
| 115 | + $this->setTemplatePath($this->module_path . 'tpl'); |
|
| 116 | 116 | $this->setTemplateFile('document_config'); |
| 117 | 117 | } |
| 118 | 118 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | function dispDocumentAdminDeclared() |
| 124 | 124 | { |
| 125 | 125 | // option for a list |
| 126 | - $args =new stdClass(); |
|
| 126 | + $args = new stdClass(); |
|
| 127 | 127 | $args->page = Context::get('page'); // /< Page |
| 128 | 128 | $args->list_count = 30; // /< the number of posts to display on a single page |
| 129 | 129 | $args->page_count = 10; // /< the number of pages that appear in the page navigation |
@@ -137,11 +137,11 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | // get a list |
| 139 | 139 | $declared_output = executeQuery('document.getDeclaredList', $args); |
| 140 | - if($declared_output->data && count($declared_output->data)) |
|
| 140 | + if ($declared_output->data && count($declared_output->data)) |
|
| 141 | 141 | { |
| 142 | 142 | $document_list = array(); |
| 143 | 143 | |
| 144 | - foreach($declared_output->data as $key => $document) |
|
| 144 | + foreach ($declared_output->data as $key => $document) |
|
| 145 | 145 | { |
| 146 | 146 | $document_list[$key] = new documentItem(); |
| 147 | 147 | $document_list[$key]->setAttribute($document); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | Context::set('page_navigation', $declared_output->page_navigation); |
| 158 | 158 | Context::set('status_name_list', $statusNameList); |
| 159 | 159 | // Set the template |
| 160 | - $this->setTemplatePath($this->module_path.'tpl'); |
|
| 160 | + $this->setTemplatePath($this->module_path . 'tpl'); |
|
| 161 | 161 | $this->setTemplateFile('declared_list'); |
| 162 | 162 | } |
| 163 | 163 | |
@@ -168,15 +168,15 @@ discard block |
||
| 168 | 168 | function dispDocumentAdminAlias() |
| 169 | 169 | { |
| 170 | 170 | $args->document_srl = Context::get('document_srl'); |
| 171 | - if(!$args->document_srl) return $this->dispDocumentAdminList(); |
|
| 171 | + if (!$args->document_srl) return $this->dispDocumentAdminList(); |
|
| 172 | 172 | |
| 173 | 173 | $oModel = getModel('document'); |
| 174 | 174 | $oDocument = $oModel->getDocument($args->document_srl); |
| 175 | - if(!$oDocument->isExists()) return $this->dispDocumentAdminList(); |
|
| 175 | + if (!$oDocument->isExists()) return $this->dispDocumentAdminList(); |
|
| 176 | 176 | Context::set('oDocument', $oDocument); |
| 177 | 177 | |
| 178 | 178 | $output = executeQueryArray('document.getAliases', $args); |
| 179 | - if(!$output->data) |
|
| 179 | + if (!$output->data) |
|
| 180 | 180 | { |
| 181 | 181 | $aliases = array(); |
| 182 | 182 | } |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | Context::set('aliases', $aliases); |
| 189 | 189 | |
| 190 | - $this->setTemplatePath($this->module_path.'tpl'); |
|
| 190 | + $this->setTemplatePath($this->module_path . 'tpl'); |
|
| 191 | 191 | $this->setTemplateFile('document_alias'); |
| 192 | 192 | } |
| 193 | 193 | |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | Context::set('document_list', $output->data); |
| 219 | 219 | Context::set('page_navigation', $output->page_navigation); |
| 220 | 220 | // set the template |
| 221 | - $this->setTemplatePath($this->module_path.'tpl'); |
|
| 221 | + $this->setTemplatePath($this->module_path . 'tpl'); |
|
| 222 | 222 | $this->setTemplateFile('document_trash_list'); |
| 223 | 223 | } |
| 224 | 224 | } |
@@ -168,19 +168,22 @@ |
||
| 168 | 168 | function dispDocumentAdminAlias() |
| 169 | 169 | { |
| 170 | 170 | $args->document_srl = Context::get('document_srl'); |
| 171 | - if(!$args->document_srl) return $this->dispDocumentAdminList(); |
|
| 171 | + if(!$args->document_srl) { |
|
| 172 | + return $this->dispDocumentAdminList(); |
|
| 173 | + } |
|
| 172 | 174 | |
| 173 | 175 | $oModel = getModel('document'); |
| 174 | 176 | $oDocument = $oModel->getDocument($args->document_srl); |
| 175 | - if(!$oDocument->isExists()) return $this->dispDocumentAdminList(); |
|
| 177 | + if(!$oDocument->isExists()) { |
|
| 178 | + return $this->dispDocumentAdminList(); |
|
| 179 | + } |
|
| 176 | 180 | Context::set('oDocument', $oDocument); |
| 177 | 181 | |
| 178 | 182 | $output = executeQueryArray('document.getAliases', $args); |
| 179 | 183 | if(!$output->data) |
| 180 | 184 | { |
| 181 | 185 | $aliases = array(); |
| 182 | - } |
|
| 183 | - else |
|
| 186 | + } else |
|
| 184 | 187 | { |
| 185 | 188 | $aliases = $output->data; |
| 186 | 189 | } |