]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/replies.php
Fix help text for getvaliddaemons.php
[quix0rs-gnu-social.git] / actions / replies.php
index 7eff74a6691e34505ceda2aa6dccbf9bc979bf33..d7ed440e9237d0a32fd814eb1dd99269ad6393f9 100644 (file)
@@ -45,9 +45,8 @@ require_once INSTALLDIR.'/lib/feedlist.php';
  * @link     http://laconi.ca/
  */
 
-class RepliesAction extends Action
+class RepliesAction extends OwnerDesignAction
 {
-    var $user = null;
     var $page = null;
 
     /**
@@ -84,7 +83,7 @@ class RepliesAction extends Action
         $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
 
         common_set_returnto($this->selfUrl());
-        
+
         return true;
     }
 
@@ -129,16 +128,13 @@ class RepliesAction extends Action
      * @return void
      */
 
-    function showFeeds()
+    function getFeeds()
     {
         $rssurl   = common_local_url('repliesrss',
                                      array('nickname' => $this->user->nickname));
         $rsstitle = sprintf(_('Feed for replies to %s'), $this->user->nickname);
 
-        $this->element('link', array('rel' => 'alternate',
-                                     'href' => $rssurl,
-                                     'type' => 'application/rss+xml',
-                                     'title' => $rsstitle));
+        return array(new Feed(Feed::RSS1, $rssurl, $rsstitle));
     }
 
     /**
@@ -153,25 +149,6 @@ class RepliesAction extends Action
         $nav->show();
     }
 
-    /**
-     * Show the replies feed links
-     *
-     * @return void
-     */
-
-    function showExportData()
-    {
-        $fl = new FeedList($this);
-
-        $rssurl = common_local_url('repliesrss',
-                                   array('nickname' => $this->user->nickname));
-
-        $fl->show(array(0=>array('href'=> $rssurl,
-                                 'type' => 'rss',
-                                 'version' => 'RSS 1.0',
-                                 'item' => 'repliesrss')));
-    }
-
     /**
      * Show the content
      *
@@ -188,13 +165,37 @@ class RepliesAction extends Action
         $nl = new NoticeList($notice, $this);
 
         $cnt = $nl->show();
+        if (0 === $cnt) {
+            $this->showEmptyListMessage();
+        }
 
         $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE,
                           $this->page, 'replies',
                           array('nickname' => $this->user->nickname));
     }
 
-    function isReadOnly()
+    function showEmptyListMessage()
+    {
+        $message = sprintf(_('This is the timeline showing replies to %s but %s hasn\'t received a notice to his attention yet.'), $this->user->nickname, $this->user->nickname) . ' ';
+
+        if (common_logged_in()) {
+            $current_user = common_current_user();
+            if ($this->user->id === $current_user->id) {
+                $message .= _('You can engage other users in a conversation, subscribe to more people or [join groups](%%action.groups%%).');
+            } else {
+                $message .= sprintf(_('You can try to [nudge %s](../%s) or [post something to his or her attention](%%%%action.newnotice%%%%?status_textarea=%s).'), $this->user->nickname, $this->user->nickname, '@' . $this->user->nickname);
+            }
+        }
+        else {
+            $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to his or her attention.'), $this->user->nickname);
+        }
+
+        $this->elementStart('div', 'guide');
+        $this->raw(common_markup_to_html($message));
+        $this->elementEnd('div');
+    }
+
+    function isReadOnly($args)
     {
         return true;
     }