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

classes/class.ilObjRoleTemplate.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 
00024 require_once "class.ilObject.php";
00025 
00034 class ilObjRoleTemplate extends ilObject
00035 {
00042         function ilObjRoleTemplate($a_id = 0,$a_call_by_reference = false)
00043         {
00044                 $this->type = "rolt";
00045                 $this->ilObject($a_id,$a_call_by_reference);
00046         }
00047 
00048 
00055         function delete()
00056         {               
00057                 // put here role template specific stuff
00058                 global $rbacadmin;
00059 
00060                 // delete rbac permissions
00061                 $rbacadmin->deleteTemplate($this->getId(),$_GET["ref_id"]);
00062 
00063                 // always call parent delete function at the end!!
00064                 return (parent::delete()) ? true : false;
00065         }
00066 
00067         function isInternalTemplate()
00068         {
00069                 if (substr($this->getTitle(),0,3) == "il_")
00070                 {
00071                         return true;
00072                 }
00073                 
00074                 return false;
00075         }
00076         
00077         function getFilterOfInternalTemplate()
00078         {
00079                 global $objDefinition;
00080                 
00081                 $filter = array();
00082 
00083                 switch($this->getTitle())
00084                 {
00085                         case "il_icrs_admin":
00086                         case "il_icrs_member":
00087                                 $obj_data = $objDefinition->getSubObjects('icrs',false);
00088                                 unset($obj_data["rolf"]);
00089                                 $filter = array_keys($obj_data);
00090                                 $filter[] = 'icrs';
00091                                 break;
00092 
00093                         case "il_grp_admin":
00094                         case "il_grp_member":
00095                         case "il_grp_status_closed":
00096                         case "il_grp_status_open":
00097                                 $obj_data = $objDefinition->getSubObjects('grp',false);
00098                                 unset($obj_data["rolf"]);
00099                                 $filter = array_keys($obj_data);
00100                                 $filter[] = 'grp';
00101                                 break;
00102                                 
00103                         case "il_crs_admin":
00104                         case "il_crs_tutor":
00105                         case "il_crs_member":
00106                         case "il_crs_non_member":
00107                                 $obj_data = $objDefinition->getSubObjects('crs',false);
00108                                 unset($obj_data["rolf"]);
00109                                 $filter = array_keys($obj_data);
00110                                 $filter[] = 'crs';
00111                                 break;
00112                         case "il_frm_moderator":
00113                                 $filter[] = 'frm';
00114                                 break;
00115                 }
00116                 
00117                 return $filter;
00118         }
00119 } // END class.ilObjRoleTemplate
00120 ?>

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