]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/profileminilist.php
typo in profileminilist class
[quix0rs-gnu-social.git] / lib / profileminilist.php
index 81cd7aed5583f66ffb06ab88e9c597d63cba2f8a..09bef6f7c6158a054c806b210add89c8b3b2daea 100644 (file)
@@ -33,7 +33,7 @@ if (!defined('LACONICA')) {
 
 require_once INSTALLDIR.'/lib/profilelist.php';
 
-define('PROFILES_PER_MINILIST', 80);
+define('PROFILES_PER_MINILIST', 27);
 
 /**
  * Widget to show a list of profiles, good for sidebar
@@ -47,26 +47,20 @@ define('PROFILES_PER_MINILIST', 80);
 
 class ProfileMiniList extends ProfileList
 {
-    function show()
+    function startList()
     {
         $this->out->elementStart('ul', 'entities users xoxo');
+    }
 
-        $cnt = 0;
-
-        while ($this->profile->fetch()) {
-            $cnt++;
-            if($cnt > PROFILES_PER_MINILIST) {
-                break;
-            }
-            $this->showProfile();
-        }
-
-        $this->out->elementEnd('ul');
-
-        return $cnt;
+    function newListItem($profile)
+    {
+        return new ProfileMiniListItem($profile, $this->action);
     }
+}
 
-    function showProfile()
+class ProfileMiniListItem extends ProfileListItem
+{
+    function show()
     {
         $this->out->elementStart('li', 'vcard');
         $this->out->elementStart('a', array('title' => $this->profile->getBestName(),
@@ -74,7 +68,7 @@ class ProfileMiniList extends ProfileList
                                        'rel' => 'contact member',
                                        'class' => 'url'));
         $avatar = $this->profile->getAvatar(AVATAR_MINI_SIZE);
-        $this->out->element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) :  common_default_avatar(AVATAR_MINI_SIZE)),
+        $this->out->element('img', array('src' => (($avatar) ? $avatar->displayUrl() :  Avatar::defaultImage(AVATAR_MINI_SIZE)),
                                     'width' => AVATAR_MINI_SIZE,
                                     'height' => AVATAR_MINI_SIZE,
                                     'class' => 'avatar photo',