@@ -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 | } |
@@ -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 | } |
@@ -109,7 +109,7 @@ 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 | 115 | $this->setTemplatePath($this->module_path.'tpl'); |
@@ -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); |
@@ -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 | } |
@@ -28,7 +28,9 @@ discard block |
||
28 | 28 | function getEmoticonList() |
29 | 29 | { |
30 | 30 | $emoticon = Context::get('emoticon'); |
31 | - if(!$emoticon || !preg_match("/^([a-z0-9\_]+)$/i",$emoticon)) return new Object(-1,'msg_invalid_request'); |
|
31 | + if(!$emoticon || !preg_match("/^([a-z0-9\_]+)$/i",$emoticon)) { |
|
32 | + return new Object(-1,'msg_invalid_request'); |
|
33 | + } |
|
32 | 34 | |
33 | 35 | $list = $this->getEmoticons($emoticon); |
34 | 36 | |
@@ -46,11 +48,17 @@ discard block |
||
46 | 48 | $oDir = dir($emoticon_path); |
47 | 49 | while($file = $oDir->read()) |
48 | 50 | { |
49 | - if(substr($file,0,1)=='.') continue; |
|
50 | - if(preg_match('/\.(jpg|jpeg|gif|png)$/i',$file)) $output[] = sprintf("%s/%s", $path, str_replace($this->emoticon_path,'',$file)); |
|
51 | + if(substr($file,0,1)=='.') { |
|
52 | + continue; |
|
53 | + } |
|
54 | + if(preg_match('/\.(jpg|jpeg|gif|png)$/i',$file)) { |
|
55 | + $output[] = sprintf("%s/%s", $path, str_replace($this->emoticon_path,'',$file)); |
|
56 | + } |
|
51 | 57 | } |
52 | 58 | $oDir->close(); |
53 | - if(count($output)) asort($output); |
|
59 | + if(count($output)) { |
|
60 | + asort($output); |
|
61 | + } |
|
54 | 62 | return $output; |
55 | 63 | } |
56 | 64 | |
@@ -66,7 +74,9 @@ discard block |
||
66 | 74 | { |
67 | 75 | foreach($emoticon_dirs as $emoticon) |
68 | 76 | { |
69 | - if(preg_match("/^([a-z0-9\_]+)$/i", $emoticon)) $emoticon_list[] = $emoticon; |
|
77 | + if(preg_match("/^([a-z0-9\_]+)$/i", $emoticon)) { |
|
78 | + $emoticon_list[] = $emoticon; |
|
79 | + } |
|
70 | 80 | } |
71 | 81 | } |
72 | 82 | Context::set('emoticon_list', $emoticon_list); |
@@ -96,7 +106,9 @@ discard block |
||
96 | 106 | } |
97 | 107 | |
98 | 108 | $src = str_replace(array('&','"'), array('&','&qout;'), $src); |
99 | - if(!$alt) $alt = $src; |
|
109 | + if(!$alt) { |
|
110 | + $alt = $src; |
|
111 | + } |
|
100 | 112 | |
101 | 113 | $attr_output = array(); |
102 | 114 | $attr_output = array("src=\"".$src."\""); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | { |
20 | 20 | $this->editor_sequence = $editor_sequence; |
21 | 21 | $this->component_path = $component_path; |
22 | - $this->emoticon_path = sprintf('%s%s/images',preg_replace('/^\.\//i','',$this->component_path),'tpl','images'); |
|
22 | + $this->emoticon_path = sprintf('%s%s/images', preg_replace('/^\.\//i', '', $this->component_path), 'tpl', 'images'); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | function getEmoticonList() |
29 | 29 | { |
30 | 30 | $emoticon = Context::get('emoticon'); |
31 | - if(!$emoticon || !preg_match("/^([a-z0-9\_]+)$/i",$emoticon)) return new Object(-1,'msg_invalid_request'); |
|
31 | + if (!$emoticon || !preg_match("/^([a-z0-9\_]+)$/i", $emoticon)) return new Object(-1, 'msg_invalid_request'); |
|
32 | 32 | |
33 | 33 | $list = $this->getEmoticons($emoticon); |
34 | 34 | |
35 | - $this->add('emoticons', implode("\n",$list)); |
|
35 | + $this->add('emoticons', implode("\n", $list)); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -44,13 +44,13 @@ discard block |
||
44 | 44 | $output = array(); |
45 | 45 | |
46 | 46 | $oDir = dir($emoticon_path); |
47 | - while($file = $oDir->read()) |
|
47 | + while ($file = $oDir->read()) |
|
48 | 48 | { |
49 | - if(substr($file,0,1)=='.') continue; |
|
50 | - if(preg_match('/\.(jpg|jpeg|gif|png)$/i',$file)) $output[] = sprintf("%s/%s", $path, str_replace($this->emoticon_path,'',$file)); |
|
49 | + if (substr($file, 0, 1) == '.') continue; |
|
50 | + if (preg_match('/\.(jpg|jpeg|gif|png)$/i', $file)) $output[] = sprintf("%s/%s", $path, str_replace($this->emoticon_path, '', $file)); |
|
51 | 51 | } |
52 | 52 | $oDir->close(); |
53 | - if(count($output)) asort($output); |
|
53 | + if (count($output)) asort($output); |
|
54 | 54 | return $output; |
55 | 55 | } |
56 | 56 | |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | // Bringing a list of emoticons directory |
63 | 63 | $emoticon_dirs = FileHandler::readDir($this->emoticon_path); |
64 | 64 | $emoticon_list = array(); |
65 | - if($emoticon_dirs) |
|
65 | + if ($emoticon_dirs) |
|
66 | 66 | { |
67 | - foreach($emoticon_dirs as $emoticon) |
|
67 | + foreach ($emoticon_dirs as $emoticon) |
|
68 | 68 | { |
69 | - if(preg_match("/^([a-z0-9\_]+)$/i", $emoticon)) $emoticon_list[] = $emoticon; |
|
69 | + if (preg_match("/^([a-z0-9\_]+)$/i", $emoticon)) $emoticon_list[] = $emoticon; |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | Context::set('emoticon_list', $emoticon_list); |
@@ -89,24 +89,24 @@ discard block |
||
89 | 89 | $src = $xml_obj->attrs->src; |
90 | 90 | $alt = $xml_obj->attrs->alt; |
91 | 91 | |
92 | - if(!$alt) |
|
92 | + if (!$alt) |
|
93 | 93 | { |
94 | - $tmp_arr = explode('/',$src); |
|
94 | + $tmp_arr = explode('/', $src); |
|
95 | 95 | $alt = array_pop($tmp_arr); |
96 | 96 | } |
97 | 97 | |
98 | - $src = str_replace(array('&','"'), array('&','&qout;'), $src); |
|
99 | - if(!$alt) $alt = $src; |
|
98 | + $src = str_replace(array('&', '"'), array('&', '&qout;'), $src); |
|
99 | + if (!$alt) $alt = $src; |
|
100 | 100 | |
101 | 101 | $attr_output = array(); |
102 | 102 | $attr_output = array("src=\"".$src."\""); |
103 | 103 | |
104 | - if($alt) |
|
104 | + if ($alt) |
|
105 | 105 | { |
106 | 106 | $attr_output[] = "alt=\"".$alt."\""; |
107 | 107 | } |
108 | 108 | |
109 | - $code = sprintf("<img %s style=\"border:0px\" />", implode(" ",$attr_output)); |
|
109 | + $code = sprintf("<img %s style=\"border:0px\" />", implode(" ", $attr_output)); |
|
110 | 110 | |
111 | 111 | return $code; |
112 | 112 | } |
@@ -75,15 +75,20 @@ |
||
75 | 75 | // HTML gallery output, the output settings via the template for the conversion to generate the html code should |
76 | 76 | preg_match_all('/(width|height)([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches); |
77 | 77 | $gallery_info->width = trim($matches[3][0]); |
78 | - if(!$gallery_info->width) $gallery_info->width = 400; |
|
78 | + if(!$gallery_info->width) { |
|
79 | + $gallery_info->width = 400; |
|
80 | + } |
|
79 | 81 | |
80 | 82 | Context::set('gallery_info', $gallery_info); |
81 | 83 | |
82 | 84 | $tpl_path = $this->component_path.'tpl'; |
83 | 85 | Context::set("tpl_path", $tpl_path); |
84 | 86 | |
85 | - if($gallery_info->gallery_style == "list") $tpl_file = 'list_gallery.html'; |
|
86 | - else $tpl_file = 'slide_gallery.html'; |
|
87 | + if($gallery_info->gallery_style == "list") { |
|
88 | + $tpl_file = 'list_gallery.html'; |
|
89 | + } else { |
|
90 | + $tpl_file = 'slide_gallery.html'; |
|
91 | + } |
|
87 | 92 | |
88 | 93 | $oTemplate = &TemplateHandler::getInstance(); |
89 | 94 | return $oTemplate->compile($tpl_path, $tpl_file); |
@@ -45,14 +45,14 @@ discard block |
||
45 | 45 | { |
46 | 46 | $gallery_info = new stdClass(); |
47 | 47 | $gallery_info->srl = rand(111111, 999999); |
48 | - $gallery_info->border_thickness = (int)$xml_obj->attrs->border_thickness; |
|
48 | + $gallery_info->border_thickness = (int) $xml_obj->attrs->border_thickness; |
|
49 | 49 | $gallery_info->gallery_style = $xml_obj->attrs->gallery_style; |
50 | 50 | $color_preg = "/^([a-fA-F0-9]{6})/"; |
51 | - $gallery_info->border_color = preg_replace($color_preg,"#$1",$xml_obj->attrs->border_color); |
|
52 | - $gallery_info->bg_color = preg_replace($color_preg,"#$1",$xml_obj->attrs->bg_color); |
|
51 | + $gallery_info->border_color = preg_replace($color_preg, "#$1", $xml_obj->attrs->border_color); |
|
52 | + $gallery_info->bg_color = preg_replace($color_preg, "#$1", $xml_obj->attrs->bg_color); |
|
53 | 53 | $gallery_info->gallery_align = $xml_obj->attrs->gallery_align; |
54 | 54 | |
55 | - if(!in_array($gallery_info->gallery_align, array('left', 'center', 'right'))) { |
|
55 | + if (!in_array($gallery_info->gallery_align, array('left', 'center', 'right'))) { |
|
56 | 56 | $gallery_info->gallery_align = 'center'; |
57 | 57 | } |
58 | 58 | |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | $gallery_info->images_list = preg_grep("/^[a-z0-9\/]+\.(gif|jpe?g|png)+$/", $images_list); |
63 | 63 | |
64 | 64 | // If you set the output to output the XML code generated a list of the image |
65 | - if(Context::getResponseMethod() == 'XMLRPC') |
|
65 | + if (Context::getResponseMethod() == 'XMLRPC') |
|
66 | 66 | { |
67 | 67 | $output = array(); |
68 | - for($i=0;$i<count($gallery_info->images_list);$i++) |
|
68 | + for ($i = 0; $i < count($gallery_info->images_list); $i++) |
|
69 | 69 | { |
70 | 70 | $output[] = sprintf('<img src="%s" alt="" />', $gallery_info->images_list[$i]); |
71 | 71 | } |
@@ -73,16 +73,16 @@ discard block |
||
73 | 73 | return implode('<br />', $output); |
74 | 74 | } |
75 | 75 | // HTML gallery output, the output settings via the template for the conversion to generate the html code should |
76 | - preg_match_all('/(width|height)([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches); |
|
76 | + preg_match_all('/(width|height)([^[:digit:]]+)([0-9]+)/i', $xml_obj->attrs->style, $matches); |
|
77 | 77 | $gallery_info->width = trim($matches[3][0]); |
78 | - if(!$gallery_info->width) $gallery_info->width = 400; |
|
78 | + if (!$gallery_info->width) $gallery_info->width = 400; |
|
79 | 79 | |
80 | 80 | Context::set('gallery_info', $gallery_info); |
81 | 81 | |
82 | 82 | $tpl_path = $this->component_path.'tpl'; |
83 | 83 | Context::set("tpl_path", $tpl_path); |
84 | 84 | |
85 | - if($gallery_info->gallery_style == "list") $tpl_file = 'list_gallery.html'; |
|
85 | + if ($gallery_info->gallery_style == "list") $tpl_file = 'list_gallery.html'; |
|
86 | 86 | else $tpl_file = 'slide_gallery.html'; |
87 | 87 | |
88 | 88 | $oTemplate = &TemplateHandler::getInstance(); |
@@ -60,14 +60,19 @@ discard block |
||
60 | 60 | |
61 | 61 | // Image containing the address to the address conversion request uri (rss output, etc. purposes) |
62 | 62 | $temp_src = explode('/', $src); |
63 | - if(substr($src, 0,2)=='./') $src = Context::getRequestUri().substr($src, 2); |
|
64 | - else if(substr($src , 0, 1)=='/') |
|
63 | + if(substr($src, 0,2)=='./') { |
|
64 | + $src = Context::getRequestUri().substr($src, 2); |
|
65 | + } else if(substr($src , 0, 1)=='/') |
|
65 | 66 | { |
66 | - if($_SERVER['HTTPS']=='on') $http_src = 'https://'; |
|
67 | - else $http_src = 'http://'; |
|
67 | + if($_SERVER['HTTPS']=='on') { |
|
68 | + $http_src = 'https://'; |
|
69 | + } else { |
|
70 | + $http_src = 'http://'; |
|
71 | + } |
|
68 | 72 | $src = $http_src.$_SERVER['HTTP_HOST'].$src; |
73 | + } else if(!strpos($temp_src[0],':') && $src) { |
|
74 | + $src = Context::getRequestUri().$src; |
|
69 | 75 | } |
70 | - else if(!strpos($temp_src[0],':') && $src) $src = Context::getRequestUri().$src; |
|
71 | 76 | |
72 | 77 | $attr_output = array(); |
73 | 78 | $attr_output = array("src=\"".$src."\""); |
@@ -81,17 +86,27 @@ discard block |
||
81 | 86 | { |
82 | 87 | $style = trim(preg_replace('/margin[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i','', $style)).';'; |
83 | 88 | $style = str_replace(';;',';',$style); |
84 | - if($style == ';') $style = ''; |
|
89 | + if($style == ';') { |
|
90 | + $style = ''; |
|
91 | + } |
|
85 | 92 | $style .= ' margin:'.$margin.'px;'; |
86 | 93 | } |
87 | - if($align) $attr_output[] = "align=\"".$align."\""; |
|
88 | - if($width) $attr_output[] = 'width="'.$width.'"'; |
|
89 | - if($height) $attr_output[] = 'height="'.$height.'"'; |
|
94 | + if($align) { |
|
95 | + $attr_output[] = "align=\"".$align."\""; |
|
96 | + } |
|
97 | + if($width) { |
|
98 | + $attr_output[] = 'width="'.$width.'"'; |
|
99 | + } |
|
100 | + if($height) { |
|
101 | + $attr_output[] = 'height="'.$height.'"'; |
|
102 | + } |
|
90 | 103 | if($border) |
91 | 104 | { |
92 | 105 | $style = trim(preg_replace('/border[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i','', $style)).';'; |
93 | 106 | $style = str_replace(';;',';',$style); |
94 | - if($style == ';') $style = ''; |
|
107 | + if($style == ';') { |
|
108 | + $style = ''; |
|
109 | + } |
|
95 | 110 | $style .= ' border-style: solid; border-width:'.$border.'px;'; |
96 | 111 | } |
97 | 112 | |
@@ -99,8 +114,11 @@ discard block |
||
99 | 114 | |
100 | 115 | if($link_url) |
101 | 116 | { |
102 | - if($open_window =='Y') $code = sprintf('<a href="%s" onclick="window.open(this.href);return false;">%s</a>', $link_url, $code); |
|
103 | - else $code = sprintf('<a href="%s" >%s</a>', $link_url, $code); |
|
117 | + if($open_window =='Y') { |
|
118 | + $code = sprintf('<a href="%s" onclick="window.open(this.href);return false;">%s</a>', $link_url, $code); |
|
119 | + } else { |
|
120 | + $code = sprintf('<a href="%s" >%s</a>', $link_url, $code); |
|
121 | + } |
|
104 | 122 | } |
105 | 123 | return $code; |
106 | 124 | } |
@@ -49,57 +49,57 @@ |
||
49 | 49 | $align = $xml_obj->attrs->align; |
50 | 50 | $alt = $xml_obj->attrs->alt; |
51 | 51 | $title = $xml_obj->attrs->title; |
52 | - $border = (int)$xml_obj->attrs->border; |
|
52 | + $border = (int) $xml_obj->attrs->border; |
|
53 | 53 | $link_url = $xml_obj->attrs->link_url; |
54 | 54 | $open_window = $xml_obj->attrs->open_window; |
55 | 55 | $style = $xml_obj->attrs->style; |
56 | - $margin = (int)$xml_obj->attrs->margin; |
|
56 | + $margin = (int) $xml_obj->attrs->margin; |
|
57 | 57 | |
58 | - $src = str_replace(array('&','"'), array('&','&qout;'), $src); |
|
58 | + $src = str_replace(array('&', '"'), array('&', '&qout;'), $src); |
|
59 | 59 | $src = str_replace('&amp;', '&', $src); |
60 | 60 | |
61 | 61 | // Image containing the address to the address conversion request uri (rss output, etc. purposes) |
62 | 62 | $temp_src = explode('/', $src); |
63 | - if(substr($src, 0,2)=='./') $src = Context::getRequestUri().substr($src, 2); |
|
64 | - else if(substr($src , 0, 1)=='/') |
|
63 | + if (substr($src, 0, 2) == './') $src = Context::getRequestUri().substr($src, 2); |
|
64 | + else if (substr($src, 0, 1) == '/') |
|
65 | 65 | { |
66 | - if($_SERVER['HTTPS']=='on') $http_src = 'https://'; |
|
66 | + if ($_SERVER['HTTPS'] == 'on') $http_src = 'https://'; |
|
67 | 67 | else $http_src = 'http://'; |
68 | 68 | $src = $http_src.$_SERVER['HTTP_HOST'].$src; |
69 | 69 | } |
70 | - else if(!strpos($temp_src[0],':') && $src) $src = Context::getRequestUri().$src; |
|
70 | + else if (!strpos($temp_src[0], ':') && $src) $src = Context::getRequestUri().$src; |
|
71 | 71 | |
72 | 72 | $attr_output = array(); |
73 | 73 | $attr_output = array("src=\"".$src."\""); |
74 | 74 | $attr_output[] = "alt=\"".$alt."\""; |
75 | 75 | |
76 | - if($title) |
|
76 | + if ($title) |
|
77 | 77 | { |
78 | 78 | $attr_output[] = "title=\"".$title."\""; |
79 | 79 | } |
80 | - if($margin) |
|
80 | + if ($margin) |
|
81 | 81 | { |
82 | - $style = trim(preg_replace('/margin[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i','', $style)).';'; |
|
83 | - $style = str_replace(';;',';',$style); |
|
84 | - if($style == ';') $style = ''; |
|
82 | + $style = trim(preg_replace('/margin[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i', '', $style)).';'; |
|
83 | + $style = str_replace(';;', ';', $style); |
|
84 | + if ($style == ';') $style = ''; |
|
85 | 85 | $style .= ' margin:'.$margin.'px;'; |
86 | 86 | } |
87 | - if($align) $attr_output[] = "align=\"".$align."\""; |
|
88 | - if($width) $attr_output[] = 'width="'.$width.'"'; |
|
89 | - if($height) $attr_output[] = 'height="'.$height.'"'; |
|
90 | - if($border) |
|
87 | + if ($align) $attr_output[] = "align=\"".$align."\""; |
|
88 | + if ($width) $attr_output[] = 'width="'.$width.'"'; |
|
89 | + if ($height) $attr_output[] = 'height="'.$height.'"'; |
|
90 | + if ($border) |
|
91 | 91 | { |
92 | - $style = trim(preg_replace('/border[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i','', $style)).';'; |
|
93 | - $style = str_replace(';;',';',$style); |
|
94 | - if($style == ';') $style = ''; |
|
92 | + $style = trim(preg_replace('/border[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i', '', $style)).';'; |
|
93 | + $style = str_replace(';;', ';', $style); |
|
94 | + if ($style == ';') $style = ''; |
|
95 | 95 | $style .= ' border-style: solid; border-width:'.$border.'px;'; |
96 | 96 | } |
97 | 97 | |
98 | - $code = sprintf("<img %s style=\"%s\" />", implode(' ',$attr_output), $style); |
|
98 | + $code = sprintf("<img %s style=\"%s\" />", implode(' ', $attr_output), $style); |
|
99 | 99 | |
100 | - if($link_url) |
|
100 | + if ($link_url) |
|
101 | 101 | { |
102 | - if($open_window =='Y') $code = sprintf('<a href="%s" onclick="window.open(this.href);return false;">%s</a>', $link_url, $code); |
|
102 | + if ($open_window == 'Y') $code = sprintf('<a href="%s" onclick="window.open(this.href);return false;">%s</a>', $link_url, $code); |
|
103 | 103 | else $code = sprintf('<a href="%s" >%s</a>', $link_url, $code); |
104 | 104 | } |
105 | 105 | return $code; |
@@ -47,11 +47,15 @@ |
||
47 | 47 | { |
48 | 48 | $poll_srl = $xml_obj->attrs->poll_srl; |
49 | 49 | $skin = $xml_obj->attrs->skin; |
50 | - if(!$skin) $skin = 'default'; |
|
50 | + if(!$skin) { |
|
51 | + $skin = 'default'; |
|
52 | + } |
|
51 | 53 | |
52 | 54 | preg_match('/width([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches); |
53 | 55 | $width = $matches[2]; |
54 | - if(!$width) $width = 400; |
|
56 | + if(!$width) { |
|
57 | + $width = 400; |
|
58 | + } |
|
55 | 59 | $style = sprintf('width:%dpx', $width); |
56 | 60 | // poll model object creation to come get it return html |
57 | 61 | $oPollModel = getModel('poll'); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | { |
28 | 28 | // Wanted Skins survey |
29 | 29 | $oModuleModel = getModel('module'); |
30 | - $skin_list = $oModuleModel->getSkins(_XE_PATH_ . 'modules/poll/'); |
|
30 | + $skin_list = $oModuleModel->getSkins(_XE_PATH_.'modules/poll/'); |
|
31 | 31 | Context::set('skin_list', $skin_list); |
32 | 32 | // Pre-compiled source code to compile template return to |
33 | 33 | $tpl_path = $this->component_path.'tpl'; |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | { |
48 | 48 | $poll_srl = $xml_obj->attrs->poll_srl; |
49 | 49 | $skin = $xml_obj->attrs->skin; |
50 | - if(!$skin) $skin = 'default'; |
|
50 | + if (!$skin) $skin = 'default'; |
|
51 | 51 | |
52 | - preg_match('/width([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches); |
|
52 | + preg_match('/width([^[:digit:]]+)([0-9]+)/i', $xml_obj->attrs->style, $matches); |
|
53 | 53 | $width = $matches[2]; |
54 | - if(!$width) $width = 400; |
|
54 | + if (!$width) $width = 400; |
|
55 | 55 | $style = sprintf('width:%dpx', $width); |
56 | 56 | // poll model object creation to come get it return html |
57 | 57 | $oPollModel = getModel('poll'); |
@@ -23,8 +23,12 @@ discard block |
||
23 | 23 | $enables = Context::get('enables'); |
24 | 24 | $component_names = Context::get('component_names'); |
25 | 25 | |
26 | - if(!is_array($component_names)) $component_names = array(); |
|
27 | - if(!is_array($enables)) $enables = array(); |
|
26 | + if(!is_array($component_names)) { |
|
27 | + $component_names = array(); |
|
28 | + } |
|
29 | + if(!is_array($enables)) { |
|
30 | + $enables = array(); |
|
31 | + } |
|
28 | 32 | |
29 | 33 | $unables = array_diff($component_names, $enables); |
30 | 34 | $componentList = array(); |
@@ -39,10 +43,14 @@ discard block |
||
39 | 43 | } |
40 | 44 | |
41 | 45 | $output = $this->editorListOrder($component_names,$site_module_info->site_srl); |
42 | - if(!$output->toBool()) return new Object(); |
|
46 | + if(!$output->toBool()) { |
|
47 | + return new Object(); |
|
48 | + } |
|
43 | 49 | |
44 | 50 | $output = $this->editorCheckUse($componentList,$site_module_info->site_srl); |
45 | - if(!$output->toBool()) return new Object(); |
|
51 | + if(!$output->toBool()) { |
|
52 | + return new Object(); |
|
53 | + } |
|
46 | 54 | |
47 | 55 | $oEditorController = getController('editor'); |
48 | 56 | $oEditorController->removeCache($site_module_info->site_srl); |
@@ -64,13 +72,14 @@ discard block |
||
64 | 72 | if($site_srl == 0) |
65 | 73 | { |
66 | 74 | $output = executeQuery('editor.updateComponent', $args); |
67 | - } |
|
68 | - else |
|
75 | + } else |
|
69 | 76 | { |
70 | 77 | $output = executeQuery('editor.updateSiteComponent', $args); |
71 | 78 | } |
72 | 79 | } |
73 | - if(!$output->toBool()) return new Object(); |
|
80 | + if(!$output->toBool()) { |
|
81 | + return new Object(); |
|
82 | + } |
|
74 | 83 | |
75 | 84 | unset($componentList); |
76 | 85 | return $output; |
@@ -93,13 +102,14 @@ discard block |
||
93 | 102 | if($site_srl == 0) |
94 | 103 | { |
95 | 104 | $output = executeQuery('editor.updateComponent', $args); |
96 | - } |
|
97 | - else |
|
105 | + } else |
|
98 | 106 | { |
99 | 107 | $output = executeQuery('editor.updateSiteComponent', $args); |
100 | 108 | } |
101 | 109 | |
102 | - if(!$output->toBool()) return new Object(); |
|
110 | + if(!$output->toBool()) { |
|
111 | + return new Object(); |
|
112 | + } |
|
103 | 113 | $list_order_num++; |
104 | 114 | } |
105 | 115 | } |
@@ -126,9 +136,14 @@ discard block |
||
126 | 136 | $args->extra_vars = serialize($extra_vars); |
127 | 137 | $args->site_srl = (int)$site_module_info->site_srl; |
128 | 138 | |
129 | - if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $args); |
|
130 | - else $output = executeQuery('editor.updateSiteComponent', $args); |
|
131 | - if(!$output->toBool()) return $output; |
|
139 | + if(!$args->site_srl) { |
|
140 | + $output = executeQuery('editor.updateComponent', $args); |
|
141 | + } else { |
|
142 | + $output = executeQuery('editor.updateSiteComponent', $args); |
|
143 | + } |
|
144 | + if(!$output->toBool()) { |
|
145 | + return $output; |
|
146 | + } |
|
132 | 147 | |
133 | 148 | $oEditorController = getController('editor'); |
134 | 149 | $oEditorController->removeCache($args->site_srl); |
@@ -145,13 +160,17 @@ discard block |
||
145 | 160 | $oModuleController = getController('module'); |
146 | 161 | $configVars = Context::getRequestVars(); |
147 | 162 | |
148 | - if($configVars->font_defined != 'Y') $config->font_defined = $configVars->font_defined = 'N'; |
|
149 | - else $config->font_defined = 'Y'; |
|
163 | + if($configVars->font_defined != 'Y') { |
|
164 | + $config->font_defined = $configVars->font_defined = 'N'; |
|
165 | + } else { |
|
166 | + $config->font_defined = 'Y'; |
|
167 | + } |
|
150 | 168 | |
151 | - if($config->font_defined == 'Y') |
|
152 | - $config->content_font = $configVars->content_font_defined; |
|
153 | - else |
|
154 | - $config->content_font = $configVars->content_font; |
|
169 | + if($config->font_defined == 'Y') { |
|
170 | + $config->content_font = $configVars->content_font_defined; |
|
171 | + } else { |
|
172 | + $config->content_font = $configVars->content_font; |
|
173 | + } |
|
155 | 174 | |
156 | 175 | $config->editor_skin = $configVars->editor_skin; |
157 | 176 | $config->editor_height = $configVars->editor_height; |
@@ -172,21 +191,32 @@ discard block |
||
172 | 191 | */ |
173 | 192 | function insertComponent($component_name, $enabled = false, $site_srl = 0) |
174 | 193 | { |
175 | - if($enabled) $enabled = 'Y'; |
|
176 | - else $enabled = 'N'; |
|
194 | + if($enabled) { |
|
195 | + $enabled = 'Y'; |
|
196 | + } else { |
|
197 | + $enabled = 'N'; |
|
198 | + } |
|
177 | 199 | |
178 | 200 | $args = new stdClass; |
179 | 201 | $args->component_name = $component_name; |
180 | 202 | $args->enabled = $enabled; |
181 | 203 | $args->site_srl = $site_srl; |
182 | 204 | // Check if the component exists |
183 | - if(!$site_srl) $output = executeQuery('editor.isComponentInserted', $args); |
|
184 | - else $output = executeQuery('editor.isSiteComponentInserted', $args); |
|
185 | - if($output->data->count) return new Object(-1, 'msg_component_is_not_founded'); |
|
205 | + if(!$site_srl) { |
|
206 | + $output = executeQuery('editor.isComponentInserted', $args); |
|
207 | + } else { |
|
208 | + $output = executeQuery('editor.isSiteComponentInserted', $args); |
|
209 | + } |
|
210 | + if($output->data->count) { |
|
211 | + return new Object(-1, 'msg_component_is_not_founded'); |
|
212 | + } |
|
186 | 213 | // Inert a component |
187 | 214 | $args->list_order = getNextSequence(); |
188 | - if(!$site_srl) $output = executeQuery('editor.insertComponent', $args); |
|
189 | - else $output = executeQuery('editor.insertSiteComponent', $args); |
|
215 | + if(!$site_srl) { |
|
216 | + $output = executeQuery('editor.insertComponent', $args); |
|
217 | + } else { |
|
218 | + $output = executeQuery('editor.insertSiteComponent', $args); |
|
219 | + } |
|
190 | 220 | |
191 | 221 | $oEditorController = getController('editor'); |
192 | 222 | $oEditorController->removeCache($site_srl); |
@@ -23,26 +23,26 @@ discard block |
||
23 | 23 | $enables = Context::get('enables'); |
24 | 24 | $component_names = Context::get('component_names'); |
25 | 25 | |
26 | - if(!is_array($component_names)) $component_names = array(); |
|
27 | - if(!is_array($enables)) $enables = array(); |
|
26 | + if (!is_array($component_names)) $component_names = array(); |
|
27 | + if (!is_array($enables)) $enables = array(); |
|
28 | 28 | |
29 | 29 | $unables = array_diff($component_names, $enables); |
30 | 30 | $componentList = array(); |
31 | 31 | |
32 | - foreach($enables as $component_name) |
|
32 | + foreach ($enables as $component_name) |
|
33 | 33 | { |
34 | 34 | $componentList[$component_name] = 'Y'; |
35 | 35 | } |
36 | - foreach($unables as $component_name) |
|
36 | + foreach ($unables as $component_name) |
|
37 | 37 | { |
38 | 38 | $componentList[$component_name] = 'N'; |
39 | 39 | } |
40 | 40 | |
41 | - $output = $this->editorListOrder($component_names,$site_module_info->site_srl); |
|
42 | - if(!$output->toBool()) return new Object(); |
|
41 | + $output = $this->editorListOrder($component_names, $site_module_info->site_srl); |
|
42 | + if (!$output->toBool()) return new Object(); |
|
43 | 43 | |
44 | - $output = $this->editorCheckUse($componentList,$site_module_info->site_srl); |
|
45 | - if(!$output->toBool()) return new Object(); |
|
44 | + $output = $this->editorCheckUse($componentList, $site_module_info->site_srl); |
|
45 | + if (!$output->toBool()) return new Object(); |
|
46 | 46 | |
47 | 47 | $oEditorController = getController('editor'); |
48 | 48 | $oEditorController->removeCache($site_module_info->site_srl); |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | $args = new stdClass(); |
58 | 58 | $args->site_srl = $site_srl; |
59 | 59 | |
60 | - foreach($componentList as $componentName => $value) |
|
60 | + foreach ($componentList as $componentName => $value) |
|
61 | 61 | { |
62 | 62 | $args->component_name = $componentName; |
63 | 63 | $args->enabled = $value; |
64 | - if($site_srl == 0) |
|
64 | + if ($site_srl == 0) |
|
65 | 65 | { |
66 | 66 | $output = executeQuery('editor.updateComponent', $args); |
67 | 67 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $output = executeQuery('editor.updateSiteComponent', $args); |
71 | 71 | } |
72 | 72 | } |
73 | - if(!$output->toBool()) return new Object(); |
|
73 | + if (!$output->toBool()) return new Object(); |
|
74 | 74 | |
75 | 75 | unset($componentList); |
76 | 76 | return $output; |
@@ -84,13 +84,13 @@ discard block |
||
84 | 84 | $args = new stdClass(); |
85 | 85 | $args->site_srl = $site_srl; |
86 | 86 | $list_order_num = '30'; |
87 | - if(is_array($component_names)) |
|
87 | + if (is_array($component_names)) |
|
88 | 88 | { |
89 | - foreach($component_names as $name) |
|
89 | + foreach ($component_names as $name) |
|
90 | 90 | { |
91 | 91 | $args->list_order = $list_order_num; |
92 | 92 | $args->component_name = $name; |
93 | - if($site_srl == 0) |
|
93 | + if ($site_srl == 0) |
|
94 | 94 | { |
95 | 95 | $output = executeQuery('editor.updateComponent', $args); |
96 | 96 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $output = executeQuery('editor.updateSiteComponent', $args); |
100 | 100 | } |
101 | 101 | |
102 | - if(!$output->toBool()) return new Object(); |
|
102 | + if (!$output->toBool()) return new Object(); |
|
103 | 103 | $list_order_num++; |
104 | 104 | } |
105 | 105 | } |
@@ -124,11 +124,11 @@ discard block |
||
124 | 124 | $args = new stdClass; |
125 | 125 | $args->component_name = $component_name; |
126 | 126 | $args->extra_vars = serialize($extra_vars); |
127 | - $args->site_srl = (int)$site_module_info->site_srl; |
|
127 | + $args->site_srl = (int) $site_module_info->site_srl; |
|
128 | 128 | |
129 | - if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $args); |
|
129 | + if (!$args->site_srl) $output = executeQuery('editor.updateComponent', $args); |
|
130 | 130 | else $output = executeQuery('editor.updateSiteComponent', $args); |
131 | - if(!$output->toBool()) return $output; |
|
131 | + if (!$output->toBool()) return $output; |
|
132 | 132 | |
133 | 133 | $oEditorController = getController('editor'); |
134 | 134 | $oEditorController->removeCache($args->site_srl); |
@@ -146,10 +146,10 @@ discard block |
||
146 | 146 | $configVars = Context::getRequestVars(); |
147 | 147 | |
148 | 148 | $config = new stdClass; |
149 | - if($configVars->font_defined != 'Y') $config->font_defined = $configVars->font_defined = 'N'; |
|
149 | + if ($configVars->font_defined != 'Y') $config->font_defined = $configVars->font_defined = 'N'; |
|
150 | 150 | else $config->font_defined = 'Y'; |
151 | 151 | |
152 | - if($config->font_defined == 'Y') |
|
152 | + if ($config->font_defined == 'Y') |
|
153 | 153 | $config->content_font = $configVars->content_font_defined; |
154 | 154 | else |
155 | 155 | $config->content_font = $configVars->content_font; |
@@ -160,11 +160,11 @@ discard block |
||
160 | 160 | $config->comment_editor_height = $configVars->comment_editor_height; |
161 | 161 | $config->content_style = $configVars->content_style; |
162 | 162 | |
163 | - $config->content_font_size= $configVars->content_font_size.'px'; |
|
164 | - $config->sel_editor_colorset= $configVars->sel_editor_colorset; |
|
165 | - $config->sel_comment_editor_colorset= $configVars->sel_comment_editor_colorset; |
|
163 | + $config->content_font_size = $configVars->content_font_size.'px'; |
|
164 | + $config->sel_editor_colorset = $configVars->sel_editor_colorset; |
|
165 | + $config->sel_comment_editor_colorset = $configVars->sel_comment_editor_colorset; |
|
166 | 166 | |
167 | - $oModuleController->insertModuleConfig('editor',$config); |
|
167 | + $oModuleController->insertModuleConfig('editor', $config); |
|
168 | 168 | $this->setRedirectUrl(Context::get('error_return_url')); |
169 | 169 | } |
170 | 170 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | */ |
174 | 174 | function insertComponent($component_name, $enabled = false, $site_srl = 0) |
175 | 175 | { |
176 | - if($enabled) $enabled = 'Y'; |
|
176 | + if ($enabled) $enabled = 'Y'; |
|
177 | 177 | else $enabled = 'N'; |
178 | 178 | |
179 | 179 | $args = new stdClass; |
@@ -181,12 +181,12 @@ discard block |
||
181 | 181 | $args->enabled = $enabled; |
182 | 182 | $args->site_srl = $site_srl; |
183 | 183 | // Check if the component exists |
184 | - if(!$site_srl) $output = executeQuery('editor.isComponentInserted', $args); |
|
184 | + if (!$site_srl) $output = executeQuery('editor.isComponentInserted', $args); |
|
185 | 185 | else $output = executeQuery('editor.isSiteComponentInserted', $args); |
186 | - if($output->data->count) return new Object(-1, 'msg_component_is_not_founded'); |
|
186 | + if ($output->data->count) return new Object(-1, 'msg_component_is_not_founded'); |
|
187 | 187 | // Inert a component |
188 | 188 | $args->list_order = getNextSequence(); |
189 | - if(!$site_srl) $output = executeQuery('editor.insertComponent', $args); |
|
189 | + if (!$site_srl) $output = executeQuery('editor.insertComponent', $args); |
|
190 | 190 | else $output = executeQuery('editor.insertSiteComponent', $args); |
191 | 191 | |
192 | 192 | $oEditorController = getController('editor'); |
@@ -35,12 +35,24 @@ discard block |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | //editor_config init |
38 | - if(!$editor_config->editor_height) $editor_config->editor_height = 300; |
|
39 | - if(!$editor_config->comment_editor_height) $editor_config->comment_editor_height = 100; |
|
40 | - if(!$editor_config->editor_skin) $editor_config->editor_skin = 'ckeditor'; |
|
41 | - if(!$editor_config->comment_editor_skin) $editor_config->comment_editor_skin = 'ckeditor'; |
|
42 | - if(!$editor_config->sel_editor_colorset) $editor_config->sel_editor_colorset= 'moono'; |
|
43 | - if(!$editor_config->sel_comment_editor_colorset) $editor_config->sel_comment_editor_colorset= 'moono'; |
|
38 | + if(!$editor_config->editor_height) { |
|
39 | + $editor_config->editor_height = 300; |
|
40 | + } |
|
41 | + if(!$editor_config->comment_editor_height) { |
|
42 | + $editor_config->comment_editor_height = 100; |
|
43 | + } |
|
44 | + if(!$editor_config->editor_skin) { |
|
45 | + $editor_config->editor_skin = 'ckeditor'; |
|
46 | + } |
|
47 | + if(!$editor_config->comment_editor_skin) { |
|
48 | + $editor_config->comment_editor_skin = 'ckeditor'; |
|
49 | + } |
|
50 | + if(!$editor_config->sel_editor_colorset) { |
|
51 | + $editor_config->sel_editor_colorset= 'moono'; |
|
52 | + } |
|
53 | + if(!$editor_config->sel_comment_editor_colorset) { |
|
54 | + $editor_config->sel_comment_editor_colorset= 'moono'; |
|
55 | + } |
|
44 | 56 | |
45 | 57 | $component_list = $oEditorModel->getComponentList(false, $site_srl, true); |
46 | 58 | $editor_skin_list = FileHandler::readDir(_XE_PATH_.'modules/editor/skins'); |
@@ -65,14 +77,20 @@ discard block |
||
65 | 77 | $xml_info->path = './modules/editor/components/'.$xml_info->component_name; |
66 | 78 | $xml_info->delete_url = $oAutoinstallModel->getRemoveUrlByPath($xml_info->path); |
67 | 79 | $xml_info->package_srl = $oAutoinstallModel->getPackageSrlByPath($xml_info->path); |
68 | - if($xml_info->package_srl) $targetpackages[$xml_info->package_srl] = 0; |
|
80 | + if($xml_info->package_srl) { |
|
81 | + $targetpackages[$xml_info->package_srl] = 0; |
|
82 | + } |
|
69 | 83 | } |
70 | 84 | |
71 | - if(is_array($targetpackages)) $packages = $oAutoinstallModel->getInstalledPackages(array_keys($targetpackages)); |
|
85 | + if(is_array($targetpackages)) { |
|
86 | + $packages = $oAutoinstallModel->getInstalledPackages(array_keys($targetpackages)); |
|
87 | + } |
|
72 | 88 | |
73 | 89 | foreach($component_list as $component_name => $xml_info) |
74 | 90 | { |
75 | - if($packages[$xml_info->package_srl]) $xml_info->need_update = $packages[$xml_info->package_srl]->need_update; |
|
91 | + if($packages[$xml_info->package_srl]) { |
|
92 | + $xml_info->need_update = $packages[$xml_info->package_srl]->need_update; |
|
93 | + } |
|
76 | 94 | } |
77 | 95 | $editor_config_default = array( "editor_height" => "300", "comment_editor_height" => "100","content_font_size"=>"13"); |
78 | 96 | |
@@ -162,13 +180,16 @@ discard block |
||
162 | 180 | // Get a list of module category |
163 | 181 | $module_categories = $oModuleModel->getModuleCategories(); |
164 | 182 | |
165 | - if(!is_array($mid_list)) $mid_list = array($mid_list); |
|
183 | + if(!is_array($mid_list)) { |
|
184 | + $mid_list = array($mid_list); |
|
185 | + } |
|
166 | 186 | foreach($mid_list as $module_srl => $module) |
167 | 187 | { |
168 | - if($module) $module_categories[$module->module_category_srl]->list[$module_srl] = $module; |
|
188 | + if($module) { |
|
189 | + $module_categories[$module->module_category_srl]->list[$module_srl] = $module; |
|
190 | + } |
|
169 | 191 | } |
170 | - } |
|
171 | - else |
|
192 | + } else |
|
172 | 193 | { |
173 | 194 | $module_categories[0]->list = $mid_list; |
174 | 195 | } |
@@ -22,59 +22,59 @@ discard block |
||
22 | 22 | { |
23 | 23 | $component_count = 0; |
24 | 24 | $site_module_info = Context::get('site_module_info'); |
25 | - $site_srl = (int)$site_module_info->site_srl; |
|
25 | + $site_srl = (int) $site_module_info->site_srl; |
|
26 | 26 | |
27 | 27 | // Get a type of component |
28 | 28 | $oEditorModel = getModel('editor'); |
29 | 29 | $oModuleModel = getModel('module'); |
30 | 30 | $editor_config = $oModuleModel->getModuleConfig('editor'); |
31 | 31 | |
32 | - if(!$editor_config) |
|
32 | + if (!$editor_config) |
|
33 | 33 | { |
34 | 34 | $editor_config = new stdClass(); |
35 | 35 | } |
36 | 36 | |
37 | 37 | //editor_config init |
38 | - if(!$editor_config->editor_height) $editor_config->editor_height = 300; |
|
39 | - if(!$editor_config->comment_editor_height) $editor_config->comment_editor_height = 100; |
|
40 | - if(!$editor_config->editor_skin) $editor_config->editor_skin = 'ckeditor'; |
|
41 | - if(!$editor_config->comment_editor_skin) $editor_config->comment_editor_skin = 'ckeditor'; |
|
42 | - if(!$editor_config->sel_editor_colorset) $editor_config->sel_editor_colorset= 'moono'; |
|
43 | - if(!$editor_config->sel_comment_editor_colorset) $editor_config->sel_comment_editor_colorset= 'moono'; |
|
38 | + if (!$editor_config->editor_height) $editor_config->editor_height = 300; |
|
39 | + if (!$editor_config->comment_editor_height) $editor_config->comment_editor_height = 100; |
|
40 | + if (!$editor_config->editor_skin) $editor_config->editor_skin = 'ckeditor'; |
|
41 | + if (!$editor_config->comment_editor_skin) $editor_config->comment_editor_skin = 'ckeditor'; |
|
42 | + if (!$editor_config->sel_editor_colorset) $editor_config->sel_editor_colorset = 'moono'; |
|
43 | + if (!$editor_config->sel_comment_editor_colorset) $editor_config->sel_comment_editor_colorset = 'moono'; |
|
44 | 44 | |
45 | 45 | $component_list = $oEditorModel->getComponentList(false, $site_srl, true); |
46 | 46 | $editor_skin_list = FileHandler::readDir(_XE_PATH_.'modules/editor/skins'); |
47 | 47 | |
48 | - $skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->editor_skin); |
|
48 | + $skin_info = $oModuleModel->loadSkinInfo($this->module_path, $editor_config->editor_skin); |
|
49 | 49 | |
50 | 50 | $contents = FileHandler::readDir(_XE_PATH_.'modules/editor/styles'); |
51 | 51 | $content_style_list = array(); |
52 | - for($i=0,$c=count($contents);$i<$c;$i++) |
|
52 | + for ($i = 0, $c = count($contents); $i < $c; $i++) |
|
53 | 53 | { |
54 | 54 | $style = $contents[$i]; |
55 | - $info = $oModuleModel->loadSkinInfo($this->module_path,$style,'styles'); |
|
55 | + $info = $oModuleModel->loadSkinInfo($this->module_path, $style, 'styles'); |
|
56 | 56 | $content_style_list[$style] = new stdClass(); |
57 | 57 | $content_style_list[$style]->title = $info->title; |
58 | 58 | } |
59 | 59 | |
60 | 60 | // Get install info, update info, count |
61 | 61 | $oAutoinstallModel = getModel('autoinstall'); |
62 | - foreach($component_list as $component_name => $xml_info) |
|
62 | + foreach ($component_list as $component_name => $xml_info) |
|
63 | 63 | { |
64 | 64 | $component_count++; |
65 | 65 | $xml_info->path = './modules/editor/components/'.$xml_info->component_name; |
66 | 66 | $xml_info->delete_url = $oAutoinstallModel->getRemoveUrlByPath($xml_info->path); |
67 | 67 | $xml_info->package_srl = $oAutoinstallModel->getPackageSrlByPath($xml_info->path); |
68 | - if($xml_info->package_srl) $targetpackages[$xml_info->package_srl] = 0; |
|
68 | + if ($xml_info->package_srl) $targetpackages[$xml_info->package_srl] = 0; |
|
69 | 69 | } |
70 | 70 | |
71 | - if(is_array($targetpackages)) $packages = $oAutoinstallModel->getInstalledPackages(array_keys($targetpackages)); |
|
71 | + if (is_array($targetpackages)) $packages = $oAutoinstallModel->getInstalledPackages(array_keys($targetpackages)); |
|
72 | 72 | |
73 | - foreach($component_list as $component_name => $xml_info) |
|
73 | + foreach ($component_list as $component_name => $xml_info) |
|
74 | 74 | { |
75 | - if($packages[$xml_info->package_srl]) $xml_info->need_update = $packages[$xml_info->package_srl]->need_update; |
|
75 | + if ($packages[$xml_info->package_srl]) $xml_info->need_update = $packages[$xml_info->package_srl]->need_update; |
|
76 | 76 | } |
77 | - $editor_config_default = array( "editor_height" => "300", "comment_editor_height" => "100","content_font_size"=>"13"); |
|
77 | + $editor_config_default = array("editor_height" => "300", "comment_editor_height" => "100", "content_font_size"=>"13"); |
|
78 | 78 | |
79 | 79 | //editor preview |
80 | 80 | $config = $oEditorModel->getEditorConfig(); |
@@ -138,12 +138,12 @@ discard block |
||
138 | 138 | function dispEditorAdminSetupComponent() |
139 | 139 | { |
140 | 140 | $site_module_info = Context::get('site_module_info'); |
141 | - $site_srl = (int)$site_module_info->site_srl; |
|
141 | + $site_srl = (int) $site_module_info->site_srl; |
|
142 | 142 | |
143 | 143 | $component_name = Context::get('component_name'); |
144 | 144 | // Get information of the editor component |
145 | 145 | $oEditorModel = getModel('editor'); |
146 | - $component = $oEditorModel->getComponent($component_name,$site_srl); |
|
146 | + $component = $oEditorModel->getComponent($component_name, $site_srl); |
|
147 | 147 | Context::set('component', $component); |
148 | 148 | // Get a group list to set a group |
149 | 149 | $oMemberModel = getModel('member'); |
@@ -152,20 +152,20 @@ discard block |
||
152 | 152 | // Get a mid list |
153 | 153 | $oModuleModel = getModel('module'); |
154 | 154 | |
155 | - $args =new stdClass(); |
|
155 | + $args = new stdClass(); |
|
156 | 156 | $args->site_srl = $site_srl; |
157 | 157 | $columnList = array('module_srl', 'mid', 'module_category_srl', 'browser_title'); |
158 | 158 | $mid_list = $oModuleModel->getMidList($args, $columnList); |
159 | 159 | // Combination of module_category and module |
160 | - if(!$args->site_srl) |
|
160 | + if (!$args->site_srl) |
|
161 | 161 | { |
162 | 162 | // Get a list of module category |
163 | 163 | $module_categories = $oModuleModel->getModuleCategories(); |
164 | 164 | |
165 | - if(!is_array($mid_list)) $mid_list = array($mid_list); |
|
166 | - foreach($mid_list as $module_srl => $module) |
|
165 | + if (!is_array($mid_list)) $mid_list = array($mid_list); |
|
166 | + foreach ($mid_list as $module_srl => $module) |
|
167 | 167 | { |
168 | - if($module) $module_categories[$module->module_category_srl]->list[$module_srl] = $module; |
|
168 | + if ($module) $module_categories[$module->module_category_srl]->list[$module_srl] = $module; |
|
169 | 169 | } |
170 | 170 | } |
171 | 171 | else |
@@ -173,13 +173,13 @@ discard block |
||
173 | 173 | $module_categories[0]->list = $mid_list; |
174 | 174 | } |
175 | 175 | |
176 | - Context::set('mid_list',$module_categories); |
|
176 | + Context::set('mid_list', $module_categories); |
|
177 | 177 | |
178 | 178 | //Security |
179 | 179 | $security = new Security(); |
180 | 180 | $security->encodeHTML('group_list..title'); |
181 | 181 | $security->encodeHTML('component...'); |
182 | - $security->encodeHTML('mid_list..title','mid_list..list..browser_title'); |
|
182 | + $security->encodeHTML('mid_list..title', 'mid_list..list..browser_title'); |
|
183 | 183 | |
184 | 184 | $this->setTemplatePath($this->module_path.'tpl'); |
185 | 185 | $this->setTemplateFile('setup_component'); |
@@ -16,16 +16,16 @@ discard block |
||
16 | 16 | $oModuleController = getController('module'); |
17 | 17 | // Add the default editor component |
18 | 18 | $oEditorController = getAdminController('editor'); |
19 | - $oEditorController->insertComponent('colorpicker_text',true); |
|
20 | - $oEditorController->insertComponent('colorpicker_bg',true); |
|
21 | - $oEditorController->insertComponent('emoticon',true); |
|
22 | - $oEditorController->insertComponent('url_link',true); |
|
23 | - $oEditorController->insertComponent('image_link',true); |
|
24 | - $oEditorController->insertComponent('multimedia_link',true); |
|
25 | - $oEditorController->insertComponent('quotation',true); |
|
26 | - $oEditorController->insertComponent('table_maker',true); |
|
27 | - $oEditorController->insertComponent('poll_maker',true); |
|
28 | - $oEditorController->insertComponent('image_gallery',true); |
|
19 | + $oEditorController->insertComponent('colorpicker_text', true); |
|
20 | + $oEditorController->insertComponent('colorpicker_bg', true); |
|
21 | + $oEditorController->insertComponent('emoticon', true); |
|
22 | + $oEditorController->insertComponent('url_link', true); |
|
23 | + $oEditorController->insertComponent('image_link', true); |
|
24 | + $oEditorController->insertComponent('multimedia_link', true); |
|
25 | + $oEditorController->insertComponent('quotation', true); |
|
26 | + $oEditorController->insertComponent('table_maker', true); |
|
27 | + $oEditorController->insertComponent('poll_maker', true); |
|
28 | + $oEditorController->insertComponent('image_gallery', true); |
|
29 | 29 | // Create a directory to use in the editor module |
30 | 30 | FileHandler::makeDir('./files/cache/editor'); |
31 | 31 | // 2007. 10. 17 Add a trigger to delete automatically saved document whenever the document(insert or update) is modified |
@@ -48,21 +48,21 @@ discard block |
||
48 | 48 | |
49 | 49 | $oDB = &DB::getInstance(); |
50 | 50 | // 2009. 06. 15 Save module_srl when auto-saving |
51 | - if(!$oDB->isColumnExists("editor_autosave","module_srl")) return true; |
|
52 | - if(!$oDB->isIndexExists("editor_autosave","idx_module_srl")) return true; |
|
51 | + if (!$oDB->isColumnExists("editor_autosave", "module_srl")) return true; |
|
52 | + if (!$oDB->isIndexExists("editor_autosave", "idx_module_srl")) return true; |
|
53 | 53 | |
54 | 54 | // 2007. 10. 17 Add a trigger to delete automatically saved document whenever the document(insert or update) is modified |
55 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) return true; |
|
56 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) return true; |
|
55 | + if (!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) return true; |
|
56 | + if (!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) return true; |
|
57 | 57 | // 2007. 10. 23 Add an editor trigger on the module addition setup |
58 | - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) return true; |
|
58 | + if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) return true; |
|
59 | 59 | // 2009. 04. 14 Add a trigger from compiled codes of the editor component |
60 | - if(!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) return true; |
|
60 | + if (!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) return true; |
|
61 | 61 | // 2009. 06. 19 Remove unused trigger |
62 | - if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) return true; |
|
62 | + if ($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) return true; |
|
63 | 63 | |
64 | 64 | // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied |
65 | - if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after')) return true; |
|
65 | + if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after')) return true; |
|
66 | 66 | |
67 | 67 | return false; |
68 | 68 | } |
@@ -77,29 +77,29 @@ discard block |
||
77 | 77 | |
78 | 78 | $oDB = &DB::getInstance(); |
79 | 79 | // Save module_srl when auto-saving 15/06/2009 |
80 | - if(!$oDB->isColumnExists("editor_autosave","module_srl")) |
|
81 | - $oDB->addColumn("editor_autosave","module_srl","number",11); |
|
80 | + if (!$oDB->isColumnExists("editor_autosave", "module_srl")) |
|
81 | + $oDB->addColumn("editor_autosave", "module_srl", "number", 11); |
|
82 | 82 | |
83 | 83 | // create an index on module_srl |
84 | - if(!$oDB->isIndexExists("editor_autosave","idx_module_srl")) $oDB->addIndex("editor_autosave","idx_module_srl", "module_srl"); |
|
84 | + if (!$oDB->isIndexExists("editor_autosave", "idx_module_srl")) $oDB->addIndex("editor_autosave", "idx_module_srl", "module_srl"); |
|
85 | 85 | |
86 | 86 | // 2007. 10. 17 Add a trigger to delete automatically saved document whenever the document(insert or update) is modified |
87 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) |
|
87 | + if (!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) |
|
88 | 88 | $oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'); |
89 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) |
|
89 | + if (!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) |
|
90 | 90 | $oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'); |
91 | 91 | // 2007. 10. Add an editor trigger on the module addition setup |
92 | - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) |
|
92 | + if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) |
|
93 | 93 | $oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before'); |
94 | 94 | // 2009. 04. 14 Add a trigger from compiled codes of the editor component |
95 | - if(!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) |
|
95 | + if (!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) |
|
96 | 96 | $oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before'); |
97 | 97 | // 2009. 06. 19 Remove unused trigger |
98 | - if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) |
|
98 | + if ($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) |
|
99 | 99 | $oModuleController->deleteTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before'); |
100 | 100 | |
101 | 101 | // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied |
102 | - if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after')) |
|
102 | + if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after')) |
|
103 | 103 | { |
104 | 104 | $oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after'); |
105 | 105 | } |
@@ -48,21 +48,37 @@ discard block |
||
48 | 48 | |
49 | 49 | $oDB = &DB::getInstance(); |
50 | 50 | // 2009. 06. 15 Save module_srl when auto-saving |
51 | - if(!$oDB->isColumnExists("editor_autosave","module_srl")) return true; |
|
52 | - if(!$oDB->isIndexExists("editor_autosave","idx_module_srl")) return true; |
|
51 | + if(!$oDB->isColumnExists("editor_autosave","module_srl")) { |
|
52 | + return true; |
|
53 | + } |
|
54 | + if(!$oDB->isIndexExists("editor_autosave","idx_module_srl")) { |
|
55 | + return true; |
|
56 | + } |
|
53 | 57 | |
54 | 58 | // 2007. 10. 17 Add a trigger to delete automatically saved document whenever the document(insert or update) is modified |
55 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) return true; |
|
56 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) return true; |
|
59 | + if(!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) { |
|
60 | + return true; |
|
61 | + } |
|
62 | + if(!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) { |
|
63 | + return true; |
|
64 | + } |
|
57 | 65 | // 2007. 10. 23 Add an editor trigger on the module addition setup |
58 | - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) return true; |
|
66 | + if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) { |
|
67 | + return true; |
|
68 | + } |
|
59 | 69 | // 2009. 04. 14 Add a trigger from compiled codes of the editor component |
60 | - if(!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) return true; |
|
70 | + if(!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) { |
|
71 | + return true; |
|
72 | + } |
|
61 | 73 | // 2009. 06. 19 Remove unused trigger |
62 | - if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) return true; |
|
74 | + if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) { |
|
75 | + return true; |
|
76 | + } |
|
63 | 77 | |
64 | 78 | // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied |
65 | - if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after')) return true; |
|
79 | + if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after')) { |
|
80 | + return true; |
|
81 | + } |
|
66 | 82 | |
67 | 83 | return false; |
68 | 84 | } |
@@ -77,26 +93,34 @@ discard block |
||
77 | 93 | |
78 | 94 | $oDB = &DB::getInstance(); |
79 | 95 | // Save module_srl when auto-saving 15/06/2009 |
80 | - if(!$oDB->isColumnExists("editor_autosave","module_srl")) |
|
81 | - $oDB->addColumn("editor_autosave","module_srl","number",11); |
|
96 | + if(!$oDB->isColumnExists("editor_autosave","module_srl")) { |
|
97 | + $oDB->addColumn("editor_autosave","module_srl","number",11); |
|
98 | + } |
|
82 | 99 | |
83 | 100 | // create an index on module_srl |
84 | - if(!$oDB->isIndexExists("editor_autosave","idx_module_srl")) $oDB->addIndex("editor_autosave","idx_module_srl", "module_srl"); |
|
101 | + if(!$oDB->isIndexExists("editor_autosave","idx_module_srl")) { |
|
102 | + $oDB->addIndex("editor_autosave","idx_module_srl", "module_srl"); |
|
103 | + } |
|
85 | 104 | |
86 | 105 | // 2007. 10. 17 Add a trigger to delete automatically saved document whenever the document(insert or update) is modified |
87 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) |
|
88 | - $oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'); |
|
89 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) |
|
90 | - $oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'); |
|
106 | + if(!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) { |
|
107 | + $oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'); |
|
108 | + } |
|
109 | + if(!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) { |
|
110 | + $oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'); |
|
111 | + } |
|
91 | 112 | // 2007. 10. Add an editor trigger on the module addition setup |
92 | - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) |
|
93 | - $oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before'); |
|
113 | + if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) { |
|
114 | + $oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before'); |
|
115 | + } |
|
94 | 116 | // 2009. 04. 14 Add a trigger from compiled codes of the editor component |
95 | - if(!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) |
|
96 | - $oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before'); |
|
117 | + if(!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) { |
|
118 | + $oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before'); |
|
119 | + } |
|
97 | 120 | // 2009. 06. 19 Remove unused trigger |
98 | - if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) |
|
99 | - $oModuleController->deleteTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before'); |
|
121 | + if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) { |
|
122 | + $oModuleController->deleteTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before'); |
|
123 | + } |
|
100 | 124 | |
101 | 125 | // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied |
102 | 126 | if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after')) |
@@ -36,8 +36,7 @@ discard block |
||
36 | 36 | Context::set('message', sprintf(Context::getLang('msg_component_is_not_founded'), $component)); |
37 | 37 | $this->setTemplatePath($this->module_path.'tpl'); |
38 | 38 | $this->setTemplateFile('component_not_founded'); |
39 | - } |
|
40 | - else |
|
39 | + } else |
|
41 | 40 | { |
42 | 41 | // Get the result after executing a method to display popup url of the component |
43 | 42 | $popup_content = $oComponent->getPopupContent(); |
@@ -82,7 +81,9 @@ discard block |
||
82 | 81 | // Get information of the current module |
83 | 82 | $current_module_info = Context::get('current_module_info'); |
84 | 83 | $current_module_srl = $current_module_info->module_srl; |
85 | - if(!$current_module_srl) return new Object(); |
|
84 | + if(!$current_module_srl) { |
|
85 | + return new Object(); |
|
86 | + } |
|
86 | 87 | } |
87 | 88 | // Get editors settings |
88 | 89 | $oEditorModel = getModel('editor'); |
@@ -172,8 +173,7 @@ discard block |
||
172 | 173 | $option_com->content_style = $config->comment_content_style; |
173 | 174 | $option_com->colorset = $config->sel_comment_editor_colorset; |
174 | 175 | $editor = $oEditorModel->getEditor(0, $option_com); |
175 | - } |
|
176 | - else |
|
176 | + } else |
|
177 | 177 | { |
178 | 178 | $option = new stdClass(); |
179 | 179 | $option->allow_fileupload = false; |
@@ -27,11 +27,11 @@ discard block |
||
27 | 27 | $component = Context::get('component'); |
28 | 28 | |
29 | 29 | $site_module_info = Context::get('site_module_info'); |
30 | - $site_srl = (int)$site_module_info->site_srl; |
|
30 | + $site_srl = (int) $site_module_info->site_srl; |
|
31 | 31 | // Get compoenet object |
32 | 32 | $oEditorModel = getModel('editor'); |
33 | 33 | $oComponent = &$oEditorModel->getComponentObject($component, $editor_sequence, $site_srl); |
34 | - if(!$oComponent->toBool()) |
|
34 | + if (!$oComponent->toBool()) |
|
35 | 35 | { |
36 | 36 | Context::set('message', sprintf(Context::getLang('msg_component_is_not_founded'), $component)); |
37 | 37 | $this->setTemplatePath($this->module_path.'tpl'); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $component_name = Context::get('component_name'); |
59 | 59 | |
60 | 60 | $site_module_info = Context::get('site_module_info'); |
61 | - $site_srl = (int)$site_module_info->site_srl; |
|
61 | + $site_srl = (int) $site_module_info->site_srl; |
|
62 | 62 | |
63 | 63 | $oEditorModel = getModel('editor'); |
64 | 64 | $component = $oEditorModel->getComponent($component_name, $site_srl); |
@@ -77,12 +77,12 @@ discard block |
||
77 | 77 | $current_module_srl = Context::get('module_srl'); |
78 | 78 | $current_module_srls = Context::get('module_srls'); |
79 | 79 | |
80 | - if(!$current_module_srl && !$current_module_srls) |
|
80 | + if (!$current_module_srl && !$current_module_srls) |
|
81 | 81 | { |
82 | 82 | // Get information of the current module |
83 | 83 | $current_module_info = Context::get('current_module_info'); |
84 | 84 | $current_module_srl = $current_module_info->module_srl; |
85 | - if(!$current_module_srl) return new Object(); |
|
85 | + if (!$current_module_srl) return new Object(); |
|
86 | 86 | } |
87 | 87 | // Get editors settings |
88 | 88 | $oEditorModel = getModel('editor'); |
@@ -95,17 +95,17 @@ discard block |
||
95 | 95 | $editor_skin_list = FileHandler::readDir(_XE_PATH_.'modules/editor/skins'); |
96 | 96 | Context::set('editor_skin_list', $editor_skin_list); |
97 | 97 | |
98 | - $skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->editor_skin); |
|
98 | + $skin_info = $oModuleModel->loadSkinInfo($this->module_path, $editor_config->editor_skin); |
|
99 | 99 | Context::set('editor_colorset_list', $skin_info->colorset); |
100 | - $skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->comment_editor_skin); |
|
100 | + $skin_info = $oModuleModel->loadSkinInfo($this->module_path, $editor_config->comment_editor_skin); |
|
101 | 101 | Context::set('editor_comment_colorset_list', $skin_info->colorset); |
102 | 102 | |
103 | 103 | $contents = FileHandler::readDir(_XE_PATH_.'modules/editor/styles'); |
104 | 104 | $content_style_list = array(); |
105 | - for($i=0,$c=count($contents);$i<$c;$i++) |
|
105 | + for ($i = 0, $c = count($contents); $i < $c; $i++) |
|
106 | 106 | { |
107 | 107 | $style = $contents[$i]; |
108 | - $info = $oModuleModel->loadSkinInfo($this->module_path,$style,'styles'); |
|
108 | + $info = $oModuleModel->loadSkinInfo($this->module_path, $style, 'styles'); |
|
109 | 109 | $content_style_list[$style] = new stdClass(); |
110 | 110 | $content_style_list[$style]->title = $info->title; |
111 | 111 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | { |
143 | 143 | $skin = Context::get('skin'); |
144 | 144 | $oModuleModel = getModel('module'); |
145 | - $skin_info = $oModuleModel->loadSkinInfo($this->module_path,$skin); |
|
145 | + $skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin); |
|
146 | 146 | $colorset = $skin_info->colorset; |
147 | 147 | Context::set('colorset', $colorset); |
148 | 148 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | |
155 | 155 | $mode = Context::get('mode'); |
156 | 156 | |
157 | - if($mode != 'main') |
|
157 | + if ($mode != 'main') |
|
158 | 158 | { |
159 | 159 | $option_com = new stdClass(); |
160 | 160 | $option_com->allow_fileupload = false; |