From d7b3bea8f4c38e7985fc94edbed8dc62affdeec8 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Tue, 3 Nov 2009 19:03:34 +0000 Subject: [PATCH] - improved handling of the 'menu' parameter (Thanks to david-alves for reporting it) - removed unneeded paragraph marks around the h2 title for a better HTMl formatting. SVN:trunk[197] --- pages/UI.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pages/UI.php b/pages/UI.php index 2e9e66402..b20da6808 100644 --- a/pages/UI.php +++ b/pages/UI.php @@ -8,7 +8,7 @@ require_once('../application/startup.inc.php'); $oContext = new UserContext(); $oAppContext = new ApplicationContext(); $iActiveNodeId = utils::ReadParam('menu', ''); -if (empty($iActiveNodeId)) +if (empty($iActiveNodeId) && !is_numeric($iActiveNodeId)) { // No menu specified, let's get the default one: // 1) It's a root menu item (parent_id == 0) @@ -319,7 +319,7 @@ switch($operation) $oWizard = new UIWizard($oP, $sClass, $sStateCode); $sStateCode = $oWizard->GetTargetState(); // Will computes the default state if none was supplied $sClassLabel = MetaModel::GetName($sClass); - $oP->p("

Creation of a new $sClassLabel

"); + $oP->add("

Creation of a new $sClassLabel

"); if (!empty($sStateCode)) { $aStates = MetaModel::EnumStates($sClass); @@ -1092,7 +1092,10 @@ switch($operation) break; default: - $oActiveNode->RenderContent($oP, $oAppContext->GetAsHash()); + if (is_object($oActiveNode)) + { + $oActiveNode->RenderContent($oP, $oAppContext->GetAsHash()); + } } ////MetaModel::ShowQueryTrace(); $oP->output();