From fc9bcb492728e4f258dd23dd4f2f5111d264832e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Wed, 29 Apr 2009 21:23:01 +0200 Subject: [PATCH] Customize whether move object lists are lmited to (grand)parents --- include/objectManager.php | 15 ++++++++++++--- include/testData.php | 6 ++++++ include/version.php | 6 ++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/include/objectManager.php b/include/objectManager.php index be0b458..e7df527 100644 --- a/include/objectManager.php +++ b/include/objectManager.php @@ -923,9 +923,18 @@ class ObjectManager "color4"); $oParent = $oObject->objectGetParent(); - $oGrandFather = $oParent->objectGetParent(); - if($oGrandFather) + if(method_exists($oParent, 'objectGetParent')) + { + $oGrandFather = $oParent->objectGetParent(); + $oParentOM = new objectManager(get_class($oParent), '', $oParent->objectGetId()); + } else + { + $oGrandFather = null; + $oParentOM = null; + } + + if($oGrandFather && $oParentOM->GetOptionalSetting('objectRestrictMoveObjectListsToParents', false)) { $aParentSiblings = $oGrandFather->objectGetChildrenClassSpecific(get_class($oParent)); @@ -997,7 +1006,7 @@ class ObjectManager "Move here"), "color4"); - if(method_exists($oObject, 'objectGetParent')) + if($this->GetOptionalSetting('objectRestrictMoveObjectListsToParents', false)) { $oParent = $oObject->objectGetParent(); diff --git a/include/testData.php b/include/testData.php index 6789ec0..7a28d54 100644 --- a/include/testData.php +++ b/include/testData.php @@ -1429,6 +1429,12 @@ class testData{ return new version($this->iVersionId); } + /* Only show children of (grand)parents in the Move Child Objects and Change Parent lists */ + public static function objectRestrictMoveObjectListsToParents() + { + return true; + } + function objectGetChildren($bIncludeDeleted = false) { /* We have none */ diff --git a/include/version.php b/include/version.php index 52b0bae..9f81501 100644 --- a/include/version.php +++ b/include/version.php @@ -789,6 +789,12 @@ class version { return new application($this->iAppId); } + /* Only show children of (grand)parents in the Move Child Objects and Change Parent lists */ + public static function objectRestrictMoveObjectListsToParents() + { + return true; + } + public function getRatingInfo() { return testData::getRatingInfoForVersionId($this->iVersionId);