/** * @throws \Cunity\Core\Exception * @throws \Exception */ public function show() { if (Login::loggedIn() && $_GET['m'] !== "admin") { $this->registerScript("search", "livesearch"); $this->registerScript("messages", "message-modal"); $this->registerScript("notifications", "notifications"); $this->registerScript("messages", "chat"); $this->registerCss("messages", "chat"); $this->registerCss("search", "livesearch"); $this->registerCss("messages", "message-modal"); $this->registerCss("notifications", "notifications"); $this->registerScript("friends", "friends"); } $announcements = new Announcements(); $this->assign("announcements", $announcements->getAnnouncements()); if (Login::loggedIn()) { /** @noinspection PhpUndefinedMethodInspection */ $this->assign('user', $_SESSION['user']->getTable()->get($_SESSION['user']->userid)); } else { $this->assign('user', []); } $this->assign('isAdmin', UserHelper::isAdmin()); $this->assign('hasUpdate', UpdateHelper::hasUpdates()); $this->assign('menu', new Menu()); $this->registerCunityPlugin("jscrollpane", ["css/jquery.jscrollpane.css", "js/jquery.jscrollpane.min.js"]); $this->registerCunityPlugin("bootstrap-validator", ["css/bootstrapValidator.min.css", "js/bootstrapValidator.min.js"]); $this->_metadata["module"] = $_GET['m']; $this->assign("meta", $this->_metadata); $this->assign('script_head', implode("\n", $this->_headScripts)); $this->assign('css_head', base64_encode(implode(",", $this->_headCss))); $modRewrite = false; if (function_exists("apache_get_modules")) { $modRewrite = (bool) in_array('mod_rewrite', apache_get_modules()); } $this->assign('modrewrite', $modRewrite); if ($this->_useWrapper) { $this->assign('tpl_name', $this->_templateDir . '/styles/' . $this->_templateFile); $this->display($this->_wrapper); } else { $this->display($this->_templateDir . DIRECTORY_SEPARATOR . 'styles' . DIRECTORY_SEPARATOR . $this->_templateFile); } }
/** * */ public function __construct() { $this->assignments['hasUpdate'] = UpdateHelper::hasUpdates(); $this->render("update"); }