Extended profile - autocomplete for manager

This commit is contained in:
Zach Copley
2011-03-15 18:45:08 -07:00
parent e4eb6719a5
commit 95d03e74e9
5 changed files with 144 additions and 6 deletions

View File

@@ -54,6 +54,7 @@ class ExtendedProfilePlugin extends Plugin
function onAutoload($cls)
{
$lower = strtolower($cls);
switch ($lower)
{
case 'extendedprofile':
@@ -62,6 +63,9 @@ class ExtendedProfilePlugin extends Plugin
case 'profiledetailsettingsaction':
require_once dirname(__FILE__) . '/' . $lower . '.php';
return false;
case 'userautocompleteaction':
require_once dirname(__FILE__) . '/action/' . mb_substr($lower, 0, -6) . '.php';
return false;
case 'profile_detail':
require_once dirname(__FILE__) . '/' . ucfirst($lower) . '.php';
return false;
@@ -81,11 +85,19 @@ class ExtendedProfilePlugin extends Plugin
*/
function onStartInitializeRouter($m)
{
$m->connect(':nickname/detail',
array('action' => 'profiledetail'),
array('nickname' => Nickname::DISPLAY_FMT));
$m->connect('settings/profile/detail',
array('action' => 'profiledetailsettings'));
$m->connect(
':nickname/detail',
array('action' => 'profiledetail'),
array('nickname' => Nickname::DISPLAY_FMT)
);
$m->connect(
'/settings/profile/finduser',
array('action' => 'Userautocomplete')
);
$m->connect(
'settings/profile/detail',
array('action' => 'profiledetailsettings')
);
return true;
}