objectManager: Use GetOptionalSetting() in more places

This commit is contained in:
Alexander Nicolaysen Sørnes
2007-10-22 19:03:37 +02:00
committed by Chris Morgan
parent fe56884a98
commit 9069952d91
2 changed files with 8 additions and 23 deletions

View File

@@ -162,6 +162,10 @@ class ObjectManager
return; return;
} }
// if displaying a queue display the help for the given queue
if($this->getIsQueue())
$this->GetOptionalSetting("ObjectDisplayQueueProcessingHelp", "");
$oObject = new $this->sClass(); $oObject = new $this->sClass();
// Display top of the page selectors for items per page and // Display top of the page selectors for items per page and
@@ -199,8 +203,7 @@ class ObjectManager
break; break;
} }
if(method_exists($oObject, "objectShowAddEntry") && if($this->GetOptionalSetting("objectShowAddEntry", FALSE))
$oObject->objectShowAddEntry())
{ {
echo "<br /><center><a href=\"". echo "<br /><center><a href=\"".
$this->makeUrl("add", false, $this->makeUrl("add", false,
@@ -266,9 +269,7 @@ class ObjectManager
echo "</table>"; echo "</table>";
$oObject = new $this->sClass(); $oObject = new $this->sClass();
if($oObject->canEdit() && if($oObject->canEdit() && $this->GetOptionalSetting("objectShowAddEntry", FALSE))
method_exists($oObject, "objectShowAddEntry") &&
$oObject->objectShowAddEntry())
{ {
echo "<br /><br /><a href=\"".$this->makeUrl("add", false, echo "<br /><br /><a href=\"".$this->makeUrl("add", false,
"Add $this->sClass")."\">Add entry</a>\n"; "Add $this->sClass")."\">Add entry</a>\n";
@@ -338,8 +339,7 @@ class ObjectManager
if($this->bIsQueue || ($oObject->objectGetSubmitterId() && $oObject->objectGetSubmitterId() != $_SESSION['current']->iUserId)) if($this->bIsQueue || ($oObject->objectGetSubmitterId() && $oObject->objectGetSubmitterId() != $_SESSION['current']->iUserId))
{ {
/* If it isn't implemented, that means there is no default text */ /* If it isn't implemented, that means there is no default text */
if(method_exists(new $this->sClass, "getDefaultReply")) $sDefaultReply = $this->getOptionalSetting("getDefaultReply", "");
$sDefaultReply = $oObject->getDefaultReply();
echo html_frame_start("Reply text", "90%", "", 0); echo html_frame_start("Reply text", "90%", "", 0);
echo "<table width='100%' border=0 cellpadding=2 cellspacing=0>\n"; 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 '<tr valign=top><td class=color3 align=center colspan=2>' ,"\n";
echo '<input name="sSubmit" type="submit" value="Submit" class="button" '. echo '<input name="sSubmit" type="submit" value="Submit" class="button" '.
'/>',"\n"; '/>',"\n";
if(!method_exists(new $this->sClass, "objectHideDelete")) if(!$this->getOptionalSetting("objectHideDelete", FALSE))
{ {
echo '<input name="sSubmit" type="submit" value="Delete" '. echo '<input name="sSubmit" type="submit" value="Delete" '.
'class="button" />',"\n"; '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 */ /* Ask whether the user really wants to delete the entry and display a delete reason box */
public function delete_prompt() public function delete_prompt()
{ {

View File

@@ -124,10 +124,6 @@ if($oObject->getId() && $sAction != "add")
$oObject->add_entry($aClean, $sErrors); $oObject->add_entry($aClean, $sErrors);
} else } else
{ {
// if displaying a queue display the help for the given queue
if($oObject->getIsQueue())
$oObject->display_queue_processing_help();
$oObject->display_table($aClean); $oObject->display_table($aClean);
} }