Skip to content
This repository was archived by the owner on May 31, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 84 additions & 69 deletions admin.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
<?php include("inc/adminpanel.php"); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//DE" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--
** This is YaP - Yet another Pager
** Yet another Pager is a content management system without a (common) database.
** It uses xml-files to save it's content.
** We are aviable on http://github.com/chrischdi/YaP
-->

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
<title><?php $ap->website->title(); ?> AdminPanel - <?php $ap->page->title(); ?></title>

<style type="text/css">
* {
border: 0px;
}

#header, #headbar {
height: 95px;
html, body {
height: 100%;
margin: 0;
padding: 0;
font-family: sans-serif,verdana;
}

#wrapper {
Expand All @@ -27,39 +32,47 @@
width: 960px;
}

html, body {
height: 100%;
margin: 0;
padding: 0;
font-family: sans-serif,verdana;
#header, #headbar {
height: 95px;
}

#headbar {
background-color:#3B5998;
width:100%
left: 0;
}
#headbar {
background-color:#3B5998;
width:100%
left: 0;
}

#header {
text-align: center;
width: 960px;
color: #ffffff;
}

#header div {
padding: 5px;
}
#header div {
padding: 5px;
}

#header h1 a:link, #header h1 a:visited, #header h1 :hover, #header h1 a:active {
margin: 0 2px;
color: #ffffff;
text-decoration:none;
}
#header h1 a:link, #header h1 a:visited, #header h1 :hover, #header h1 a:active {
margin: 0 2px;
color: #ffffff;
text-decoration:none;
}

#nav {
margin-top: -23px;
}

#nav a:link, #nav a:visited, #nav a:hover, #nav a:active {
margin: 0 2px;
color: #eeeeee;
text-decoration:none;
}

#nav a:hover {
color: #ffffff;
text-decoration: underline;
}

#main {
margin: 10px 0;
width: 960px;
Expand All @@ -80,104 +93,106 @@
height: 40px;
padding: 10px;
text-align: center;
}input
}

#footer span {
margin: 0 10px 0 10px;
}

#nav a:link, #nav a:visited, #nav a:hover, #nav a:active {
margin: 0 2px;
color: #eeeeee;
text-decoration:none;
}
#nav a:hover {
color: #ffffff;
text-decoration: underline;
}

/*AdminPanel zusatz */

/*AdminPanel */
input {
border:1px solid #aaaaaa;
}

#AdminLogin * input[type=text], #AdminLogin * input[type=password] {
.AdminLogin * input[type=text], .AdminLogin * input[type=password] {
width:350px;
}

#AdminLogin form table{
.AdminLogin form table{
margin: 0 auto;
}

textarea {
width:350px;
height:240px;
border: 1px solid #AAAAAA;
}

table.pages {
border-collapse:collapse;
}
.pages #item-name {

.pages .item-name {
width:130px;
}
.pages #edit-button {

.pages .edit-button {
width:50px;
}
.pages #delete-button {

.pages .delete-button {
width:50px;
}

.pages td {
border-top:1px solid black;
border-bottom:1px solid black;
}

table.general {
border-collapse:collapse;
}
.general #item-name {

.general .item-name {
width:130px;
}

table.users {
border-collapse:collapse;
}
.users #item-name {

.users .item-name {
width:130px;
}
.users #edit-button {

.users .edit-button {
width:50px;
}

.user .item-name {
width:130px;
}

.users td {
border-top:1px solid black;
border-bottom:1px solid black;
}

table.user {
border-collapse:collapse;
}
.user #item-name {
width:130px;
}

</style>
<title><?php $ap->website->title(); ?> AdminPanel - <?php $ap->page->title(); ?></title>
<?php $ap->page->head(); ?>
</head><body>
<div id="headbar"></div>
<div id="wrapper">
<div id="header">
<div>
<h1><a href="<?php $ap->website->domain(); ?>"><?php $ap->website->title(); ?></h1>
<div id="nav">
<?php $ap->nav->menu(); ?>
</div>
</div>
</div>
<div id="main">
<div id="content">
<?php $ap->page->body(); ?>
<div style="clear: both;">&nbsp;</div>
<br>&nbsp;
</head>

<body>
<div id="headbar"></div>
<div id="wrapper">
<div id="header">
<div>
<h1><a href="<?php $ap->website->domain(); ?>"><?php $ap->website->title(); ?></a></h1>
<div id="nav">
<?php $ap->nav->menu(); ?>
</div>
</div>
</div>
<div id="main">
<div id="content">
<?php $ap->page->body(); ?>
<div style="clear: both;">&nbsp;</div>
</div>
</div>
<div id="footer">&copy; by 9er &amp; Chrischdi</div>
</div>
<div id="footer">&copy; by 9er &amp; Chrischdi</div>
</div>
</body></html>
</body>
</html>
22 changes: 11 additions & 11 deletions inc/adminbrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ function AdminBrowser($db) {
$this->dir = $_GET['dir'];
$this->path .= $this->dir;
if($_GET['do'] == "upload") $this->doUpload();
$this->body = "<span id=\"AdminBrowser\">\n";
$this->body = "<div id=\"AdminBrowser\">\n";
$this->body .= $this->getBodyBrowser();
$this->body .= $this->getBodyUpload();
$this->body .= "</span>\n";
$this->body .= "</div>\n";
$this->head = $this->getHeadBrowser();
$this->head .= $this->getHeadUpload();
}
Expand All @@ -35,12 +35,12 @@ function getBodyUpload() {
else $ret .= "Uploaded the files successful";
}

$ret .= "<form enctype=\"multipart/form-data\" action=\"".$_SERVER['PHP_SELF']."?edit=browser&dir=".$this->dir."&do=upload\" method=\"post\"> \n";
$ret .= "<span id=\"forms\" fields=\"1\">\n";
$ret .= "<div><input type=\"file\" name=\"file[]\"></div>";
$ret .= "</span>\n";
$ret .= "<input type=\"button\" onClick=\"addInputFile();\" value=\"Add field\">\n";
$ret .= "<input type=\"submit\" value=\"upload\">\n";
$ret .= "<form enctype=\"multipart/form-data\" action=\"".$_SERVER['PHP_SELF']."?edit=browser&amp;dir=".$this->dir."&amp;do=upload\" method=\"post\"> \n";
$ret .= "<div id=\"forms\">\n";
$ret .= "<div><input type=\"file\" name=\"file[]\"/></div>";
$ret .= "</div>\n";
$ret .= "<input type=\"button\" onclick=\"addInputFile();\" value=\"Add field\"/>\n";
$ret .= "<input type=\"submit\" value=\"upload\"/>\n";
$ret .= "</form>\n";
$ret .= "</div>";
return $ret;
Expand Down Expand Up @@ -77,16 +77,16 @@ function getBodyBrowser() {
$handle = openDir($this->path);
$dirs = null;
$files = null;
$ret = "<h1>Browser</h2>\n";
$ret .= "<a href=\"".$_SERVER['PHP_SELF']."?edit=browser&dir=".dirname($this->dir)."\">BACK</a>\n";
$ret = "<h1>Browser</h1>\n";
$ret .= "<a href=\"".$_SERVER['PHP_SELF']."?edit=browser&amp;dir=".dirname($this->dir)."\">BACK</a>\n";
$ret .= "<table class=\"general\">\n";
$ret .= " <tr><th>Name</th><th class=\"right\">Size</th><th class=\"right\">Actions</th></tr>\n";
while ($file = readdir($handle)) {
if(is_dir($this->path."/".$file) and $file !== "." and $file !== ".."){
$dirs .= " ";
$dirs .= "<tr class=\"dir\">";
$dirs .= "<td>";
$dirs .= "<a href=\"".$_SERVER['PHP_SELF']."?edit=browser&dir=".$this->dir."/".$file."\">";
$dirs .= "<a href=\"".$_SERVER['PHP_SELF']."?edit=browser&amp;dir=".$this->dir."/".$file."\">";
$dirs .= $file;
$dirs .= "</a>";
$dirs .= "<td class=\"right\"></td>";
Expand Down
17 changes: 8 additions & 9 deletions inc/admingeneral.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,22 @@ function AdminGeneral($db) {
}

// build page
$ret = "<span id=\"AdminGeneral\"\n>";
$ret = "<div id=\"AdminGeneral\"\n>";
$ret .= "<h1>General Setup</h1>\n";
if ($saved) {
// ToDo: print some "page saved successfully"-stuff
$ret .= "";
}

$ret .= "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">\n<table class=\"general\">\n";
$ret .= "<input type=\"hidden\" name=\"edit\" value=\"general\">\n";
$ret .= "<h2>Website</h2>
\n";
$ret .= "<tr><td id=\"item-name\">Title</td><td><input type=\"text\" name=\"title\" value=\"".$db->getWebsiteTitle()."\"></td></tr>\n";
$ret .= "<tr><td id=\"item-name\">Domain</td><td><input type=\"text\" name=\"domain\" value=\"".$db->getWebsiteDomain()."\"></td></tr>\n";
$ret .= "<tr><td id=\"item-name\">Webmaster</td><td><input type=\"text\" name=\"webmaster\" value=\"".$db->getWebsiteWebmaster()."\"></td></tr>\n";
$ret .= "<tr><td></td><td><input type=\"submit\" value=\"save\"></td></tr>\n";
$ret .= "<input type=\"hidden\" name=\"edit\" value=\"general\"/>\n";
$ret .= "<h2>Website</h2>\n";
$ret .= "<tr><td class=\"item-name\">Title</td><td><input type=\"text\" name=\"title\" value=\"".$db->getWebsiteTitle()."\"/></td></tr>\n";
$ret .= "<tr><td class=\"item-name\">Domain</td><td><input type=\"text\" name=\"domain\" value=\"".$db->getWebsiteDomain()."\"/></td></tr>\n";
$ret .= "<tr><td class=\"item-name\">Webmaster</td><td><input type=\"text\" name=\"webmaster\" value=\"".$db->getWebsiteWebmaster()."\"/></td></tr>\n";
$ret .= "<tr><td></td><td><input type=\"submit\" value=\"save\"/></td></tr>\n";
$ret .= "</table></form>\n";
$ret .= "</span>\n";
$ret .= "</div>\n";
$this->body = $ret;
$this->head = "";
}
Expand Down
12 changes: 6 additions & 6 deletions inc/adminlogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ function AdminLogin($db) {
$this->title = "Login";
$this->id = "";
$this->author = "";
$ret = "<span id=\"AdminLogin\">\n";
$ret = "<div id=\"AdminLogin\">\n";
$ret .= "<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."\"><table>\n";
$ret .= "<tr><td>username</td><td><input type=\"text\" name=\"username\"></td></tr>\n";
$ret .= "<tr><td>password</td><td><input type=\"password\" name=\"password\"></td></tr>\n";
$ret .= "<tr><td></td><td><input type=\"submit\" value=\"login\"></td></tr>\n";
$ret .= "<input type=\"hidden\" name=\"action\" value=\"login\">\n";
$ret .= "<tr><td>username</td><td><input type=\"text\" name=\"username\"/></td></tr>\n";
$ret .= "<tr><td>password</td><td><input type=\"password\" name=\"password\"/></td></tr>\n";
$ret .= "<tr><td></td><td><input type=\"submit\" value=\"login\"/>\n";
$ret .= "<input type=\"hidden\" name=\"action\" value=\"login\"/></td></tr>\n";
$ret .= "</table></form>";
$ret .= "</span>\n";
$ret .= "</div>\n";
$this->body = $ret;
$this->head = "";

Expand Down
Loading