Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added styling using Twitter Bootstrap

  • Loading branch information...
commit 13cdeaea83b29028cf77354a71c7d7d711ae3bb1 1 parent d0494cf
@craig552uk authored
View
1  body.txt
@@ -0,0 +1 @@
+
View
7 config.php
@@ -1,6 +1,13 @@
<?php
/**
+ * Site details
+ */
+$site_title = 'My Site';
+$site_author = 'Author';
+$site_description = 'Site Description';
+
+/**
* Administrator account details
*/
$username = 'admin';
View
48 edit/auth.php
@@ -2,19 +2,45 @@
<html lang="en">
<head>
<meta charset="utf-8">
- <title>CMS</title>
+ <title><?php echo $site_title; ?> - Login</title>
<link rel="stylesheet" href="../bootstrap-1.2.0.min.css">
</head>
<body>
-
- <form method="POST" action="?action=login">
- <?php if(isset($login_error)): ?>
- <p class="error"><?php echo $login_error; ?></p>
- <?php endif; ?>
- <p><input type="text" name="username" id="username"></p>
- <p><input type="password" name="password" id="password"></p>
- <p><input type="submit" value="Login"></p>
- </form>
-
+ <div class="topbar">
+ <div class="topbar-inner">
+ <div class="container">
+ <h3><a href="../"><?php echo $site_title; ?></a></h3>
+ <ul class="nav secondary-nav">
+ <li><a href="../">View Site</a></li>
+ </ul>
+ </div><!-- .container -->
+ </div><!-- .topbar-inner-->
+ </div><!-- .topbar-->
+
+ <div class="container" style="margin-top: 40px;">
+ <form method="POST" action="?action=login">
+ <fieldset>
+ <?php if(isset($login_error)): ?>
+ <p class="alert-message error"><?php echo $login_error; ?></p>
+ <?php endif; ?>
+ <div class="clearfix">
+ <label for="username">User Name</label>
+ <div class="input">
+ <input type="text" name="username" id="username">
+ </div>
+ </div>
+ <div class="clearfix">
+ <label for="password">Password</label>
+ <div class="input">
+ <input type="password" name="password" id="password">
+ </div>
+ </div>
+ <div class="actions">
+ <input type="submit" class="btn primary" value="Login">
+ <a href="../" class="btn">Cancel</a>
+ </div>
+ </fieldset>
+ </form>
+ </div><!-- .container -->
</body>
</html>
View
50 edit/editor.php
@@ -2,22 +2,44 @@
<html lang="en">
<head>
<meta charset="utf-8">
- <title>CMS</title>
+ <title><?php echo $site_title; ?> - Editor</title>
<link rel="stylesheet" href="../bootstrap-1.2.0.min.css">
</head>
<body>
-
- <form method="POST" action="?action=save">
- <?php if(isset($editor_error)): ?>
- <p class="error"><?php echo $editor_error; ?></p>
- <?php endif; ?>
- <?php if(isset($editor_msg)): ?>
- <p class="error"><?php echo $editor_msg; ?></p>
- <?php endif; ?>
- <textarea name="content" id="content"><?php echo $content; ?></textarea>
- <p><input type="submit" value="Save"> <a href="?action=logout">Logout</a></p>
- <p class="blurb">Allowed tags <em><?php echo htmlspecialchars($allowed_tags); ?></em></p>
- </form>
-
+ <div class="topbar">
+ <div class="topbar-inner">
+ <div class="container">
+ <h3><a href="../"><?php echo $site_title; ?></a></h3>
+ <ul class="nav secondary-nav">
+ <li><a href="../">View Site</a></li>
+ <li><a href="?action=logout">Logout</a></li>
+ </ul>
+ </div><!-- .container -->
+ </div><!-- .topbar-inner-->
+ </div><!-- .topbar-->
+
+ <div class="container" style="margin-top: 40px;">
+ <form method="POST" action="?action=save" class="form-stacked">
+ <fieldset>
+ <?php if(isset($editor_error)): ?>
+ <p class="alert-message error"><?php echo $editor_error; ?></p>
+ <?php endif; ?>
+ <?php if(isset($editor_msg)): ?>
+ <p class="alert-message success"><?php echo $editor_msg; ?></p>
+ <?php endif; ?>
+ <div class="clearfix">
+ <label for="content">Page Content</label>
+ <div class="input">
+ <textarea name="content" id="content" style="width: 95%; height: 300px;"><?php echo $content; ?></textarea>
+ <p class="help-block">Allowed tags <em><?php echo htmlspecialchars($allowed_tags); ?></em></p>
+ </div>
+ </div>
+ <div class="actions">
+ <input type="submit" class="btn primary" value="Save Changes">
+ <a href="." class="btn">Revert</a>
+ </div>
+ </fieldset>
+ </form>
+ </div><!-- .container -->
</body>
</html>
View
2  edit/index.php
@@ -21,7 +21,7 @@
session_destroy();
break;
case 'save': /* Save changes */
- if (file_put_contents('../body.txt', strip_tags($_POST['content'], $allowed_tags))){
+ if (file_put_contents('../body.txt', strip_tags($_POST['content'].' ', $allowed_tags))){
$editor_msg = $editor_save_success;
}else{
$editor_error = $editor_save_error;
View
5 index.php
@@ -1,13 +1,14 @@
+<?php include('config.php'); /* Load the config file */ ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
- <title>CMS</title>
+ <title><?php echo $site_title; ?></title>
<link rel="stylesheet" href="bootstrap-1.2.0.min.css">
</head>
<body>
- <?php include('body.txt');?>
+ <?php include('body.txt'); /* Load the body content */ ?>
<foot>
<p>
Please sign in to comment.
Something went wrong with that request. Please try again.