/** * Render about page * * @param bool $logo_xoops show logo * * @return bool|mixed|string */ public function renderAbout($logo_xoops = true) { $xoops = \Xoops::getInstance(); $date = explode('/', $this->module->getInfo('release_date')); $author = explode(',', $this->module->getInfo('author')); $nickname = explode(',', $this->module->getInfo('nickname')); $release_date = \XoopsLocale::formatTimestamp(mktime(0, 0, 0, $date[1], $date[2], $date[0]), 's'); $author_list = ''; foreach (array_keys($author) as $i) { $author_list .= $author[$i]; if (isset($nickname[$i]) && $nickname[$i] != '') { $author_list .= " (" . $nickname[$i] . "), "; } else { $author_list .= ", "; } } $changelog = ''; $language = $xoops->getConfig('locale'); if (!is_file(\XoopsBaseConfig::get('root-path') . "/modules/" . $this->module->getVar("dirname") . "/locale/" . $language . "/changelog.txt")) { $language = 'en_US'; } $file = \XoopsBaseConfig::get('root-path') . "/modules/" . $this->module->getVar("dirname") . "/locale/" . $language . "/changelog.txt"; if (is_readable($file)) { $changelog = utf8_encode(implode("<br />", file($file))) . "\n"; } else { $file = \XoopsBaseConfig::get('root-path') . "/modules/" . $this->module->getVar("dirname") . "/docs/changelog.txt"; if (is_readable($file)) { $changelog = utf8_encode(implode("<br />", file($file))) . "\n"; } } $author_list = substr($author_list, 0, -2); $this->module->setInfo('release_date', $release_date); $this->module->setInfo('author_list', $author_list); if (is_array($this->module->getInfo('paypal'))) { $this->module->setInfo('paypal', $this->module->getInfo('paypal')); } $this->module->setInfo('changelog', $changelog); $xoops->tpl()->assign('module', $this->module); $this->addInfoBox(\XoopsLocale::MODULE_INFORMATION, 'info', 'id="xo-about"'); $this->addInfoBoxLine(\XoopsLocale::C_DESCRIPTION . ' ' . $this->module->getInfo("description"), 'info'); $this->addInfoBoxLine(\XoopsLocale::C_UPDATE_DATE . ' <span class="bold">' . \XoopsLocale::formatTimestamp($this->module->getVar("last_update"), "m") . '</span>', 'info'); $this->addInfoBoxLine(\XoopsLocale::C_WEBSITE . ' <a class="xo-tooltip" href="http://' . $this->module->getInfo("module_website_url") . '" rel="external" title="' . $this->module->getInfo("module_website_name") . ' - ' . $this->module->getInfo("module_website_url") . '">' . $this->module->getInfo("module_website_name") . '</a>', 'info'); $xoops->tpl()->assign('xoops_logo', $logo_xoops); $xoops->tpl()->assign('xo_admin_box', $this->itemInfoBox); return $xoops->tpl()->fetch($this->getTplPath('about')); }