]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/TagSub/TagSubPlugin.php
Added tagsub to the left-hand menu
[quix0rs-gnu-social.git] / plugins / TagSub / TagSubPlugin.php
index 53a06ab5bf701cdaf9ddb1beb8abe3947c4fd8f3..13e525bb62d5529955d187e946a802760910b3dd 100644 (file)
@@ -80,6 +80,7 @@ class TagSubPlugin extends Plugin
         case 'TagunsubAction':
         case 'TagsubsAction':
         case 'TagSubForm':
+        case 'TagSubMenu':
         case 'TagUnsubForm':
             include_once $dir.'/'.strtolower($cls).'.php';
             return false;
@@ -239,4 +240,28 @@ class TagSubPlugin extends Plugin
         }
         return true;
     }
+
+    function onEndDefaultLocalNav($menu, $user)
+    {
+        $user = common_current_user();
+
+        $tags = TagSub::forProfile($user->getProfile());
+
+        if (!empty($tags)) {
+            $tagSubMenu = new TagSubMenu($menu->out, $user, $tags);
+            $menu->submenu(_m('Tags'), $tagSubMenu);
+        }
+
+        foreach ($tags as $tag) {
+                $menu->out->menuItem(common_local_url('tag',
+                                                      array('tag' => $tag)),
+                                     sprintf('#%s', $tag),
+                                     sprintf(_('Notices tagged with %s'), $tag),
+                                     $menu->actionName == 'tag' && $menu->action->arg('tag') == $tag,
+                                     'nav_streams_tag_'.$tag);
+        }
+
+        return true;
+    }
+
 }