* @link http://status.net/
*/
-if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
-}
+if (!defined('GNUSOCIAL') && !defined('STATUSNET')) { exit(1); }
/**
* widget for displaying a list of notices
{
protected $userProfile;
- function __construct($notice, $out=null, $profile=-1)
+ function __construct(Notice $notice, HTMLOutputter $out=null, $profile=-1)
{
parent::__construct($notice, $out);
if (is_int($profile) && $profile == -1) {
if ($notice->repeat_of) {
$orig = Notice::getKV('id', $notice->repeat_of);
- if ($orig) {
+ if ($orig instanceof Notice) {
$notice = $orig;
}
}
// Get the convo's root notice
$root = $notice->conversationRoot($this->userProfile);
- if ($root) {
+ if ($root instanceof Notice) {
$notice = $root;
}
*
* @return NoticeListItem a list item for displaying the notice
*/
- function newListItem($notice)
+ function newListItem(Notice $notice)
{
return new ThreadedNoticeListItem($notice, $this->out, $this->userProfile);
}
{
protected $userProfile = null;
- function __construct($notice, $out=null, $profile=null)
+ function __construct(Notice $notice, HTMLOutputter $out=null, $profile=null)
{
parent::__construct($notice, $out);
$this->userProfile = $profile;
$moreCutoff = null;
while ($notice->fetch()) {
if (Event::handle('StartAddNoticeReply', array($this, $this->notice, $notice))) {
+ // Don't list repeats as separate notices in a conversation
+ if (!empty($notice->repeat_of)) {
+ continue;
+ }
+
if ($notice->id == $this->notice->id) {
// Skip!
continue;
{
protected $root = null;
- function __construct($notice, $root, $out)
+ function __construct(Notice $notice, $root, $out)
{
$this->root = $root;
parent::__construct($notice, $out);
{
$item = new ThreadedNoticeListInlineFavesItem($this->notice, $this->out);
$hasFaves = $item->show();
+ $item = new ThreadedNoticeListInlineRepeatsItem($this->notice, $this->out);
+ $hasRepeats = $item->show();
parent::showEnd();
}
}
{
protected $cnt;
- function __construct($notice, $out, $cnt)
+ function __construct(Notice $notice, HTMLOutputter $out, $cnt)
{
parent::__construct($notice, $out);
$this->cnt = $cnt;
function showMiniForm()
{
$id = $this->notice->conversation;
- $url = common_local_url('conversationreplies', array('id' => $id));
+ $url = common_local_url('conversation', array('id' => $id));
$n = Conversation::noticeCount($id) - 1;
{
function showStart()
{
- $this->out->elementStart('div', array('class' => 'entry-content notice-faves'));
+ $this->out->elementStart('div', array('class' => 'e-content notice-faves'));
}
function showEnd()
}
/**
- * Placeholder for showing faves...
+ * Placeholder for showing repeats...
*/
class ThreadedNoticeListRepeatsItem extends NoticeListActorsItem
{
$this->out->elementEnd('li');
}
}
+
+// @todo FIXME: needs documentation.
+class ThreadedNoticeListInlineRepeatsItem extends ThreadedNoticeListRepeatsItem
+{
+ function showStart()
+ {
+ $this->out->elementStart('div', array('class' => 'e-content notice-repeats'));
+ }
+
+ function showEnd()
+ {
+ $this->out->elementEnd('div');
+ }
+}