class 'page' display now in view/page.php
authorDylan Lloyd <dylan@dylansserver.com>
Thu, 22 Mar 2012 22:17:04 +0000 (18:17 -0400)
committerDylan Lloyd <dylan@dylansserver.com>
Thu, 22 Mar 2012 22:17:04 +0000 (18:17 -0400)
cms.php
view/page.php [new file with mode: 0644]

diff --git a/cms.php b/cms.php
index caa22a1..00a8d7c 100644 (file)
--- a/cms.php
+++ b/cms.php
@@ -320,7 +320,10 @@ class page extends cms {
   }
 
   public function display() {
-    $this->display_head();
+      require_once("view/page.php");
+  }
+
+  public function display_notes() {
     echo "<div id='notes'>";
     $sql = "SELECT date_posted, title, url, text
               FROM notes ORDER BY date_posted DESC
@@ -347,25 +350,7 @@ class page extends cms {
 END_NOTE;
     }
     echo "</div>";
-    $this->write_navigation();
-    $this->display_close();
-  }
-
-  private function write_navigation() {
-    echo "<div id='navigation'>";
-    echo "<h1>";
-    if($this->page > 1){
-      $previous_page = $this->page - 1;
-      echo "<a href='/notes/page/$previous_page'>prev</a>";
-    }
-    if($this->page < $this->number_of_pages) {
-    $forward_page = $this->page + 1;
-    echo " <a href='/notes/page/$forward_page'>next</a>";
-    }
-    echo "</h1>";
-    echo "</div>";
   }
-
 }
 
 
diff --git a/view/page.php b/view/page.php
new file mode 100644 (file)
index 0000000..2829668
--- /dev/null
@@ -0,0 +1,62 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+<head>
+  <title><?php echo $this->title; ?></title>
+  <link rel="icon" href="/favicon.ico" type="image/png">
+  <link href='/includes/style.css' rel='stylesheet' type='text/css'>
+  <script type='text/javascript' src='/includes/syntax/scripts/shCore.js'></script>
+  <script type='text/javascript' src='/includes/syntax/scripts/shAutoloader.js'></script>
+  <link type='text/css' rel='stylesheet' href='/includes/syntax/styles/shCore.css'>
+  <link type='text/css' rel='stylesheet' href='/includes/syntax/styles/shThemeDefault.css'>
+  <script type='text/javascript'>
+    function highlight() {
+      SyntaxHighlighter.autoloader(
+       'js /includes/syntax/scripts/shBrushJScript.js',
+       'bash /includes/syntax/scripts/shBrushBash.js',
+       'sql /includes/syntax/scripts/shBrushSql.js',
+       'cpp /includes/syntax/scripts/shBrushCpp.js');
+      SyntaxHighlighter.defaults['gutter'] = false;
+      SyntaxHighlighter.defaults['toolbar'] = false;
+      SyntaxHighlighter.all();
+    }
+  </script>
+  <script type='text/javascript' src='http://www.google.com/recaptcha/api/js/recaptcha_ajax.js'></script>
+  <script type='text/javascript' src='/includes/comment.js'></script>
+</head>
+
+<body onload="return typeof highlight == 'function' ? highlight() : true">
+  <div id="structure">
+    <div id="banner">
+      <a href="<?php echo $this->home_link ?>">
+      <img src="/images/dylansserver.png" alt="dylansserver"
+      border="0"></a>
+    </div>
+
+    <div id="content">
+      <div id='notes'>
+        <?php $this->display_notes() ?>
+    <div id='navigation'>
+    <h1>
+    <?php
+    if($this->page > 1){
+      $previous_page = $this->page - 1;
+      echo "<a href='/notes/page/$previous_page'>prev</a>";
+    }
+    if($this->page < $this->number_of_pages) {
+    $forward_page = $this->page + 1;
+    echo " <a href='/notes/page/$forward_page'>next</a>";
+    } ?>
+    </h1>
+    </div>
+      <div id="contact_me"><h1><a href=
+      "mailto:dylan@psu.edu">dylan</a></h1><a href=
+      "mailto:dylan@psu.edu">@psu.edu</a>
+      </div>
+    </div>
+    <br>
+    <br>
+  </div>
+</body>
+</html>