AddDefaultCharset UTF-8
RewriteEngine on
RewriteRule ^[^/.]*$ /run.php [L]
-RewriteRule ^style_[0-9]*.css$ /style.css [L]
+RewriteRule ^style_[0-9]*.less$ /style.less [L]
<FilesMatch "\.(css|jpg|png)$">
ExpiresActive On
<html lang="en">
<head>
- <title><!--~main_title show {~-->~this_host~ Administration<!--~}~--></title>
+ <title><!--~$title show {~-->~this_host~ Administration<!--~}~--></title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
- <!--~main_body show {~-->
+ <!--~$body show {~-->
<h2>~this_host~ Administration</h2>
<p><a href="admin_images">Upload/edit images</a></p>
<html>
<head>
- <title><!--~main_title show {~-->Images<!--~}~--></title>
+ <title><!--~$title show {~-->Images<!--~}~--></title>
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
-<!--~main_body show {~-->
+<!--~$body show {~-->
<!--~display {~-->
<h2>Image details</h2>
</ol>
<!--~smaller {~-->
- <div><strong>On the right: </strong>(with the page text to the left of it)</div><div><code class="html"><span class="float_right"><img src="~src~" width="~width~" height="~height~" alt="" />~caption html~</span></code></div>
+ <div><strong>On the right: </strong>(with the page text to the left of it)</div><div><code class="html"><span class="wfpl_ifr" style="background-image: url(~src~); width: ~width~px; padding-top: ~height~;">~caption html~</span></code></div>
<div><strong>On the left: </strong>(with the page text to the right of it)</div><div><code class="html"><span class="float_left"><img src="~src~" width="~width~" height="~height~" alt="" />~caption html~</span></code></div>
<div><strong>Centered: </strong>(with nothing to either side)</div><div> <code class="html"><div class="mid_pic" style="width: ~width~px"><img src="~src~" width="~width~" height="~height~" alt="" />~caption html~</div></code></div>
<div><img src="~src~" alt="" /></div>
<html>
<head>
- <title><!--~main_title show {~-->~this_host~ Admin Login<!--~}~--></title>
+ <title><!--~$title show {~-->~this_host~ Admin Login<!--~}~--></title>
</head>
<body>
- <!--~main_body show {~-->
+ <!--~$body show {~-->
<!--~form {~-->
<h2>~this_host~ Admin Login</h2>
<html lang="en">
<head>
- <title><!--~main_title show {~-->~this_host~ Admin: <!--~listings {~-->Pages Listing<!--~}~--><!--~form {~--><!--~new_msg {~-->Add a new page<!--~}~--><!--~edit_msg {~-->Edit page "~title html~"<!--~}~--><!--~}~--><!--~}~--></title>
+ <title><!--~$title show {~-->~this_host~ Admin: <!--~listings {~-->Pages Listing<!--~}~--><!--~form {~--><!--~new_msg {~-->Add a new page<!--~}~--><!--~edit_msg {~-->Edit page "~title html~"<!--~}~--><!--~}~--><!--~}~--></title>
<meta charset="utf-8" />
- <!--~extra_headers {~-->
+ <!--~$head {~-->
<script type="text/javascript" src="code/ckeditor/ckeditor.js"></script>
<script type="text/javascript">
function make_wysiwyg(name) {
</head>
<body>
-<!--~main_body show {~-->
+<!--~$body show {~-->
<!--~form {~-->
<form action="admin_pages" method="post"><!--~editing {~--><div style="display: none"><input type="hidden" name="and_then" value="~and_then attr~" /><input type="hidden" name="admin_pages_edit_id" value="~admin_pages_edit_id attr~" /></div><!--~}~-->
}
tem_set('form', $data);
- tem_set('extra_headers', 'show');
+ tem_set('$head', 'show'); # wysiwyg init goes in <head>
}
<?php
function cms_display($basename, &$tem) {
- $tem->set('basename', $basename);
-
$nav_items = db_get_assocs('cms_pages', "coalesce(nullif(nav_title,''), title) as title,filename", 'where navbar!=0 order by navbar');
if($nav_items) {
foreach($nav_items as &$nav_item) {
$nav_item['title'] = '-- blank --';
}
}
- $tem->set('navbar_items', $nav_items);
+ $tem->set('$navbar_items', $nav_items);
}
- $have_content = cms_display_content($tem, 'where filename=%"', $basename);
+ $cms_page_id = cms_display_content($tem, 'where filename=%"', $basename);
if(logged_in_as_admin()) {
- $tem->set('admin_links', 1);
+ $admin_links = array();
+ if($cms_page_id) {
+ $admin_links['id'] = $cms_page_id;
+ }
+ $tem->set('$admin_links', $admin_links);
+ }
+
+ if($cms_page_id) {
+ return true;
+ } else {
+ return false;
}
- return $have_content;
}
function cms_display_content(&$tem /*, 'where clause %", %i', string, int */) {
$args = array_slice(func_get_args(), 1);
- $args = array_merge(array('cms_pages', 'id as admin_edit_page_id,title as cms_title,content as cms_body,keywords as meta_keywords,description as meta_description'), $args);
+ $args = array_merge(array('cms_pages', 'id,title,keywords,description,content'), $args);
$row = call_user_func_array('db_get_assoc', $args);
if($row) {
- # dump it into the global scope:
- $tem->sets($row);
- return true;
+ $tem->set('$cms_title', $row['title']);
+ $tem->set('$meta_keywords', $row['keywords']);
+ $tem->set('$meta_description', $row['description']);
+ $tem->set('$cms_body', $row['content']);
+ return $row['id'];
}
return false;
}
-Subproject commit 615c6667d12c7972fb08288e1ffaecea8abb16a8
+Subproject commit 2d753b1cb86b98e2995476b74f47cb5663670e4d
+++ /dev/null
-body {
- margin: 0;
- padding: 0;
- color: black;
- background: white;
- font: 14px verdana, arial, free-sans, sans-serif;
-}
-
-nav {
- width: 154px;
- float: left;
- overflow: none;
- background: #ffe;
-}
-
-nav h3 {
- padding-left: 10px;
-}
-
-footer {
- float: left;
- clear: both;
- width: 596px;
- margin-top: 35px;
- text-align: center;
- font-size: 9px;
-}
-
-#body {
- width: 596px;
- padding: 25px 25px 15px 25px;
- float: left;
-}
-
-#centerer {
- margin: 10px auto 20px;
- width: 800px;
-}
-
-#admin_links {
- background: #ddf;
- margin-bottom: 20px;
-}
-
-
-/************ FLOATING IMAGES **************/
-span.float_left {
- display: block;
- float: left;
- font-size: 10px;
- text-align: right;
- padding: 4px 15px 7px 0;
-}
-span.float_right {
- display: block;
- float: right;
- font-size: 10px;
- text-align: right;
- padding: 4px 0 7px 15px;
-}
-span.float_left img, span.float_right img {
- display: block;
- padding-bottom: 1px;
-}
-span.float_center img {
- display: inline;
-}
-div.mid_pic {
- margin: 15px auto;
- font-size: 10px;
- text-align: right;
-}
-
-/************ GENERAL **************/
-/* HTML5 tags */
-header, hgroup, section, footer, aside, nav, article, figure {
- display: block;
-}
-
-img {
- display: block;
-}
-
-a img {
- border: 0;
-}
-
-code.html {
- background: #ddd;
-}
-
-.first {
- padding-top: 0px;
- margin-top: 0px;
-}
-.last, div.last {
- padding-bottom: 0px;
- margin-bottom: 0px;
-}
-
-
-/************ FORMS **************/
-div.caption {
- font-weight: bold;
-}
-div.field {
- margin-bottom: 20px;
-}
-div.field_notes {
- font-size: 12px;
- line-height: 16px;
-}
-div.field_notes ul {
- padding-top: 0;
- padding-bottom: 0;
- margin-top: 0;
- margin-bottom: 0;
-}
-div.error {
- border: 2px solid red;
- padding: 13px;
- margin: 20px;
- background: #fdd;
-}
-
-.form_section {
- border: 1px dotted black;
- padding: 23px 15px 15px 15px;
- margin: 25px 0;
- position: relative;
-}
-.form_section_header {
- position: absolute;
- left: 42px;
- top: -9px;
- background: white;
- padding: 0 6px;
-}
-
-#cke_content {
- /* wysiwyg area seems to be 10px narrower than cke_content */
- /* Then we leave another 20px for the scrollbar */
- /* And another 20px for padding */
- width: 670px;
- margin-left: -11px;
-}
--- /dev/null
+// dimensions
+@site-width: 940px;
+@nav-width: 200px;
+@site-gutter-width: 18px;
+@site-main-body-width: @site-width - 2*@site-gutter-width - @nav-width;
+
+// colors
+@site-header-color: #ddf;
+@nav-color: #dff;
+@site-body-color: #fff;
+@site-window-color: #eee;
+@site-footer-color: #ddf;
+@site-gutter-color: #fff;
+
+header, hgroup, section, footer, aside, nav, article, figure, img {
+ display: block;
+}
+
+body {
+ margin: 0;
+ padding: 0;
+ color: #000;
+ background: @site-window-color;
+ font: 14px "Verdana", sans-serif;
+}
+
+#centerer {
+ position: relative;
+ background: @nav-color;
+ margin: 0 auto;
+ width: @site-width;
+ -moz-box-shadow: 2px 2px 15px #777;
+ -webkit-box-shadow: 2px 2px 15px #777;
+ box-shadow: 2px 2px 13px #777;
+}
+
+header {
+ width: @site-width;
+ height: 100px;
+ background: @site-header-color;
+}
+
+@nav-padding: 10px;
+nav {
+ float: left;
+ width: @nav-width - 2*@nav-padding;
+ padding: @nav-padding;
+ background: @nav-color;
+ a {
+ display: block;
+ }
+}
+
+#main-body {
+ float: left;
+ width: @site-main-body-width;
+ padding: @site-gutter-width @site-gutter-width @site-gutter-width @site-gutter-width;
+ background: @site-body-color;
+}
+
+footer {
+ clear: both;
+ width: @site-width;
+ height: 50px;
+ background: @site-footer-color;
+}
+
+#wfpl_messages {
+ border: 2px solid red;
+ background: #fbb;
+ padding: 5px;
+ margin: 20px 0px;
+ p {
+ font-size: 120%;
+ padding: 5px;
+ margin: 0px;
+ }
+ hr {
+ height: 1px;
+ }
+}
+.caption {
+ margin-top: 15px;
+ font-weight: bold;
+}
+.field {
+ margin-bottom: 15px;
+}
+div.field_notes {
+ font-size: 12px;
+ line-height: 16px;
+}
+fieldset {
+ border: 1px dotted black;
+ padding: 0 15px 15px 15px;
+ margin: 15px 0;
+ position: relative;
+}
+legend {
+ padding: 0 6px;
+ font-weight: bold;
+}
+div.error {
+ border: 2px solid red;
+ padding: 13px;
+ margin: 20px;
+ background: #fdd;
+}
+
+/* hack so that vertical margins are only between siblings for the most part */
+td > :first-child,
+th > :first-child,
+legend + *,
+article > :first-child,
+section > :first-child,
+nav > :first-child,
+div > :first-child,
+.first {
+ margin-top: 0px;
+}
+td > :last-child,
+th > :last-child,
+fieldset > :last-child,
+article > :last-child,
+section > :last-child,
+nav > :last-child,
+div > :last-child,
+.last {
+ margin-bottom: 0px;
+}
+
+/************ FLOATING IMAGES (from CMS) **************/
+span.wfpl_ifl {
+ display: block;
+ float: left;
+ font-size: 10px;
+ text-align: right;
+ padding: 4px 15px 7px 0;
+}
+span.wfpl_ifr {
+ display: block;
+ float: right;
+ font-size: 10px;
+ text-align: right;
+ background-repeat: no-repeat;
+ background-position: top left;
+}
+span.float_left img, span.float_right img {
+ display: block;
+ padding-bottom: 1px;
+}
+span.float_center img {
+ display: inline;
+}
+div.mid_pic {
+ margin: 15px auto;
+ font-size: 10px;
+ text-align: right;
+}
<!DOCTYPE html>
<html lang="en">
<head>
- <title>~main_title html~~cms_title html~</title>
<meta charset="utf-8" />
+ <title>~$title html~~$cms_title html~</title>
<!--~meta_description nonempty {~--><meta name="description" content="~meta_description attr~" /><!--~}~-->
<!--~meta_description nonempty {~--><meta name="keywords" content="~meta_keywords attr~" /><!--~}~-->
- <!--[if IE]>
- <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+ <!--[if lt IE 9]>
+ ~$running_locally {~<script src="/javascript/html5.js"></script>~}~
+ ~$running_locally unset {~<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>~}~
<![endif]-->
- <link rel="stylesheet" href="style_05.css" />
- <!--~extra_headers~-->
+ <script>less = {env:'development'};</script>
+ <link rel="stylesheet/less" href="style_01.less" />
+ <!--~$running_locally {~--><script src="/javascript/less/less.min.js"></script><!--~}~-->
+ <!--~$running_locally unset {~--><script src="http://lesscss.googlecode.com/files/less-1.0.41.min.js"></script><!--~}~-->
+ <!--~$head~-->
</head>
<body>
<header>
header image here
</header>
- <nav><!--~navbar_items {~-->
+ <nav><!--~$navbar_items {~-->
<h3><a href="~filename~">~title html~</a></h3><!--~}~-->
</nav>
- <div id="body">
- <!--~admin_links {~-->
- <div id="admin_links">You are logged in as an administrator. <a href="admin_pages?admin_pages_edit_id=~admin_edit_page_id~&admin_pages_new=1&new_filename=~basename~">Edit this page</a> — <a href="admin">Control panel</a> — <a href="logout">Log out</a></div>
+ <div id="main-body">
+ <!--~$admin_links {~-->
+ <div id="admin_links">You are logged in as an administrator. <a href="admin_pages?~id {~edit_id=~id~~}~~id unset {~&new=1&new_filename=~$basename~~}~">Edit this page</a> — <a href="admin">Control panel</a> — <a href="logout">Log out</a></div>
<!--~}~-->
- <!--~wfpl_messages {~-->
- <!--~ first {~--><div style="border: 2px solid red; background: #fbb; padding: 5px; margin: 20px 0px"><!--~}~-->
- <p style="font-size: 120%; padding: 5px; margin: 0px">~data html~</p>
- <!--~ sep {~--><hr><!--~}~-->
- <!--~ last {~--></div><!--~}~-->
+ <!--~$messages once_if {~-->
+ <div id="wfpl_messages">
+ <!--~$messages {~-->
+ <p>~message html~</p>
+ <!--~ sep {~-->
+ <hr>
+ <!--~}~-->
+ <!--~}~-->
+ </div>
<!--~}~-->
<article>
- ~cms_body~
+ ~$cms_body~
- ~main_body~
+ ~$body~
</article>
- <footer>
- footer text here
- </footer>
</div>
+ <footer>
+ footer text here
+ </footer>
</div>
</body>
</html>