]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Bookmark/BookmarkPlugin.php
add jquery-ui js and css
[quix0rs-gnu-social.git] / plugins / Bookmark / BookmarkPlugin.php
index c3ff17c4e9aba0713662344a9b21fd6ebfdbd3cb..bc8985e907b8821d992252c1eb8890f45bb5e7b4 100644 (file)
@@ -365,17 +365,15 @@ class BookmarkPlugin extends MicroAppPlugin
     /**
      * Save a bookmark from an activity
      *
-     * @param Profile  $profile  Profile to use as author
      * @param Activity $activity Activity to save
+     * @param Profile  $profile  Profile to use as author
      * @param array    $options  Options to pass to bookmark-saving code
      *
      * @return Notice resulting notice
      */
 
-    function saveNoticeFromActivity($activity, $profile)
+    function saveNoticeFromActivity($activity, $profile, $options=array())
     {
-        $options = array();
-
         $bookmark = $activity->objects[0];
 
         $relLinkEls = ActivityUtils::getLinks($bookmark->element, 'related');
@@ -510,8 +508,17 @@ class BookmarkPlugin extends MicroAppPlugin
         return $object;
     }
 
+    /**
+     * @fixme WARNING WARNING WARNING this opens a 'div' that is apparently closed by MicroAppPlugin
+     * @fixme that's probably wrong?
+     *
+     * @param Notice $notice
+     * @param HTMLOutputter $out
+     */
     function showNotice($notice, $out)
     {
+        $nb = Bookmark::getByNotice($notice);
+
         $profile = $notice->getProfile();
 
         $atts = $notice->attachments();
@@ -544,8 +551,8 @@ class BookmarkPlugin extends MicroAppPlugin
 
         // Replies look like "for:" tags
 
-        $replies = $nli->notice->getReplies();
-        $tags = $nli->notice->getTags();
+        $replies = $notice->getReplies();
+        $tags = $notice->getTags();
 
         if (!empty($replies) || !empty($tags)) {
 
@@ -609,12 +616,15 @@ class BookmarkPlugin extends MicroAppPlugin
                             'height' => AVATAR_MINI_SIZE,
                             'alt' => $profile->getBestName()));
 
-        $out->raw(' ');
+        $out->raw(' '); // avoid   for AJAX XML compatibility
 
+        $out->elementStart('span', 'vcard author'); // hack for belongsOnTimeline; JS needs to be able to find the author
         $out->element('a', 
-                      array('href' => $profile->profileurl,
+                      array('class' => 'url',
+                            'href' => $profile->profileurl,
                             'title' => $profile->getBestName()),
                       $profile->nickname);
+        $out->elementEnd('span');
     }
 
     function entryForm($out)
@@ -622,4 +632,13 @@ class BookmarkPlugin extends MicroAppPlugin
         return new BookmarkForm($out);
     }
 
+    function tag()
+    {
+        return 'bookmark';
+    }
+
+    function appTitle()
+    {
+        return _m('Bookmark');
+    }
 }