]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/noticelist.php
If there's no Happening, we can't use the RSVP.
[quix0rs-gnu-social.git] / lib / noticelist.php
index 5c0e67adb0b8e051ce9a1043873c76c43eb1f185..727be89bc6d0da56effbe0c05bd9e176d323639d 100644 (file)
@@ -55,6 +55,7 @@ class NoticeList extends Widget
 
     protected $addressees = true;
     protected $attachments = true;
+    protected $id_prefix = null;
     protected $maxchars = 0;
     protected $options = true;
     protected $show_n = NOTICES_PER_PAGE;
@@ -81,7 +82,12 @@ class NoticeList extends Widget
                 $this->$key = (bool)$prefs[$key];
             }
         }
-
+        // string preferences
+        foreach(array('id_prefix') as $key) {
+            if (array_key_exists($key, $prefs)) {
+                $this->$key = $prefs[$key];
+            }
+        }
     }
 
     /**
@@ -94,9 +100,8 @@ class NoticeList extends Widget
      *
      * @return int  Total amount of notices actually available.
      */
-    function show()
+    public function show()
     {
-        $this->out->elementStart('div', array('id' =>'notices_primary'));
         $this->out->elementStart('ol', array('class' => 'notices xoxo'));
 
                $notices = $this->notice->fetchAll();
@@ -118,8 +123,6 @@ class NoticeList extends Widget
         }
 
         $this->out->elementEnd('ol');
-        $this->out->elementEnd('div');
-
         return $total;
     }
 
@@ -137,6 +140,7 @@ class NoticeList extends Widget
     {
         $prefs = array('addressees' => $this->addressees,
                        'attachments' => $this->attachments,
+                       'id_prefix' => $this->id_prefix,
                        'maxchars' => $this->maxchars,
                        'options' => $this->options);
         return new NoticeListItem($notice, $this->out, $prefs);
@@ -151,15 +155,9 @@ class NoticeList extends Widget
 
             // Prefill attachments
             Notice::fillAttachments($notices);
-            // Prefill repeat data
-            Notice::fillRepeats($notices);
             // Prefill the profiles
             $profiles = Notice::fillProfiles($notices);
 
-            if ($scoped instanceof Profile) {
-                Notice::pivotGet('repeat_of', $notice_ids, array('profile_id' => $scoped->id));
-            }
-
             Event::handle('EndNoticeListPrefill', array(&$notices, &$profiles, $notice_ids, $scoped));
         }
     }