From 60aeb3ebcff66c55fcdf3b43b7e3db0ef7d54e02 Mon Sep 17 00:00:00 2001 From: Ryan Walberg Date: Thu, 15 Nov 2012 03:52:25 +0000 Subject: [PATCH] refactored out the navbar --- src/item.php | 2 ++ src/profile.php | 2 ++ src/shop.php | 1 + src/templates/event.tpl | 8 +++--- src/templates/home.tpl | 39 ++-------------------------- src/templates/item.tpl | 12 +++++---- src/templates/navbar.tpl | 53 +++++++++++++++++++++++++++++++++++++++ src/templates/profile.tpl | 4 ++- src/templates/receive.tpl | 2 +- src/templates/shop.tpl | 6 +++-- 10 files changed, 80 insertions(+), 49 deletions(-) create mode 100644 src/templates/navbar.tpl diff --git a/src/item.php b/src/item.php index fbed9ef..b5d65d0 100644 --- a/src/item.php +++ b/src/item.php @@ -253,5 +253,7 @@ $smarty->assign('image_filename', $image_filename); $smarty->assign('comment', $comment); $smarty->assign('categories', $categories); $smarty->assign('ranks', $ranks); +$smarty->assign('isadmin', $_SESSION["admin"]); $smarty->assign('opt', $OPT); $smarty->display('item.tpl'); +?> diff --git a/src/profile.php b/src/profile.php index d842705..bae1b31 100644 --- a/src/profile.php +++ b/src/profile.php @@ -81,5 +81,7 @@ $smarty->assign('fullname', $fullname); $smarty->assign('email', $email); $smarty->assign('email_msgs', $email_msgs); $smarty->assign('comment', $comment); +$smarty->assign('isadmin', $_SESSION["admin"]); $smarty->assign('opt', $OPT); $smarty->display('profile.tpl'); +?> diff --git a/src/shop.php b/src/shop.php index 6ca05f2..ea8b9ce 100644 --- a/src/shop.php +++ b/src/shop.php @@ -210,6 +210,7 @@ $smarty->assign('ufullname', $ufullname); $smarty->assign('shopfor', $shopfor); $smarty->assign('shoprows', $shoprows); $smarty->assign('userid', $userid); +$smarty->assign('isadmin', $_SESSION["admin"]); $smarty->assign('opt', $OPT); $smarty->display('shop.tpl'); ?> diff --git a/src/templates/event.tpl b/src/templates/event.tpl index 43c5334..d363c1e 100644 --- a/src/templates/event.tpl +++ b/src/templates/event.tpl @@ -23,7 +23,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -
+ {include file='navbar.tpl' isadmin=$isadmin} + +
{if isset($message)}
@@ -98,7 +100,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- + {if isset($description_error)} {$description_error} {/if} @@ -107,7 +109,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- +

mm/dd/yyyy

{if isset($eventdate_error)} {$eventdate_error} diff --git a/src/templates/home.tpl b/src/templates/home.tpl index 8ee9d53..2270313 100644 --- a/src/templates/home.tpl +++ b/src/templates/home.tpl @@ -31,43 +31,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - + {include file='navbar.tpl'} +
{if isset($message)}
diff --git a/src/templates/item.tpl b/src/templates/item.tpl index cd9c89d..4eb324d 100644 --- a/src/templates/item.tpl +++ b/src/templates/item.tpl @@ -23,7 +23,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -
+ {include file='navbar.tpl' isadmin=$isadmin} + +
{if $opt.show_helptext}
@@ -56,7 +58,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- + {if isset($description_error)} {$description_error} {/if} @@ -88,7 +90,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- + {if isset($source_error)} {$source_error} {/if} @@ -111,7 +113,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- + {if isset($quantity_error)} {$quantity_error} {/if} @@ -123,7 +125,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- + {if isset($url_error)} {$url_error} {/if} diff --git a/src/templates/navbar.tpl b/src/templates/navbar.tpl new file mode 100644 index 0000000..2b6f786 --- /dev/null +++ b/src/templates/navbar.tpl @@ -0,0 +1,53 @@ +{* +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*} + + diff --git a/src/templates/profile.tpl b/src/templates/profile.tpl index d48e4e4..06e4dba 100644 --- a/src/templates/profile.tpl +++ b/src/templates/profile.tpl @@ -48,7 +48,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -
+ {include file='navbar.tpl' isadmin=$isadmin} + +
diff --git a/src/templates/receive.tpl b/src/templates/receive.tpl index 37d58c7..f4831bf 100644 --- a/src/templates/receive.tpl +++ b/src/templates/receive.tpl @@ -44,7 +44,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- +

Once you have received all of an item, it will be deleted.

diff --git a/src/templates/shop.tpl b/src/templates/shop.tpl index 6beebee..f49fc32 100644 --- a/src/templates/shop.tpl +++ b/src/templates/shop.tpl @@ -28,7 +28,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -
+ {include file='navbar.tpl' isadmin=$isadmin} + +
{if isset($message)}
@@ -39,7 +41,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{/if}
-

Gift Registry - Shopping List for {$ufullname|escape:'htmlall'}

+

Shopping List for {$ufullname|escape:'htmlall'}

{if $opt.show_helptext}