本文整理汇总了PHP中XoopsModule::setInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsModule::setInfo方法的具体用法?PHP XoopsModule::setInfo怎么用?PHP XoopsModule::setInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsModule
的用法示例。
在下文中一共展示了XoopsModule::setInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderAbout
/**
* 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'));
}