• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

classes/class.ilObjRecoveryFolderGUI.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00034 require_once "class.ilObjectGUI.php";
00035 
00036 class ilObjRecoveryFolderGUI extends ilObjectGUI
00037 {
00042         function ilObjRecoveryFolderGUI($a_data,$a_id,$a_call_by_reference)
00043         {
00044                 $this->type = "recf";
00045                 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference);
00046         }
00047         
00052         function saveObject()
00053         {
00054                 global $rbacadmin;
00055 
00056                 // create and insert forum in objecttree
00057                 $newObj = parent::saveObject();
00058 
00059                 // setup rolefolder & default local roles
00060                 //$roles = $newObj->initDefaultRoles();
00061 
00062                 // ...finally assign role to creator of object
00063                 //$rbacadmin->assignUser($roles[0], $newObj->getOwner(), "y");
00064 
00065                 // put here object specific stuff
00066                         
00067                 // always send a message
00068                 sendInfo($this->lng->txt("object_added"),true);
00069                 
00070                 header("Location:".$this->getReturnLocation("save","adm_object.php?".$this->link_params));
00071                 exit();
00072         }
00073 
00074         function removeFromSystemObject()
00075         {
00076                 global $rbacsystem;
00077                 
00078                 // AT LEAST ONE OBJECT HAS TO BE CHOSEN.
00079                 if (!isset($_POST["id"]))
00080                 {
00081                         $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
00082                 }
00083 
00084                 $this->object->notify("removeFromSystem", $_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$_POST["trash_id"]);
00085 
00086                 // DELETE THEM
00087                 foreach ($_POST["id"] as $id)
00088                 {
00089                         // GET COMPLETE NODE_DATA OF ALL SUBTREE NODES
00090                         $node_data = $this->tree->getNodeData($id);
00091                         $subtree_nodes = $this->tree->getSubTree($node_data);
00092 
00093                         // remember already checked deleted node_ids
00094                         $checked[] = $id;
00095 
00096                         // dive in recursive manner in each already deleted subtrees and remove these objects too
00097                         $this->removeDeletedNodes($id,$checked);
00098 
00099                         foreach ($subtree_nodes as $node)
00100                         {
00101                                 $node_obj =& $this->ilias->obj_factory->getInstanceByRefId($node["ref_id"]);
00102                                 
00103                                 // this is due to bug #1860 (even if this will not completely fix it)
00104                                 // and the fact, that media pool folders may find their way into
00105                                 // the recovery folder (what results in broken pools, if the are deleted)
00106                                 // Alex, 2006-07-21
00107                                 if ($node_obj->getType() != "fold")
00108                                 {
00109                                         $node_obj->delete();
00110                                 }
00111                         }
00112 
00113                         // FIRST DELETE ALL ENTRIES IN RBAC TREE
00114                         $this->tree->deleteTree($node_data);
00115                 }
00116                 
00117                 sendInfo($this->lng->txt("msg_removed"),true);
00118 
00119                 ilUtil::redirect($this->getReturnLocation("removeFromSystem","adm_object.php?ref_id=".$_GET["ref_id"]));
00120 
00121         }
00122         
00123         function showPossibleSubObjects()
00124         {
00125                 $this->sub_objects = "";
00126         }
00127 } // END class.ilObjRecoveryFolderGUI
00128 ?>

Generated on Fri Dec 13 2013 09:06:34 for ILIAS Release_3_4_x_branch .rev 46804 by  doxygen 1.7.1