From 9069952d91a871a58a7c9092999e1e63b9659610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Mon, 22 Oct 2007 19:03:37 +0200 Subject: [PATCH] objectManager: Use GetOptionalSetting() in more places --- include/objectManager.php | 27 ++++++++------------------- objectManager.php | 4 ---- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/include/objectManager.php b/include/objectManager.php index d888f05..8c49d0c 100644 --- a/include/objectManager.php +++ b/include/objectManager.php @@ -162,6 +162,10 @@ class ObjectManager return; } + // if displaying a queue display the help for the given queue + if($this->getIsQueue()) + $this->GetOptionalSetting("ObjectDisplayQueueProcessingHelp", ""); + $oObject = new $this->sClass(); // Display top of the page selectors for items per page and @@ -199,8 +203,7 @@ class ObjectManager break; } - if(method_exists($oObject, "objectShowAddEntry") && - $oObject->objectShowAddEntry()) + if($this->GetOptionalSetting("objectShowAddEntry", FALSE)) { echo "
makeUrl("add", false, @@ -266,9 +269,7 @@ class ObjectManager echo ""; $oObject = new $this->sClass(); - if($oObject->canEdit() && - method_exists($oObject, "objectShowAddEntry") && - $oObject->objectShowAddEntry()) + if($oObject->canEdit() && $this->GetOptionalSetting("objectShowAddEntry", FALSE)) { echo "

makeUrl("add", false, "Add $this->sClass")."\">Add entry\n"; @@ -338,8 +339,7 @@ class ObjectManager if($this->bIsQueue || ($oObject->objectGetSubmitterId() && $oObject->objectGetSubmitterId() != $_SESSION['current']->iUserId)) { /* If it isn't implemented, that means there is no default text */ - if(method_exists(new $this->sClass, "getDefaultReply")) - $sDefaultReply = $oObject->getDefaultReply(); + $sDefaultReply = $this->getOptionalSetting("getDefaultReply", ""); echo html_frame_start("Reply text", "90%", "", 0); echo "\n"; @@ -376,7 +376,7 @@ class ObjectManager echo '
' ,"\n"; echo '',"\n"; - if(!method_exists(new $this->sClass, "objectHideDelete")) + if(!$this->getOptionalSetting("objectHideDelete", FALSE)) { echo '',"\n"; @@ -412,17 +412,6 @@ class ObjectManager } - /* Display help for queue processing */ - public function display_queue_processing_help() - { - /* No help text defined, so do nothing */ - if(!method_exists(new $this->sClass(), "ObjectDisplayQueueProcessingHelp")) - return FALSE; - - call_user_func(array($this->sClass, - "ObjectDisplayQueueProcessingHelp")); - } - /* Ask whether the user really wants to delete the entry and display a delete reason box */ public function delete_prompt() { diff --git a/objectManager.php b/objectManager.php index 7d5b0ad..4b74ac2 100644 --- a/objectManager.php +++ b/objectManager.php @@ -124,10 +124,6 @@ if($oObject->getId() && $sAction != "add") $oObject->add_entry($aClean, $sErrors); } else { - // if displaying a queue display the help for the given queue - if($oObject->getIsQueue()) - $oObject->display_queue_processing_help(); - $oObject->display_table($aClean); }