• 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 
00036 require_once "class.ilContainerGUI.php";
00037 
00038 class ilObjRecoveryFolderGUI extends ilContainerGUI
00039 {
00044         function ilObjRecoveryFolderGUI($a_data,$a_id,$a_call_by_reference)
00045         {
00046                 $this->type = "recf";
00047                 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,false);
00048         }
00049         
00054         function saveObject()
00055         {
00056                 global $rbacadmin;
00057 
00058                 // create and insert forum in objecttree
00059                 $newObj = parent::saveObject();
00060 
00061                 // setup rolefolder & default local roles
00062                 //$roles = $newObj->initDefaultRoles();
00063 
00064                 // ...finally assign role to creator of object
00065                 //$rbacadmin->assignUser($roles[0], $newObj->getOwner(), "y");
00066 
00067                 // put here object specific stuff
00068                         
00069                 // always send a message
00070                 sendInfo($this->lng->txt("object_added"),true);
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                 $this->ctrl->redirect($this, "view");
00120         }
00121         
00122                 function &executeCommand()
00123         {
00124                 $next_class = $this->ctrl->getNextClass($this);
00125                 $cmd = $this->ctrl->getCmd();
00126                 $this->prepareOutput();
00127 
00128                 switch($next_class)
00129                 {
00130                         case 'ilpermissiongui':
00131                                 include_once("./classes/class.ilPermissionGUI.php");
00132                                 $perm_gui =& new ilPermissionGUI($this);
00133                                 $ret =& $this->ctrl->forwardCommand($perm_gui);
00134                                 break;
00135 
00136                         default:
00137                                 if(!$cmd)
00138                                 {
00139                                         $cmd = "view";
00140                                 }
00141                                 $cmd .= "Object";
00142                                 $this->$cmd();
00143 
00144                                 break;
00145                 }
00146                 return true;
00147         }
00148 
00149         
00150         function showPossibleSubObjects()
00151         {
00152                 $this->sub_objects = "";
00153         }
00154 } // END class.ilObjRecoveryFolderGUI
00155 ?>

Generated on Fri Dec 13 2013 11:57:54 for ILIAS Release_3_6_x_branch .rev 46809 by  doxygen 1.7.1