return true;
}
- /**
- * Load related modules when needed
- *
- * @param string $cls Name of the class to be loaded
- *
- * @return boolean hook value; true means continue processing, false means stop.
- */
- function onAutoload($cls)
- {
- $dir = dirname(__FILE__);
-
- switch ($cls)
- {
- case 'TagSub':
- include_once $dir.'/'.$cls.'.php';
- return false;
- case 'TagsubAction':
- case 'TagunsubAction':
- case 'TagsubsAction':
- case 'TagSubForm':
- case 'TagSubMenu':
- case 'TagUnsubForm':
- include_once $dir.'/'.strtolower($cls).'.php';
- return false;
- default:
- return true;
- }
- }
-
/**
* Map URLs to actions
*
*
* @return value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'TagSub',
'version' => self::VERSION,
function onStartTagShowContent(TagAction $action)
{
$user = common_current_user();
- if ($user) {
+
+ if ($user instanceof User) {
$tag = $action->trimmed('tag');
$tagsub = TagSub::pkeyGet(array('tag' => $tag,
'profile_id' => $user->id));
$action->elementEnd('ul');
$action->elementEnd('div');
}
+
return true;
}