Added editing function for pages (using tinymce).
Added editing pages for footer, banner, aside. Added page overview. Added public page. Added settings page. Added generator for embed pseudocodes.
This commit is contained in:
@ -9,25 +9,36 @@
|
||||
*
|
||||
* @param string $page Name / ID of the current page.
|
||||
* @param string $title Title of the page.
|
||||
* @param string $icon The icon of the website.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function printBackendHead(string $page = "home", string $title = "Home"):string {
|
||||
function printBackendHead(string $page = "home", string $title = "Home", string $icon = ""):string {
|
||||
|
||||
$output = '<!DOCTYPE html>
|
||||
<html lang="en" id="' . $page . '">
|
||||
<head>
|
||||
|
||||
<!-- Content Security policies -->
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src \'none\'; script-src \'self\'; connect-src \'self\'; img-src \'self\' data: blob:; style-src \'self\' \'unsafe-inline\'; font-src \'self\';" />
|
||||
|
||||
<title>' . $title . '</title>
|
||||
<link rel="stylesheet" type="text/css" href="themes/imports.css">
|
||||
<link rel="stylesheet" type="text/css" href="themes/default/default.css">
|
||||
<meta http-equiv="content-type" content="text/html;charset=utf-8">';
|
||||
|
||||
if ($icon) {
|
||||
$output .= '
|
||||
<link rel="shortcut icon" sizes="16x16 32x32" href="' . $icon . '" />
|
||||
';
|
||||
}
|
||||
|
||||
$output .= '
|
||||
<meta name="robots" content="none" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<script type="text/javascript" src="./js/newToolTip.js"></script>
|
||||
<script type="text/javascript" src="./js/main.js"></script>
|
||||
<script type="text/javascript" src="../js/main.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
@ -59,7 +70,7 @@ function printBackendHeader(string $title = "Home", string $helpText = ""):strin
|
||||
<span id="toggleNavigation"></span>
|
||||
<h1>' . $title . '</h1>
|
||||
<span>
|
||||
<span id="toggleTextBlocks"></span>';
|
||||
';
|
||||
if ($helpText) $output .= '
|
||||
<span class="newToolTipTag" data-for="pageHelp" id="helpText">
|
||||
<span>?</span>
|
||||
@ -69,6 +80,7 @@ function printBackendHeader(string $title = "Home", string $helpText = ""):strin
|
||||
</span>';
|
||||
$output .= '
|
||||
<span id="uploadFile"></span>
|
||||
<a id="logoutLink" href="./?logout"></a>
|
||||
</span>
|
||||
|
||||
</header>
|
||||
@ -100,12 +112,11 @@ function generateHelpToolTip(string $tooltipName, string $title, string $helpTex
|
||||
/**
|
||||
* Prints the navigation for the backend.
|
||||
*
|
||||
* @param string[] $translations Translation variable.
|
||||
* @param integer[] $numbers Count of the given values.
|
||||
* @param string[] $translations Translation variable.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function printBackendNav(array $translations, $numbers = []):string {
|
||||
function printBackendNav(array $translations):string {
|
||||
|
||||
$output = '
|
||||
|
||||
@ -119,24 +130,41 @@ function printBackendNav(array $translations, $numbers = []):string {
|
||||
<div>
|
||||
<a href="pages.php">' . $translations['pages'] . '</a>
|
||||
<a href="page.php"> + </a>';
|
||||
if (isset($numbers['pages'])) $output .= '
|
||||
<a href="users.php#listUsers">' . $numbers['pages'] . '</a>';
|
||||
if (isset($GLOBALS['pages']) and is_array($GLOBALS['pages'])) $output .= '
|
||||
<a href="pages.php">' . count($GLOBALS['pages']) . '</a>';
|
||||
$output .= '
|
||||
</div>
|
||||
<div>
|
||||
<a href="fileUpload.php">' . $translations['fileUpload'] . '</a>
|
||||
<a href="editHTMLPage.php?id=banner">' . $translations['banner'] . '</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="editHTMLPage.php?id=footer">' . $translations['footer'] . '</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="editHTMLPage.php?id=aside">' . $translations['aside'] . '</a>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
|
||||
if ($_SESSION['admin']) {
|
||||
$output .= '
|
||||
<div>
|
||||
<span>' . $translations['administration'] . '</span>
|
||||
<div>
|
||||
<a href="users.php#listUsers">' . $translations['users'] . '</a>
|
||||
<a href="users.php#addUser"> + </a>';
|
||||
if (isset($numbers['users'])) $output .= '
|
||||
<a href="users.php#listUsers">' . $numbers['users'] . '</a>';
|
||||
$output .= '
|
||||
if (isset($GLOBALS['users']) and is_array($GLOBALS['users'])) $output .= '
|
||||
<a href="users.php#listUsers">' . count($GLOBALS['users']) . '</a>';
|
||||
$output .= '
|
||||
</div>
|
||||
<div>
|
||||
<a href="settings.php">' . $translations['settings'] . '</a>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
||||
$output .= '
|
||||
|
||||
</nav>
|
||||
';
|
||||
@ -160,4 +188,5 @@ function printBackendEnd():string {
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user