@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | { |
34 | 34 | $this->pipe = $pipe; |
35 | 35 | |
36 | - if(!is_array($conditions)) |
|
36 | + if (!is_array($conditions)) |
|
37 | 37 | { |
38 | 38 | $conditions = array($conditions); |
39 | 39 | } |
40 | 40 | |
41 | - foreach($conditions as $condition) |
|
41 | + foreach ($conditions as $condition) |
|
42 | 42 | { |
43 | 43 | //if($condition->node_name === 'query') $this->conditions[] = new QueryTag($condition, true); |
44 | 44 | $this->conditions[] = new ConditionTag($condition); |
@@ -56,21 +56,21 @@ discard block |
||
56 | 56 | */ |
57 | 57 | function getConditionGroupString() |
58 | 58 | { |
59 | - $conditions_string = 'array(' . PHP_EOL; |
|
60 | - foreach($this->conditions as $condition) |
|
59 | + $conditions_string = 'array('.PHP_EOL; |
|
60 | + foreach ($this->conditions as $condition) |
|
61 | 61 | { |
62 | - $conditions_string .= $condition->getConditionString() . PHP_EOL . ','; |
|
62 | + $conditions_string .= $condition->getConditionString().PHP_EOL.','; |
|
63 | 63 | } |
64 | 64 | $conditions_string = substr($conditions_string, 0, -2); //remove ',' |
65 | 65 | $conditions_string .= ')'; |
66 | 66 | |
67 | - return sprintf("new ConditionGroup(%s%s)", $conditions_string, $this->pipe ? ',\'' . $this->pipe . '\'' : ''); |
|
67 | + return sprintf("new ConditionGroup(%s%s)", $conditions_string, $this->pipe ? ',\''.$this->pipe.'\'' : ''); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | function getArguments() |
71 | 71 | { |
72 | 72 | $arguments = array(); |
73 | - foreach($this->conditions as $condition) |
|
73 | + foreach ($this->conditions as $condition) |
|
74 | 74 | { |
75 | 75 | $arguments = array_merge($arguments, $condition->getArguments()); |
76 | 76 | } |
@@ -25,42 +25,42 @@ discard block |
||
25 | 25 | function ConditionsTag($xml_conditions) |
26 | 26 | { |
27 | 27 | $this->condition_groups = array(); |
28 | - if(!$xml_conditions) |
|
28 | + if (!$xml_conditions) |
|
29 | 29 | { |
30 | 30 | return; |
31 | 31 | } |
32 | 32 | |
33 | 33 | $xml_condition_list = array(); |
34 | - if($xml_conditions->condition) |
|
34 | + if ($xml_conditions->condition) |
|
35 | 35 | { |
36 | 36 | $xml_condition_list = $xml_conditions->condition; |
37 | 37 | } |
38 | 38 | |
39 | - if($xml_conditions->query) |
|
39 | + if ($xml_conditions->query) |
|
40 | 40 | { |
41 | - if(!is_array($xml_condition_list)) |
|
41 | + if (!is_array($xml_condition_list)) |
|
42 | 42 | { |
43 | 43 | $xml_condition_list = array($xml_condition_list); |
44 | 44 | } |
45 | - if(!is_array($xml_conditions->query)) |
|
45 | + if (!is_array($xml_conditions->query)) |
|
46 | 46 | { |
47 | 47 | $xml_conditions->query = array($xml_conditions->query); |
48 | 48 | } |
49 | 49 | $xml_condition_list = array_merge($xml_condition_list, $xml_conditions->query); |
50 | 50 | } |
51 | - if($xml_condition_list) |
|
51 | + if ($xml_condition_list) |
|
52 | 52 | { |
53 | 53 | $this->condition_groups[] = new ConditionGroupTag($xml_condition_list); |
54 | 54 | } |
55 | 55 | |
56 | 56 | $xml_groups = $xml_conditions->group; |
57 | - if($xml_groups) |
|
57 | + if ($xml_groups) |
|
58 | 58 | { |
59 | - if(!is_array($xml_groups)) |
|
59 | + if (!is_array($xml_groups)) |
|
60 | 60 | { |
61 | 61 | $xml_groups = array($xml_groups); |
62 | 62 | } |
63 | - foreach($xml_groups as $group) |
|
63 | + foreach ($xml_groups as $group) |
|
64 | 64 | { |
65 | 65 | $this->condition_groups[] = new ConditionGroupTag($group->condition, $group->attrs->pipe); |
66 | 66 | } |
@@ -73,10 +73,10 @@ discard block |
||
73 | 73 | */ |
74 | 74 | function toString() |
75 | 75 | { |
76 | - $output_conditions = 'array(' . PHP_EOL; |
|
77 | - foreach($this->condition_groups as $condition) |
|
76 | + $output_conditions = 'array('.PHP_EOL; |
|
77 | + foreach ($this->condition_groups as $condition) |
|
78 | 78 | { |
79 | - $output_conditions .= $condition->getConditionGroupString() . PHP_EOL . ','; |
|
79 | + $output_conditions .= $condition->getConditionGroupString().PHP_EOL.','; |
|
80 | 80 | } |
81 | 81 | $output_conditions = substr($output_conditions, 0, -1); |
82 | 82 | $output_conditions .= ')'; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | function getArguments() |
87 | 87 | { |
88 | 88 | $arguments = array(); |
89 | - foreach($this->condition_groups as $condition) |
|
89 | + foreach ($this->condition_groups as $condition) |
|
90 | 90 | { |
91 | 91 | $arguments = array_merge($arguments, $condition->getArguments()); |
92 | 92 | } |
@@ -26,19 +26,19 @@ discard block |
||
26 | 26 | { |
27 | 27 | $this->groups = array(); |
28 | 28 | |
29 | - if($xml_groups) |
|
29 | + if ($xml_groups) |
|
30 | 30 | { |
31 | - if(!is_array($xml_groups)) |
|
31 | + if (!is_array($xml_groups)) |
|
32 | 32 | { |
33 | 33 | $xml_groups = array($xml_groups); |
34 | 34 | } |
35 | 35 | |
36 | 36 | $dbParser = &DB::getParser(); |
37 | - for($i = 0; $i < count($xml_groups); $i++) |
|
37 | + for ($i = 0; $i < count($xml_groups); $i++) |
|
38 | 38 | { |
39 | 39 | $group = $xml_groups[$i]; |
40 | 40 | $column = trim($group->attrs->column); |
41 | - if(!$column) |
|
41 | + if (!$column) |
|
42 | 42 | { |
43 | 43 | continue; |
44 | 44 | } |
@@ -51,10 +51,10 @@ discard block |
||
51 | 51 | |
52 | 52 | function toString() |
53 | 53 | { |
54 | - $output = 'array(' . PHP_EOL; |
|
55 | - foreach($this->groups as $group) |
|
54 | + $output = 'array('.PHP_EOL; |
|
55 | + foreach ($this->groups as $group) |
|
56 | 56 | { |
57 | - $output .= "'" . $group . "' ,"; |
|
57 | + $output .= "'".$group."' ,"; |
|
58 | 58 | } |
59 | 59 | $output = substr($output, 0, -1); |
60 | 60 | $output .= ')'; |
@@ -16,13 +16,13 @@ |
||
16 | 16 | */ |
17 | 17 | function toString() |
18 | 18 | { |
19 | - $arg = sprintf("\n" . '${\'%s_argument\'} = new SortArgument(\'%s\', %s);' . "\n" |
|
19 | + $arg = sprintf("\n".'${\'%s_argument\'} = new SortArgument(\'%s\', %s);'."\n" |
|
20 | 20 | , $this->argument_name |
21 | 21 | , $this->argument_name |
22 | - , '$args->' . $this->variable_name); |
|
22 | + , '$args->'.$this->variable_name); |
|
23 | 23 | $arg .= $this->argument_validator->toString(); |
24 | 24 | |
25 | - $arg .= sprintf('if(!${\'%s_argument\'}->isValid()) return ${\'%s_argument\'}->getErrorMessage();' . "\n" |
|
25 | + $arg .= sprintf('if(!${\'%s_argument\'}->isValid()) return ${\'%s_argument\'}->getErrorMessage();'."\n" |
|
26 | 26 | , $this->argument_name |
27 | 27 | , $this->argument_name |
28 | 28 | ); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | { |
71 | 71 | return $this->_is_string; |
72 | 72 | $str_pos = strpos($this->value, '('); |
73 | - if($str_pos === false) |
|
73 | + if ($str_pos === false) |
|
74 | 74 | { |
75 | 75 | return TRUE; |
76 | 76 | } |
@@ -99,31 +99,31 @@ discard block |
||
99 | 99 | |
100 | 100 | function _setValue() |
101 | 101 | { |
102 | - if(!isset($this->value)) |
|
102 | + if (!isset($this->value)) |
|
103 | 103 | { |
104 | 104 | return; |
105 | 105 | } |
106 | 106 | |
107 | 107 | // If value contains comma separated values and does not contain paranthesis |
108 | 108 | // -> default value is an array |
109 | - if(strpos($this->value, ',') !== FALSE && strpos($this->value, '(') === FALSE) |
|
109 | + if (strpos($this->value, ',') !== FALSE && strpos($this->value, '(') === FALSE) |
|
110 | 110 | { |
111 | 111 | return sprintf('array(%s)', $this->value); |
112 | 112 | } |
113 | 113 | |
114 | 114 | $str_pos = strpos($this->value, '('); |
115 | 115 | // // TODO Replace this with parseExpression |
116 | - if($str_pos === FALSE) |
|
116 | + if ($str_pos === FALSE) |
|
117 | 117 | { |
118 | 118 | $this->_is_string = TRUE; |
119 | - return '\'' . $this->value . '\''; |
|
119 | + return '\''.$this->value.'\''; |
|
120 | 120 | } |
121 | 121 | //if($str_pos===false) return $this->value; |
122 | 122 | |
123 | 123 | $func_name = substr($this->value, 0, $str_pos); |
124 | 124 | $args = substr($this->value, $str_pos + 1, -1); |
125 | 125 | |
126 | - switch($func_name) |
|
126 | + switch ($func_name) |
|
127 | 127 | { |
128 | 128 | case 'ipaddress' : |
129 | 129 | $val = '$_SERVER[\'REMOTE_ADDR\']'; |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $val = sprintf('%d', $args); |
160 | 160 | break; |
161 | 161 | default : |
162 | - $val = '\'' . $this->value . '\''; |
|
162 | + $val = '\''.$this->value.'\''; |
|
163 | 163 | //$val = $this->value; |
164 | 164 | } |
165 | 165 |
@@ -7,24 +7,24 @@ discard block |
||
7 | 7 | function pointLevelIconTrans($matches) |
8 | 8 | { |
9 | 9 | $member_srl = $matches[3]; |
10 | - if($member_srl < 1) |
|
10 | + if ($member_srl < 1) |
|
11 | 11 | { |
12 | 12 | return $matches[0]; |
13 | 13 | } |
14 | 14 | |
15 | - $orig_text = preg_replace('/' . preg_quote($matches[5], '/') . '<\/' . $matches[6] . '>$/', '', $matches[0]); |
|
15 | + $orig_text = preg_replace('/'.preg_quote($matches[5], '/').'<\/'.$matches[6].'>$/', '', $matches[0]); |
|
16 | 16 | |
17 | 17 | // Check Group Image Mark |
18 | 18 | $oMemberModel = getModel('member'); |
19 | - if($oMemberModel->getGroupImageMark($member_srl)) |
|
19 | + if ($oMemberModel->getGroupImageMark($member_srl)) |
|
20 | 20 | { |
21 | - return $orig_text . $matches[5] . '</' . $matches[6] . '>'; |
|
21 | + return $orig_text.$matches[5].'</'.$matches[6].'>'; |
|
22 | 22 | } |
23 | 23 | |
24 | - if(!isset($GLOBALS['_pointLevelIcon'][$member_srl])) |
|
24 | + if (!isset($GLOBALS['_pointLevelIcon'][$member_srl])) |
|
25 | 25 | { |
26 | 26 | // Get point configuration |
27 | - if(!$GLOBALS['_pointConfig']) |
|
27 | + if (!$GLOBALS['_pointConfig']) |
|
28 | 28 | { |
29 | 29 | $oModuleModel = getModel('module'); |
30 | 30 | $GLOBALS['_pointConfig'] = $oModuleModel->getModuleConfig('point'); |
@@ -32,14 +32,14 @@ discard block |
||
32 | 32 | $config = $GLOBALS['_pointConfig']; |
33 | 33 | |
34 | 34 | // Get point model |
35 | - if(!$GLOBALS['_pointModel']) |
|
35 | + if (!$GLOBALS['_pointModel']) |
|
36 | 36 | { |
37 | 37 | $GLOBALS['_pointModel'] = getModel('point'); |
38 | 38 | } |
39 | 39 | $oPointModel = &$GLOBALS['_pointModel']; |
40 | 40 | |
41 | 41 | // Get points |
42 | - if(!$oPointModel->isExistsPoint($member_srl)) |
|
42 | + if (!$oPointModel->isExistsPoint($member_srl)) |
|
43 | 43 | { |
44 | 44 | return $matches[0]; |
45 | 45 | } |
@@ -55,25 +55,25 @@ discard block |
||
55 | 55 | |
56 | 56 | // Get per to go to the next level if not a top level |
57 | 57 | $per = NULL; |
58 | - if($level < $config->max_level) |
|
58 | + if ($level < $config->max_level) |
|
59 | 59 | { |
60 | 60 | $next_point = $config->level_step[$level + 1]; |
61 | 61 | $present_point = $config->level_step[$level]; |
62 | - if($next_point > 0) |
|
62 | + if ($next_point > 0) |
|
63 | 63 | { |
64 | 64 | $per = (int) (($point - $present_point) / ($next_point - $present_point) * 100); |
65 | - $per = $per . '%'; |
|
65 | + $per = $per.'%'; |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | - $title = sprintf('%s:%s%s%s, %s:%s/%s', Context::getLang('point'), $point, $config->point_name, $per ? ' (' . $per . ')' : '', Context::getLang('level'), $level, $config->max_level); |
|
69 | + $title = sprintf('%s:%s%s%s, %s:%s/%s', Context::getLang('point'), $point, $config->point_name, $per ? ' ('.$per.')' : '', Context::getLang('level'), $level, $config->max_level); |
|
70 | 70 | $alt = sprintf('[%s:%s]', Context::getLang('level'), $level); |
71 | 71 | |
72 | 72 | $GLOBALS['_pointLevelIcon'][$member_srl] = sprintf('<img src="%s" alt="%s" title="%s" class="xe_point_level_icon" style="vertical-align:middle;margin-right:3px;" />', $level_icon, $alt, $title); |
73 | 73 | } |
74 | 74 | $text = $GLOBALS['_pointLevelIcon'][$member_srl]; |
75 | 75 | |
76 | - return $orig_text . $text . $matches[5] . '</' . $matches[6] . '>'; |
|
76 | + return $orig_text.$text.$matches[5].'</'.$matches[6].'>'; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /* End of file point_level_icon.lib.php */ |
@@ -63,7 +63,7 @@ |
||
63 | 63 | Context::set('group_list', $group_list); |
64 | 64 | |
65 | 65 | // specify a template |
66 | - $this->setTemplatePath($this->module_path . 'tpl'); |
|
66 | + $this->setTemplatePath($this->module_path.'tpl'); |
|
67 | 67 | $this->setTemplateFile('index'); |
68 | 68 | } |
69 | 69 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | function getCacheFilePath($type = "pc") |
27 | 27 | { |
28 | 28 | static $addon_file; |
29 | - if(isset($addon_file)) |
|
29 | + if (isset($addon_file)) |
|
30 | 30 | { |
31 | 31 | return $addon_file; |
32 | 32 | } |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | $site_module_info = Context::get('site_module_info'); |
35 | 35 | $site_srl = $site_module_info->site_srl; |
36 | 36 | |
37 | - $addon_path = _XE_PATH_ . 'files/cache/addons/'; |
|
38 | - $addon_file = $addon_path . $site_srl . $type . '.acivated_addons.cache.php'; |
|
37 | + $addon_path = _XE_PATH_.'files/cache/addons/'; |
|
38 | + $addon_file = $addon_path.$site_srl.$type.'.acivated_addons.cache.php'; |
|
39 | 39 | |
40 | - if($this->addon_file_called) |
|
40 | + if ($this->addon_file_called) |
|
41 | 41 | { |
42 | 42 | return $addon_file; |
43 | 43 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | FileHandler::makeDir($addon_path); |
48 | 48 | |
49 | - if(!file_exists($addon_file)) |
|
49 | + if (!file_exists($addon_file)) |
|
50 | 50 | { |
51 | 51 | $this->makeCacheFile($site_srl, $type); |
52 | 52 | } |
@@ -82,30 +82,30 @@ discard block |
||
82 | 82 | $buff = array('<?php if(!defined("__XE__")) exit();', '$_m = Context::get(\'mid\');'); |
83 | 83 | $oAddonModel = getAdminModel('addon'); |
84 | 84 | $addon_list = $oAddonModel->getInsertedAddons($site_srl, $gtype); |
85 | - foreach($addon_list as $addon => $val) |
|
85 | + foreach ($addon_list as $addon => $val) |
|
86 | 86 | { |
87 | - if($val->addon == "smartphone" |
|
87 | + if ($val->addon == "smartphone" |
|
88 | 88 | || ($type == "pc" && $val->is_used != 'Y') |
89 | 89 | || ($type == "mobile" && $val->is_used_m != 'Y') |
90 | 90 | || ($gtype == 'global' && $val->is_fixed != 'Y') |
91 | - || !is_dir(_XE_PATH_ . 'addons/' . $addon)) |
|
91 | + || !is_dir(_XE_PATH_.'addons/'.$addon)) |
|
92 | 92 | { |
93 | 93 | continue; |
94 | 94 | } |
95 | 95 | |
96 | 96 | $extra_vars = unserialize($val->extra_vars); |
97 | 97 | $mid_list = $extra_vars->mid_list; |
98 | - if(!is_array($mid_list) || count($mid_list) < 1) |
|
98 | + if (!is_array($mid_list) || count($mid_list) < 1) |
|
99 | 99 | { |
100 | 100 | $mid_list = NULL; |
101 | 101 | } |
102 | 102 | |
103 | 103 | $buff[] = '$before_time = microtime(true);'; |
104 | - $buff[] = '$rm = \'' . $extra_vars->xe_run_method . "';"; |
|
104 | + $buff[] = '$rm = \''.$extra_vars->xe_run_method."';"; |
|
105 | 105 | $buff[] = '$ml = array('; |
106 | - if($mid_list) |
|
106 | + if ($mid_list) |
|
107 | 107 | { |
108 | - foreach($mid_list as $mid) |
|
108 | + foreach ($mid_list as $mid) |
|
109 | 109 | { |
110 | 110 | $buff[] = "'$mid' => 1,"; |
111 | 111 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $buff[] = ');'; |
114 | 114 | $buff[] = sprintf('$addon_file = \'./addons/%s/%s.addon.php\';', $addon, $addon); |
115 | 115 | |
116 | - if($val->extra_vars) |
|
116 | + if ($val->extra_vars) |
|
117 | 117 | { |
118 | 118 | unset($extra_vars); |
119 | 119 | $extra_vars = base64_encode($val->extra_vars); |
@@ -131,13 +131,13 @@ discard block |
||
131 | 131 | $buff[] = '$after_time = microtime(true);'; |
132 | 132 | $buff[] = '$addon_time_log = new stdClass();'; |
133 | 133 | $buff[] = '$addon_time_log->caller = $called_position;'; |
134 | - $buff[] = '$addon_time_log->called = "' . $addon . '";'; |
|
135 | - $buff[] = '$addon_time_log->called_extension = "' . $addon . '";'; |
|
134 | + $buff[] = '$addon_time_log->called = "'.$addon.'";'; |
|
135 | + $buff[] = '$addon_time_log->called_extension = "'.$addon.'";'; |
|
136 | 136 | $buff[] = 'writeSlowlog("addon",$after_time-$before_time,$addon_time_log);'; |
137 | 137 | } |
138 | - $addon_path = _XE_PATH_ . 'files/cache/addons/'; |
|
138 | + $addon_path = _XE_PATH_.'files/cache/addons/'; |
|
139 | 139 | FileHandler::makeDir($addon_path); |
140 | - $addon_file = $addon_path . ($gtype == 'site' ? $site_srl : '') . $type . '.acivated_addons.cache.php'; |
|
140 | + $addon_file = $addon_path.($gtype == 'site' ? $site_srl : '').$type.'.acivated_addons.cache.php'; |
|
141 | 141 | FileHandler::writeFile($addon_file, join(PHP_EOL, $buff)); |
142 | 142 | } |
143 | 143 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | function doSetup($addon, $extra_vars, $site_srl = 0, $gtype = 'site') |
154 | 154 | { |
155 | - if(!is_array($extra_vars->mid_list)) |
|
155 | + if (!is_array($extra_vars->mid_list)) |
|
156 | 156 | { |
157 | 157 | unset($extra_vars->mid_list); |
158 | 158 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $args = new stdClass(); |
161 | 161 | $args->addon = $addon; |
162 | 162 | $args->extra_vars = serialize($extra_vars); |
163 | - if($gtype == 'global') |
|
163 | + if ($gtype == 'global') |
|
164 | 164 | { |
165 | 165 | return executeQuery('addon.updateAddon', $args); |
166 | 166 | } |
@@ -176,9 +176,9 @@ discard block |
||
176 | 176 | */ |
177 | 177 | function removeAddonConfig($site_srl) |
178 | 178 | { |
179 | - $addon_path = _XE_PATH_ . 'files/cache/addons/'; |
|
180 | - $addon_file = $addon_path . $site_srl . '.acivated_addons.cache.php'; |
|
181 | - if(file_exists($addon_file)) |
|
179 | + $addon_path = _XE_PATH_.'files/cache/addons/'; |
|
180 | + $addon_file = $addon_path.$site_srl.'.acivated_addons.cache.php'; |
|
181 | + if (file_exists($addon_file)) |
|
182 | 182 | { |
183 | 183 | FileHandler::removeFile($addon_file); |
184 | 184 | } |
@@ -145,7 +145,7 @@ |
||
145 | 145 | * Save setup |
146 | 146 | * |
147 | 147 | * @param string $addon Addon name |
148 | - * @param object $extra_vars Extra variables |
|
148 | + * @param BaseObject $extra_vars Extra variables |
|
149 | 149 | * @param int $site_srl Site srl |
150 | 150 | * @param string $gtype site or global |
151 | 151 | * @return BaseObject |
@@ -21,19 +21,19 @@ discard block |
||
21 | 21 | // Create module model object |
22 | 22 | $oModuleModel = getModel('module'); |
23 | 23 | // module_srl two come over to save the module, putting the information in advance |
24 | - if($module_srl) |
|
24 | + if ($module_srl) |
|
25 | 25 | { |
26 | 26 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); |
27 | - if(!$module_info) |
|
27 | + if (!$module_info) |
|
28 | 28 | { |
29 | - Context::set('module_srl',''); |
|
29 | + Context::set('module_srl', ''); |
|
30 | 30 | $this->act = 'list'; |
31 | 31 | } |
32 | 32 | else |
33 | 33 | { |
34 | 34 | ModuleModel::syncModuleToSite($module_info); |
35 | 35 | $this->module_info = $module_info; |
36 | - Context::set('module_info',$module_info); |
|
36 | + Context::set('module_info', $module_info); |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 | // Get a list of module categories |
@@ -59,10 +59,10 @@ discard block |
||
59 | 59 | $args->page_count = 10; |
60 | 60 | $args->s_module_category_srl = Context::get('module_category_srl'); |
61 | 61 | |
62 | - $search_target_list = array('s_mid','s_browser_title'); |
|
62 | + $search_target_list = array('s_mid', 's_browser_title'); |
|
63 | 63 | $search_target = Context::get('search_target'); |
64 | 64 | $search_keyword = Context::get('search_keyword'); |
65 | - if(in_array($search_target,$search_target_list) && $search_keyword) $args->{$search_target} = $search_keyword; |
|
65 | + if (in_array($search_target, $search_target_list) && $search_keyword) $args->{$search_target} = $search_keyword; |
|
66 | 66 | |
67 | 67 | $output = executeQuery('page.getPageList', $args); |
68 | 68 | $oModuleModel = getModel('module'); |
@@ -101,9 +101,9 @@ discard block |
||
101 | 101 | $module_srl = Context::get('module_srl'); |
102 | 102 | $module_info = Context::get('module_info'); |
103 | 103 | // If you do not value module_srl just showing the index page |
104 | - if(!$module_srl) return $this->dispPageAdminContent(); |
|
104 | + if (!$module_srl) return $this->dispPageAdminContent(); |
|
105 | 105 | // If the layout is destined to add layout information haejum (layout_title, layout) |
106 | - if($module_info->layout_srl) |
|
106 | + if ($module_info->layout_srl) |
|
107 | 107 | { |
108 | 108 | $oLayoutModel = getModel('layout'); |
109 | 109 | $layout_info = $oLayoutModel->getLayout($module_info->layout_srl); |
@@ -115,15 +115,15 @@ discard block |
||
115 | 115 | $layout_list = $oLayoutModel->getLayoutList(); |
116 | 116 | Context::set('layout_list', $layout_list); |
117 | 117 | |
118 | - $mobile_layout_list = $oLayoutModel->getLayoutList(0,"M"); |
|
118 | + $mobile_layout_list = $oLayoutModel->getLayoutList(0, "M"); |
|
119 | 119 | Context::set('mlayout_list', $mobile_layout_list); |
120 | 120 | // Set a template file |
121 | 121 | |
122 | - if($this->module_info->page_type == 'ARTICLE') |
|
122 | + if ($this->module_info->page_type == 'ARTICLE') |
|
123 | 123 | { |
124 | 124 | $oModuleModel = getModel('module'); |
125 | 125 | $skin_list = $oModuleModel->getSkins($this->module_path); |
126 | - Context::set('skin_list',$skin_list); |
|
126 | + Context::set('skin_list', $skin_list); |
|
127 | 127 | |
128 | 128 | $mskin_list = $oModuleModel->getSkins($this->module_path, "m.skins"); |
129 | 129 | Context::set('mskin_list', $mskin_list); |
@@ -161,23 +161,23 @@ discard block |
||
161 | 161 | |
162 | 162 | function dispPageAdminMobileContent() |
163 | 163 | { |
164 | - if($this->module_info->page_type == 'OUTSIDE') |
|
164 | + if ($this->module_info->page_type == 'OUTSIDE') |
|
165 | 165 | { |
166 | 166 | return $this->stop(-1, 'msg_invalid_request'); |
167 | 167 | } |
168 | 168 | |
169 | - if($this->module_srl) |
|
169 | + if ($this->module_srl) |
|
170 | 170 | { |
171 | - Context::set('module_srl',$this->module_srl); |
|
171 | + Context::set('module_srl', $this->module_srl); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | $oPageMobile = &getMobile('page'); |
175 | 175 | $oPageMobile->module_info = $this->module_info; |
176 | 176 | $page_type_name = strtolower($this->module_info->page_type); |
177 | - $method = '_get' . ucfirst($page_type_name) . 'Content'; |
|
178 | - if(method_exists($oPageMobile, $method)) |
|
177 | + $method = '_get'.ucfirst($page_type_name).'Content'; |
|
178 | + if (method_exists($oPageMobile, $method)) |
|
179 | 179 | { |
180 | - if($method == '_getArticleContent' && $this->module_info->is_mskin_fix == 'N') |
|
180 | + if ($method == '_getArticleContent' && $this->module_info->is_mskin_fix == 'N') |
|
181 | 181 | { |
182 | 182 | $oModuleModel = getModel('module'); |
183 | 183 | $oPageMobile->module_info->mskin = $oModuleModel->getModuleDefaultSkin('page', 'M'); |
@@ -230,16 +230,16 @@ discard block |
||
230 | 230 | function _setWidgetTypeContentModify($isMobile = false) |
231 | 231 | { |
232 | 232 | // Setting contents |
233 | - if($isMobile) |
|
233 | + if ($isMobile) |
|
234 | 234 | { |
235 | 235 | $content = Context::get('mcontent'); |
236 | - if(!$content) $content = $this->module_info->mcontent; |
|
236 | + if (!$content) $content = $this->module_info->mcontent; |
|
237 | 237 | $templateFile = 'page_mobile_content_modify'; |
238 | 238 | } |
239 | 239 | else |
240 | 240 | { |
241 | 241 | $content = Context::get('content'); |
242 | - if(!$content) $content = $this->module_info->content; |
|
242 | + if (!$content) $content = $this->module_info->content; |
|
243 | 243 | $templateFile = 'page_content_modify'; |
244 | 244 | } |
245 | 245 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | |
257 | 257 | //Security |
258 | 258 | $security = new Security(); |
259 | - $security->encodeHTML('widget_list..title','module_info.mid'); |
|
259 | + $security->encodeHTML('widget_list..title', 'module_info.mid'); |
|
260 | 260 | |
261 | 261 | // Set a template file |
262 | 262 | $this->setTemplateFile($templateFile); |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $oDocumentModel = getModel('document'); |
268 | 268 | $oDocument = $oDocumentModel->getDocument(0, true); |
269 | 269 | |
270 | - if($isMobile) |
|
270 | + if ($isMobile) |
|
271 | 271 | { |
272 | 272 | Context::set('isMobile', 'Y'); |
273 | 273 | $target = 'mdocument_srl'; |
@@ -278,13 +278,13 @@ discard block |
||
278 | 278 | $target = 'document_srl'; |
279 | 279 | } |
280 | 280 | |
281 | - if($this->module_info->{$target}) |
|
281 | + if ($this->module_info->{$target}) |
|
282 | 282 | { |
283 | 283 | $document_srl = $this->module_info->{$target}; |
284 | 284 | $oDocument->setDocument($document_srl); |
285 | 285 | Context::set('document_srl', $document_srl); |
286 | 286 | } |
287 | - else if(Context::get('document_srl')) |
|
287 | + else if (Context::get('document_srl')) |
|
288 | 288 | { |
289 | 289 | $document_srl = Context::get('document_srl'); |
290 | 290 | $oDocument->setDocument($document_srl); |
@@ -307,12 +307,12 @@ discard block |
||
307 | 307 | function dispPageAdminDelete() |
308 | 308 | { |
309 | 309 | $module_srl = Context::get('module_srl'); |
310 | - if(!$module_srl) return $this->dispContent(); |
|
310 | + if (!$module_srl) return $this->dispContent(); |
|
311 | 311 | |
312 | 312 | $oModuleModel = getModel('module'); |
313 | 313 | $columnList = array('module_srl', 'module', 'mid'); |
314 | 314 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); |
315 | - Context::set('module_info',$module_info); |
|
315 | + Context::set('module_info', $module_info); |
|
316 | 316 | // Set a template file |
317 | 317 | $this->setTemplateFile('page_delete'); |
318 | 318 |
@@ -28,8 +28,7 @@ discard block |
||
28 | 28 | { |
29 | 29 | Context::set('module_srl',''); |
30 | 30 | $this->act = 'list'; |
31 | - } |
|
32 | - else |
|
31 | + } else |
|
33 | 32 | { |
34 | 33 | ModuleModel::syncModuleToSite($module_info); |
35 | 34 | $this->module_info = $module_info; |
@@ -62,7 +61,9 @@ discard block |
||
62 | 61 | $search_target_list = array('s_mid','s_browser_title'); |
63 | 62 | $search_target = Context::get('search_target'); |
64 | 63 | $search_keyword = Context::get('search_keyword'); |
65 | - if(in_array($search_target,$search_target_list) && $search_keyword) $args->{$search_target} = $search_keyword; |
|
64 | + if(in_array($search_target,$search_target_list) && $search_keyword) { |
|
65 | + $args->{$search_target} = $search_keyword; |
|
66 | + } |
|
66 | 67 | |
67 | 68 | $output = executeQuery('page.getPageList', $args); |
68 | 69 | $oModuleModel = getModel('module'); |
@@ -101,7 +102,9 @@ discard block |
||
101 | 102 | $module_srl = Context::get('module_srl'); |
102 | 103 | $module_info = Context::get('module_info'); |
103 | 104 | // If you do not value module_srl just showing the index page |
104 | - if(!$module_srl) return $this->dispPageAdminContent(); |
|
105 | + if(!$module_srl) { |
|
106 | + return $this->dispPageAdminContent(); |
|
107 | + } |
|
105 | 108 | // If the layout is destined to add layout information haejum (layout_title, layout) |
106 | 109 | if($module_info->layout_srl) |
107 | 110 | { |
@@ -183,8 +186,7 @@ discard block |
||
183 | 186 | $oPageMobile->module_info->mskin = $oModuleModel->getModuleDefaultSkin('page', 'M'); |
184 | 187 | } |
185 | 188 | $page_content = $oPageMobile->{$method}(); |
186 | - } |
|
187 | - else |
|
189 | + } else |
|
188 | 190 | { |
189 | 191 | return new BaseObject(-1, sprintf('%s method is not exists', $method)); |
190 | 192 | } |
@@ -202,8 +204,7 @@ discard block |
||
202 | 204 | if ($this->module_info->page_type == 'WIDGET') |
203 | 205 | { |
204 | 206 | $this->_setWidgetTypeContentModify(true); |
205 | - } |
|
206 | - else if ($this->module_info->page_type == 'ARTICLE') |
|
207 | + } else if ($this->module_info->page_type == 'ARTICLE') |
|
207 | 208 | { |
208 | 209 | $this->_setArticleTypeContentModify(true); |
209 | 210 | } |
@@ -220,8 +221,7 @@ discard block |
||
220 | 221 | if ($this->module_info->page_type == 'WIDGET') |
221 | 222 | { |
222 | 223 | $this->_setWidgetTypeContentModify(); |
223 | - } |
|
224 | - else if ($this->module_info->page_type == 'ARTICLE') |
|
224 | + } else if ($this->module_info->page_type == 'ARTICLE') |
|
225 | 225 | { |
226 | 226 | $this->_setArticleTypeContentModify(); |
227 | 227 | } |
@@ -233,13 +233,16 @@ discard block |
||
233 | 233 | if($isMobile) |
234 | 234 | { |
235 | 235 | $content = Context::get('mcontent'); |
236 | - if(!$content) $content = $this->module_info->mcontent; |
|
236 | + if(!$content) { |
|
237 | + $content = $this->module_info->mcontent; |
|
238 | + } |
|
237 | 239 | $templateFile = 'page_mobile_content_modify'; |
238 | - } |
|
239 | - else |
|
240 | + } else |
|
240 | 241 | { |
241 | 242 | $content = Context::get('content'); |
242 | - if(!$content) $content = $this->module_info->content; |
|
243 | + if(!$content) { |
|
244 | + $content = $this->module_info->content; |
|
245 | + } |
|
243 | 246 | $templateFile = 'page_content_modify'; |
244 | 247 | } |
245 | 248 | |
@@ -271,8 +274,7 @@ discard block |
||
271 | 274 | { |
272 | 275 | Context::set('isMobile', 'Y'); |
273 | 276 | $target = 'mdocument_srl'; |
274 | - } |
|
275 | - else |
|
277 | + } else |
|
276 | 278 | { |
277 | 279 | Context::set('isMobile', 'N'); |
278 | 280 | $target = 'document_srl'; |
@@ -283,14 +285,12 @@ discard block |
||
283 | 285 | $document_srl = $this->module_info->{$target}; |
284 | 286 | $oDocument->setDocument($document_srl); |
285 | 287 | Context::set('document_srl', $document_srl); |
286 | - } |
|
287 | - else if(Context::get('document_srl')) |
|
288 | + } else if(Context::get('document_srl')) |
|
288 | 289 | { |
289 | 290 | $document_srl = Context::get('document_srl'); |
290 | 291 | $oDocument->setDocument($document_srl); |
291 | 292 | Context::set('document_srl', $document_srl); |
292 | - } |
|
293 | - else |
|
293 | + } else |
|
294 | 294 | { |
295 | 295 | $oDocument->add('module_srl', $this->module_info->module_srl); |
296 | 296 | } |
@@ -307,7 +307,9 @@ discard block |
||
307 | 307 | function dispPageAdminDelete() |
308 | 308 | { |
309 | 309 | $module_srl = Context::get('module_srl'); |
310 | - if(!$module_srl) return $this->dispContent(); |
|
310 | + if(!$module_srl) { |
|
311 | + return $this->dispContent(); |
|
312 | + } |
|
311 | 313 | |
312 | 314 | $oModuleModel = getModel('module'); |
313 | 315 | $columnList = array('module_srl', 'module', 'mid'); |