. * * @category GroupPrivateMessage * @package StatusNet * @author Evan Prodromou * @copyright 2011 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ if (!defined('STATUSNET')) { // This check helps protect against security problems; // your code file can't be executed directly from the web. exit(1); } /** * Widget for showing a single group message * * @category GroupPrivateMessage * @package StatusNet * @author Evan Prodromou * @copyright 2011 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ class GroupMessageListItem extends Widget { var $gm; /** * Constructor * * @param HTMLOutputter $out output context * @param Group_message $gm Group message */ function __construct($out, $gm) { parent::__construct($out); $this->gm = $gm; } /** * Show the item * * @return void */ function show() { $group = $this->gm->getGroup(); $sender = $this->gm->getSender(); $this->out->elementStart('li', array('class' => 'hentry notice message group-message', 'id' => 'message-' . $this->gm->id)); $this->out->elementStart('div', 'entry-title'); $this->out->elementStart('span', 'vcard author'); $this->out->elementStart('a', array('href' => $sender->profileurl, 'class' => 'url')); $avatar = $sender->getAvatar(AVATAR_STREAM_SIZE); $this->out->element('img', array('src' => ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_STREAM_SIZE), 'width' => AVATAR_STREAM_SIZE, 'height' => AVATAR_STREAM_SIZE, 'class' => 'photo avatar', 'alt' => $sender->getBestName())); $this->out->element('span', array('class' => 'nickname fn'), $sender->nickname); $this->out->elementEnd('a'); $this->out->elementEnd('span'); $this->out->elementStart('p', array('class' => 'entry-content message-content')); $this->out->raw($this->gm->rendered); $this->out->elementEnd('p'); $this->out->elementEnd('div'); $this->out->elementStart('div', 'entry-content'); $this->out->elementStart('a', array('rel' => 'bookmark', 'class' => 'timestamp', 'href' => $this->gm->url)); $dt = common_date_iso8601($this->gm->created); $this->out->element('abbr', array('class' => 'published', 'title' => $dt), common_date_string($this->gm->created)); $this->out->elementEnd('a'); $this->out->elementEnd('div'); $this->out->elementEnd('li'); } }