Permalink
Browse files

reorder nav

  • Loading branch information...
rmarianski committed Jun 1, 2011
1 parent d7900ca commit a510831bd0ae3dd43ef5e53577089abdc7a50ad0
Showing with 25 additions and 9 deletions.
  1. +25 −9 application/helpers/nav.php
@@ -19,15 +19,6 @@ public static function main_tabs($this_page = FALSE)
$menu = "";
- // Reports Submit
- if (Kohana::config('settings.allow_reports'))
- {
- $menu .= "<li><a href=\"".url::site()."reports/submit\" ";
- $menu .= ($this_page == 'reports_submit') ? " class=\"active\"":"";
- $menu .= ">".Kohana::lang('ui_main.submit')."</a></li>";
- }
-
-
// Home
$menu .= "<li><a href=\"".url::site()."main\" ";
$menu .= ($this_page == 'home') ? " class=\"active\"" : "";
@@ -37,6 +28,29 @@ public static function main_tabs($this_page = FALSE)
$menu .= "<li><a href=\"".url::site()."reports\" ";
$menu .= ($this_page == 'reports') ? " class=\"active\"" : "";
$menu .= ">".Kohana::lang('ui_main.reports')."</a></li>";
+
+ // Trends page
+ // lookup the id from the database
+ $pages = ORM::factory("page")
+ ->where("page_title", "Trends")
+ ->where("page_active", "1")
+ ->find_all();
+ if (!empty($pages)) {
+ $page = $pages[0];
+
+ $menu .= "<li><a href=\"".url::site()."page/index/".$page->id."\" ";
+ $menu .= ($this_page == 'page_'.$page->id) ? " class=\"active\"" : "";
+ $menu .= ">".$page->page_tab."</a></li>";
+ }
+
+ // Reports Submit
+ if (Kohana::config('settings.allow_reports'))
+ {
+ $menu .= "<li><a href=\"".url::site()."reports/submit\" ";
+ $menu .= ($this_page == 'reports_submit') ? " class=\"active\"":"";
+ $menu .= ">".Kohana::lang('ui_main.submit')."</a></li>";
+ }
+
/** Alerts
@@ -52,9 +66,11 @@ public static function main_tabs($this_page = FALSE)
$pages = ORM::factory('page')->where('page_active', '1')->find_all();
foreach ($pages as $page)
{
+ if ($page->page_title !== "Trends") {
$menu .= "<li><a href=\"".url::site()."page/index/".$page->id."\" ";
$menu .= ($this_page == 'page_'.$page->id) ? " class=\"active\"" : "";
$menu .= ">".$page->page_tab."</a></li>";
+ }
}
/* // Contacts

0 comments on commit a510831

Please sign in to comment.