diff options
author | Brion Vibber <brion@pobox.com> | 2010-11-15 15:34:12 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-11-15 15:34:12 -0800 |
commit | 0e763b49024703efc3e2bbadad83b03d3dd62790 (patch) | |
tree | 6378983e5a0dd559982cb17ca5332b29e324cf9d /plugins/ModPlus/ModPlusPlugin.php | |
parent | 0d0e51292d97e0b3a07cf1d12031df0b8f69823f (diff) |
Stub RemoteprofileAction to show the standard profile header stuff for offsite users -- provides a way to get at the mod & block controls for remote users.
Diffstat (limited to 'plugins/ModPlus/ModPlusPlugin.php')
-rw-r--r-- | plugins/ModPlus/ModPlusPlugin.php | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/plugins/ModPlus/ModPlusPlugin.php b/plugins/ModPlus/ModPlusPlugin.php index 485b82181..89bbdf857 100644 --- a/plugins/ModPlus/ModPlusPlugin.php +++ b/plugins/ModPlus/ModPlusPlugin.php @@ -40,4 +40,59 @@ class ModPlusPlugin extends Plugin return true; } + + /** + * Load JS at runtime if we're logged in. + * + * @param Action $action + * @return boolean hook result + */ + function onEndShowScripts($action) + { + $user = common_current_user(); + if ($user) { + $action->script('plugins/ModPlus/modplus.js'); + } + return true; + } + + /** + * Autoloader + * + * Loads our classes if they're requested. + * + * @param string $cls Class requested + * + * @return boolean hook return + */ + function onAutoload($cls) + { + switch ($cls) + { + case 'RemoteprofileAction': + case 'RemoteProfileAction': + require_once dirname(__FILE__) . '/remoteprofileaction.php'; + return false; + default: + return true; + } + } + + /** + * Add OpenID-related paths to the router table + * + * Hook for RouterInitialized event. + * + * @param Net_URL_Mapper $m URL mapper + * + * @return boolean hook return + */ + function onStartInitializeRouter($m) + { + $m->connect('user/remote/:id', + array('action' => 'remoteprofile'), + array('id' => '[\d]+')); + + return true; + } } |