diff --git a/mod/message.php b/mod/message.php index d4772d0261..39aa0479ff 100644 --- a/mod/message.php +++ b/mod/message.php @@ -45,21 +45,32 @@ function message_content(&$a) { $myprofile = $a->get_baseurl() . '/profile/' . $a->user['nickname']; - if (($a->argc > 1) && ($a->argv[1] === 'new')) { - $tab = 'new'; - } else if ($a->argc == 2 && $a->argv[1] === 'sent') { - $tab = 'sent'; - } else { - $tab = 'inbox'; - } - + + $tabs = array( + array( + 'label' => t('Inbox'), + 'url'=> $a->get_baseurl() . '/message', + 'sel'=> (($a->argc == 1) ? 'active' : ''), + ), + array( + 'label' => t('Outbox'), + 'url' => $a->get_baseurl() . '/message/sent', + 'sel'=> (($a->argv[1] == 'sent') ? 'active' : ''), + ), + array( + 'label' => t('New Message'), + 'url' => $a->get_baseurl() . '/message/new', + 'sel'=> (($a->argv[1] == 'new') ? 'active' : ''), + ), + ); + $tpl = get_markup_template('common_tabs.tpl'); + $tab_content = replace_macros($tpl, array('$tabs'=>$tabs)); + + $tpl = get_markup_template('mail_head.tpl'); $header = replace_macros($tpl, array( '$messages' => t('Messages'), - '$inbox' => t('Inbox'), - '$outbox' => t('Outbox'), - '$new' => t('New Message'), - '$activetab' => $tab + '$tab_content' => $tab_content )); diff --git a/mod/notifications.php b/mod/notifications.php index 6d78ea0242..6c3e67cb42 100644 --- a/mod/notifications.php +++ b/mod/notifications.php @@ -63,10 +63,39 @@ function notifications_content(&$a) { return; } + nav_set_selected('notifications'); + $o = ''; - + $tabs = array( + array( + 'label' => t('Network'), + 'url'=>$a->get_baseurl() . '/notifications/network', + 'sel'=> (($a->argv[1] == 'network') ? 'active' : ''), + ), + array( + 'label' => t('Home'), + 'url' => $a->get_baseurl() . '/notifications/home', + 'sel'=> (($a->argv[1] == 'home') ? 'active' : ''), + ), + array( + 'label' => t('Introductions'), + 'url' => $a->get_baseurl() . '/notifications/intros', + 'sel'=> (($a->argv[1] == 'intros') ? 'active' : ''), + ), + array( + 'label' => t('Messages'), + 'url' => $a->get_baseurl() . '/message', + 'sel'=> '', + ), + ); + $tpl = get_markup_template('common_tabs.tpl'); + $tab_content = replace_macros($tpl, array('$tabs'=>$tabs)); + + + + if( (($a->argc > 1) && ($a->argv[1] == 'intros')) || (($a->argc == 1))) { - + nav_set_selected('introductions'); if(($a->argc > 2) && ($a->argv[2] == 'all')) $sql_extra = ''; else @@ -167,6 +196,8 @@ function notifications_content(&$a) { info( t('No notifications.') . EOL); $o .= replace_macros($notif_tpl,array( + '$notif_header' => t('Notifications'), + '$tabs' => $tab_content, '$notif_content' => $notif_content, '$activetab' => 'intros' )); @@ -175,7 +206,6 @@ function notifications_content(&$a) { return $o; } else if (($a->argc > 1) && ($a->argv[1] == 'network')) { - $notif_tpl = get_markup_template('notifications.tpl'); $r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`, @@ -252,6 +282,8 @@ function notifications_content(&$a) { } $o .= replace_macros($notif_tpl,array( + '$notif_header' => t('Notifications'), + '$tabs' => $tab_content, '$notif_content' => $notif_content, '$activetab' => 'network' )); @@ -327,6 +359,8 @@ function notifications_content(&$a) { } $o .= replace_macros($notif_tpl,array( + '$notif_header' => t('Notifications'), + '$tabs' => $tab_content, '$notif_content' => $notif_content, '$activetab' => 'home' )); diff --git a/view/mail_head.tpl b/view/mail_head.tpl index 2aeb3006e0..afb65f5373 100644 --- a/view/mail_head.tpl +++ b/view/mail_head.tpl @@ -1,10 +1,3 @@

$messages

- - +$tab_content diff --git a/view/notifications.tpl b/view/notifications.tpl index 24f78f37ef..d737a7507e 100644 --- a/view/notifications.tpl +++ b/view/notifications.tpl @@ -1,14 +1,5 @@ - -

Notifications

- -

- Network - Home - Introductions - Messages -

-
- +

$notif_header

+$tabs
$notif_content