]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/noticelistitem.php
updated and moved jquery-cookie
[quix0rs-gnu-social.git] / lib / noticelistitem.php
index a8506aa46e077bf271cef69023e7f437b0cc070d..f829f963ee3f8ddb30ab61a7158941625416b50f 100644 (file)
@@ -73,7 +73,7 @@ class NoticeListItem extends Widget
     {
         parent::__construct($out);
         if (!empty($notice->repeat_of)) {
-            $original = Notice::staticGet('id', $notice->repeat_of);
+            $original = Notice::getKV('id', $notice->repeat_of);
             if (empty($original)) { // could have been deleted
                 $this->notice = $notice;
             } else {
@@ -144,10 +144,13 @@ class NoticeListItem extends Widget
             $user = common_current_user();
             if ($user) {
                 $this->out->elementStart('div', 'notice-options');
-                $this->showFaveForm();
-                $this->showReplyLink();
-                $this->showRepeatForm();
-                $this->showDeleteLink();
+                if (Event::handle('StartShowNoticeOptionItems', array($this))) {
+                    $this->showFaveForm();
+                    $this->showReplyLink();
+                    $this->showRepeatForm();
+                    $this->showDeleteLink();
+                    Event::handle('EndShowNoticeOptionItems', array($this));
+                }
                 $this->out->elementEnd('div');
             }
             Event::handle('EndShowNoticeOptions', array($this));
@@ -269,7 +272,7 @@ class NoticeListItem extends Widget
         $groups = $this->getGroups();
 
         $user = common_current_user();
-        
+
         $streamNicknames = !empty($user) && $user->streamNicknames();
 
         foreach ($groups as $group) {
@@ -294,7 +297,7 @@ class NoticeListItem extends Widget
         $replies = $this->getReplyProfiles();
 
         $user = common_current_user();
-        
+
         $streamNicknames = !empty($user) && $user->streamNicknames();
 
         foreach ($replies as $reply) {
@@ -568,7 +571,7 @@ class NoticeListItem extends Widget
     function showContext()
     {
         if ($this->notice->hasConversation()) {
-            $conv = Conversation::staticGet(
+            $conv = Conversation::getKV(
                 'id',
                 $this->notice->conversation
             );
@@ -604,7 +607,7 @@ class NoticeListItem extends Widget
     {
         if (!empty($this->repeat)) {
 
-            $repeater = Profile::staticGet('id', $this->repeat->profile_id);
+            $repeater = Profile::getKV('id', $this->repeat->profile_id);
 
             $attrs = array('href' => $repeater->profileurl,
                            'class' => 'url');
@@ -617,7 +620,7 @@ class NoticeListItem extends Widget
 
             // TRANS: Addition in notice list item if notice was repeated. Followed by a span with a nickname.
             $this->out->raw(_('Repeated by'));
-            $this->out->raw(_(' '));
+            $this->out->raw(' ');
 
             $this->out->elementStart('a', $attrs);
             $this->out->element('span', 'fn nickname', $repeater->nickname);
@@ -720,4 +723,17 @@ class NoticeListItem extends Widget
             Event::handle('EndCloseNoticeListItemElement', array($this));
         }
     }
+
+    /**
+     * Get the notice in question
+     *
+     * For hooks, etc., this may be useful
+     *
+     * @return Notice The notice we're showing
+     */
+
+    function getNotice()
+    {
+        return $this->notice;
+    }
 }