$xoops->events()->triggerEvent('core.include.common.xframeoption'); if (!headers_sent() && !empty($xFrameOptions)) { header('X-Frame-Options: ' . $xFrameOptions); } /** * Check Bad Ip Addressed against database and block bad ones, requires configs loaded */ $xoops->security()->checkBadips(); /** * Load Language settings and defines */ $xoops->loadLocale(); //For legacy $xoops->setConfig('language', XoopsLocale::getLegacyLanguage()); date_default_timezone_set(XoopsLocale::getTimezone()); setlocale(LC_ALL, XoopsLocale::getLocale()); /** * User Sessions */ $member_handler = $xoops->getHandlerMember(); $xoops->session()->sessionStart(); /** * Gather some info about the logged in user */ if ($xoops->session()->has('xoopsUserId')) { $uid = $xoops->session()->get('xoopsUserId'); $xoops->user = $member_handler->getUser($uid); if ($xoops->user instanceof \XoopsUser) { if ((int) $xoops->user->getVar('last_login') + 60 * 5 < time()) { $user_handler = $xoops->getHandlerUser(); $criteria = new Criteria('uid', $uid);
/** * Load localization information * Folder structure for localization: * themes/themefolder/english * - main.php - language definitions * - style.css - localization stylesheet * - script.js - localization script * * @param string $type language domain (unused?) * * @return array list of 2 arrays, one */ public function getLocalizationAssets($type = "main") { $cssAssets = array(); $jsAssets = array(); $xoops = \Xoops::getInstance(); \Xoops\Locale::loadThemeLocale($this); $language = \XoopsLocale::getLocale(); // Load global localization stylesheet if available if (\XoopsLoad::fileExists($xoops->path('locale/' . $language . '/style.css'))) { $cssAssets[] = $xoops->path('locale/' . $language . '/style.css'); } //$this->addLanguage($type); // Load theme localization stylesheet and scripts if available if (\XoopsLoad::fileExists($this->path . '/locale/' . $language . '/script.js')) { $jsAssets[] = $this->url . '/locale/' . $language . '/script.js'; } if (\XoopsLoad::fileExists($this->path . '/locale/' . $language . '/style.css')) { $cssAssets[] = $this->path . '/locale/' . $language . '/style.css'; } return array($cssAssets, $jsAssets); }
} elseif (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoopsConfig['language'] . '/help/' . $page . '.html')) { $helpcontent = $xoops->tpl()->fetch(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoopsConfig['language'] . '/help/' . $page . '.html'); } else { if (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getVar('dirname', 'e') . '/language/english/help/' . $page . '.html')) { $helpcontent = $xoops->tpl()->fetch(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getVar('dirname', 'e') . '/language/english/help/' . $page . '.html'); } else { $xoops->tpl()->assign('load_error', 1); } } if ($module->getVar('dirname', 'e') != 'system') { $xoops->tpl()->assign('help_module', true); } $xoops->tpl()->assign('helpcontent', $helpcontent); } else { if ($helpfile = XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getVar('dirname', 'e') . '/locale/' . XoopsLocale::getLocale() . '/help/module_index.html')) { $helpcontent = $xoops->tpl()->fetch(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getVar('dirname', 'e') . '/locale/' . XoopsLocale::getLocale() . '/help/module_index.html'); } elseif (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoops->getConfig('language') . '/help/module_index.html')) { $helpcontent = $xoops->tpl()->fetch(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoops->getConfig('language') . '/help/module_index.html'); } else { $helpcontent = '<p>' . $module->getInfo('description') . '</p>'; } $xoops->tpl()->assign('helpcontent', $helpcontent); } } else { $system_breadcrumb->render(); $criteria = new CriteriaCompo(); $criteria->setOrder('weight'); // Get all installed modules $installed_mods = $xoops->getHandlerModule()->getObjectsArray($criteria); $listed_mods = array(); $i = 0;