ChangeSet ID: 31363 CVSROOT: /opt/cvs-commit Module name: appdb Changes by: wineowner@winehq.org 2007/09/08 17:42:34
Modified files: include : application.php distribution.php objectManager.php vendor.php
Log message: Alexander Nicolaysen Sørnes alex@thehandofagony.com 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.
Patch: http://cvs.winehq.org/patch.py?id=31363
Old revision New revision Changes Path 1.126 1.127 +5 -0 appdb/include/application.php 1.46 1.47 +5 -0 appdb/include/distribution.php 1.50 1.51 +11 -3 appdb/include/objectManager.php 1.37 1.38 +5 -0 appdb/include/vendor.php
Index: appdb/include/application.php diff -u -p appdb/include/application.php:1.126 appdb/include/application.php:1.127 --- appdb/include/application.php:1.126 8 Sep 2007 22:42:34 -0000 +++ appdb/include/application.php 8 Sep 2007 22:42:34 -0000 @@ -1068,6 +1068,11 @@ class Application { { return $this->iAppId; } + + function objectShowAddEntry() + { + return TRUE; + } }
function get_vendor_from_keywords($sKeywords) Index: appdb/include/distribution.php diff -u -p appdb/include/distribution.php:1.46 appdb/include/distribution.php:1.47 --- appdb/include/distribution.php:1.46 8 Sep 2007 22:42:34 -0000 +++ appdb/include/distribution.php 8 Sep 2007 22:42:34 -0000 @@ -669,6 +669,11 @@ class distribution { { return FALSE; } + + function objectShowAddEntry() + { + return TRUE; + } }
?> Index: appdb/include/objectManager.php diff -u -p appdb/include/objectManager.php:1.50 appdb/include/objectManager.php:1.51 --- appdb/include/objectManager.php:1.50 8 Sep 2007 22:42:34 -0000 +++ appdb/include/objectManager.php 8 Sep 2007 22:42:34 -0000 @@ -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"; Index: appdb/include/vendor.php diff -u -p appdb/include/vendor.php:1.37 appdb/include/vendor.php:1.38 --- appdb/include/vendor.php:1.37 8 Sep 2007 22:42:34 -0000 +++ appdb/include/vendor.php 8 Sep 2007 22:42:34 -0000 @@ -395,6 +395,11 @@ class Vendor { $iDefaultPerPage = 25; return array($aItemsPerPage, $iDefaultPerPage); } + + function objectShowAddEntry() + { + return TRUE; + } }
?>