indicate currently selected group in group picker

This commit is contained in:
Friendika 2011-07-01 06:14:15 -07:00
parent 6e5532149a
commit b1aa77584f
3 changed files with 14 additions and 6 deletions

View file

@ -136,7 +136,7 @@ function group_public_members($gid) {
function group_side($every="contacts",$each="group",$edit = false) { function group_side($every="contacts",$each="group",$edit = false, $group_id = 0) {
$o = ''; $o = '';
@ -145,7 +145,7 @@ function group_side($every="contacts",$each="group",$edit = false) {
$createtext = t('Create a new group'); $createtext = t('Create a new group');
$linktext= t('Everybody'); $linktext= t('Everybody');
$selected = (($group_id == 0 && $every !== 'contacts') ? ' class="group-selected" ' : '');
$o .= <<< EOT $o .= <<< EOT
<div id="group-sidebar"> <div id="group-sidebar">
@ -157,7 +157,7 @@ $o .= <<< EOT
<div id="sidebar-group-list"> <div id="sidebar-group-list">
<ul id="sidebar-group-ul"> <ul id="sidebar-group-ul">
<li class="sidebar-group-li" ><a href="$every" >$linktext</a></li> <li class="sidebar-group-li" ><a href="$every" $selected >$linktext</a></li>
EOT; EOT;
@ -166,7 +166,8 @@ EOT;
); );
if(count($r)) { if(count($r)) {
foreach($r as $rr) foreach($r as $rr)
$o .= ' <li class="sidebar-group-li">' . (($edit) ? "<a href=\"group/{$rr['id']}\" title=\"" . t('Edit') . "\" ><img src=\"images/spencil.gif\" alt=\"" . t('Edit') . "\"></a> " : "") . "<a href=\"$each/{$rr['id']}\">{$rr['name']}</a></li>\r\n"; $selected = (($group_id == $rr['id'] && $every !== 'contacts') ? ' class="group-selected" ' : '');
$o .= ' <li class="sidebar-group-li">' . (($edit) ? "<a href=\"group/{$rr['id']}\" title=\"" . t('Edit') . "\" ><img src=\"images/spencil.gif\" alt=\"" . t('Edit') . "\"></a> " : "") . "<a href=\"$each/{$rr['id']}\" $selected >{$rr['name']}</a></li>\r\n";
} }
$o .= " </ul>\r\n </div>\r\n</div>"; $o .= " </ul>\r\n </div>\r\n</div>";

View file

@ -7,7 +7,8 @@ function network_init(&$a) {
return; return;
} }
$group_id = (($a->argc > 1 && intval($a->argv[1])) ? intval($a->argv[1]) : 0);
require_once('include/group.php'); require_once('include/group.php');
if(! x($a->page,'aside')) if(! x($a->page,'aside'))
$a->page['aside'] = ''; $a->page['aside'] = '';
@ -29,7 +30,7 @@ function network_init(&$a) {
$a->page['aside'] .= '</div>'; $a->page['aside'] .= '</div>';
$a->page['aside'] .= group_side('network','network',true); $a->page['aside'] .= group_side('network','network',true,$group_id);
} }

View file

@ -249,6 +249,12 @@ div.wall-item-content-wrapper.shiny {
cursor: pointer; cursor: pointer;
} }
.group-selected {
padding: 3px;
border: 2px solid #CCCCCC;
font-weight: bold;
}
.fakelink:hover { .fakelink:hover {
color: #3465a4; color: #3465a4;
text-decoration: underline; text-decoration: underline;