@@ -44,27 +44,27 @@ |
||
44 | 44 | */ |
45 | 45 | public function render() |
46 | 46 | { |
47 | - $ret = $this->getTitle() . "\n" . '<form name="' . $this->getName() . '" id="' |
|
48 | - . $this->getName() . '" action="' . $this->getAction() . '" method="' . $this->getMethod() |
|
49 | - . '"' . $this->getExtra() . '>' . "\n" . '<table border="0" width="100%">' . "\n"; |
|
47 | + $ret = $this->getTitle()."\n".'<form name="'.$this->getName().'" id="' |
|
48 | + . $this->getName().'" action="'.$this->getAction().'" method="'.$this->getMethod() |
|
49 | + . '"'.$this->getExtra().'>'."\n".'<table border="0" width="100%">'."\n"; |
|
50 | 50 | $hidden = ""; |
51 | 51 | foreach ($this->getElements() as $ele) { |
52 | 52 | /* @var $ele Element */ |
53 | 53 | if (!$ele->isHidden()) { |
54 | 54 | if (!$ele instanceof Raw) { |
55 | - $ret .= '<tr valign="top" align="left"><td>' . $ele->getCaption(); |
|
55 | + $ret .= '<tr valign="top" align="left"><td>'.$ele->getCaption(); |
|
56 | 56 | if ($ele_desc = $ele->getDescription()) { |
57 | - $ret .= '<br /><br /><span style="font-weight: normal;">' . $ele_desc . '</span>'; |
|
57 | + $ret .= '<br /><br /><span style="font-weight: normal;">'.$ele_desc.'</span>'; |
|
58 | 58 | } |
59 | - $ret .= '</td><td>' . $ele->render() . '</td></tr>'; |
|
59 | + $ret .= '</td><td>'.$ele->render().'</td></tr>'; |
|
60 | 60 | } else { |
61 | 61 | $ret .= $ele->render(); |
62 | 62 | } |
63 | 63 | } else { |
64 | - $hidden .= $ele->render() . "\n"; |
|
64 | + $hidden .= $ele->render()."\n"; |
|
65 | 65 | } |
66 | 66 | } |
67 | - $ret .= '</table>' . "\n" . ' ' . $hidden . '</form>' . "\n"; |
|
67 | + $ret .= '</table>'."\n".' '.$hidden.'</form>'."\n"; |
|
68 | 68 | return $ret; |
69 | 69 | } |
70 | 70 | } |
@@ -83,7 +83,7 @@ |
||
83 | 83 | $editor_handler->allowed_editors = $this->allowed_editors; |
84 | 84 | $option_select = new Select("", $this->name, $this->value); |
85 | 85 | $onchangeCode = '"if(this.options[this.selectedIndex].value.length > 0 ){window.document.forms.' |
86 | - . $this->form->getName() . '.submit();}"'; |
|
86 | + . $this->form->getName().'.submit();}"'; |
|
87 | 87 | $option_select->set('onchange', $onchangeCode); |
88 | 88 | $option_select->addOptionArray($editor_handler->getList($this->nohtml)); |
89 | 89 | $this->addElement($option_select); |
@@ -74,7 +74,7 @@ |
||
74 | 74 | $configs = $this->captchaHandler->loadConfig(); |
75 | 75 | |
76 | 76 | $this->captchaHandler->setConfigs($configs); |
77 | - if (! $this->captchaHandler->isActive()) { |
|
77 | + if (!$this->captchaHandler->isActive()) { |
|
78 | 78 | $this->setHidden(); |
79 | 79 | } |
80 | 80 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | return $default; |
132 | 132 | } |
133 | 133 | |
134 | - $this->addLog("Getting config '{$name}' : " . $configs[$name]); |
|
134 | + $this->addLog("Getting config '{$name}' : ".$configs[$name]); |
|
135 | 135 | |
136 | 136 | return $configs[$name]; |
137 | 137 | } |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | */ |
214 | 214 | public function url($url = '') |
215 | 215 | { |
216 | - return $this->xoops()->url('modules/' . $this->dirname . '/' . $url); |
|
216 | + return $this->xoops()->url('modules/'.$this->dirname.'/'.$url); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | /** |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | */ |
226 | 226 | public function path($path = '') |
227 | 227 | { |
228 | - return $this->xoops()->path('modules/' . $this->dirname . '/' . $path); |
|
228 | + return $this->xoops()->path('modules/'.$this->dirname.'/'.$path); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
@@ -35,7 +35,7 @@ |
||
35 | 35 | if ($xoops->isActiveModule($dirname)) { |
36 | 36 | //Load Module helper if available |
37 | 37 | if (\XoopsLoad::loadFile($xoops->path("modules/{$dirname}/class/helper.php"))) { |
38 | - $className = '\\' . ucfirst($dirname); |
|
38 | + $className = '\\'.ucfirst($dirname); |
|
39 | 39 | if (class_exists($className)) { |
40 | 40 | $class = new $className(); |
41 | 41 | if ($class instanceof \Xoops\Module\Helper\HelperAbstract) { |
@@ -70,8 +70,8 @@ |
||
70 | 70 | } |
71 | 71 | foreach ($dirnames as $dirname) { |
72 | 72 | if (\XoopsLoad::loadFile($xoops->path("modules/{$dirname}/class/plugin/{$pluginName}.php"))) { |
73 | - $className = '\\' . ucfirst($dirname) . ucfirst($pluginName) . 'Plugin'; |
|
74 | - $interface = '\\' . ucfirst($pluginName) . 'PluginInterface'; |
|
73 | + $className = '\\'.ucfirst($dirname).ucfirst($pluginName).'Plugin'; |
|
74 | + $interface = '\\'.ucfirst($pluginName).'PluginInterface'; |
|
75 | 75 | $class = new $className($dirname); |
76 | 76 | if ($class instanceof $interface) { |
77 | 77 | static::$plugins[$pluginName][$dirname] = $class; |
@@ -283,21 +283,21 @@ discard block |
||
283 | 283 | */ |
284 | 284 | public function addConfigModuleVersion($moddir, $minversion) |
285 | 285 | { |
286 | - $return=false; |
|
287 | - $helper= \Xoops::getInstance()->getModuleHelper($moddir); |
|
286 | + $return = false; |
|
287 | + $helper = \Xoops::getInstance()->getModuleHelper($moddir); |
|
288 | 288 | if (is_object($helper) && is_object($helper->getModule())) { |
289 | - $mod_modversion=$helper->getModule()->getVar('version'); |
|
290 | - $mod_version_f = $mod_modversion/100; |
|
291 | - $min_version_f = $minversion/100; |
|
289 | + $mod_modversion = $helper->getModule()->getVar('version'); |
|
290 | + $mod_version_f = $mod_modversion / 100; |
|
291 | + $min_version_f = $minversion / 100; |
|
292 | 292 | $value = sprintf( |
293 | 293 | \XoopsLocale::EF_MODULE_VERSION, |
294 | 294 | strtoupper($moddir), |
295 | 295 | $min_version_f, |
296 | 296 | $mod_version_f |
297 | 297 | ); |
298 | - if ($mod_modversion>=$minversion) { |
|
298 | + if ($mod_modversion >= $minversion) { |
|
299 | 299 | $this->addConfigAccept($value); |
300 | - $return=true; |
|
300 | + $return = true; |
|
301 | 301 | } else { |
302 | 302 | $this->addConfigError($value); |
303 | 303 | } |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | $value = sprintf( |
306 | 306 | \XoopsLocale::EF_MODULE_NOTFOUND, |
307 | 307 | strtoupper($moddir), |
308 | - $minversion/100 |
|
308 | + $minversion / 100 |
|
309 | 309 | ); |
310 | 310 | $this->addConfigError($value); |
311 | 311 | } |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | */ |
397 | 397 | private function getTplPath($type = '') |
398 | 398 | { |
399 | - return 'admin:' . $this->tplModule . '/' . $this->tplFile[$type]; |
|
399 | + return 'admin:'.$this->tplModule.'/'.$this->tplFile[$type]; |
|
400 | 400 | } |
401 | 401 | |
402 | 402 | /** |
@@ -484,19 +484,19 @@ discard block |
||
484 | 484 | $xoops = \Xoops::getInstance(); |
485 | 485 | $this->module->loadAdminMenu(); |
486 | 486 | foreach (array_keys($this->module->adminmenu) as $i) { |
487 | - if (\XoopsLoad::fileExists($xoops->path("media/xoops/images/icons/32/" . $this->module->adminmenu[$i]['icon']))) { |
|
488 | - $this->module->adminmenu[$i]['icon'] = $xoops->url("media/xoops/images/icons/32/" . $this->module->adminmenu[$i]['icon']); |
|
489 | - } elseif (\XoopsLoad::fileExists($xoops->path("modules/" . $xoops->module->dirname() . "/assets/icons/32/" . $this->module->adminmenu[$i]['icon']))) { |
|
490 | - $this->module->adminmenu[$i]['icon'] = $xoops->url("modules/" . $xoops->module->dirname() . "/assets/icons/32/" . $this->module->adminmenu[$i]['icon']); |
|
487 | + if (\XoopsLoad::fileExists($xoops->path("media/xoops/images/icons/32/".$this->module->adminmenu[$i]['icon']))) { |
|
488 | + $this->module->adminmenu[$i]['icon'] = $xoops->url("media/xoops/images/icons/32/".$this->module->adminmenu[$i]['icon']); |
|
489 | + } elseif (\XoopsLoad::fileExists($xoops->path("modules/".$xoops->module->dirname()."/assets/icons/32/".$this->module->adminmenu[$i]['icon']))) { |
|
490 | + $this->module->adminmenu[$i]['icon'] = $xoops->url("modules/".$xoops->module->dirname()."/assets/icons/32/".$this->module->adminmenu[$i]['icon']); |
|
491 | 491 | } else { |
492 | - $this->module->adminmenu[$i]['icon'] = $xoops->url("modules/" . $xoops->module->dirname() . "/icons/32/" . $this->module->adminmenu[$i]['icon']); |
|
492 | + $this->module->adminmenu[$i]['icon'] = $xoops->url("modules/".$xoops->module->dirname()."/icons/32/".$this->module->adminmenu[$i]['icon']); |
|
493 | 493 | } |
494 | 494 | $xoops->tpl()->append('xo_admin_index_menu', $this->module->adminmenu[$i]); |
495 | 495 | } |
496 | 496 | if ($this->module->getInfo('help')) { |
497 | 497 | $help = array(); |
498 | - $help['link'] = '../system/help.php?mid=' . $this->module->getVar('mid', 's') |
|
499 | - . "&" . $this->module->getInfo('help'); |
|
498 | + $help['link'] = '../system/help.php?mid='.$this->module->getVar('mid', 's') |
|
499 | + . "&".$this->module->getInfo('help'); |
|
500 | 500 | $help['icon'] = $xoops->url("/media/xoops/images/icons/32/help.png"); |
501 | 501 | $help['title'] = \XoopsLocale::HELP; |
502 | 502 | $xoops->tpl()->append('xo_admin_index_menu', $help); |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | if (0 >= version_compare($dbCurrentVersion, $dbRequiredVersion)) { |
558 | 558 | $this->addConfigBoxLine( |
559 | 559 | sprintf( |
560 | - strtoupper(\XoopsBaseConfig::get('db-type')) . ' ' |
|
560 | + strtoupper(\XoopsBaseConfig::get('db-type')).' ' |
|
561 | 561 | . \XoopsLocale::F_MINIMUM_DATABASE_VERSION_REQUIRED, |
562 | 562 | $dbRequiredVersion, |
563 | 563 | $dbCurrentVersion |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | } else { |
568 | 568 | $this->addConfigBoxLine( |
569 | 569 | sprintf( |
570 | - strtoupper(\XoopsBaseConfig::get('db-type')) . ' ' . \XoopsLocale::F_MINIMUM_DATABASE_VERSION_REQUIRED, |
|
570 | + strtoupper(\XoopsBaseConfig::get('db-type')).' '.\XoopsLocale::F_MINIMUM_DATABASE_VERSION_REQUIRED, |
|
571 | 571 | $dbRequiredVersion, |
572 | 572 | $dbCurrentVersion |
573 | 573 | ), |
@@ -635,13 +635,13 @@ discard block |
||
635 | 635 | |
636 | 636 | $this->module->loadAdminMenu(); |
637 | 637 | foreach (array_keys($this->module->adminmenu) as $i) { |
638 | - if ($this->module->adminmenu[$i]['link'] == "admin/" . $menu) { |
|
639 | - if (\XoopsLoad::fileExists($xoops->path("media/xoops/images/icons/32/" . $this->module->adminmenu[$i]['icon']))) { |
|
640 | - $this->module->adminmenu[$i]['icon'] = $xoops->url("media/xoops/images/icons/32/". $this->module->adminmenu[$i]['icon']); |
|
641 | - } elseif (\XoopsLoad::fileExists($xoops->path("modules/" . $xoops->module->dirname() . "/assets/icons/32/" . $this->module->adminmenu[$i]['icon']))) { |
|
642 | - $this->module->adminmenu[$i]['icon'] = $xoops->url("modules/" . $xoops->module->dirname() . "/assets/icons/32/" . $this->module->adminmenu[$i]['icon']); |
|
638 | + if ($this->module->adminmenu[$i]['link'] == "admin/".$menu) { |
|
639 | + if (\XoopsLoad::fileExists($xoops->path("media/xoops/images/icons/32/".$this->module->adminmenu[$i]['icon']))) { |
|
640 | + $this->module->adminmenu[$i]['icon'] = $xoops->url("media/xoops/images/icons/32/".$this->module->adminmenu[$i]['icon']); |
|
641 | + } elseif (\XoopsLoad::fileExists($xoops->path("modules/".$xoops->module->dirname()."/assets/icons/32/".$this->module->adminmenu[$i]['icon']))) { |
|
642 | + $this->module->adminmenu[$i]['icon'] = $xoops->url("modules/".$xoops->module->dirname()."/assets/icons/32/".$this->module->adminmenu[$i]['icon']); |
|
643 | 643 | } else { |
644 | - $this->module->adminmenu[$i]['icon'] = $xoops->url("modules/" . $xoops->module->dirname() . "/icons/32/". $this->module->adminmenu[$i]['icon']); |
|
644 | + $this->module->adminmenu[$i]['icon'] = $xoops->url("modules/".$xoops->module->dirname()."/icons/32/".$this->module->adminmenu[$i]['icon']); |
|
645 | 645 | } |
646 | 646 | $xoops->tpl()->assign('xo_sys_navigation', $this->module->adminmenu[$i]); |
647 | 647 | $ret[] = $xoops->tpl()->fetch($this->getTplPath('nav')); |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | foreach (array_keys($author) as $i) { |
708 | 708 | $author_list .= $author[$i]; |
709 | 709 | if (isset($nickname[$i]) && $nickname[$i] != '') { |
710 | - $author_list .= " (" . $nickname[$i] . "), "; |
|
710 | + $author_list .= " (".$nickname[$i]."), "; |
|
711 | 711 | } else { |
712 | 712 | $author_list .= ", "; |
713 | 713 | } |
@@ -715,19 +715,19 @@ discard block |
||
715 | 715 | $changelog = ''; |
716 | 716 | $language = $xoops->getConfig('locale'); |
717 | 717 | if (!is_file( |
718 | - \XoopsBaseConfig::get('root-path') . "/modules/" . $this->module->getVar("dirname") |
|
719 | - . "/locale/" . $language . "/changelog.txt" |
|
718 | + \XoopsBaseConfig::get('root-path')."/modules/".$this->module->getVar("dirname") |
|
719 | + . "/locale/".$language."/changelog.txt" |
|
720 | 720 | )) { |
721 | 721 | $language = 'en_US'; |
722 | 722 | } |
723 | - $file = \XoopsBaseConfig::get('root-path') . "/modules/" . $this->module->getVar("dirname") |
|
724 | - . "/locale/" . $language . "/changelog.txt"; |
|
723 | + $file = \XoopsBaseConfig::get('root-path')."/modules/".$this->module->getVar("dirname") |
|
724 | + . "/locale/".$language."/changelog.txt"; |
|
725 | 725 | if (is_readable($file)) { |
726 | - $changelog = utf8_encode(implode("<br />", file($file))) . "\n"; |
|
726 | + $changelog = utf8_encode(implode("<br />", file($file)))."\n"; |
|
727 | 727 | } else { |
728 | - $file = \XoopsBaseConfig::get('root-path') . "/modules/" . $this->module->getVar("dirname") . "/docs/changelog.txt"; |
|
728 | + $file = \XoopsBaseConfig::get('root-path')."/modules/".$this->module->getVar("dirname")."/docs/changelog.txt"; |
|
729 | 729 | if (is_readable($file)) { |
730 | - $changelog = utf8_encode(implode("<br />", file($file))) . "\n"; |
|
730 | + $changelog = utf8_encode(implode("<br />", file($file)))."\n"; |
|
731 | 731 | } |
732 | 732 | } |
733 | 733 | $author_list = substr($author_list, 0, -2); |
@@ -742,22 +742,22 @@ discard block |
||
742 | 742 | |
743 | 743 | $this->addInfoBox(\XoopsLocale::MODULE_INFORMATION, 'info', 'id="xo-about"'); |
744 | 744 | $this->addInfoBoxLine( |
745 | - \XoopsLocale::C_DESCRIPTION . ' ' . $this->module->getInfo("description"), |
|
745 | + \XoopsLocale::C_DESCRIPTION.' '.$this->module->getInfo("description"), |
|
746 | 746 | 'info' |
747 | 747 | ); |
748 | 748 | $this->addInfoBoxLine( |
749 | - \XoopsLocale::C_UPDATE_DATE . ' <span class="bold">' |
|
749 | + \XoopsLocale::C_UPDATE_DATE.' <span class="bold">' |
|
750 | 750 | . \XoopsLocale::formatTimestamp($this->module->getVar("last_update"), "m") |
751 | 751 | . '</span>', |
752 | 752 | 'info' |
753 | 753 | ); |
754 | 754 | $this->addInfoBoxLine( |
755 | - \XoopsLocale::C_WEBSITE . ' <a class="xo-tooltip" href="http://' |
|
755 | + \XoopsLocale::C_WEBSITE.' <a class="xo-tooltip" href="http://' |
|
756 | 756 | . $this->module->getInfo("module_website_url") |
757 | 757 | . '" rel="external" title="' |
758 | - . $this->module->getInfo("module_website_name") . ' - ' |
|
759 | - . $this->module->getInfo("module_website_url") . '">' |
|
760 | - . $this->module->getInfo("module_website_name") . '</a>', |
|
758 | + . $this->module->getInfo("module_website_name").' - ' |
|
759 | + . $this->module->getInfo("module_website_url").'">' |
|
760 | + . $this->module->getInfo("module_website_name").'</a>', |
|
761 | 761 | 'info' |
762 | 762 | ); |
763 | 763 |
@@ -171,7 +171,7 @@ |
||
171 | 171 | public static function substr($str, $start, $length, $ellipsis = '…') |
172 | 172 | { |
173 | 173 | $str2 = mb_strcut($str, $start, $length - strlen($ellipsis)); |
174 | - return $str2 . (mb_strlen($str)-$start != mb_strlen($str2) ? $ellipsis : ''); |
|
174 | + return $str2.(mb_strlen($str) - $start != mb_strlen($str2) ? $ellipsis : ''); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
@@ -41,7 +41,7 @@ |
||
41 | 41 | */ |
42 | 42 | public function render() |
43 | 43 | { |
44 | - $tag = '<img ' . $this->renderAttributeString() . ' />'; |
|
44 | + $tag = '<img '.$this->renderAttributeString().' />'; |
|
45 | 45 | |
46 | 46 | return $tag; |
47 | 47 | } |