From a3059d02d40684f2bc1a0439c979ca7f79d8f10f Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Sat, 28 Nov 2015 20:09:28 +0100 Subject: [PATCH] group_side - unify look with forumlist --- include/group.php | 34 ++++++++++++------ mod/contacts.php | 2 +- mod/group.php | 2 +- mod/network.php | 2 +- mod/nogroup.php | 2 +- view/templates/group_side.tpl | 68 ++++++++++++++++++----------------- view/theme/smoothly/style.css | 3 +- view/theme/vier/style.css | 13 ++++--- 8 files changed, 74 insertions(+), 52 deletions(-) diff --git a/include/group.php b/include/group.php index fe29d39f1a..862d06818d 100644 --- a/include/group.php +++ b/include/group.php @@ -213,9 +213,20 @@ function mini_group_select($uid,$gid = 0) { } - - -function group_side($every="contacts",$each="group",$edit = false, $group_id = 0, $cid = 0) { +/** + * @brief Create group sidebar widget + * + * @param string $every + * @param string $each + * @param string $editmode + * 'standard' => include link 'Edit groups' + * 'extended' => include link 'Create new group' + * 'full' => include link 'Create new group' and provide for each group a link to edit this group + * @param int $group_id + * @param int $cid + * @return string + */ +function group_side($every="contacts",$each="group",$editmode = "standard", $group_id = 0, $cid = 0) { $o = ''; @@ -239,13 +250,13 @@ function group_side($every="contacts",$each="group",$edit = false, $group_id = 0 $member_of = array(); if($cid) { $member_of = groups_containing(local_user(),$cid); - } + } if(count($r)) { foreach($r as $rr) { $selected = (($group_id == $rr['id']) ? ' group-selected' : ''); - if ($edit) { + if ($editmode == "full") { $groupedit = array( 'href' => "group/".$rr['id'], 'title' => t('edit'), @@ -269,14 +280,17 @@ function group_side($every="contacts",$each="group",$edit = false, $group_id = 0 $tpl = get_markup_template("group_side.tpl"); $o = replace_macros($tpl, array( - '$title' => t('Groups'), + '$title' => t('Groups'), + 'newgroup' => (($editmode == "extended") || ($editmode == "full") ? 1 : ''), + '$editgroupstext' => t('Edit groups'), + 'grouppage' => "group/", '$edittext' => t('Edit group'), '$createtext' => t('Create a new group'), - '$creategroup' => t('Group Name: '), - '$form_security_token' => get_form_security_token("group_edit"), + '$creategroup' => t('Group Name: '), + '$form_security_token' => get_form_security_token("group_edit"), '$ungrouped' => (($every === 'contacts') ? t('Contacts not in any group') : ''), - '$groups' => $groups, - '$add' => t('add'), + '$groups' => $groups, + '$add' => t('add'), )); diff --git a/mod/contacts.php b/mod/contacts.php index 017b1d6435..1dc886363a 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -55,7 +55,7 @@ function contacts_init(&$a) { $findpeople_widget .= findpeople_widget(); } - $groups_widget .= group_side('contacts','group',false,0,$contact_id); + $groups_widget .= group_side('contacts','group','full',0,$contact_id); $a->page['aside'] .= replace_macros(get_markup_template("contacts-widget-sidebar.tpl"),array( '$vcard_widget' => $vcard_widget, diff --git a/mod/group.php b/mod/group.php index 263586e2e9..e9f9561f46 100644 --- a/mod/group.php +++ b/mod/group.php @@ -7,7 +7,7 @@ function validate_members(&$item) { function group_init(&$a) { if(local_user()) { require_once('include/group.php'); - $a->page['aside'] = group_side('contacts','group',false,(($a->argc > 1) ? intval($a->argv[1]) : 0)); + $a->page['aside'] = group_side('contacts','group','extended',(($a->argc > 1) ? intval($a->argv[1]) : 0)); } } diff --git a/mod/network.php b/mod/network.php index 903ee41548..fd22f3e192 100644 --- a/mod/network.php +++ b/mod/network.php @@ -145,7 +145,7 @@ function network_init(&$a) { )); } - $a->page['aside'] .= (feature_enabled(local_user(),'groups') ? group_side('network/0','network',true,$group_id) : ''); + $a->page['aside'] .= (feature_enabled(local_user(),'groups') ? group_side('network/0','network','standard',$group_id) : ''); $a->page['aside'] .= (feature_enabled(local_user(),'forumlist_widget') ? widget_forumlist($a) : ''); $a->page['aside'] .= posted_date_widget($a->get_baseurl() . '/network',local_user(),false); $a->page['aside'] .= networks_widget($a->get_baseurl(true) . '/network',(x($_GET, 'nets') ? $_GET['nets'] : '')); diff --git a/mod/nogroup.php b/mod/nogroup.php index 06fa730e0d..9f6e978433 100644 --- a/mod/nogroup.php +++ b/mod/nogroup.php @@ -15,7 +15,7 @@ function nogroup_init(&$a) { if(! x($a->page,'aside')) $a->page['aside'] = ''; - $a->page['aside'] .= group_side('contacts','group',false,0,$contact_id); + $a->page['aside'] .= group_side('contacts','group','extended',0,$contact_id); } diff --git a/view/templates/group_side.tpl b/view/templates/group_side.tpl index 4905c2fa1a..466882370f 100644 --- a/view/templates/group_side.tpl +++ b/view/templates/group_side.tpl @@ -1,38 +1,42 @@
-

{{$title}}

+

{{$title}}

- diff --git a/view/theme/smoothly/style.css b/view/theme/smoothly/style.css index ba0c4bff6e..3b6b73dc6e 100644 --- a/view/theme/smoothly/style.css +++ b/view/theme/smoothly/style.css @@ -854,7 +854,8 @@ li.widget-list { padding: 3px 24px; } -#sidebar-new-group { +#sidebar-new-group, +#sidebar-edit-groups { padding: 7px; width: 165px; margin: auto; diff --git a/view/theme/vier/style.css b/view/theme/vier/style.css index ecbb2ad96c..5bd475759f 100644 --- a/view/theme/vier/style.css +++ b/view/theme/vier/style.css @@ -347,7 +347,7 @@ code { display: inline-block; min-width: 10px; padding: 3px 7px; - font-size: 12px; + font-size: 10px; font-weight: 700; line-height: 1; color: #fff; @@ -382,7 +382,7 @@ code { #sidebar-group-list .tool:hover { background: #EEE; } -#sidebar-group-list .notify { +/*#sidebar-group-list .notify { min-width: 10px; text-align: center; color: #FFF; @@ -391,6 +391,9 @@ code { padding: 3px; border-radius: 10px; display: none; +}*/ +#sidebar-group-list .notify { + display: none; } #sidebar-group-list .notify.show { display: inline-block; } .tool .label { @@ -416,7 +419,7 @@ code { opacity: 1; } -.sidebar-group-li:hover, #sidebar-new-group:hover, #forum-widget-collapse:hover, +.sidebar-group-li:hover, #sidebar-new-group:hover, #sidebar-edit-groups:hover, #forum-widget-collapse:hover, #sidebar-ungrouped:hover, .side-link:hover, .nets-ul li:hover, #forumlist-sidebar li:hover, #forumlist-sidebar-right li:hover, .nets-all:hover, .saved-search-li:hover, li.tool:hover, .admin.link:hover, aside h4 a:hover, right_aside h4 a:hover, #message-new:hover { /* background-color: #ddd; */ @@ -436,7 +439,7 @@ code { font-weight: bold; } -#forum-widget-showmore, #sidebar-new-group, #forum-widget-collapse, #forumlist-rsidebar-right, #sidebar-ungrouped, +#forum-widget-showmore, #sidebar-new-group, #sidebar-edit-groups, #forum-widget-collapse, #forumlist-rsidebar-right, #sidebar-ungrouped, .side-link, #peoplefind-desc, #connect-desc, .nets-all, .admin.link, #message-new { padding-left: 10px; padding-top: 3px; @@ -464,7 +467,7 @@ code { display: inline-block; } -a.nets-link, .side-link a, #sidebar-new-group a, a.savedsearchterm, a.fileas-link, aside h4 a, right_aside h4 a { +a.nets-link, .side-link a, #sidebar-new-group a, #sidebar-edit-groups a, a.savedsearchterm, a.fileas-link, aside h4 a, right_aside h4 a { display: block; color: #737373; } -- 2.39.5