]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/TagSub/TagSubPlugin.php
Some cleanups:
[quix0rs-gnu-social.git] / plugins / TagSub / TagSubPlugin.php
index 59297a7fb34680871120b5c03c1ba664970c3622..db142e608a9615049946ea97cedfa39a5655d557 100644 (file)
@@ -60,35 +60,6 @@ class TagSubPlugin extends Plugin
         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
      *
@@ -165,7 +136,8 @@ class TagSubPlugin extends Plugin
     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));
@@ -182,6 +154,7 @@ class TagSubPlugin extends Plugin
             $action->elementEnd('ul');
             $action->elementEnd('div');
         }
+
         return true;
     }
 
@@ -192,7 +165,6 @@ class TagSubPlugin extends Plugin
      *
      * @return boolean hook return
      */
-
     function onEndSubGroupNav($widget)
     {
         $action = $widget->out;
@@ -218,11 +190,11 @@ class TagSubPlugin extends Plugin
 
             if (!empty($tags) && count($tags) > 0) {
                 $tagSubMenu = new TagSubMenu($menu->out, $user, $tags);
+                // TRANS: Menu item text for tags submenu.
                 $menu->submenu(_m('Tags'), $tagSubMenu);
             }
         }
 
         return true;
     }
-
 }