]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Directory/lib/sortablesubscriptionlist.php
CSS can handle alternating row colouring now
[quix0rs-gnu-social.git] / plugins / Directory / lib / sortablesubscriptionlist.php
index 75c42a5fdfc06fd254d6aca69b482295d0822dcc..d6df6c64cda02b44ba29ba0c94122b65cf7c68f8 100644 (file)
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET')) {
-    exit(1);
-}
-
-require_once INSTALLDIR . '/lib/subscriptionlist.php';
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * Widget to show a sortable list of subscriptions
@@ -128,32 +124,9 @@ class SortableSubscriptionList extends SubscriptionList
         $this->out->elementEnd('table');
     }
 
-    function showProfiles()
+    function newListItem($profile)
     {
-        // Note: we don't use fetchAll() because it's borked with query()
-
-        $profiles = array();
-
-        while ($this->profile->fetch()) {
-            $profiles[] = clone($this->profile);
-        }
-
-        $cnt = count($profiles);
-
-        $max = min($cnt, $this->maxProfiles());
-
-        for ($i = 0; $i < $max; $i++) {
-            $odd = ($i % 2 == 0); // for zebra striping
-            $pli = $this->newListItem($profiles[$i], $odd);
-            $pli->show();
-        }
-
-        return $cnt;
-    }
-
-    function newListItem($profile, $odd)
-    {
-        return new SortableSubscriptionListItem($profile, $this->owner, $this->action, $odd);
+        return new SortableSubscriptionListItem($profile, $this->owner, $this->action);
     }
 }
 
@@ -162,11 +135,10 @@ class SortableSubscriptionListItem extends SubscriptionListItem
     /** Owner of this list */
     var $owner = null;
 
-    function __construct($profile, $owner, $action, $alt)
+    function __construct($profile, $owner, $action)
     {
         parent::__construct($profile, $owner, $action);
 
-        $this->alt   = $alt; // is this row alternate?
         $this->owner = $owner;
     }
 
@@ -177,10 +149,6 @@ class SortableSubscriptionListItem extends SubscriptionListItem
             'id'    => 'profile-' . $this->profile->id
         );
 
-        if ($this->alt) {
-            $attr['class'] .= ' alt';
-        }
-
         $this->out->elementStart('tr', $attr);
     }