[frio] Improve Group Editing (#5349)

* Improve group-editing and edit-navigation.

Use icons next to groups and header for navigation to editing groups and adding new groups.
Also use icon from group-sidebar for editing groups.

* Unify look&feel of contact search bars.

* Remove nogroup page and replace with /group/none.

* Make sure proper items are selected in aside.

* Use icon instead of link for 'View Contacs' on profile page.

* Fix none-working /group/none.

* Fix highlighting for everyone in group aside.
This commit is contained in:
Andreas Neustifter 2018-07-10 00:36:50 +02:00 committed by Hypolite Petovan
parent 09b7e217c7
commit 32ef5623ab
16 changed files with 180 additions and 177 deletions

View file

@ -696,49 +696,20 @@ class Contact extends BaseObject
*
* @return array
*/
public static function getUngroupedList($uid, $start = 0, $count = 0)
public static function getUngroupedList($uid)
{
if (!$count) {
$r = q(
"SELECT COUNT(*) AS `total`
FROM `contact`
WHERE `uid` = %d
AND NOT `self`
AND NOT `blocked`
AND NOT `pending`
AND `id` NOT IN (
SELECT DISTINCT(`contact-id`)
FROM `group_member`
WHERE `uid` = %d
)",
intval($uid),
intval($uid)
);
return $r;
}
$r = q(
"SELECT *
FROM `contact`
WHERE `uid` = %d
AND NOT `self`
AND NOT `blocked`
AND NOT `pending`
AND `id` NOT IN (
SELECT DISTINCT(`contact-id`)
FROM `group_member`
INNER JOIN `group` ON `group`.`id` = `group_member`.`gid`
WHERE `group`.`uid` = %d
)
LIMIT %d, %d",
intval($uid),
intval($uid),
intval($start),
intval($count)
);
return $r;
return q("SELECT *
FROM `contact`
WHERE `uid` = %d
AND NOT `self`
AND NOT `blocked`
AND NOT `pending`
AND `id` NOT IN (
SELECT DISTINCT(`contact-id`)
FROM `group_member`
INNER JOIN `group` ON `group`.`id` = `group_member`.`gid`
WHERE `group`.`uid` = %d
)", intval($uid), intval($uid));
}
/**

View file

@ -361,7 +361,7 @@ class Group extends BaseObject
* @param int $cid
* @return string
*/
public static function sidebarWidget($every = 'contacts', $each = 'group', $editmode = 'standard', $group_id = 0, $cid = 0)
public static function sidebarWidget($every = 'contacts', $each = 'group', $editmode = 'standard', $group_id = '', $cid = 0)
{
$o = '';
@ -373,7 +373,7 @@ class Group extends BaseObject
[
'text' => L10n::t('Everybody'),
'id' => 0,
'selected' => (($group_id == 0) ? 'group-selected' : ''),
'selected' => (($group_id === 'everyone') ? 'group-selected' : ''),
'href' => $every,
]
];
@ -417,6 +417,7 @@ class Group extends BaseObject
'grouppage' => 'group/',
'$edittext' => L10n::t('Edit group'),
'$ungrouped' => $every === 'contacts' ? L10n::t('Contacts not in any group') : '',
'$ungrouped_selected' => (($group_id === 'none') ? 'group-selected' : ''),
'$createtext' => L10n::t('Create a new group'),
'$creategroup' => L10n::t('Group Name: '),
'$editgroupstext' => L10n::t('Edit groups'),