Only show the 'add entry' link if the class has enabled it. The link is only useful for classes

that have no parent objects. The objectShowAddEntry() method is not required because it only
affects the user interface.
This commit is contained in:
Alexander Nicolaysen Sørnes
2007-09-08 22:42:34 +00:00
committed by WineHQ
parent 5a4cbf49a3
commit 4d65a32e17
4 changed files with 26 additions and 3 deletions

View File

@@ -130,8 +130,14 @@ class ObjectManager
break;
}
echo "<br /><center><a href=\"".$this->makeUrl("add", false,
"Add $this->sClass entry")."\">Add an entry?</a></center>";
if(method_exists($oObject, "objectShowAddEntry") &&
$oObject->objectShowAddEntry())
{
echo "<br /><center><a href=\"".
$this->makeUrl("add", false,
"Add $this->sClass entry").
"\">Add an entry?</a></center>";
}
return;
}
@@ -187,7 +193,9 @@ class ObjectManager
echo "</table>";
$oObject = new $this->sClass();
if($oObject->canEdit())
if($oObject->canEdit() &&
method_exists($oObject, "objectShowAddEntry") &&
$oObject->objectShowAddEntry())
{
echo "<br /><br /><a href=\"".$this->makeUrl("add", false,
"Add $this->sClass")."\">Add entry</a>\n";