*/
namespace Friendica\Model;
-use Friendica\Core\L10n;
use Friendica\BaseObject;
+use Friendica\Core\L10n;
use Friendica\Database\DBM;
use dba;
return $return;
}
+ /**
+ * Update group information.
+ *
+ * @param int $id Group ID
+ * @param string $name Group name
+ *
+ * @return bool Was the update successful?
+ */
+ public static function update($id, $name)
+ {
+ return dba::update('group', ['name' => $name], ['id' => $id]);
+ }
+
/**
* @brief Get a list of group ids a contact belongs to
*
}
if ($check_dead && !$use_gcontact) {
- require_once 'include/acl_selectors.php';
- $return = prune_deadguys($return);
+ Contact::pruneUnavailable($return);
}
return $return;
}
* @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 = '';
[
'text' => L10n::t('Everybody'),
'id' => 0,
- 'selected' => (($group_id == 0) ? 'group-selected' : ''),
+ 'selected' => (($group_id === 'everyone') ? 'group-selected' : ''),
'href' => $every,
]
];
'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'),