]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Only show the site_nav_object block if Action::showObjectNav has been overridden...
authorBrion Vibber <brion@pobox.com>
Wed, 9 Mar 2011 20:07:26 +0000 (12:07 -0800)
committerBrion Vibber <brion@pobox.com>
Wed, 9 Mar 2011 20:07:26 +0000 (12:07 -0800)
(Copied similar check from showPageNoticeBlock, handy!)

lib/action.php

index ea3b50a229af4e4c50ebf582ffef038d24a40e73..2b237118af8be006f934d2c82e6b3acfc1c2d921 100644 (file)
@@ -713,16 +713,24 @@ class Action extends HTMLOutputter // lawsuit
     /**
      * Show menu for an object (group, profile)
      *
+     * This block will only show if a subclass has overridden
+     * the showObjectNav() method.
+     *
      * @return nothing
      */
     function showObjectNavBlock()
     {
-        // Need to have this ID for CSS; I'm too lazy to add it to
-        // all menus
-        $this->elementStart('div', array('id' => 'site_nav_object',
-                                         'class' => 'section'));
-        $this->showObjectNav();
-        $this->elementEnd('div');
+        $rmethod = new ReflectionMethod($this, 'showObjectNav');
+        $dclass = $rmethod->getDeclaringClass()->getName();
+
+        if ($dclass != 'Action') {
+            // Need to have this ID for CSS; I'm too lazy to add it to
+            // all menus
+            $this->elementStart('div', array('id' => 'site_nav_object',
+                                             'class' => 'section'));
+            $this->showObjectNav();
+            $this->elementEnd('div');
+        }
     }
 
     /**