]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/QnA/QnAPlugin.php
Merge request from robmyers upping the PHP version dependency
[quix0rs-gnu-social.git] / plugins / QnA / QnAPlugin.php
index 8712c549037ebd0e225cb733d77fbb2e7065ea1b..ec1b16b872c5c3871c0f46efa7241f91b1a94a29 100644 (file)
@@ -46,6 +46,9 @@ if (!defined('STATUSNET')) {
  */
 class QnAPlugin extends MicroAppPlugin
 {
+
+    var $oldSaveNew = true;
+
     /**
      * Set up our tables (question and answer)
      *
@@ -161,7 +164,7 @@ class QnAPlugin extends MicroAppPlugin
      *
      * @return Notice the resulting notice
      */
-    function saveNoticeFromActivity($activity, $actor, $options=array())
+    function saveNoticeFromActivity(Activity $activity, Profile $actor, array $options=array())
     {
         if (count($activity->objects) != 1) {
             // TRANS: Exception thrown when there are too many activity objects.
@@ -211,7 +214,7 @@ class QnAPlugin extends MicroAppPlugin
      * @return ActivityObject
      */
 
-    function activityObjectFromNotice($notice)
+    function activityObjectFromNotice(Notice $notice)
     {
         $question = null;
 
@@ -242,7 +245,7 @@ class QnAPlugin extends MicroAppPlugin
         $obj->id      = $question->uri;
         $obj->type    = QnA_Question::OBJECT_TYPE;
         $obj->title   = $question->title;
-        $obj->link    = $notice->bestUrl();
+        $obj->link    = $notice->getUrl();
 
         // XXX: probably need other stuff here
 
@@ -265,7 +268,7 @@ class QnAPlugin extends MicroAppPlugin
         {
         case QnA_Question::OBJECT_TYPE:
             $id = (empty($nli->repeat)) ? $nli->notice->id : $nli->repeat->id;
-            $class = 'hentry notice question';
+            $class = 'h-entry notice question';
             if ($nli->notice->scope != 0 && $nli->notice->scope != 1) {
                 $class .= ' limited-scope';
             }
@@ -288,7 +291,7 @@ class QnAPlugin extends MicroAppPlugin
         case QnA_Answer::OBJECT_TYPE:
             $id = (empty($nli->repeat)) ? $nli->notice->id : $nli->repeat->id;
 
-            $cls = array('hentry', 'notice', 'answer');
+            $cls = array('h-entry', 'notice', 'answer');
 
             $answer = QnA_Answer::getKV('uri', $nli->notice->uri);
 
@@ -319,7 +322,7 @@ class QnAPlugin extends MicroAppPlugin
      * @param Notice $notice
      * @param HTMLOutputter $out
      */
-    function showNotice($notice, $out)
+    function showNoticeContent(Notice $notice, $out)
     {
         switch ($notice->object_type) {
         case QnA_Question::OBJECT_TYPE:
@@ -337,7 +340,7 @@ class QnAPlugin extends MicroAppPlugin
         }
     }
 
-    function showNoticeQuestion($notice, $out)
+    function showNoticeQuestion(Notice $notice, $out)
     {
         $user = common_current_user();
 
@@ -345,7 +348,7 @@ class QnAPlugin extends MicroAppPlugin
         $nli = new NoticeListItem($notice, $out);
         $nli->showNotice();
 
-        $out->elementStart('div', array('class' => 'entry-content question-description'));
+        $out->elementStart('div', array('class' => 'e-content question-description'));
 
         $question = QnA_Question::getByNotice($notice);
 
@@ -361,7 +364,7 @@ class QnAPlugin extends MicroAppPlugin
         $out->elementEnd('div');
 
         // @fixme
-        $out->elementStart('div', array('class' => 'entry-content'));
+        $out->elementStart('div', array('class' => 'e-content'));
     }
 
     /**
@@ -427,7 +430,7 @@ class QnAPlugin extends MicroAppPlugin
         return false;
     }
 
-    function showNoticeAnswer($notice, $out)
+    function showNoticeAnswer(Notice $notice, $out)
     {
         $user = common_current_user();
 
@@ -437,7 +440,7 @@ class QnAPlugin extends MicroAppPlugin
         $nli = new NoticeListItem($notice, $out);
         $nli->showNotice();
 
-        $out->elementStart('div', array('class' => 'entry-content answer-content'));
+        $out->elementStart('div', array('class' => 'e-content answer-content'));
 
         if (!empty($answer)) {
             $form = new QnashowanswerForm($out, $answer);
@@ -450,7 +453,7 @@ class QnAPlugin extends MicroAppPlugin
         $out->elementEnd('div');
 
         // @todo FIXME
-        $out->elementStart('div', array('class' => 'entry-content'));
+        $out->elementStart('div', array('class' => 'e-content'));
     }
 
     static function shorten($content, $notice)
@@ -465,7 +468,7 @@ class QnAPlugin extends MicroAppPlugin
             $ellipsis = _m('…');
             $short = mb_substr($content, 0, $max - 1);
             $short .= sprintf('<a href="%1$s" rel="more" title="%2$s">%3$s</a>',
-                              $notice->uri,
+                              $notice->getUrl(),
                               // TRANS: Title for link that is an ellipsis in English.
                               _m('more...'),
                               $ellipsis);
@@ -492,7 +495,7 @@ class QnAPlugin extends MicroAppPlugin
      *
      * @param Notice $notice
      */
-    function deleteRelated($notice)
+    function deleteRelated(Notice $notice)
     {
         switch ($notice->object_type) {
         case QnA_Question::OBJECT_TYPE: