]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/showprofiletag.php
better output for registration confirmation
[quix0rs-gnu-social.git] / actions / showprofiletag.php
index 29ecf4788f95d90145e57e3fccf8343513888eaf..d1b0768d232aebf95dbf9a06896cf5b41a3dc6d7 100644 (file)
@@ -33,7 +33,7 @@ require_once INSTALLDIR.'/lib/feedlist.php';
 
 class ShowprofiletagAction extends Action
 {
-    var $notice, $tagger, $peopletag;
+    var $notice, $tagger, $peopletag, $userProfile;
 
     function isReadOnly($args)
     {
@@ -82,13 +82,18 @@ class ShowprofiletagAction extends Action
                    ($this->peopletag->private && $this->peopletag->tagger === $current->id));
 
         if (!$can_see) {
-            // TRANS: Client error displayed trying to reference a non-existing people tag.
-            $this->clientError(_('No such people tag.'), 404);
+            // TRANS: Client error displayed trying to reference a non-existing list.
+            $this->clientError(_('No such list.'), 404);
             return false;
         }
 
         $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
-        $this->notice = $this->peopletag->getNotices(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
+        $this->userProfile = Profile::current();
+
+        $stream = new PeopletagNoticeStream($this->peopletag, $this->userProfile);
+
+        $this->notice = $stream->getNotices(($this->page-1)*NOTICES_PER_PAGE,
+                                            NOTICES_PER_PAGE + 1);
 
         if ($this->page > 1 && $this->notice->N == 0) {
             // TRANS: Server error when page not found (404).
@@ -115,46 +120,46 @@ class ShowprofiletagAction extends Action
     {
         if ($this->page > 1) {
             if($this->peopletag->private) {
-                // TRANS: Title for private people tag timeline.
-                // TRANS: %1$s is a people tag, %2$s is a page number.
-                return sprintf(_('Private timeline for people tagged %1$s by you, page %2$d'),
+                // TRANS: Title for private list timeline.
+                // TRANS: %1$s is a list, %2$s is a page number.
+                return sprintf(_('Private timeline for %1$s list by you, page %2$d'),
                                 $this->peopletag->tag, $this->page);
             }
 
             $current = common_current_user();
             if (!empty($current) && $current->id == $this->peopletag->tagger) {
-                // TRANS: Title for public people tag timeline where the viewer is the tagger.
-                // TRANS: %1$s is a people tag, %2$s is a page number.
-                return sprintf(_('Timeline for people tagged %1$s by you, page %2$d'),
+                // TRANS: Title for public list timeline where the viewer is the tagger.
+                // TRANS: %1$s is a list, %2$s is a page number.
+                return sprintf(_('Timeline for %1$s list by you, page %2$d'),
                                 $this->peopletag->tag, $this->page);
             }
 
-            // TRANS: Title for private people tag timeline.
-            // TRANS: %1$s is a people tag, %2$s is the tagger's nickname, %3$d is a page number.
-            return sprintf(_('Timeline for people tagged %1$s by %2$s, page %3$d'),
+            // TRANS: Title for private list timeline.
+            // TRANS: %1$s is a list, %2$s is the tagger's nickname, %3$d is a page number.
+            return sprintf(_('Timeline for %1$s list by %2$s, page %3$d'),
                                 $this->peopletag->tag,
                                 $this->tagger->nickname,
                                 $this->page
                           );
         } else {
             if($this->peopletag->private) {
-                // TRANS: Title for private people tag timeline.
-                // TRANS: %s is a people tag.
-                return sprintf(_('Private timeline of people tagged %s by you'),
+                // TRANS: Title for private list timeline.
+                // TRANS: %s is a list.
+                return sprintf(_('Private timeline of %s list by you'),
                                 $this->peopletag->tag);
             }
 
             $current = common_current_user();
             if (!empty($current) && $current->id == $this->peopletag->tagger) {
-                // TRANS: Title for public people tag timeline where the viewer is the tagger.
-                // TRANS: %s is a people tag.
-                return sprintf(_('Timeline for people tagged %s by you'),
+                // TRANS: Title for public list timeline where the viewer is the tagger.
+                // TRANS: %s is a list.
+                return sprintf(_('Timeline for %s list by you'),
                                 $this->peopletag->tag);
             }
 
-            // TRANS: Title for private people tag timeline.
-            // TRANS: %1$s is a people tag, %2$s is the tagger's nickname.
-            return sprintf(_('Timeline for people tagged %1$s by %2$s'),
+            // TRANS: Title for private list timeline.
+            // TRANS: %1$s is a list, %2$s is the tagger's nickname.
+            return sprintf(_('Timeline for %1$s list by %2$s'),
                                 $this->peopletag->tag,
                                 $this->tagger->nickname
                           );
@@ -184,8 +189,8 @@ class ShowprofiletagAction extends Action
                     )
                 ),
                 // TRANS: Feed title.
-                // TRANS: %1$s is a people tag, %2$s is tagger's nickname.
-                sprintf(_('Feed for people tagged %1$s by %2$s (Atom)'),
+                // TRANS: %1$s is a list, %2$s is tagger's nickname.
+                sprintf(_('Feed for %1$s list by %2$s (Atom)'),
                             $this->peopletag->tag, $this->tagger->nickname
                        )
               )
@@ -200,20 +205,20 @@ class ShowprofiletagAction extends Action
 
     function showEmptyListMessage()
     {
-        // TRANS: Empty list message for people tag timeline.
-        // TRANS: %1$s is a people tag, %2$s is a tagger's nickname.
-        $message = sprintf(_('This is the timeline for people tagged %1$s by %2$s but no one has posted anything yet.'),
+        // TRANS: Empty list message for list timeline.
+        // TRANS: %1$s is a list, %2$s is a tagger's nickname.
+        $message = sprintf(_('This is the timeline for %1$s list by %2$s but no one has posted anything yet.'),
                            $this->peopletag->tag,
                            $this->tagger->nickname) . ' ';
 
         if (common_logged_in()) {
             $current_user = common_current_user();
             if ($this->tagger->id == $current_user->id) {
-                // TRANS: Additional empty list message for people tag timeline for currently logged in user tagged tags.
+                // TRANS: Additional empty list message for list timeline for currently logged in user tagged tags.
                 $message .= _('Try tagging more people.');
             }
         } else {
-            // TRANS: Additional empty list message for people tag timeline.
+            // TRANS: Additional empty list message for list timeline.
             // TRANS: This message contains Markdown links in the form [description](link).
             $message .= _('Why not [register an account](%%%%action.register%%%%) and start following this timeline!');
         }
@@ -247,10 +252,12 @@ class ShowprofiletagAction extends Action
                 $this->showEmptyListMessage();
             }
 
-            $this->pagination(
-                $this->page > 1, $cnt > NOTICES_PER_PAGE,
-                $this->page, 'showprofiletag', array('tag' => $this->peopletag->tag,
-                                                     'tagger' => $this->tagger->nickname)
+            $this->pagination($this->page > 1,
+                              $cnt > NOTICES_PER_PAGE,
+                              $this->page,
+                              'showprofiletag',
+                              array('tag' => $this->peopletag->tag,
+                                    'tagger' => $this->tagger->nickname)
             );
 
             Event::handle('EndShowProfileTagContent', array($this));
@@ -280,20 +287,8 @@ class ShowprofiletagAction extends Action
         if (Event::handle('StartShowTaggedProfilesMiniList', array($this))) {
             $title = '';
 
-            $current = common_current_user();
-            if(!empty($current) && $this->peopletag->tagger == $current->id) {
-                // TRANS: Header on show profile tag page.
-                // TRANS: %s is a people tag.
-                $title =  sprintf(_('People tagged %s by you'), $this->peopletag->tag);
-            } else {
-                // TRANS: Header on show profile tag page.
-                // TRANS: %1$s is a people tag, %2$s is a tagger's nickname.
-                $title = sprintf(_('People tagged %1$s by %2$s'),
-                                $this->peopletag->tag,
-                                $this->tagger->nickname);
-            }
-
-            $this->element('h2', null, $title);
+            // TRANS: Header on show list page.
+            $this->element('h2', null, _('Listed'));
 
             $cnt = 0;
 
@@ -301,7 +296,7 @@ class ShowprofiletagAction extends Action
                 $pml = new ProfileMiniList($profile, $this);
                 $cnt = $pml->show();
                 if ($cnt == 0) {
-                    // TRANS: Content of "People tagged x by a user" if there are no tagged users.
+                    // TRANS: Content of "Listed" page if there are no listed users.
                     $this->element('p', null, _('(None)'));
                 }
             }
@@ -312,7 +307,7 @@ class ShowprofiletagAction extends Action
                                                                      array('nickname' => $this->tagger->nickname,
                                                                            'profiletag' => $this->peopletag->tag)),
                                           'class' => 'more'),
-                               // TRANS: Link for more "People tagged x by a user"
+                               // TRANS: Link for more "People in list x by a user"
                                // TRANS: if there are more than the mini list's maximum.
                                _('Show all'));
                 $this->elementEnd('p');