• Main Page
  • Related Pages
  • Modules
  • 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 
00035 require_once "class.ilContainerGUI.php";
00036 
00037 class ilObjRecoveryFolderGUI extends ilContainerGUI
00038 {
00043         function ilObjRecoveryFolderGUI($a_data,$a_id,$a_call_by_reference)
00044         {
00045                 $this->type = "recf";
00046                 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,false);
00047         }
00048         
00053         function saveObject()
00054         {
00055                 global $rbacadmin;
00056 
00057                 // create and insert forum in objecttree
00058                 $newObj = parent::saveObject();
00059 
00060                 // setup rolefolder & default local roles
00061                 //$roles = $newObj->initDefaultRoles();
00062 
00063                 // ...finally assign role to creator of object
00064                 //$rbacadmin->assignUser($roles[0], $newObj->getOwner(), "y");
00065 
00066                 // put here object specific stuff
00067                         
00068                 // always send a message
00069                 ilUtil::sendInfo($this->lng->txt("object_added"),true);
00070                 exit();
00071         }
00072 
00073         function removeFromSystemObject()
00074         {
00075                 global $rbacsystem;
00076                 
00077                 // AT LEAST ONE OBJECT HAS TO BE CHOSEN.
00078                 if (!isset($_POST["id"]))
00079                 {
00080                         $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
00081                 }
00082 
00083                 $this->object->notify("removeFromSystem", $_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$_POST["trash_id"]);
00084 
00085                 // DELETE THEM
00086                 foreach ($_POST["id"] as $id)
00087                 {
00088                         // GET COMPLETE NODE_DATA OF ALL SUBTREE NODES
00089                         $node_data = $this->tree->getNodeData($id);
00090                         $subtree_nodes = $this->tree->getSubTree($node_data);
00091 
00092                         // remember already checked deleted node_ids
00093                         $checked[] = $id;
00094 
00095                         // dive in recursive manner in each already deleted subtrees and remove these objects too
00096                         $this->removeDeletedNodes($id,$checked);
00097 
00098                         foreach ($subtree_nodes as $node)
00099                         {
00100                                 $node_obj =& $this->ilias->obj_factory->getInstanceByRefId($node["ref_id"]);
00101                                 
00102                                 // this is due to bug #1860 (even if this will not completely fix it)
00103                                 // and the fact, that media pool folders may find their way into
00104                                 // the recovery folder (what results in broken pools, if the are deleted)
00105                                 // Alex, 2006-07-21
00106                                 if ($node_obj->getType() != "fold")
00107                                 {
00108                                         $node_obj->delete();
00109                                 }
00110                         }
00111 
00112                         // FIRST DELETE ALL ENTRIES IN RBAC TREE
00113                         $this->tree->deleteTree($node_data);
00114                 }
00115                 
00116                 ilUtil::sendInfo($this->lng->txt("msg_removed"),true);
00117 
00118                 $this->ctrl->redirect($this, "view");
00119         }
00120         
00121                 function &executeCommand()
00122         {
00123                 $next_class = $this->ctrl->getNextClass($this);
00124                 $cmd = $this->ctrl->getCmd();
00125                 $this->prepareOutput();
00126 
00127                 switch($next_class)
00128                 {
00129                         case 'ilpermissiongui':
00130                                 include_once("./classes/class.ilPermissionGUI.php");
00131                                 $perm_gui =& new ilPermissionGUI($this);
00132                                 $ret =& $this->ctrl->forwardCommand($perm_gui);
00133                                 break;
00134 
00135                         default:
00136                                 if(!$cmd)
00137                                 {
00138                                         $cmd = "view";
00139                                 }
00140                                 $cmd .= "Object";
00141                                 $this->$cmd();
00142 
00143                                 break;
00144                 }
00145                 return true;
00146         }
00147 
00148         
00149         function showPossibleSubObjects()
00150         {
00151                 $this->sub_objects = "";
00152         }
00153 } // END class.ilObjRecoveryFolderGUI
00154 ?>

Generated on Fri Dec 13 2013 17:56:48 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1