Style group directory output

This commit is contained in:
Zach Copley 2011-04-13 15:08:12 -07:00
parent b6b9baa9a2
commit 42e945a42d
5 changed files with 24 additions and 46 deletions

View 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'));
}

View 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') {

View 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();

View 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;
}

View 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()