]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Event/eventlistitem.php
Merge commit 'refs/merge-requests/182' of gitorious.org:statusnet/mainline into 1.1.x
[quix0rs-gnu-social.git] / plugins / Event / eventlistitem.php
index fb27704461378cc788c47a2754a7c572c7829574..b563e228f98ead4c5ed15cc8cd4a638669fcef04 100644 (file)
@@ -152,14 +152,38 @@ class EventListItem extends NoticeListItemAdapter
 
         $out->elementStart('div', 'event-rsvps');
         // TRANS: Field label for event description.
-        $out->element('strong', null, _m('Attending:'));
-        $out->element('span', 'event-rsvps',
-                      // TRANS: RSVP counts.
-                      // TRANS: %1$d, %2$d and %3$d are numbers of RSVPs.
-                      sprintf(_m('Yes: %1$d No: %2$d Maybe: %3$d'),
-                              count($rsvps[RSVP::POSITIVE]),
-                              count($rsvps[RSVP::NEGATIVE]),
-                              count($rsvps[RSVP::POSSIBLE])));
+
+        $out->text(_('Attending:'));
+        $out->elementStart('ul', 'attending-list');
+
+        foreach ($rsvps as $verb => $responses) {
+            $out->elementStart('li', 'rsvp-list');
+            switch ($verb)
+            {
+            case RSVP::POSITIVE:
+                $out->text(_('Yes:'));
+                break;
+            case RSVP::NEGATIVE:
+                $out->text(_('No:'));
+                break;
+            case RSVP::POSSIBLE:
+                $out->text(_('Maybe:'));
+                break;
+            }
+            $ids = array();
+            foreach ($responses as $response) {
+                $ids[] = $response->profile_id;
+            }
+            $ids = array_slice($ids, 0, ProfileMiniList::MAX_PROFILES + 1);
+            $profiles = Profile::pivotGet('id', $ids);
+            $profile  = new ArrayWrapper(array_values($profiles));
+            $minilist = new ProfileMiniList($profile, $out);
+            $minilist->show();
+
+            $out->elementEnd('li');
+        }
+
+        $out->elementEnd('ul');
         $out->elementEnd('div');
 
         $user = common_current_user();