Skip to content
Browse files

Initial commit

  • Loading branch information...
0 parents commit 15b092455ef1fb9f0d98443fde853f8bc06d911a @benallfree committed Sep 29, 2011
Showing with 35 additions and 0 deletions.
  1. +27 −0 callbacks/nav_links.php
  2. +5 −0 callbacks/subnav_links.php
  3. +3 −0 routes.php
27 callbacks/nav_links.php
@@ -0,0 +1,27 @@
+<?
+
+if (logged_in())
+{
+ $message_counts = event('message_count');
+ $c=0;
+ foreach($message_counts as $module_name=>$data)
+ {
+ if (array_key_exists('message_count', $data))
+ {
+ $c+=$data['message_count'];
+ }
+ }
+ global $message_center_subnav_links;
+ $message_center_subnav_links=array();
+ $link_data = event('message_center_nav_links');
+ foreach($link_data as $module_name=>$data)
+ {
+ if (!array_key_exists('links', $data)) continue;
+ {
+ $message_center_subnav_links = array_merge($message_center_subnav_links, $data['links']);
+ }
+ }
+ $links = array(
+ array('href'=>$message_center_subnav_links[0]['href'], 'label'=>se("Inbox") . (($c > 0) ? " ($c)" : '') )
+ );
+}
5 callbacks/subnav_links.php
@@ -0,0 +1,5 @@
+<?
+
+global $message_center_subnav_links;
+
+$links = $message_center_subnav_links;
3 routes.php
@@ -0,0 +1,3 @@
+<?
+
+map('subnav_links', "messages/*");

0 comments on commit 15b0924

Please sign in to comment.
Something went wrong with that request. Please try again.