From 13c67aa5e9a7a33877ecf52de467c28fe3fcd662 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Wed, 22 Aug 2007 02:52:08 +0000 Subject: [PATCH] Add a 'move children' link to the object editing pages, if we have permission to move the entries --- include/objectManager.php | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/include/objectManager.php b/include/objectManager.php index 19799d3..47852ea 100644 --- a/include/objectManager.php +++ b/include/objectManager.php @@ -296,6 +296,9 @@ class ObjectManager echo html_frame_end(); } else { + // display the move children entry + $this->displayMoveChildren($oObject); + echo '',"\n"; echo ''. ' ',"\n"; @@ -461,6 +464,17 @@ class ObjectManager "now, it only takes a few seconds."); } + function displayMoveChildren($oObject) + { + /* Display a link to the move child objects page if the class has the necessary + functions and the user has edit rights. Not all classes have child objects. */ + if(method_exists($oObject, "objectMoveChildren") && + method_exists($oObject, "objectGetId") && $oObject->canEdit()) + { + echo "makeUrl("showMoveChildren", $this->iId, + "Move Child Objects")."\">Move child objects\n"; + } + } /* View an entry */ function view($sBackLink) @@ -469,17 +483,11 @@ class ObjectManager $oObject = new $this->sClass($this->iId); - /* Display a link to the move child objects page if the class has the necessary - functions and the user has edit rights. Not all classes have child objects. */ - if(method_exists($oObject, "objectMoveChildren") && - method_exists($oObject, "objectGetId") && $oObject->canEdit()) - { - echo "makeUrl("showMoveChildren", $this->iId, - "Move Child Objects")."\">Move child objects

\n"; - } - $oObject->display(); + // display the move children entry + $this->displayMoveChildren($oObject); + echo html_back_link(1, $sBackLink); }