Rearrange alphanav to better fit 3CL
This commit is contained in:
parent
4b24f09ab4
commit
b431a3b216
@ -121,7 +121,7 @@ class DirectoryPlugin extends Plugin
|
|||||||
$m->connect(
|
$m->connect(
|
||||||
'directory/users/:filter',
|
'directory/users/:filter',
|
||||||
array('action' => 'userdirectory'),
|
array('action' => 'userdirectory'),
|
||||||
array('filter' => '[0-9a-zA-Z_]{1,64}')
|
array('filter' => '([0-9a-zA-Z_]{1,64}|0-9)')
|
||||||
);
|
);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -213,7 +213,7 @@ class UserdirectoryAction extends Action
|
|||||||
|
|
||||||
$this->elementStart('div', array('id' => 'user_directory'));
|
$this->elementStart('div', array('id' => 'user_directory'));
|
||||||
|
|
||||||
$alphaNav = new AlphaNav($this, true, array('All'));
|
$alphaNav = new AlphaNav($this, false, false, array('0-9', 'All'));
|
||||||
$alphaNav->show();
|
$alphaNav->show();
|
||||||
|
|
||||||
$profile = null;
|
$profile = null;
|
||||||
@ -320,7 +320,16 @@ class UserdirectoryAction extends Action
|
|||||||
$sort = $this->getSortKey();
|
$sort = $this->getSortKey();
|
||||||
$sql = 'SELECT profile.* FROM profile, user WHERE profile.id = user.id';
|
$sql = 'SELECT profile.* FROM profile, user WHERE profile.id = user.id';
|
||||||
|
|
||||||
if ($this->filter != 'all') {
|
switch($this->filter)
|
||||||
|
{
|
||||||
|
case 'all':
|
||||||
|
// NOOP
|
||||||
|
break;
|
||||||
|
case '0-9':
|
||||||
|
$sql .=
|
||||||
|
' AND LEFT(profile.nickname, 1) BETWEEN \'0\' AND \'9\'';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
$sql .= sprintf(
|
$sql .= sprintf(
|
||||||
' AND LEFT(LOWER(profile.nickname), 1) = \'%s\'',
|
' AND LEFT(LOWER(profile.nickname), 1) = \'%s\'',
|
||||||
$this->filter
|
$this->filter
|
||||||
|
@ -75,11 +75,11 @@ class AlphaNav extends Widget
|
|||||||
$this->filters = array_merge($this->filters, range(0, 9));
|
$this->filters = array_merge($this->filters, range(0, 9));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->filters = array_merge($this->filters, range('A', 'Z'));
|
||||||
|
|
||||||
if ($append) {
|
if ($append) {
|
||||||
$this->filters = array_merge($this->filters, $append);
|
$this->filters = array_merge($this->filters, $append);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->filters = array_merge($this->filters, range('A', 'Z'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user