ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilObjSurveyAdministration.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22*/
23
34require_once "./Services/Object/classes/class.ilObject.php";
35
37{
39
46 function ilObjSurveyAdministration($a_id = 0,$a_call_by_reference = true)
47 {
48 include_once "./Services/Administration/classes/class.ilSetting.php";
49 $this->setting = new ilSetting("survey");
50 $this->type = "svyf";
51 $this->ilObject($a_id,$a_call_by_reference);
52 }
53
60 function update()
61 {
62 if (!parent::update())
63 {
64 return false;
65 }
66
67 // put here object specific stuff
68
69 return true;
70 }
71
72
79 function delete()
80 {
81 // always call parent delete function first!!
82 if (!parent::delete())
83 {
84 return false;
85 }
86
87 //put here your module specific stuff
88
89 return true;
90 }
91
92
106 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
107 {
108 global $tree;
109
110 switch ($a_event)
111 {
112 case "link":
113
114 //var_dump("<pre>",$a_params,"</pre>");
115 //echo "Module name ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
116 //exit;
117 break;
118
119 case "cut":
120
121 //echo "Module name ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
122 //exit;
123 break;
124
125 case "copy":
126
127 //var_dump("<pre>",$a_params,"</pre>");
128 //echo "Module name ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
129 //exit;
130 break;
131
132 case "paste":
133
134 //echo "Module name ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
135 //exit;
136 break;
137
138 case "new":
139
140 //echo "Module name ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
141 //exit;
142 break;
143 }
144
145 // At the beginning of the recursive process it avoids second call of the notify function with the same parameter
146 if ($a_node_id==$_GET["ref_id"])
147 {
148 $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
149 $parent_type = $parent_obj->getType();
150 if($parent_type == $this->getType())
151 {
152 $a_node_id = (int) $tree->getParentId($a_node_id);
153 }
154 }
155
156 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
157 }
158
159 /* #7927: special users are deprecated
160 function addSpecialUsers($arr_user_id)
161 {
162 $surveySetting = new ilSetting("survey");
163 $allowedUsers = strlen($surveySetting->get("multiple_survey_users")) ? explode(",",$surveySetting->get("multiple_survey_users")) : array();
164 $arr = array_unique(array_merge($allowedUsers, $arr_user_id));
165 $surveySetting->set("multiple_survey_users", implode(",", $arr));
166 }
167
168 function removeSpecialUsers($arr_user_id)
169 {
170 $surveySetting = new ilSetting("survey");
171 $allowedUsers = strlen($surveySetting->get("multiple_survey_users")) ? explode(",",$surveySetting->get("multiple_survey_users")) : array();
172 $arr = array_diff($allowedUsers, $arr_user_id);
173 $surveySetting->set("multiple_survey_users", implode(",", array_values($arr)));
174 }
175
176 function getSpecialUsers()
177 {
178 $surveySetting = new ilSetting("survey");
179 return strlen($surveySetting->get("multiple_survey_users")) ? explode(",",$surveySetting->get("multiple_survey_users")) : array();
180 }
181 */
182
183} // END class.ilObjSurveyAdministration.php
184?>
$_GET["client_id"]
Class ilObjSurveyAdministration.
ilObjSurveyAdministration($a_id=0, $a_call_by_reference=true)
Constructor @access public.
notify($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
notifys an object about an event occured Based on the event happend, each object may decide how it re...
Class ilObject Basic functions for all objects.
getType()
get object type @access public
ilObject($a_id=0, $a_reference=true)
Constructor @access public.
ILIAS Setting Class.
redirection script todo: (a better solution should control the processing via a xml file)