X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FGroup.php;h=8981e2c647ee35c488355ebb16e809794e212fca;hb=24d7ffa3fee7e3686589f29f005fb2c419c9985a;hp=b32b61e103036659e17956ac04f8cd6a1988ec07;hpb=8821d33f73785884cfce83e7b23d3ef19cc1bc11;p=friendica.git diff --git a/src/Model/Group.php b/src/Model/Group.php index b32b61e103..8981e2c647 100644 --- a/src/Model/Group.php +++ b/src/Model/Group.php @@ -12,10 +12,6 @@ use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\Util\Security; -require_once 'boot.php'; -require_once 'include/dba.php'; -require_once 'include/text.php'; - /** * @brief functions for interacting with the group database table */ @@ -33,7 +29,7 @@ class Group extends BaseObject public static function create($uid, $name) { $return = false; - if (x($uid) && x($name)) { + if (!empty($uid) && !empty($name)) { $gid = self::getIdByName($uid, $name); // check for dupes if ($gid !== false) { // This could be a problem. @@ -202,7 +198,7 @@ class Group extends BaseObject */ public static function removeByName($uid, $name) { $return = false; - if (x($uid) && x($name)) { + if (!empty($uid) && !empty($name)) { $gid = self::getIdByName($uid, $name); $return = self::remove($gid); @@ -355,8 +351,6 @@ class Group extends BaseObject */ public static function sidebarWidget($every = 'contact', $each = 'group', $editmode = 'standard', $group_id = '', $cid = 0) { - $o = ''; - if (!local_user()) { return ''; } @@ -400,6 +394,11 @@ class Group extends BaseObject ]; } + // Don't show the groups on the network page when there is only one + if ((count($display_groups) <= 2) && ($each == 'network')) { + return ''; + } + $tpl = Renderer::getMarkupTemplate('group_side.tpl'); $o = Renderer::replaceMacros($tpl, [ '$add' => L10n::t('add'),