. * * @category Public * @package StatusNet * @author Evan Prodromou * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } require_once INSTALLDIR.'/lib/grouplist.php'; /** * Widget to show a list of groups, good for sidebar * * @category Public * @package StatusNet * @author Evan Prodromou * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ class GroupMiniList extends GroupList { function show() { $this->out->elementStart('ul', 'entities groups xoxo'); $cnt = 0; while ($this->group->fetch()) { $cnt++; if($cnt > GROUPS_PER_MINILIST) { break; } $this->showGroup(); } $this->out->elementEnd('ul'); return $cnt; } function showGroup() { $this->out->elementStart('li', 'h-card'); $this->out->elementStart('a', array('title' => $this->group->getBestName(), 'href' => $this->group->homeUrl(), 'rel' => 'contact group', 'class' => 'p-name u-url org')); $logo = ($this->group->mini_logo) ? $this->group->mini_logo : User_group::defaultLogo(AVATAR_MINI_SIZE); $this->out->element('img', array('src' => $logo, 'width' => AVATAR_MINI_SIZE, 'height' => AVATAR_MINI_SIZE, 'class' => 'avatar photo', 'alt' => $this->group->getBestName())); $this->out->elementEnd('a'); $this->out->elementEnd('li'); } }