common tabs to notifications and mail

This commit is contained in:
Friendika 2011-10-11 21:30:23 -07:00
parent 3ef7dcac4b
commit df7702709b
4 changed files with 63 additions and 34 deletions

View file

@ -45,21 +45,32 @@ function message_content(&$a) {
$myprofile = $a->get_baseurl() . '/profile/' . $a->user['nickname']; $myprofile = $a->get_baseurl() . '/profile/' . $a->user['nickname'];
if (($a->argc > 1) && ($a->argv[1] === 'new')) {
$tab = 'new'; $tabs = array(
} else if ($a->argc == 2 && $a->argv[1] === 'sent') { array(
$tab = 'sent'; 'label' => t('Inbox'),
} else { 'url'=> $a->get_baseurl() . '/message',
$tab = 'inbox'; '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'); $tpl = get_markup_template('mail_head.tpl');
$header = replace_macros($tpl, array( $header = replace_macros($tpl, array(
'$messages' => t('Messages'), '$messages' => t('Messages'),
'$inbox' => t('Inbox'), '$tab_content' => $tab_content
'$outbox' => t('Outbox'),
'$new' => t('New Message'),
'$activetab' => $tab
)); ));

View file

@ -63,10 +63,39 @@ function notifications_content(&$a) {
return; return;
} }
nav_set_selected('notifications');
$o = ''; $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))) { if( (($a->argc > 1) && ($a->argv[1] == 'intros')) || (($a->argc == 1))) {
nav_set_selected('introductions');
if(($a->argc > 2) && ($a->argv[2] == 'all')) if(($a->argc > 2) && ($a->argv[2] == 'all'))
$sql_extra = ''; $sql_extra = '';
else else
@ -167,6 +196,8 @@ function notifications_content(&$a) {
info( t('No notifications.') . EOL); info( t('No notifications.') . EOL);
$o .= replace_macros($notif_tpl,array( $o .= replace_macros($notif_tpl,array(
'$notif_header' => t('Notifications'),
'$tabs' => $tab_content,
'$notif_content' => $notif_content, '$notif_content' => $notif_content,
'$activetab' => 'intros' '$activetab' => 'intros'
)); ));
@ -175,7 +206,6 @@ function notifications_content(&$a) {
return $o; return $o;
} else if (($a->argc > 1) && ($a->argv[1] == 'network')) { } else if (($a->argc > 1) && ($a->argv[1] == 'network')) {
$notif_tpl = get_markup_template('notifications.tpl'); $notif_tpl = get_markup_template('notifications.tpl');
$r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`, $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( $o .= replace_macros($notif_tpl,array(
'$notif_header' => t('Notifications'),
'$tabs' => $tab_content,
'$notif_content' => $notif_content, '$notif_content' => $notif_content,
'$activetab' => 'network' '$activetab' => 'network'
)); ));
@ -327,6 +359,8 @@ function notifications_content(&$a) {
} }
$o .= replace_macros($notif_tpl,array( $o .= replace_macros($notif_tpl,array(
'$notif_header' => t('Notifications'),
'$tabs' => $tab_content,
'$notif_content' => $notif_content, '$notif_content' => $notif_content,
'$activetab' => 'home' '$activetab' => 'home'
)); ));

View file

@ -1,10 +1,3 @@
<h3>$messages</h3> <h3>$messages</h3>
<div class="message-links"> $tab_content
<ul>
<li><a href="message" class="button message-link-inbox">$inbox</a></li>
<li><a href="message/sent" class="button message-link-outbox">$outbox</a></li>
<li><a href="message/new" class="button message-link-new">$new</a></li>
</ul>
</div>
<div class="message-links-end"></div>

View file

@ -1,14 +1,5 @@
<h1>$notif_header</h1>
<h1>Notifications</h1> $tabs
<p id="notification-listing-desc">
<a href="/notifications/network" class="button tabs {{if $activetab==network}}active{{endif}}">Network</a>
<a href="/notifications/home" class="button tabs {{if $activetab==home}}active{{endif}}">Home</a>
<a href="/notifications/intros" class="button tabs {{if $activetab==intros}}active{{endif}}">Introductions</a>
<a href="/message" class="button tabs">Messages</a>
</p>
<div class="notification-listing-end"></div>
<div class="notif-network-wrapper"> <div class="notif-network-wrapper">
$notif_content $notif_content
</div> </div>