/** * Display module contents * * @return void */ public function display() { // Get the module parameters $this->moduleclass = $this->params->get('moduleclass'); $this->limit = intval($this->params->get('limit', 100)); $this->recentgroups = array(); // Get the user's groups $this->allgroups = $this->_getGroups(User::get('id'), 'all'); include_once \Component::path('com_groups') . DS . 'models' . DS . 'recent.php'; $recents = Recent::all()->whereEquals('user_id', User::get('id'))->order('created', 'desc')->limit(5)->rows(); foreach ($this->allgroups as $group) { foreach ($recents as $recent) { if ($recent->get('group_id') == $group->gidNumber) { $this->recentgroups[] = $group; } } } if (!User::authorise('core.create', 'com_groups')) { $this->params->set('button_show_add', 0); } require $this->getLayoutPath(); }