]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Style group directory output
authorZach Copley <zach@status.net>
Wed, 13 Apr 2011 22:08:12 +0000 (15:08 -0700)
committerZach Copley <zach@status.net>
Wed, 13 Apr 2011 22:09:46 +0000 (15:09 -0700)
plugins/Directory/DirectoryPlugin.php
plugins/Directory/actions/groupdirectory.php
plugins/Directory/actions/userdirectory.php
plugins/Directory/css/directory.css
plugins/Directory/lib/sortablegrouplist.php

index fbc11fbede71b55e84018895c320292ee43f3449..921de71a1a434d2323171d574536198e2f2c41d7 100644 (file)
@@ -185,7 +185,7 @@ class DirectoryPlugin extends Plugin
     {
         if (in_array(
             $action->trimmed('action'),
-            array('userdirectory'))
+            array('userdirectory', 'groupdirectory'))
         ) {
             $action->cssLink($this->path('css/directory.css'));
         }
index 0966dfac98c330fc8cf43e15dab804d328bc9042..0bcc18567059324862afdcb245f5a76d3e2b33e8 100644 (file)
@@ -199,7 +199,7 @@ class GroupdirectoryAction extends Action
     {
         $this->showForm();
 
-        $this->elementStart('div', array('id' => 'group_directory'));
+        $this->elementStart('div', array('id' => 'profile_directory'));
 
         $alphaNav = new AlphaNav($this, false, false, array('0-9', 'All'));
         $alphaNav->show();
@@ -232,14 +232,13 @@ class GroupdirectoryAction extends Action
 
         $this->pagination(
             $this->page > 1,
-            $cnt > GROUPS_PER_PAGE,
+            $cnt > PROFILES_PER_PAGE,
             $this->page,
             'groupdirectory',
             $args
         );
 
         $this->elementEnd('div');
-
     }
 
     function showForm($error=null)
@@ -281,7 +280,7 @@ class GroupdirectoryAction extends Action
         $limit  = GROUPS_PER_PAGE + 1;
 
         if (isset($this->q)) {
-             
+
              $order = 'user_group.created ASC';
 
              if ($this->sort == 'nickname') {
index 6532f03c02d7637bca0e50aee0363d9829cd2150..b12d1171eaf22df83500fc86485e7d22bec12e65 100644 (file)
@@ -199,7 +199,7 @@ class UserdirectoryAction extends Action
     {
         $this->showForm();
 
-        $this->elementStart('div', array('id' => 'user_directory'));
+        $this->elementStart('div', array('id' => 'profile_directory'));
 
         $alphaNav = new AlphaNav($this, false, false, array('0-9', 'All'));
         $alphaNav->show();
index 14fd2ce23bc8f072346534b0f4281750d290bf5e..d49c28fe559cb73dbad001a16de656d140770c57 100644 (file)
@@ -1,35 +1,35 @@
 /* CSS file for the Directory plugin */
 
-div#user_directory div.alpha_nav {
+div#profile_directory div.alpha_nav {
     overflow: hidden;
     width: 100%;
     text-align: center;
 }
 
 /* XXX: this needs serious CSS foo */
-div#user_directory div.alpha_nav > a {
+div#profile_directory div.alpha_nav > a {
     border-left: 1px solid #000;
     padding-left: 2px;
 }
-div#user_directory div.alpha_nav > a.first {
+div#profile_directory div.alpha_nav > a.first {
     border-left: none;
 }
 
-div#user_directory div.alpha_nav a:link {
+div#profile_directory div.alpha_nav a:link {
     text-decoration: none;
 }
 
-div#user_directory div.alpha_nav a:visited {
+div#profile_directory div.alpha_nav a:visited {
     text-decoration: none;
 }
-div#user_directory div.alpha_nav a:active {
+div#profile_directory div.alpha_nav a:active {
     text-decoration: none;
 }
-div#user_directory div.alpha_nav a:hover {
+div#profile_directory div.alpha_nav a:hover {
     text-decoration: underline; color: blue;
 }
 
-div#user_directory div.alpha_nav a.current {
+div#profile_directory div.alpha_nav a.current {
     background-color:#9BB43E;
 }
 
index 4f875ce2c3d152589c1f6f1fd2dce6dbe54574d2..db6bc1d068e9b14781d7e7ce33c426157120b36b 100644 (file)
@@ -58,7 +58,7 @@ class SortableGroupList extends SortableSubscriptionList
 
     function startList()
     {
-        $this->out->elementStart('table', array('class' => 'profile_list xoxo', 'border' => '1'));
+        $this->out->elementStart('table', array('class' => 'profile_list xoxo'));
         $this->out->elementStart('thead');
         $this->out->elementStart('tr');
 
@@ -120,25 +120,6 @@ class SortableGroupList extends SortableSubscriptionList
         $this->out->elementStart('tbody');
     }
 
-    function showProfiles()
-    {
-        $cnt = 0;
-
-        while ($this->profile->fetch()) {
-            $cnt++;
-            if($cnt > PROFILES_PER_PAGE) {
-                break;
-            }
-
-            $odd = ($cnt % 2 == 0); // for zebra striping
-
-            $pli = $this->newListItem($this->profile, $odd);
-            $pli->show();
-        }
-
-        return $cnt;
-    }
-
     function newListItem($profile, $odd)
     {
         return new SortableGroupListItem($profile, $this->owner, $this->action, $odd);
@@ -188,13 +169,16 @@ class SortableGroupListItem extends SortableSubscriptionListItem
         $avatar = $this->profile->stream_logo;
         $aAttrs = $this->linkAttributes();
         $this->out->elementStart('a', $aAttrs);
-        $this->out->element('img', array('src' => ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_STREAM_SIZE),
-                                         'class' => 'photo avatar',
-                                         'width' => AVATAR_STREAM_SIZE,
-                                         'height' => AVATAR_STREAM_SIZE,
-                                         'alt' =>
-                                         ($this->profile->fullname) ? $this->profile->fullname :
-                                         $this->profile->nickname));
+        $this->out->element(
+            'img', 
+             array(
+                'src' => ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_STREAM_SIZE),
+                'class'  => 'photo avatar',
+                'width'  => AVATAR_STREAM_SIZE,
+                'height' => AVATAR_STREAM_SIZE,
+                'alt'    => ($this->profile->fullname) ? $this->profile->fullname : $this->profile->nickname
+             )
+        );
         $this->out->text(' ');
         $hasFN = (!empty($this->profile->fullname)) ? 'nickname' : 'fn nickname';
         $this->out->elementStart('span', $hasFN);
@@ -203,7 +187,6 @@ class SortableGroupListItem extends SortableSubscriptionListItem
         $this->out->elementEnd('a');
     }
 
-
     function endItem()
     {
         $this->out->elementEnd('tr');
@@ -266,8 +249,6 @@ class SortableGroupListItem extends SortableSubscriptionListItem
 
     function showJoinButton()
     {
-        $this->out->elementStart('td', 'entry_controls');
-
         $user = $this->owner;
         if ($user) {
   
@@ -282,8 +263,6 @@ class SortableGroupListItem extends SortableSubscriptionListItem
                 $jf->show();
             }
         }
-        $this->out->elementEnd('td');
-
     }
 
     function showMemberCount()