@@ -18,8 +18,12 @@ discard block |
||
18 | 18 | // Get configurations (using module model object) |
19 | 19 | $oModuleModel = getModel('module'); |
20 | 20 | $config = $oModuleModel->getModuleConfig('message'); |
21 | - if(!is_object($config)) $config = new stdClass; |
|
22 | - if(!$config->mskin) $config->mskin = 'default'; |
|
21 | + if(!is_object($config)) { |
|
22 | + $config = new stdClass; |
|
23 | + } |
|
24 | + if(!$config->mskin) { |
|
25 | + $config->mskin = 'default'; |
|
26 | + } |
|
23 | 27 | // Set the template path |
24 | 28 | $template_path = sprintf('%sm.skins/%s', $this->module_path, $config->mskin); |
25 | 29 | // Get the member configuration |
@@ -30,7 +34,9 @@ discard block |
||
30 | 34 | $ssl_mode = false; |
31 | 35 | if($member_config->enable_ssl == 'Y') |
32 | 36 | { |
33 | - if(strncasecmp('https://', Context::getRequestUri(), 8) === 0) $ssl_mode = true; |
|
37 | + if(strncasecmp('https://', Context::getRequestUri(), 8) === 0) { |
|
38 | + $ssl_mode = true; |
|
39 | + } |
|
34 | 40 | } |
35 | 41 | Context::set('ssl_mode',$ssl_mode); |
36 | 42 |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | // Get configurations (using module model object) |
19 | 19 | $oModuleModel = getModel('module'); |
20 | 20 | $config = $oModuleModel->getModuleConfig('message'); |
21 | - if(!is_object($config)) $config = new stdClass; |
|
22 | - if(!$config->mskin) $config->mskin = 'default'; |
|
21 | + if (!is_object($config)) $config = new stdClass; |
|
22 | + if (!$config->mskin) $config->mskin = 'default'; |
|
23 | 23 | // Set the template path |
24 | 24 | $template_path = sprintf('%sm.skins/%s', $this->module_path, $config->mskin); |
25 | 25 | // Get the member configuration |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | Context::set('member_config', $member_config); |
29 | 29 | // Set a flag to check if the https connection is made when using SSL and create https url |
30 | 30 | $ssl_mode = false; |
31 | - if($member_config->enable_ssl == 'Y') |
|
31 | + if ($member_config->enable_ssl == 'Y') |
|
32 | 32 | { |
33 | - if(strncasecmp('https://', Context::getRequestUri(), 8) === 0) $ssl_mode = true; |
|
33 | + if (strncasecmp('https://', Context::getRequestUri(), 8) === 0) $ssl_mode = true; |
|
34 | 34 | } |
35 | - Context::set('ssl_mode',$ssl_mode); |
|
35 | + Context::set('ssl_mode', $ssl_mode); |
|
36 | 36 | |
37 | 37 | Context::set('system_message', nl2br($this->getMessage())); |
38 | 38 |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | $oModuleModel = getModel('module'); |
24 | 24 | $this->module_config = $config = $oModuleModel->getModuleConfig('message', $this->module_info->site_srl); |
25 | 25 | |
26 | - if(!$config) |
|
26 | + if (!$config) |
|
27 | 27 | { |
28 | 28 | $config = new stdClass(); |
29 | 29 | } |
30 | 30 | |
31 | - if(!$config->skin) |
|
31 | + if (!$config->skin) |
|
32 | 32 | { |
33 | 33 | $config->skin = 'xedition'; |
34 | 34 | $template_path = sprintf('%sskins/%s', $this->module_path, $config->skin); |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | Context::set('member_config', $member_config); |
55 | 55 | // Set a flag to check if the https connection is made when using SSL and create https url |
56 | 56 | $ssl_mode = false; |
57 | - if($member_config->enable_ssl == 'Y') |
|
57 | + if ($member_config->enable_ssl == 'Y') |
|
58 | 58 | { |
59 | - if(strncasecmp('https://', Context::getRequestUri(), 8) === 0) $ssl_mode = true; |
|
59 | + if (strncasecmp('https://', Context::getRequestUri(), 8) === 0) $ssl_mode = true; |
|
60 | 60 | } |
61 | - Context::set('ssl_mode',$ssl_mode); |
|
61 | + Context::set('ssl_mode', $ssl_mode); |
|
62 | 62 | |
63 | 63 | Context::set('system_message', nl2br($this->getMessage())); |
64 | 64 |
@@ -32,16 +32,14 @@ discard block |
||
32 | 32 | { |
33 | 33 | $config->skin = 'xedition'; |
34 | 34 | $template_path = sprintf('%sskins/%s', $this->module_path, $config->skin); |
35 | - } |
|
36 | - else |
|
35 | + } else |
|
37 | 36 | { |
38 | 37 | //check theme |
39 | 38 | $config_parse = explode('|@|', $config->skin); |
40 | 39 | if (count($config_parse) > 1) |
41 | 40 | { |
42 | 41 | $template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]); |
43 | - } |
|
44 | - else |
|
42 | + } else |
|
45 | 43 | { |
46 | 44 | $template_path = sprintf('%sskins/%s', $this->module_path, $config->skin); |
47 | 45 | } |
@@ -56,7 +54,9 @@ discard block |
||
56 | 54 | $ssl_mode = false; |
57 | 55 | if($member_config->enable_ssl == 'Y') |
58 | 56 | { |
59 | - if(strncasecmp('https://', Context::getRequestUri(), 8) === 0) $ssl_mode = true; |
|
57 | + if(strncasecmp('https://', Context::getRequestUri(), 8) === 0) { |
|
58 | + $ssl_mode = true; |
|
59 | + } |
|
60 | 60 | } |
61 | 61 | Context::set('ssl_mode',$ssl_mode); |
62 | 62 |
@@ -4,7 +4,7 @@ |
||
4 | 4 | { |
5 | 5 | function dispModuleChangeLang() |
6 | 6 | { |
7 | - $this->setTemplatePath(sprintf("%stpl/",$this->module_path)); |
|
7 | + $this->setTemplatePath(sprintf("%stpl/", $this->module_path)); |
|
8 | 8 | $this->setTemplateFile('lang.html'); |
9 | 9 | } |
10 | 10 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | $oWidgetController->triggerWidgetCompile($page_content); |
21 | 21 | Context::setResponseMethod($requestMethod); |
22 | 22 | |
23 | - $oModule->add('page_content',$page_content); |
|
23 | + $oModule->add('page_content', $page_content); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 | /* End of file page.api.php */ |
@@ -37,7 +37,9 @@ discard block |
||
37 | 37 | for($i=0;$i<count($link_buff[0]);$i++) |
38 | 38 | { |
39 | 39 | $tmp_str = trim($link_buff[0][$i]); |
40 | - if(!$tmp_str) continue; |
|
40 | + if(!$tmp_str) { |
|
41 | + continue; |
|
42 | + } |
|
41 | 43 | $header_script .= $tmp_str."\n"; |
42 | 44 | } |
43 | 45 | |
@@ -45,7 +47,9 @@ discard block |
||
45 | 47 | for($i=0;$i<count($script_buff[0]);$i++) |
46 | 48 | { |
47 | 49 | $tmp_str = trim($script_buff[0][$i]); |
48 | - if(!$tmp_str) continue; |
|
50 | + if(!$tmp_str) { |
|
51 | + continue; |
|
52 | + } |
|
49 | 53 | $header_script .= $tmp_str."\n"; |
50 | 54 | } |
51 | 55 | |
@@ -75,17 +79,23 @@ discard block |
||
75 | 79 | $host = sprintf("%s://%s%s",$url_info['scheme'],$url_info['host'],$url_info['port']?':'.$url_info['port']:''); |
76 | 80 | $this->host = $host.'/'; |
77 | 81 | $path = $url_info['path']; |
78 | - if(substr($path,-1)=='/') $path = substr($path,-1); |
|
82 | + if(substr($path,-1)=='/') { |
|
83 | + $path = substr($path,-1); |
|
84 | + } |
|
79 | 85 | $t = explode('/',$path); |
80 | 86 | $_t = array(); |
81 | 87 | for($i=0,$c=count($t)-1;$i<$c;$i++) |
82 | 88 | { |
83 | 89 | $v = trim($t[$i]); |
84 | - if(!$v) continue; |
|
90 | + if(!$v) { |
|
91 | + continue; |
|
92 | + } |
|
85 | 93 | $_t[] = $v; |
86 | 94 | } |
87 | 95 | $path = $host.'/'.implode('/',$_t); |
88 | - if(substr($path,-1)!='/') $path .= '/'; |
|
96 | + if(substr($path,-1)!='/') { |
|
97 | + $path .= '/'; |
|
98 | + } |
|
89 | 99 | $this->path = $path; |
90 | 100 | $content = preg_replace_callback('/(src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is',array($this,'_replacePath'),$content); |
91 | 101 | |
@@ -95,16 +105,16 @@ discard block |
||
95 | 105 | function _replacePath($matches) |
96 | 106 | { |
97 | 107 | $val = trim($matches[3]); |
98 | - if(preg_match('/^(http|https|ftp|telnet|mms|mailto)/i',$val)) return $matches[0]; |
|
108 | + if(preg_match('/^(http|https|ftp|telnet|mms|mailto)/i',$val)) { |
|
109 | + return $matches[0]; |
|
110 | + } |
|
99 | 111 | if(substr($val,0,2)=='./') |
100 | 112 | { |
101 | 113 | $path = $this->path.substr($val,2); |
102 | - } |
|
103 | - elseif(substr($val,0,1)=='/') |
|
114 | + } elseif(substr($val,0,1)=='/') |
|
104 | 115 | { |
105 | 116 | $path = $this->host.substr($val,1); |
106 | - } |
|
107 | - else |
|
117 | + } else |
|
108 | 118 | { |
109 | 119 | $path = $this->path.$val; |
110 | 120 | } |
@@ -29,24 +29,24 @@ discard block |
||
29 | 29 | function getHeadScript($content) |
30 | 30 | { |
31 | 31 | // remove the title tag |
32 | - $content = preg_replace('!<title([^>]*)>(.*?)<\/title>!is','', $content); |
|
32 | + $content = preg_replace('!<title([^>]*)>(.*?)<\/title>!is', '', $content); |
|
33 | 33 | // Remove meta tags |
34 | - $content = preg_replace('!<(\/){0,1}meta([^>]*)>!is','', $content); |
|
34 | + $content = preg_replace('!<(\/){0,1}meta([^>]*)>!is', '', $content); |
|
35 | 35 | // Extract information such as <link, <style, <script and so on |
36 | 36 | preg_match_all('!<link([^>]*)>!is', $content, $link_buff); |
37 | - for($i=0;$i<count($link_buff[0]);$i++) |
|
37 | + for ($i = 0; $i < count($link_buff[0]); $i++) |
|
38 | 38 | { |
39 | 39 | $tmp_str = trim($link_buff[0][$i]); |
40 | - if(!$tmp_str) continue; |
|
41 | - $header_script .= $tmp_str."\n"; |
|
40 | + if (!$tmp_str) continue; |
|
41 | + $header_script .= $tmp_str."\n"; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | preg_match_all('!<(style|script)(.*?)<\/(style|script)>!is', $content, $script_buff); |
45 | - for($i=0;$i<count($script_buff[0]);$i++) |
|
45 | + for ($i = 0; $i < count($script_buff[0]); $i++) |
|
46 | 46 | { |
47 | 47 | $tmp_str = trim($script_buff[0][$i]); |
48 | - if(!$tmp_str) continue; |
|
49 | - $header_script .= $tmp_str."\n"; |
|
48 | + if (!$tmp_str) continue; |
|
49 | + $header_script .= $tmp_str."\n"; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | return $header_script; |
@@ -72,22 +72,22 @@ discard block |
||
72 | 72 | function replaceSrc($content, $path) |
73 | 73 | { |
74 | 74 | $url_info = parse_url($path); |
75 | - $host = sprintf("%s://%s%s",$url_info['scheme'],$url_info['host'],$url_info['port']?':'.$url_info['port']:''); |
|
75 | + $host = sprintf("%s://%s%s", $url_info['scheme'], $url_info['host'], $url_info['port'] ? ':'.$url_info['port'] : ''); |
|
76 | 76 | $this->host = $host.'/'; |
77 | 77 | $path = $url_info['path']; |
78 | - if(substr($path,-1)=='/') $path = substr($path,-1); |
|
79 | - $t = explode('/',$path); |
|
78 | + if (substr($path, -1) == '/') $path = substr($path, -1); |
|
79 | + $t = explode('/', $path); |
|
80 | 80 | $_t = array(); |
81 | - for($i=0,$c=count($t)-1;$i<$c;$i++) |
|
81 | + for ($i = 0, $c = count($t) - 1; $i < $c; $i++) |
|
82 | 82 | { |
83 | 83 | $v = trim($t[$i]); |
84 | - if(!$v) continue; |
|
84 | + if (!$v) continue; |
|
85 | 85 | $_t[] = $v; |
86 | 86 | } |
87 | - $path = $host.'/'.implode('/',$_t); |
|
88 | - if(substr($path,-1)!='/') $path .= '/'; |
|
87 | + $path = $host.'/'.implode('/', $_t); |
|
88 | + if (substr($path, -1) != '/') $path .= '/'; |
|
89 | 89 | $this->path = $path; |
90 | - $content = preg_replace_callback('/(src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is',array($this,'_replacePath'),$content); |
|
90 | + $content = preg_replace_callback('/(src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is', array($this, '_replacePath'), $content); |
|
91 | 91 | |
92 | 92 | return $content; |
93 | 93 | } |
@@ -95,14 +95,14 @@ discard block |
||
95 | 95 | function _replacePath($matches) |
96 | 96 | { |
97 | 97 | $val = trim($matches[3]); |
98 | - if(preg_match('/^(http|https|ftp|telnet|mms|mailto)/i',$val)) return $matches[0]; |
|
99 | - if(substr($val,0,2)=='./') |
|
98 | + if (preg_match('/^(http|https|ftp|telnet|mms|mailto)/i', $val)) return $matches[0]; |
|
99 | + if (substr($val, 0, 2) == './') |
|
100 | 100 | { |
101 | - $path = $this->path.substr($val,2); |
|
101 | + $path = $this->path.substr($val, 2); |
|
102 | 102 | } |
103 | - elseif(substr($val,0,1)=='/') |
|
103 | + elseif (substr($val, 0, 1) == '/') |
|
104 | 104 | { |
105 | - $path = $this->host.substr($val,1); |
|
105 | + $path = $this->host.substr($val, 1); |
|
106 | 106 | } |
107 | 107 | else |
108 | 108 | { |
@@ -15,7 +15,7 @@ |
||
15 | 15 | function procWAP(&$oMobile) |
16 | 16 | { |
17 | 17 | // Check permissions |
18 | - if(!$this->grant->access) return $oMobile->setContent(Context::getLang('msg_not_permitted')); |
|
18 | + if (!$this->grant->access) return $oMobile->setContent(Context::getLang('msg_not_permitted')); |
|
19 | 19 | // The contents of the widget chuchulham |
20 | 20 | $oWidgetController = getController('widget'); |
21 | 21 | $content = $oWidgetController->transWidgetCode($this->module_info->content); |
@@ -15,7 +15,9 @@ |
||
15 | 15 | function procWAP(&$oMobile) |
16 | 16 | { |
17 | 17 | // Check permissions |
18 | - if(!$this->grant->access) return $oMobile->setContent(Context::getLang('msg_not_permitted')); |
|
18 | + if(!$this->grant->access) { |
|
19 | + return $oMobile->setContent(Context::getLang('msg_not_permitted')); |
|
20 | + } |
|
19 | 21 | // The contents of the widget chuchulham |
20 | 22 | $oWidgetController = getController('widget'); |
21 | 23 | $content = $oWidgetController->transWidgetCode($this->module_info->content); |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | $config->able_module = 'N'; |
25 | 25 | $config->max_level = 30; |
26 | 26 | // Per-level score |
27 | - for($i=1;$i<=30;$i++) |
|
27 | + for ($i = 1; $i <= 30; $i++) |
|
28 | 28 | { |
29 | - $config->level_step[$i] = pow($i,2)*90; |
|
29 | + $config->level_step[$i] = pow($i, 2) * 90; |
|
30 | 30 | } |
31 | 31 | // Points for registration |
32 | 32 | $config->signup_point = 10; |
@@ -84,29 +84,29 @@ discard block |
||
84 | 84 | |
85 | 85 | $config = $oModuleModel->getModuleConfig('point'); |
86 | 86 | // check if module is abled |
87 | - if($config->able_module != 'N') |
|
87 | + if ($config->able_module != 'N') |
|
88 | 88 | { |
89 | 89 | // Add a trigger for registration/insert document/insert comment/upload a file/download |
90 | - if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) return true; |
|
91 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) return true; |
|
92 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) return true; |
|
93 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) return true; |
|
94 | - if(!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) return true; |
|
95 | - if(!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) return true; |
|
96 | - if(!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) return true; |
|
97 | - if(!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) return true; |
|
98 | - if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) return true; |
|
99 | - if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) return true; |
|
100 | - if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) return true; |
|
101 | - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) return true; |
|
102 | - if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) return true; |
|
90 | + if (!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) return true; |
|
91 | + if (!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) return true; |
|
92 | + if (!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) return true; |
|
93 | + if (!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) return true; |
|
94 | + if (!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) return true; |
|
95 | + if (!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) return true; |
|
96 | + if (!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) return true; |
|
97 | + if (!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) return true; |
|
98 | + if (!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) return true; |
|
99 | + if (!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) return true; |
|
100 | + if (!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) return true; |
|
101 | + if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) return true; |
|
102 | + if (!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) return true; |
|
103 | 103 | // Add a trigger for voting up and down 2008.05.13 haneul |
104 | - if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) return true; |
|
104 | + if (!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) return true; |
|
105 | 105 | // Add a trigger for using points for permanent saving of a temporarily saved document 2009.05.19 zero |
106 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) return true; |
|
106 | + if (!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) return true; |
|
107 | 107 | |
108 | 108 | // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied |
109 | - if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after')) return true; |
|
109 | + if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after')) return true; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | return false; |
@@ -121,40 +121,40 @@ discard block |
||
121 | 121 | $oModuleModel = getModel('module'); |
122 | 122 | $oModuleController = getController('module'); |
123 | 123 | // Add a trigger for registration/insert document/insert comment/upload a file/download |
124 | - if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) |
|
124 | + if (!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) |
|
125 | 125 | $oModuleController->insertTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after'); |
126 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) |
|
126 | + if (!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) |
|
127 | 127 | $oModuleController->insertTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after'); |
128 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) |
|
128 | + if (!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) |
|
129 | 129 | $oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before'); |
130 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) |
|
130 | + if (!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) |
|
131 | 131 | $oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after'); |
132 | - if(!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) |
|
132 | + if (!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) |
|
133 | 133 | $oModuleController->insertTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after'); |
134 | - if(!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) |
|
134 | + if (!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) |
|
135 | 135 | $oModuleController->insertTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after'); |
136 | - if(!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) |
|
136 | + if (!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) |
|
137 | 137 | $oModuleController->insertTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after'); |
138 | - if(!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) |
|
138 | + if (!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) |
|
139 | 139 | $oModuleController->insertTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after'); |
140 | - if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) |
|
140 | + if (!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) |
|
141 | 141 | $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before'); |
142 | - if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) |
|
142 | + if (!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) |
|
143 | 143 | $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after'); |
144 | - if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) |
|
144 | + if (!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) |
|
145 | 145 | $oModuleController->insertTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after'); |
146 | - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) |
|
146 | + if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) |
|
147 | 147 | $oModuleController->insertTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after'); |
148 | - if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) |
|
148 | + if (!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) |
|
149 | 149 | $oModuleController->insertTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after'); |
150 | 150 | // Add a trigger for voting up and down 2008.05.13 haneul |
151 | - if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) |
|
151 | + if (!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) |
|
152 | 152 | $oModuleController->insertTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after'); |
153 | 153 | // Add a trigger for using points for permanent saving of a temporarily saved document 2009.05.19 zero |
154 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) |
|
154 | + if (!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) |
|
155 | 155 | $oModuleController->insertTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before'); |
156 | 156 | // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied |
157 | - if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after')) |
|
157 | + if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after')) |
|
158 | 158 | { |
159 | 159 | $oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after'); |
160 | 160 | } |
@@ -87,26 +87,58 @@ discard block |
||
87 | 87 | if($config->able_module != 'N') |
88 | 88 | { |
89 | 89 | // Add a trigger for registration/insert document/insert comment/upload a file/download |
90 | - if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) return true; |
|
91 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) return true; |
|
92 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) return true; |
|
93 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) return true; |
|
94 | - if(!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) return true; |
|
95 | - if(!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) return true; |
|
96 | - if(!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) return true; |
|
97 | - if(!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) return true; |
|
98 | - if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) return true; |
|
99 | - if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) return true; |
|
100 | - if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) return true; |
|
101 | - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) return true; |
|
102 | - if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) return true; |
|
90 | + if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) { |
|
91 | + return true; |
|
92 | + } |
|
93 | + if(!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) { |
|
94 | + return true; |
|
95 | + } |
|
96 | + if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) { |
|
97 | + return true; |
|
98 | + } |
|
99 | + if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) { |
|
100 | + return true; |
|
101 | + } |
|
102 | + if(!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) { |
|
103 | + return true; |
|
104 | + } |
|
105 | + if(!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) { |
|
106 | + return true; |
|
107 | + } |
|
108 | + if(!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) { |
|
109 | + return true; |
|
110 | + } |
|
111 | + if(!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) { |
|
112 | + return true; |
|
113 | + } |
|
114 | + if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) { |
|
115 | + return true; |
|
116 | + } |
|
117 | + if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) { |
|
118 | + return true; |
|
119 | + } |
|
120 | + if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) { |
|
121 | + return true; |
|
122 | + } |
|
123 | + if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) { |
|
124 | + return true; |
|
125 | + } |
|
126 | + if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) { |
|
127 | + return true; |
|
128 | + } |
|
103 | 129 | // Add a trigger for voting up and down 2008.05.13 haneul |
104 | - if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) return true; |
|
130 | + if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) { |
|
131 | + return true; |
|
132 | + } |
|
105 | 133 | // Add a trigger for using points for permanent saving of a temporarily saved document 2009.05.19 zero |
106 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) return true; |
|
134 | + if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) { |
|
135 | + return true; |
|
136 | + } |
|
107 | 137 | |
108 | 138 | // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied |
109 | - if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after')) return true; |
|
139 | + if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after')) { |
|
140 | + return true; |
|
141 | + } |
|
110 | 142 | } |
111 | 143 | |
112 | 144 | return false; |
@@ -121,38 +153,53 @@ discard block |
||
121 | 153 | $oModuleModel = getModel('module'); |
122 | 154 | $oModuleController = getController('module'); |
123 | 155 | // Add a trigger for registration/insert document/insert comment/upload a file/download |
124 | - if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) |
|
125 | - $oModuleController->insertTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after'); |
|
126 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) |
|
127 | - $oModuleController->insertTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after'); |
|
128 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) |
|
129 | - $oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before'); |
|
130 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) |
|
131 | - $oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after'); |
|
132 | - if(!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) |
|
133 | - $oModuleController->insertTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after'); |
|
134 | - if(!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) |
|
135 | - $oModuleController->insertTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after'); |
|
136 | - if(!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) |
|
137 | - $oModuleController->insertTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after'); |
|
138 | - if(!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) |
|
139 | - $oModuleController->insertTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after'); |
|
140 | - if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) |
|
141 | - $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before'); |
|
142 | - if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) |
|
143 | - $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after'); |
|
144 | - if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) |
|
145 | - $oModuleController->insertTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after'); |
|
146 | - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) |
|
147 | - $oModuleController->insertTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after'); |
|
148 | - if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) |
|
149 | - $oModuleController->insertTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after'); |
|
156 | + if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) { |
|
157 | + $oModuleController->insertTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after'); |
|
158 | + } |
|
159 | + if(!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) { |
|
160 | + $oModuleController->insertTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after'); |
|
161 | + } |
|
162 | + if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) { |
|
163 | + $oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before'); |
|
164 | + } |
|
165 | + if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) { |
|
166 | + $oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after'); |
|
167 | + } |
|
168 | + if(!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) { |
|
169 | + $oModuleController->insertTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after'); |
|
170 | + } |
|
171 | + if(!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) { |
|
172 | + $oModuleController->insertTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after'); |
|
173 | + } |
|
174 | + if(!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) { |
|
175 | + $oModuleController->insertTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after'); |
|
176 | + } |
|
177 | + if(!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) { |
|
178 | + $oModuleController->insertTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after'); |
|
179 | + } |
|
180 | + if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) { |
|
181 | + $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before'); |
|
182 | + } |
|
183 | + if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) { |
|
184 | + $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after'); |
|
185 | + } |
|
186 | + if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) { |
|
187 | + $oModuleController->insertTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after'); |
|
188 | + } |
|
189 | + if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) { |
|
190 | + $oModuleController->insertTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after'); |
|
191 | + } |
|
192 | + if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) { |
|
193 | + $oModuleController->insertTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after'); |
|
194 | + } |
|
150 | 195 | // Add a trigger for voting up and down 2008.05.13 haneul |
151 | - if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) |
|
152 | - $oModuleController->insertTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after'); |
|
196 | + if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) { |
|
197 | + $oModuleController->insertTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after'); |
|
198 | + } |
|
153 | 199 | // Add a trigger for using points for permanent saving of a temporarily saved document 2009.05.19 zero |
154 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) |
|
155 | - $oModuleController->insertTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before'); |
|
200 | + if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) { |
|
201 | + $oModuleController->insertTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before'); |
|
202 | + } |
|
156 | 203 | // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied |
157 | 204 | if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after')) |
158 | 205 | { |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | function getPollList($args) |
21 | 21 | { |
22 | 22 | $output = executeQueryArray('poll.getPollList', $args); |
23 | - if(!$output->toBool()) return $output; |
|
23 | + if (!$output->toBool()) return $output; |
|
24 | 24 | |
25 | 25 | //if($output->data && !is_array($output->data)) $output->data = array($output->data); |
26 | 26 | return $output; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | function getPollListWithMember($args) |
33 | 33 | { |
34 | 34 | $output = executeQueryArray('poll.getPollListWithMember', $args); |
35 | - if(!$output->toBool()) return $output; |
|
35 | + if (!$output->toBool()) return $output; |
|
36 | 36 | |
37 | 37 | return $output; |
38 | 38 | } |
@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | |
51 | 51 | $oDocument = $oDocumentModel->getDocument($upload_target_srl); |
52 | 52 | |
53 | - if(!$oDocument->isExists()) $oComment = $oCommentModel->getComment($upload_target_srl); |
|
53 | + if (!$oDocument->isExists()) $oComment = $oCommentModel->getComment($upload_target_srl); |
|
54 | 54 | |
55 | - if($oComment && $oComment->isExists()) |
|
55 | + if ($oComment && $oComment->isExists()) |
|
56 | 56 | { |
57 | 57 | $this->add('document_srl', $oComment->get('document_srl')); |
58 | 58 | $this->add('comment_srl', $oComment->get('comment_srl')); |
59 | 59 | } |
60 | - elseif($oDocument->isExists()) |
|
60 | + elseif ($oDocument->isExists()) |
|
61 | 61 | { |
62 | 62 | $this->add('document_srl', $oDocument->get('document_srl')); |
63 | 63 | } |
@@ -20,7 +20,9 @@ discard block |
||
20 | 20 | function getPollList($args) |
21 | 21 | { |
22 | 22 | $output = executeQueryArray('poll.getPollList', $args); |
23 | - if(!$output->toBool()) return $output; |
|
23 | + if(!$output->toBool()) { |
|
24 | + return $output; |
|
25 | + } |
|
24 | 26 | |
25 | 27 | //if($output->data && !is_array($output->data)) $output->data = array($output->data); |
26 | 28 | return $output; |
@@ -32,7 +34,9 @@ discard block |
||
32 | 34 | function getPollListWithMember($args) |
33 | 35 | { |
34 | 36 | $output = executeQueryArray('poll.getPollListWithMember', $args); |
35 | - if(!$output->toBool()) return $output; |
|
37 | + if(!$output->toBool()) { |
|
38 | + return $output; |
|
39 | + } |
|
36 | 40 | |
37 | 41 | return $output; |
38 | 42 | } |
@@ -50,18 +54,20 @@ discard block |
||
50 | 54 | |
51 | 55 | $oDocument = $oDocumentModel->getDocument($upload_target_srl); |
52 | 56 | |
53 | - if(!$oDocument->isExists()) $oComment = $oCommentModel->getComment($upload_target_srl); |
|
57 | + if(!$oDocument->isExists()) { |
|
58 | + $oComment = $oCommentModel->getComment($upload_target_srl); |
|
59 | + } |
|
54 | 60 | |
55 | 61 | if($oComment && $oComment->isExists()) |
56 | 62 | { |
57 | 63 | $this->add('document_srl', $oComment->get('document_srl')); |
58 | 64 | $this->add('comment_srl', $oComment->get('comment_srl')); |
59 | - } |
|
60 | - elseif($oDocument->isExists()) |
|
65 | + } elseif($oDocument->isExists()) |
|
61 | 66 | { |
62 | 67 | $this->add('document_srl', $oDocument->get('document_srl')); |
68 | + } else { |
|
69 | + return new BaseObject(-1, 'msg_not_founded'); |
|
63 | 70 | } |
64 | - else return new BaseObject(-1, 'msg_not_founded'); |
|
65 | 71 | } |
66 | 72 | } |
67 | 73 | /* End of file poll.admin.model.php */ |
@@ -29,7 +29,9 @@ discard block |
||
29 | 29 | switch($search_target) |
30 | 30 | { |
31 | 31 | case 'title' : |
32 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
32 | + if($search_keyword) { |
|
33 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
34 | + } |
|
33 | 35 | $args->s_title= $search_keyword; |
34 | 36 | break; |
35 | 37 | case 'regdate' : |
@@ -62,17 +64,22 @@ discard block |
||
62 | 64 | |
63 | 65 | $oDocumentModel = getModel('document'); |
64 | 66 | $targetDocumentOutput = $oDocumentModel->getDocuments($uploadTargetSrlList); |
65 | - if(!is_array($targetDocumentOutput)) $targetDocumentOutput = array(); |
|
67 | + if(!is_array($targetDocumentOutput)) { |
|
68 | + $targetDocumentOutput = array(); |
|
69 | + } |
|
66 | 70 | |
67 | 71 | $oCommentModel = getModel('comment'); |
68 | 72 | $columnList = array('comment_srl', 'document_srl'); |
69 | 73 | $targetCommentOutput = $oCommentModel->getComments($uploadTargetSrlList, $columnList); |
70 | - if(!is_array($targetCommentOutput)) $targetCommentOutput = array(); |
|
74 | + if(!is_array($targetCommentOutput)) { |
|
75 | + $targetCommentOutput = array(); |
|
76 | + } |
|
71 | 77 | |
72 | 78 | foreach($output->data as $value) |
73 | 79 | { |
74 | - if(array_key_exists($value->upload_target_srl, $targetDocumentOutput)) |
|
75 | - $value->document_srl = $value->upload_target_srl; |
|
80 | + if(array_key_exists($value->upload_target_srl, $targetDocumentOutput)) { |
|
81 | + $value->document_srl = $value->upload_target_srl; |
|
82 | + } |
|
76 | 83 | |
77 | 84 | if(array_key_exists($value->upload_target_srl, $targetCommentOutput)) |
78 | 85 | { |
@@ -110,7 +117,9 @@ discard block |
||
110 | 117 | $skin_list = $oModuleModel->getSkins($this->module_path); |
111 | 118 | Context::set('skin_list', $skin_list); |
112 | 119 | |
113 | - if(!$skin_list[$config->skin]) $config->skin = "default"; |
|
120 | + if(!$skin_list[$config->skin]) { |
|
121 | + $config->skin = "default"; |
|
122 | + } |
|
114 | 123 | // Set the skin colorset once the configurations is completed |
115 | 124 | Context::set('colorset_list', $skin_list[$config->skin]->colorset); |
116 | 125 | |
@@ -137,7 +146,9 @@ discard block |
||
137 | 146 | $args->poll_index_srl = Context::get('poll_index_srl'); |
138 | 147 | |
139 | 148 | $output = executeQuery('poll.getPoll', $args); |
140 | - if(!$output->data) return $this->stop('msg_poll_not_exists'); |
|
149 | + if(!$output->data) { |
|
150 | + return $this->stop('msg_poll_not_exists'); |
|
151 | + } |
|
141 | 152 | |
142 | 153 | $poll = new stdClass(); |
143 | 154 | $poll->stop_date = $output->data->stop_date; |
@@ -24,19 +24,19 @@ discard block |
||
24 | 24 | $search_keyword = trim(Context::get('search_keyword')); |
25 | 25 | |
26 | 26 | $args = new stdClass(); |
27 | - if($search_target && $search_keyword) |
|
27 | + if ($search_target && $search_keyword) |
|
28 | 28 | { |
29 | - switch($search_target) |
|
29 | + switch ($search_target) |
|
30 | 30 | { |
31 | 31 | case 'title' : |
32 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
33 | - $args->s_title= $search_keyword; |
|
32 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
33 | + $args->s_title = $search_keyword; |
|
34 | 34 | break; |
35 | 35 | case 'regdate' : |
36 | 36 | $args->s_regdate = $search_keyword; |
37 | 37 | break; |
38 | 38 | case 'ipaddress' : |
39 | - $args->s_ipaddress= $search_keyword; |
|
39 | + $args->s_ipaddress = $search_keyword; |
|
40 | 40 | break; |
41 | 41 | } |
42 | 42 | } |
@@ -52,29 +52,29 @@ discard block |
||
52 | 52 | $output = $oPollAdminModel->getPollListWithMember($args); |
53 | 53 | |
54 | 54 | // check poll type. document or comment |
55 | - if(is_array($output->data)) |
|
55 | + if (is_array($output->data)) |
|
56 | 56 | { |
57 | 57 | $uploadTargetSrlList = array(); |
58 | - foreach($output->data as $value) |
|
58 | + foreach ($output->data as $value) |
|
59 | 59 | { |
60 | 60 | $uploadTargetSrlList[] = $value->upload_target_srl; |
61 | 61 | } |
62 | 62 | |
63 | 63 | $oDocumentModel = getModel('document'); |
64 | 64 | $targetDocumentOutput = $oDocumentModel->getDocuments($uploadTargetSrlList); |
65 | - if(!is_array($targetDocumentOutput)) $targetDocumentOutput = array(); |
|
65 | + if (!is_array($targetDocumentOutput)) $targetDocumentOutput = array(); |
|
66 | 66 | |
67 | 67 | $oCommentModel = getModel('comment'); |
68 | 68 | $columnList = array('comment_srl', 'document_srl'); |
69 | 69 | $targetCommentOutput = $oCommentModel->getComments($uploadTargetSrlList, $columnList); |
70 | - if(!is_array($targetCommentOutput)) $targetCommentOutput = array(); |
|
70 | + if (!is_array($targetCommentOutput)) $targetCommentOutput = array(); |
|
71 | 71 | |
72 | - foreach($output->data as $value) |
|
72 | + foreach ($output->data as $value) |
|
73 | 73 | { |
74 | - if(array_key_exists($value->upload_target_srl, $targetDocumentOutput)) |
|
74 | + if (array_key_exists($value->upload_target_srl, $targetDocumentOutput)) |
|
75 | 75 | $value->document_srl = $value->upload_target_srl; |
76 | 76 | |
77 | - if(array_key_exists($value->upload_target_srl, $targetCommentOutput)) |
|
77 | + if (array_key_exists($value->upload_target_srl, $targetCommentOutput)) |
|
78 | 78 | { |
79 | 79 | $value->comment_srl = $value->upload_target_srl; |
80 | 80 | $value->document_srl = $targetCommentOutput[$value->comment_srl]->document_srl; |
@@ -110,14 +110,14 @@ discard block |
||
110 | 110 | $skin_list = $oModuleModel->getSkins($this->module_path); |
111 | 111 | Context::set('skin_list', $skin_list); |
112 | 112 | |
113 | - if(!$skin_list[$config->skin]) $config->skin = "default"; |
|
113 | + if (!$skin_list[$config->skin]) $config->skin = "default"; |
|
114 | 114 | // Set the skin colorset once the configurations is completed |
115 | 115 | Context::set('colorset_list', $skin_list[$config->skin]->colorset); |
116 | 116 | |
117 | 117 | $security = new Security(); |
118 | 118 | $security->encodeHTML('config..'); |
119 | 119 | $security->encodeHTML('skin_list..title'); |
120 | - $security->encodeHTML('colorset_list..name','colorset_list..title'); |
|
120 | + $security->encodeHTML('colorset_list..name', 'colorset_list..title'); |
|
121 | 121 | |
122 | 122 | // Set a template |
123 | 123 | $this->setTemplatePath($this->module_path.'tpl'); |
@@ -137,14 +137,14 @@ discard block |
||
137 | 137 | $args->poll_index_srl = Context::get('poll_index_srl'); |
138 | 138 | |
139 | 139 | $output = executeQuery('poll.getPoll', $args); |
140 | - if(!$output->data) return $this->stop('msg_poll_not_exists'); |
|
140 | + if (!$output->data) return $this->stop('msg_poll_not_exists'); |
|
141 | 141 | |
142 | 142 | $poll = new stdClass(); |
143 | 143 | $poll->stop_date = $output->data->stop_date; |
144 | 144 | $poll->poll_count = $output->data->poll_count; |
145 | 145 | |
146 | 146 | $output = executeQuery('poll.getPollTitle', $args); |
147 | - if(!$output->data) |
|
147 | + if (!$output->data) |
|
148 | 148 | { |
149 | 149 | return $this->stop('msg_poll_not_exists'); |
150 | 150 | } |
@@ -155,14 +155,14 @@ discard block |
||
155 | 155 | $tmp->poll_count = $output->data->poll_count; |
156 | 156 | |
157 | 157 | $output = executeQuery('poll.getPollItem', $args); |
158 | - foreach($output->data as $val) |
|
158 | + foreach ($output->data as $val) |
|
159 | 159 | { |
160 | 160 | $tmp->item[] = $val; |
161 | 161 | } |
162 | 162 | |
163 | 163 | $poll->poll_srl = $poll_srl; |
164 | 164 | |
165 | - Context::set('poll',$poll); |
|
165 | + Context::set('poll', $poll); |
|
166 | 166 | // Configure the skin and the colorset for the default configuration |
167 | 167 | $oModuleModel = getModel('module'); |
168 | 168 | $poll_config = $oModuleModel->getModuleConfig('poll'); |