]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/tagrss.php
add design classes
[quix0rs-gnu-social.git] / actions / tagrss.php
index bb4edf47305fd1b5a8200a9b1f8f7e3c5c5b78a0..83cf3afe2f45b7aa594adb248291117dd4d87908 100644 (file)
@@ -23,22 +23,23 @@ require_once(INSTALLDIR.'/lib/rssaction.php');
 
 // Formatting of RSS handled by Rss10Action
 
-class TagrssAction extends Rss10Action {
+class TagrssAction extends Rss10Action
+{
+    var $tag;
 
-    function init()
-    {
-        $tag = $this->trimmed('tag');
+    function prepare($args) {
+        parent::prepare($args);
+        $tag = common_canonical_tag($this->trimmed('tag'));
         $this->tag = Notice_tag::staticGet('tag', $tag);
-
         if (!$this->tag) {
-            common_user_error(_('No such tag.'));
+            $this->clientError(_('No such tag.'));
             return false;
         } else {
             return true;
         }
     }
 
-    function get_notices($limit=0)
+    function getNotices($limit=0)
     {
         $tag = $this->tag;
 
@@ -47,7 +48,6 @@ class TagrssAction extends Rss10Action {
         }
 
         $notice = Notice_tag::getStream($tag->tag, 0, ($limit == 0) ? NOTICES_PER_PAGE : $limit);
-
         while ($notice->fetch()) {
             $notices[] = clone($notice);
         }
@@ -55,14 +55,18 @@ class TagrssAction extends Rss10Action {
         return $notices;
     }
 
-    function get_channel()
+    function getChannel()
     {
-        $tag = $this->tag->tag;
-
+        $tagname = $this->tag->tag;
         $c = array('url' => common_local_url('tagrss', array('tag' => $tagname)),
                'title' => $tagname,
                'link' => common_local_url('tagrss', array('tag' => $tagname)),
                'description' => sprintf(_('Microblog tagged with %s'), $tagname));
         return $c;
     }
+
+    function isReadOnly($args)
+    {
+        return true;
+    }
 }