Commit:    c4520deb9164dc71e016766c5a0931696c8cd824
Author:    Hannes Magnusson <[email protected]>         Wed, 18 Dec 2013 
16:25:07 -0800
Parents:   c9902b037bbe2bde7cfddd62221d00fef3350fcf
Branches:  master

Link:       
http://git.php.net/?p=web/people.git;a=commitdiff;h=c4520deb9164dc71e016766c5a0931696c8cd824

Log:
Inject sidebar in footer, and wrap main content in mainscreen

Changed paths:
  M  include/layout.php
  D  include/sidebar.inc
  M  user.php


Diff:
diff --git a/include/layout.php b/include/layout.php
index ba3e8f8..c4d508d 100644
--- a/include/layout.php
+++ b/include/layout.php
@@ -11,21 +11,23 @@ function site_header($title) {
     $CSS[] = "/shared/styles/user-autocomplete.css";
     $SEARCH = array("method" => "get", "action" => "user.php", "placeholder" 
=> "Search profiles", "name" => "username");
     include dirname(__FILE__) . "/../shared/templates/header.inc";
+    echo '<section class="mainscreen">';
 }
 
-function site_footer() {
+function site_footer($config = array()) {
     $JS = array(
         "//ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js",
         "//people.php.net/js/jquery.autocomplete.min.js",
         "//people.php.net/js/userlisting.php",
         "//people.php.net/js/search.js",
     );
+    echo '</section>';
+    if (isset($config["SIDEBAR"])) {
+        $SECONDSCREEN = $config["SIDEBAR"];
+    }
     include dirname(__FILE__) . "/../shared/templates/footer.inc";
 }
 
-function site_panel($data) {
-    include dirname(__FILE__) . "/sidebar.inc";
-}
 
 
 // vim: set expandtab shiftwidth=4 softtabstop=4 tabstop=4 : 
diff --git a/include/sidebar.inc b/include/sidebar.inc
deleted file mode 100644
index 43015e0..0000000
--- a/include/sidebar.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-<aside class="secondscreen">
-<?=$data?>
-</aside>
diff --git a/user.php b/user.php
index 8d86e19..7e10c2d 100644
--- a/user.php
+++ b/user.php
@@ -115,7 +115,6 @@ $SIDEBAR = <<< SIDEBAR
     <p class="panel"><a 
href="https://master.php.net/manage/users.php?username=$USERNAME";>Edit 
$USERNAME on master</a></p>
 SIDEBAR;
 
-site_panel($SIDEBAR);
-site_footer();
+site_footer(array("SIDEBAR" => $SIDEBAR));
 // vim: set expandtab shiftwidth=4 softtabstop=4 tabstop=4 :


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to