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:
committed by
WineHQ
parent
5a4cbf49a3
commit
4d65a32e17
@@ -1068,6 +1068,11 @@ class Application {
|
||||
{
|
||||
return $this->iAppId;
|
||||
}
|
||||
|
||||
function objectShowAddEntry()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
function get_vendor_from_keywords($sKeywords)
|
||||
|
||||
@@ -669,6 +669,11 @@ class distribution {
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
function objectShowAddEntry()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -395,6 +395,11 @@ class Vendor {
|
||||
$iDefaultPerPage = 25;
|
||||
return array($aItemsPerPage, $iDefaultPerPage);
|
||||
}
|
||||
|
||||
function objectShowAddEntry()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user