]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Generated an extra class on bookmark notice <li>s
authorEvan Prodromou <evan@status.net>
Fri, 31 Dec 2010 00:57:28 +0000 (16:57 -0800)
committerEvan Prodromou <evan@status.net>
Fri, 31 Dec 2010 00:57:28 +0000 (16:57 -0800)
plugins/Bookmark/BookmarkPlugin.php

index faddf5aafa279c38e88a10c64d6b41f1c303674f..8eef609751fc64e5b8391f122ca21b7b7671550f 100644 (file)
@@ -648,6 +648,27 @@ class BookmarkPlugin extends Plugin
         return true;
     }
 
+    /**
+     * Output our CSS class for bookmark notice list elements
+     *
+     * @param NoticeListItem $nli The item being shown
+     *
+     * @return boolean hook value
+     */
+
+    function onStartOpenNoticeListItemElement($nli)
+    {
+        $nb = Bookmark::getByNotice($nli->notice);
+        if (!empty($nb)) {
+            $id = (empty($nli->repeat)) ? $nli->notice->id : $nli->repeat->id;
+            $nli->out->elementStart('li', array('class' => 'hentry notice bookmark',
+                                                 'id' => 'notice-' . $id));
+            Event::handle('EndOpenNoticeListItemElement', array($nli));
+            return false;
+        }
+        return true;
+    }
+
     /**
      * Save a remote bookmark (from Salmon or PuSH)
      *