From 1f9a9c69bc3f5d7b33f4f73da3252ec07b5f3a87 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 9 Mar 2011 12:07:26 -0800 Subject: [PATCH] Only show the site_nav_object block if Action::showObjectNav has been overridden to do something. (Copied similar check from showPageNoticeBlock, handy!) --- lib/action.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/action.php b/lib/action.php index ea3b50a229..2b237118af 100644 --- a/lib/action.php +++ b/lib/action.php @@ -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'); + } } /** -- 2.39.5