| Conditions | 15 |
| Paths | 24 |
| Total Lines | 478 |
| Code Lines | 251 |
| Lines | 208 |
| Ratio | 43.51 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 146 | public function render() |
||
| 147 | { |
||
| 148 | global $xoopsUser, $xoopsConfig; |
||
| 149 | if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $this->getmoduleDir() . '/language/' . $xoopsConfig['language'] . '/modinfo.php')) { |
||
| 150 | include_once XOOPS_ROOT_PATH . '/modules/' . $this->getmoduleDir() . '/language/' . $xoopsConfig['language'] . '/modinfo.php'; |
||
| 151 | include_once XOOPS_ROOT_PATH . '/modules/' . $this->getmoduleDir() . '/language/' . $xoopsConfig['language'] . '/admin.php'; |
||
| 152 | } else { |
||
| 153 | include_once XOOPS_ROOT_PATH . '/modules/' . $this->getmoduleDir() . '/language/portuguesebr/modinfo.php'; |
||
| 154 | include_once XOOPS_ROOT_PATH . '/modules/' . $this->getmoduleDir() . '/language/portuguesebr/admin.php'; |
||
| 155 | } |
||
| 156 | $moduleHandler = xoops_getHandler('module'); |
||
| 157 | $module = $moduleHandler->getByDirname(MPU_MOD_DIR); |
||
| 158 | $configHandler = xoops_getHandler('config'); |
||
| 159 | $moduleConfig = $configHandler->getConfigsByCat(0, $module->getVar('mid')); |
||
| 160 | $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS; |
||
| 161 | $module_id = $module->getVar('mid'); |
||
| 162 | $url = XOOPS_URL . $moduleConfig['mpu_conf_wysiwyg_path']; |
||
| 163 | if (!empty($xoopsUser) && is_object($xoopsUser) && $moduleConfig['mpu_conf_wysiwyg']) { |
||
| 164 | if (!$xoopsUser->isAdmin()) { |
||
| 165 | echo ' |
||
| 166 | <!-- TinyMCE --> |
||
| 167 | <script language="javascript" type="text/javascript" src="' . $url . '/tiny_mce.js"></script> |
||
| 168 | <script language="javascript" type="text/javascript"> |
||
| 169 | tinyMCE.init({ |
||
| 170 | mode : "textareas", |
||
| 171 | theme : "simple", |
||
| 172 | language : "' . $moduleConfig['mpu_conf_wysiwyg_lang'] . '", |
||
| 173 | editor_selector : "mpu_wysiwyg", |
||
| 174 | disk_cache : true, |
||
| 175 | debug : false, |
||
| 176 | plugins : "' . $moduleConfig['mpu_conf_wysiwyg_plugins'] . '", |
||
| 177 | theme_advanced_buttons1_add_before : "' . $moduleConfig['mpu_conf_wysiwyg_bt1b'] . '", |
||
| 178 | theme_advanced_buttons1_add : "' . $moduleConfig['mpu_conf_wysiwyg_bt1'] . '", |
||
| 179 | theme_advanced_buttons2_add : "' . $moduleConfig['mpu_conf_wysiwyg_bt2'] . '", |
||
| 180 | theme_advanced_buttons2_add_before: "' . $moduleConfig['mpu_conf_wysiwyg_bt2b'] . '", |
||
| 181 | theme_advanced_buttons3_add_before : "' . $moduleConfig['mpu_conf_wysiwyg_bt3b'] . '", |
||
| 182 | theme_advanced_buttons3_add : "' . $moduleConfig['mpu_conf_wysiwyg_bt3'] . '", |
||
| 183 | theme_advanced_buttons4 : "' . $moduleConfig['mpu_conf_wysiwyg_bt4'] . '", |
||
| 184 | theme_advanced_toolbar_location : "top", |
||
| 185 | theme_advanced_toolbar_align : "left", |
||
| 186 | theme_advanced_path_location : "bottom", |
||
| 187 | content_css : "' . XOOPS_THEME_URL . '/' . $GLOBALS['xoopsConfig']['theme_set'] . '/style.css", |
||
| 188 | plugin_insertdate_dateFormat : "' . $moduleConfig['mpu_conf_wysiwyg_frmtdata'] . '", |
||
| 189 | plugin_insertdate_timeFormat : "' . $moduleConfig['mpu_conf_wysiwyg_frmthora'] . '", |
||
| 190 | extended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]", |
||
| 191 | theme_advanced_resize_horizontal : true, |
||
| 192 | theme_advanced_resizing : true, |
||
| 193 | nonbreaking_force_tab : true, |
||
| 194 | apply_source_formatting : true, |
||
| 195 | convert_urls : false |
||
| 196 | }); |
||
| 197 | </script> |
||
| 198 | <!-- /TinyMCE -->'; |
||
| 199 | } else { |
||
| 200 | if ($moduleConfig['mpu_conf_gzip']) { |
||
| 201 | echo ' |
||
| 202 | <!-- TinyMCE --> |
||
| 203 | <script language="javascript" type="text/javascript" src="' . $url . '/tiny_mce_gzip.js"></script> |
||
| 204 | <script language="javascript" type="text/javascript"> |
||
| 205 | tinyMCE_GZ.init({ |
||
| 206 | plugins : "' . $moduleConfig['mpu_conf_wysiwyg_plugins'] . '", |
||
| 207 | themes : "advanced", |
||
| 208 | languages : "' . $moduleConfig['mpu_conf_wysiwyg_lang'] . '", |
||
| 209 | disk_cache : true, |
||
| 210 | debug : false |
||
| 211 | }); |
||
| 212 | </script> |
||
| 213 | <script language="javascript" type="text/javascript"> |
||
| 214 | tinyMCE.init({ |
||
| 215 | mode : "textareas", |
||
| 216 | theme : "advanced", |
||
| 217 | language : "' . $moduleConfig['mpu_conf_wysiwyg_lang'] . '", |
||
| 218 | editor_selector : "mpu_wysiwyg", |
||
| 219 | disk_cache : true, |
||
| 220 | debug : false, |
||
| 221 | plugins : "' . $moduleConfig['mpu_conf_wysiwyg_plugins'] . '", |
||
| 222 | theme_advanced_buttons1_add_before : "' . $moduleConfig['mpu_conf_wysiwyg_bt1b'] . '", |
||
| 223 | theme_advanced_buttons1_add : "' . $moduleConfig['mpu_conf_wysiwyg_bt1'] . '", |
||
| 224 | theme_advanced_buttons2_add : "' . $moduleConfig['mpu_conf_wysiwyg_bt2'] . '", |
||
| 225 | theme_advanced_buttons2_add_before: "' . $moduleConfig['mpu_conf_wysiwyg_bt2b'] . '", |
||
| 226 | theme_advanced_buttons3_add_before : "' . $moduleConfig['mpu_conf_wysiwyg_bt3b'] . '", |
||
| 227 | theme_advanced_buttons3_add : "' . $moduleConfig['mpu_conf_wysiwyg_bt3'] . '", |
||
| 228 | theme_advanced_buttons4 : "' . $moduleConfig['mpu_conf_wysiwyg_bt4'] . '", |
||
| 229 | theme_advanced_toolbar_location : "top", |
||
| 230 | theme_advanced_toolbar_align : "left", |
||
| 231 | theme_advanced_path_location : "bottom", |
||
| 232 | content_css : "' . XOOPS_THEME_URL . '/' . $GLOBALS['xoopsConfig']['theme_set'] . '/style.css", |
||
| 233 | plugin_insertdate_dateFormat : "' . $moduleConfig['mpu_conf_wysiwyg_frmtdata'] . '", |
||
| 234 | plugin_insertdate_timeFormat : "' . $moduleConfig['mpu_conf_wysiwyg_frmthora'] . '", |
||
| 235 | extended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]", |
||
| 236 | external_link_list_url : "' . XOOPS_URL . '/modules/' . MPU_MOD_DIR . '/include/mpu_files_list.js.php", |
||
| 237 | external_image_list_url : "' . XOOPS_URL . '/modules/' . MPU_MOD_DIR . '/include/mpu_image_list.js.php", |
||
| 238 | media_external_list_url : "' . XOOPS_URL . '/modules/' . MPU_MOD_DIR . '/include/mpu_media_list.js.php", |
||
| 239 | file_browser_callback : "mpu_chama_browser", |
||
| 240 | theme_advanced_resize_horizontal : true, |
||
| 241 | theme_advanced_resizing : true, |
||
| 242 | nonbreaking_force_tab : true, |
||
| 243 | apply_source_formatting : true, |
||
| 244 | convert_urls : false |
||
| 245 | });'; |
||
| 246 | View Code Duplication | if ($xoopsUser->isAdmin($module->getVar('mid'))) { |
|
| 247 | echo ' |
||
| 248 | function mpu_chama_browser(field_name, url, type, win) |
||
| 249 | { |
||
| 250 | if (type == "image") { |
||
| 251 | tinyMCE.addToLang("",{ |
||
| 252 | browser_procurar : "' . MPU_ADM_BROWSER_TITULO . '", |
||
| 253 | browser_gimg_title : "' . _IMGMANAGER . '", |
||
| 254 | browser_ger_imagens : "' . MPU_ADM_BROWSER_GER_IMG . '", |
||
| 255 | browser_nova_imagem : "' . MPU_ADM_BROWSER_NIMG . '", |
||
| 256 | browser_nova_cat : "' . MPU_ADM_BROWSER_NCAT . '" |
||
| 257 | }); |
||
| 258 | tinyMCE.openWindow({ |
||
| 259 | file : "' . XOOPS_URL . '/modules/' . MPU_MOD_DIR . '/admin/browser_image.php", |
||
| 260 | width : 550 + tinyMCE.getLang("lang_media_delta_width", 0), |
||
| 261 | height : 380 + tinyMCE.getLang("lang_media_delta_height", 0), |
||
| 262 | close_previous : "no" |
||
| 263 | }, { |
||
| 264 | win: win, |
||
| 265 | campo: field_name, |
||
| 266 | url : url, |
||
| 267 | inline : "yes", |
||
| 268 | resizable : "yes", |
||
| 269 | editor_id: "' . $this->getName() . '" |
||
| 270 | }); |
||
| 271 | } elseif (type == "media") { |
||
| 272 | tinyMCE.addToLang("",{ |
||
| 273 | browser_procurar : "' . MPU_ADM_BROWSER_TITULO . '", |
||
| 274 | browser_ger_medias : "' . MPU_ADM_BROWSER_GER_MED . '", |
||
| 275 | browser_media_title : "' . MPU_ADM_BROWSER_MED_TITULO . '", |
||
| 276 | browser_nova_media : "' . MPU_ADM_NMEDIA . '" |
||
| 277 | }); |
||
| 278 | tinyMCE.openWindow({ |
||
| 279 | file : "' . XOOPS_URL . '/modules/' . MPU_MOD_DIR . '/admin/browser_media.php", |
||
| 280 | width : 550 + tinyMCE.getLang("lang_media_delta_width", 0), |
||
| 281 | height : 380 + tinyMCE.getLang("lang_media_delta_height", 0), |
||
| 282 | close_previous : "no" |
||
| 283 | }, { |
||
| 284 | win: win, |
||
| 285 | campo: field_name, |
||
| 286 | url : url, |
||
| 287 | inline : "yes", |
||
| 288 | resizable : "yes", |
||
| 289 | editor_id: "' . $this->getName() . '" |
||
| 290 | }); |
||
| 291 | } elseif (type == "file") { |
||
| 292 | tinyMCE.addToLang("",{ |
||
| 293 | browser_procurar : "' . MPU_ADM_BROWSER_TITULO . '", |
||
| 294 | browser_ger_files : "' . MPU_ADM_BROWSER_GER_FIL . '", |
||
| 295 | browser_file_title : "' . MPU_ADM_BROWSER_FIL_TITULO . '", |
||
| 296 | browser_novo_file : "' . MPU_ADM_NFILE . '" |
||
| 297 | }); |
||
| 298 | tinyMCE.openWindow({ |
||
| 299 | file : "' . XOOPS_URL . '/modules/' . MPU_MOD_DIR . '/admin/browser_files.php", |
||
| 300 | width : 550 + tinyMCE.getLang("lang_media_delta_width", 0), |
||
| 301 | height : 380 + tinyMCE.getLang("lang_media_delta_height", 0), |
||
| 302 | close_previous : "no" |
||
| 303 | }, { |
||
| 304 | win: win, |
||
| 305 | campo: field_name, |
||
| 306 | url : url, |
||
| 307 | inline : "yes", |
||
| 308 | resizable : "yes", |
||
| 309 | editor_id: "' . $this->getName() . '" |
||
| 310 | }); |
||
| 311 | } |
||
| 312 | |||
| 313 | return false; |
||
| 314 | } |
||
| 315 | </script> |
||
| 316 | <!-- /TinyMCE --> |
||
| 317 | '; |
||
| 318 | } else { |
||
| 319 | echo ' |
||
| 320 | function mpu_chama_browser(field_name, url, type, win) |
||
| 321 | { |
||
| 322 | if (type == "image") { |
||
| 323 | tinyMCE.addToLang("",{ |
||
| 324 | browser_procurar : "' . MPU_ADM_BROWSER_TITULO . '", |
||
| 325 | browser_gimg_title : "' . _IMGMANAGER . '", |
||
| 326 | browser_ger_imagens : "' . MPU_ADM_BROWSER_GER_IMG . '", |
||
| 327 | browser_nova_imagem : "' . MPU_ADM_BROWSER_NIMG . '", |
||
| 328 | browser_nova_cat : "' . MPU_ADM_BROWSER_NCAT . '" |
||
| 329 | }); |
||
| 330 | tinyMCE.openWindow({ |
||
| 331 | file : "' . XOOPS_URL . '/modules/' . MPU_MOD_DIR . '/admin/browser_image.php", |
||
| 332 | width : 550 + tinyMCE.getLang("lang_media_delta_width", 0), |
||
| 333 | height : 380 + tinyMCE.getLang("lang_media_delta_height", 0), |
||
| 334 | close_previous : "no" |
||
| 335 | }, { |
||
| 336 | win: win, |
||
| 337 | campo: field_name, |
||
| 338 | url : url, |
||
| 339 | inline : "yes", |
||
| 340 | resizable : "yes", |
||
| 341 | editor_id: "' . $this->getName() . '" |
||
| 342 | }); |
||
| 343 | } |
||
| 344 | |||
| 345 | return false; |
||
| 346 | } |
||
| 347 | </script> |
||
| 348 | <!-- /TinyMCE --> |
||
| 349 | '; |
||
| 350 | } |
||
| 351 | } else { |
||
| 352 | echo ' |
||
| 353 | <!-- TinyMCE --> |
||
| 354 | <script language="javascript" type="text/javascript" src="' . $url . '/tiny_mce.js"></script> |
||
| 355 | <script language="javascript" type="text/javascript"> |
||
| 356 | tinyMCE.init({ |
||
| 357 | mode : "textareas", |
||
| 358 | theme : "advanced", |
||
| 359 | language : "' . $moduleConfig['mpu_conf_wysiwyg_lang'] . '", |
||
| 360 | editor_selector : "mpu_wysiwyg", |
||
| 361 | disk_cache : true, |
||
| 362 | debug : false, |
||
| 363 | plugins : "' . $moduleConfig['mpu_conf_wysiwyg_plugins'] . '", |
||
| 364 | theme_advanced_buttons1_add_before : "' . $moduleConfig['mpu_conf_wysiwyg_bt1b'] . '", |
||
| 365 | theme_advanced_buttons1_add : "' . $moduleConfig['mpu_conf_wysiwyg_bt1'] . '", |
||
| 366 | theme_advanced_buttons2_add : "' . $moduleConfig['mpu_conf_wysiwyg_bt2'] . '", |
||
| 367 | theme_advanced_buttons2_add_before: "' . $moduleConfig['mpu_conf_wysiwyg_bt2b'] . '", |
||
| 368 | theme_advanced_buttons3_add_before : "' . $moduleConfig['mpu_conf_wysiwyg_bt3b'] . '", |
||
| 369 | theme_advanced_buttons3_add : "' . $moduleConfig['mpu_conf_wysiwyg_bt3'] . '", |
||
| 370 | theme_advanced_buttons4 : "' . $moduleConfig['mpu_conf_wysiwyg_bt4'] . '", |
||
| 371 | theme_advanced_toolbar_location : "top", |
||
| 372 | theme_advanced_toolbar_align : "left", |
||
| 373 | theme_advanced_path_location : "bottom", |
||
| 374 | content_css : "' . XOOPS_THEME_URL . '/' . $GLOBALS['xoopsConfig']['theme_set'] . '/style.css", |
||
| 375 | plugin_insertdate_dateFormat : "' . $moduleConfig['mpu_conf_wysiwyg_frmtdata'] . '", |
||
| 376 | plugin_insertdate_timeFormat : "' . $moduleConfig['mpu_conf_wysiwyg_frmthora'] . '", |
||
| 377 | extended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]", |
||
| 378 | external_link_list_url : "' . XOOPS_URL . '/modules/' . MPU_MOD_DIR . '/include/mpu_link_list.js", |
||
| 379 | external_image_list_url : "' . XOOPS_URL . '/modules/' . MPU_MOD_DIR . '/include/mpu_image_list.js.php", |
||
| 380 | media_external_list_url : "' . XOOPS_URL . '/modules/' . MPU_MOD_DIR . '/include/mpu_media_list.js", |
||
| 381 | file_browser_callback : "mpu_chama_browser", |
||
| 382 | theme_advanced_resize_horizontal : true, |
||
| 383 | theme_advanced_resizing : true, |
||
| 384 | nonbreaking_force_tab : true, |
||
| 385 | apply_source_formatting : true, |
||
| 386 | convert_urls : false |
||
| 387 | });'; |
||
| 388 | View Code Duplication | if ($xoopsUser->isAdmin($module->getVar('mid'))) { |
|
| 389 | echo ' |
||
| 390 | function mpu_chama_browser(field_name, url, type, win) |
||
| 391 | { |
||
| 392 | if (type == "image") { |
||
| 393 | tinyMCE.addToLang("",{ |
||
| 394 | browser_procurar : "' . MPU_ADM_BROWSER_TITULO . '", |
||
| 395 | browser_gimg_title : "' . _IMGMANAGER . '", |
||
| 396 | browser_ger_imagens : "' . MPU_ADM_BROWSER_GER_IMG . '", |
||
| 397 | browser_nova_imagem : "' . MPU_ADM_BROWSER_NIMG . '", |
||
| 398 | browser_nova_cat : "' . MPU_ADM_BROWSER_NCAT . '" |
||
| 399 | }); |
||
| 400 | tinyMCE.openWindow({ |
||
| 401 | file : "' . XOOPS_URL . '/modules/' . MPU_MOD_DIR . '/admin/browser_image.php", |
||
| 402 | width : 550 + tinyMCE.getLang("lang_media_delta_width", 0), |
||
| 403 | height : 380 + tinyMCE.getLang("lang_media_delta_height", 0), |
||
| 404 | close_previous : "no" |
||
| 405 | }, { |
||
| 406 | win: win, |
||
| 407 | campo: field_name, |
||
| 408 | url : url, |
||
| 409 | inline : "yes", |
||
| 410 | resizable : "yes", |
||
| 411 | editor_id: "' . $this->getName() . '" |
||
| 412 | }); |
||
| 413 | } elseif (type == "media") { |
||
| 414 | tinyMCE.addToLang("",{ |
||
| 415 | browser_procurar : "' . MPU_ADM_BROWSER_TITULO . '", |
||
| 416 | browser_ger_medias : "' . MPU_ADM_BROWSER_GER_MED . '", |
||
| 417 | browser_media_title : "' . MPU_ADM_BROWSER_MED_TITULO . '", |
||
| 418 | browser_nova_media : "' . MPU_ADM_NMEDIA . '" |
||
| 419 | }); |
||
| 420 | tinyMCE.openWindow({ |
||
| 421 | file : "' . XOOPS_URL . '/modules/' . MPU_MOD_DIR . '/admin/browser_media.php", |
||
| 422 | width : 550 + tinyMCE.getLang("lang_media_delta_width", 0), |
||
| 423 | height : 380 + tinyMCE.getLang("lang_media_delta_height", 0), |
||
| 424 | close_previous : "no" |
||
| 425 | }, { |
||
| 426 | win: win, |
||
| 427 | campo: field_name, |
||
| 428 | url : url, |
||
| 429 | inline : "yes", |
||
| 430 | resizable : "yes", |
||
| 431 | editor_id: "' . $this->getName() . '" |
||
| 432 | }); |
||
| 433 | } elseif (type == "file") { |
||
| 434 | tinyMCE.addToLang("",{ |
||
| 435 | browser_procurar : "' . MPU_ADM_BROWSER_TITULO . '", |
||
| 436 | browser_ger_files : "' . MPU_ADM_BROWSER_GER_FIL . '", |
||
| 437 | browser_file_title : "' . MPU_ADM_BROWSER_FIL_TITULO . '", |
||
| 438 | browser_novo_file : "' . MPU_ADM_NFILE . '" |
||
| 439 | }); |
||
| 440 | tinyMCE.openWindow({ |
||
| 441 | file : "' . XOOPS_URL . '/modules/' . MPU_MOD_DIR . '/admin/browser_files.php", |
||
| 442 | width : 550 + tinyMCE.getLang("lang_media_delta_width", 0), |
||
| 443 | height : 380 + tinyMCE.getLang("lang_media_delta_height", 0), |
||
| 444 | close_previous : "no" |
||
| 445 | }, { |
||
| 446 | win: win, |
||
| 447 | campo: field_name, |
||
| 448 | url : url, |
||
| 449 | inline : "yes", |
||
| 450 | resizable : "yes", |
||
| 451 | editor_id: "' . $this->getName() . '" |
||
| 452 | }); |
||
| 453 | } |
||
| 454 | |||
| 455 | return false; |
||
| 456 | } |
||
| 457 | </script> |
||
| 458 | <!-- /TinyMCE -->'; |
||
| 459 | } else { |
||
| 460 | echo ' |
||
| 461 | function mpu_chama_browser(field_name, url, type, win) |
||
| 462 | { |
||
| 463 | if (type == "image") { |
||
| 464 | tinyMCE.addToLang("",{ |
||
| 465 | browser_procurar : "' . MPU_ADM_BROWSER_TITULO . '", |
||
| 466 | browser_gimg_title : "' . _IMGMANAGER . '", |
||
| 467 | browser_ger_imagens : "' . MPU_ADM_BROWSER_GER_IMG . '", |
||
| 468 | browser_nova_imagem : "' . MPU_ADM_BROWSER_NIMG . '", |
||
| 469 | browser_nova_cat : "' . MPU_ADM_BROWSER_NCAT . '" |
||
| 470 | }); |
||
| 471 | tinyMCE.openWindow({ |
||
| 472 | file : "' . XOOPS_URL . '/modules/' . MPU_MOD_DIR . '/admin/browser_image.php", |
||
| 473 | width : 550 + tinyMCE.getLang("lang_media_delta_width", 0), |
||
| 474 | height : 380 + tinyMCE.getLang("lang_media_delta_height", 0), |
||
| 475 | close_previous : "no" |
||
| 476 | }, { |
||
| 477 | win: win, |
||
| 478 | campo: field_name, |
||
| 479 | url : url, |
||
| 480 | inline : "yes", |
||
| 481 | resizable : "yes", |
||
| 482 | editor_id: "' . $this->getName() . '" |
||
| 483 | }); |
||
| 484 | } |
||
| 485 | |||
| 486 | return false; |
||
| 487 | } |
||
| 488 | </script> |
||
| 489 | <!-- /TinyMCE -->'; |
||
| 490 | } |
||
| 491 | } |
||
| 492 | } |
||
| 493 | // this is sooooo dirty and ugly, but the xoops-validation-script never gets the correct content, so I had to add a blank at the end of the textarea |
||
| 494 | $form = '<textarea id="' . $this->getName() . '" name="' . $this->getName() . '" rows="1" cols="1" style="width:' . $this->getWidth() . '; height:' . $this->getHeight() . '" class="mpu_wysiwyg">' . $this->getValue() . ' </textarea>'; |
||
| 495 | $form .= $this->_renderSmileys(1); |
||
| 496 | } else { |
||
| 497 | $hiddenText = 'xoopsHiddenText'; |
||
| 498 | $form = "<a name='moresmiley'></a><img onmouseover='style.cursor=\"hand\"' src='" |
||
| 499 | . XOOPS_URL |
||
| 500 | . "/assets/images/url.gif' alt='url' onclick='xoopsCodeUrl(\"" |
||
| 501 | . $this->getName() |
||
| 502 | . '", "' |
||
| 503 | . htmlspecialchars(_ENTERURL, ENT_QUOTES) |
||
| 504 | . '", "' |
||
| 505 | . htmlspecialchars(_ENTERWEBTITLE, ENT_QUOTES) |
||
| 506 | . "\");' /> <img onmouseover='style.cursor=\"hand\"' src='" |
||
| 507 | . XOOPS_URL |
||
| 508 | . "/assets/images/email.gif' alt='email' onclick='xoopsCodeEmail(\"" |
||
| 509 | . $this->getName() |
||
| 510 | . '", "' |
||
| 511 | . htmlspecialchars(_ENTEREMAIL, ENT_QUOTES) |
||
| 512 | . "\");' /> <img onclick='xoopsCodeImg(\"" |
||
| 513 | . $this->getName() |
||
| 514 | . '", "' |
||
| 515 | . htmlspecialchars(_ENTERIMGURL, ENT_QUOTES) |
||
| 516 | . '", "' |
||
| 517 | . htmlspecialchars(_ENTERIMGPOS, ENT_QUOTES) |
||
| 518 | . '", "' |
||
| 519 | . htmlspecialchars(_IMGPOSRORL, ENT_QUOTES) |
||
| 520 | . '", "' |
||
| 521 | . htmlspecialchars(_ERRORIMGPOS, ENT_QUOTES) |
||
| 522 | . "\");' onmouseover='style.cursor=\"hand\"' src='" |
||
| 523 | . XOOPS_URL |
||
| 524 | . "/assets/images/imgsrc.gif' alt='imgsrc' /> <img onmouseover='style.cursor=\"hand\"' onclick='openWithSelfMain(\"" |
||
| 525 | . XOOPS_URL |
||
| 526 | . '/imagemanager.php?target=' |
||
| 527 | . $this->getName() |
||
| 528 | . "\",\"imgmanager\",400,430);' src='" |
||
| 529 | . XOOPS_URL |
||
| 530 | . "/assets/images/image.gif' alt='image' /> <img src='" |
||
| 531 | . XOOPS_URL |
||
| 532 | . "/assets/images/code.gif' onmouseover='style.cursor=\"hand\"' alt='code' onclick='xoopsCodeCode(\"" |
||
| 533 | . $this->getName() |
||
| 534 | . '", "' |
||
| 535 | . htmlspecialchars(_ENTERCODE, ENT_QUOTES) |
||
| 536 | . "\");' /> <img onclick='xoopsCodeQuote(\"" |
||
| 537 | . $this->getName() |
||
| 538 | . '", "' |
||
| 539 | . htmlspecialchars(_ENTERQUOTE, ENT_QUOTES) |
||
| 540 | . "\");' onmouseover='style.cursor=\"hand\"' src='" |
||
| 541 | . XOOPS_URL |
||
| 542 | . "/assets/images/quote.gif' alt='quote' /><br />\n"; |
||
| 543 | |||
| 544 | $sizearray = array('xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'); |
||
| 545 | $form .= "<select id='" . $this->getName() . "Size' onchange='setVisible(\"" . $hiddenText . '");setElementSize("' . $hiddenText . "\",this.options[this.selectedIndex].value);'>\n"; |
||
| 546 | $form .= "<option value='SIZE'>" . _SIZE . "</option>\n"; |
||
| 547 | foreach ($sizearray as $size) { |
||
| 548 | $form .= "<option value='$size'>$size</option>\n"; |
||
| 549 | } |
||
| 550 | $form .= "</select>\n"; |
||
| 551 | $fontarray = array('Arial', 'Courier', 'Georgia', 'Helvetica', 'Impact', 'Verdana'); |
||
| 552 | $form .= "<select id='" . $this->getName() . "Font' onchange='setVisible(\"" . $hiddenText . '");setElementFont("' . $hiddenText . "\",this.options[this.selectedIndex].value);'>\n"; |
||
| 553 | $form .= "<option value='FONT'>" . _FONT . "</option>\n"; |
||
| 554 | foreach ($fontarray as $font) { |
||
| 555 | $form .= "<option value='$font'>$font</option>\n"; |
||
| 556 | } |
||
| 557 | $form .= "</select>\n"; |
||
| 558 | $colorarray = array('00', '33', '66', '99', 'CC', 'FF'); |
||
| 559 | $form .= "<select id='" . $this->getName() . "Color' onchange='setVisible(\"" . $hiddenText . '");setElementColor("' . $hiddenText . "\",this.options[this.selectedIndex].value);'>\n"; |
||
| 560 | $form .= "<option value='COLOR'>" . _COLOR . "</option>\n"; |
||
| 561 | foreach ($colorarray as $color1) { |
||
| 562 | foreach ($colorarray as $color2) { |
||
| 563 | foreach ($colorarray as $color3) { |
||
| 564 | $form .= "<option value='" . $color1 . $color2 . $color3 . '\' style=\'background-color:#' . $color1 . $color2 . $color3 . ';color:#' . $color1 . $color2 . $color3 . ";'>#" . $color1 . $color2 . $color3 . "</option>\n"; |
||
| 565 | } |
||
| 566 | } |
||
| 567 | } |
||
| 568 | $form .= "</select><span id='" . $hiddenText . '\'>' . _EXAMPLE . "</span>\n"; |
||
| 569 | $form .= "<br />\n"; |
||
| 570 | $form .= "<img onclick='javascript:setVisible(\"" |
||
| 571 | . $hiddenText |
||
| 572 | . '");makeBold("' |
||
| 573 | . $hiddenText |
||
| 574 | . "\");' onmouseover='style.cursor=\"hand\"' src='" |
||
| 575 | . XOOPS_URL |
||
| 576 | . "/assets/images/bold.gif' alt='bold' /> <img onclick='javascript:setVisible(\"" |
||
| 577 | . $hiddenText |
||
| 578 | . '");makeItalic("' |
||
| 579 | . $hiddenText |
||
| 580 | . "\");' onmouseover='style.cursor=\"hand\"' src='" |
||
| 581 | . XOOPS_URL |
||
| 582 | . "/assets/images/italic.gif' alt='italic' /> <img onclick='javascript:setVisible(\"" |
||
| 583 | . $hiddenText |
||
| 584 | . '");makeUnderline("' |
||
| 585 | . $hiddenText |
||
| 586 | . "\");' onmouseover='style.cursor=\"hand\"' src='" |
||
| 587 | . XOOPS_URL |
||
| 588 | . "/assets/images/underline.gif' alt='underline' /> <img onclick='javascript:setVisible(\"" |
||
| 589 | . $hiddenText |
||
| 590 | . '");makeLineThrough("' |
||
| 591 | . $hiddenText |
||
| 592 | . "\");' src='" |
||
| 593 | . XOOPS_URL |
||
| 594 | . "/assets/images/linethrough.gif' alt='linethrough' onmouseover='style.cursor=\"hand\"' /> <input type='text' id='" |
||
| 595 | . $this->getName() |
||
| 596 | . "Addtext' size='20' /> <input type='button' onclick='xoopsCodeText(\"" |
||
| 597 | . $this->getName() |
||
| 598 | . '", "' |
||
| 599 | . $hiddenText |
||
| 600 | . '", "' |
||
| 601 | . htmlspecialchars(_ENTERTEXTBOX, ENT_QUOTES) |
||
| 602 | . "\")' class='formButton' value='" |
||
| 603 | . _ADD |
||
| 604 | . '\' /><br /><br /><textarea id=\'' |
||
| 605 | . $this->getName() |
||
| 606 | . '\' name=\'' |
||
| 607 | . $this->getName() |
||
| 608 | . '\' onselect="xoopsSavePosition(\'' |
||
| 609 | . $this->getName() |
||
| 610 | . '\');" onclick="xoopsSavePosition(\'' |
||
| 611 | . $this->getName() |
||
| 612 | . '\');" onkeyup="xoopsSavePosition(\'' |
||
| 613 | . $this->getName() |
||
| 614 | . '\');" cols=\'50\' rows=\'20\' ' |
||
| 615 | . $this->getExtra() |
||
| 616 | . " style='width:100%; height: 400px;'>" |
||
| 617 | . $this->getValue() |
||
| 618 | . "</textarea><br />\n"; |
||
| 619 | $form .= $this->_renderSmileys(0); |
||
| 620 | } |
||
| 621 | |||
| 622 | return $form; |
||
| 623 | } |
||
| 624 | |||
| 712 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.