name = pathinfo($filepath, PATHINFO_FILENAME); /** * Session */ global $user; $disableRedirect = array( 'home', 'login', 'register', 'install' ); if (!isset($_SESSION['user']) && isset($_GET['page']) && !in_array($_GET['page'], $disableRedirect)) { header('Location: /?page=login'); die(); } /** * Power */ if ($user && $user->power < $this->power) { header('Location: /?page=power&required=' . $this->power); die(); } } public function header(): void { ?>
'; /** Default */ $stylesheetDefault = 'includes/assets/css/default.css'; $stylesheetDefaultModified = filemtime($stylesheetDefault); echo ''; /** Page */ $stylesheetPage = 'includes/assets/css/' . $this->name . '.css'; if (file_exists($stylesheetPage)) { $stylesheetPageModified = filemtime($stylesheetPage); echo ''; } /** * Scripts */ /** jQuery */ $scriptjQuery = 'node_modules/jquery/dist/jquery.min.js'; $scriptjQueryModified = filemtime($scriptjQuery); echo ''; /** Fomantic */ $scriptFomantic = 'semantic/dist/semantic.min.js'; $scriptFomanticModified = filemtime($scriptFomantic); echo ''; /** Default */ $scriptDefault = 'includes/assets/js/default.js'; $scriptDefaultModified = filemtime($scriptDefault); echo ''; /** Page */ $scriptPage = 'includes/assets/js/' . $this->name . '.js'; if (file_exists($scriptPage)) { $scriptPageModified = filemtime($scriptPage); echo ''; } ?>