Alexander Nicolaysen Sørnes : objectManager: Use GetOptionalSetting() in more places

Chris Morgan cmorgan at winehq.org
Mon Oct 22 18:32:04 CDT 2007


Module: appdb
Branch: master
Commit: 9069952d91a871a58a7c9092999e1e63b9659610
URL:    http://source.winehq.org/git/appdb.git/?a=commit;h=9069952d91a871a58a7c9092999e1e63b9659610

Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date:   Mon Oct 22 19:03:37 2007 +0200

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 "<br /><center><a href=\"".
                      $this->makeUrl("add", false,
@@ -266,9 +269,7 @@ class ObjectManager
         echo "</table>";
 
         $oObject = new $this->sClass();
-        if($oObject->canEdit() &&
-           method_exists($oObject, "objectShowAddEntry") &&
-           $oObject->objectShowAddEntry())
+        if($oObject->canEdit() && $this->GetOptionalSetting("objectShowAddEntry", FALSE))
         {
             echo "<br /><br /><a href=\"".$this->makeUrl("add", false,
                     "Add $this->sClass")."\">Add entry</a>\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 "<table width='100%' border=0 cellpadding=2 cellspacing=0>\n";
@@ -376,7 +376,7 @@ class ObjectManager
             echo '<tr valign=top><td class=color3 align=center colspan=2>' ,"\n";
             echo '<input name="sSubmit" type="submit" value="Submit" class="button" '. 
                  '/>',"\n";
-            if(!method_exists(new $this->sClass, "objectHideDelete"))
+            if(!$this->getOptionalSetting("objectHideDelete", FALSE))
             {
                 echo '<input name="sSubmit" type="submit" value="Delete" '.
                      'class="button" />',"\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);
 }
 




More information about the wine-cvs mailing list