4 include_once(
"./classes/class.ilCtrl.php");
20 $n_arr = explode(
":", $a_node);
21 return $n_arr[count($n_arr) - 1];
29 $lpos = strrpos($a_node,
":");
30 return substr($a_node, 0, $lpos);
38 $n_arr = explode(
":", $a_node);
39 return $n_arr[count($n_arr) - 2];
44 $class = strtolower($a_class);
47 if ($a_par_node === 0 || $a_par_node ==
"")
65 in_array($a_class, $this->calls[$this->
getClassForCid($node_cid)]))
83 while($temp_node !=
"")
96 echo
"ERROR: Can't find target class $a_class for node $a_par_node ".
98 error_log(
"ERROR: Can't find target class $a_class for node $a_par_node ".
109 echo
"<pre>".$e->getTraceAsString().
"</pre>";
130 $a_class = strtolower($a_class);
131 if ($this->info_read_class[$a_class])
135 $set = $ilDB->query(
"SELECT * FROM ctrl_classfile ".
136 " WHERE class = ".$ilDB->quote($a_class,
"text")
138 if ($rec = $ilDB->fetchAssoc($set))
140 $this->cid_class[$rec[
"cid"]] = $a_class;
141 $this->class_cid[$a_class] = $rec[
"cid"];
144 $set = $ilDB->query(
"SELECT * FROM ctrl_calls ".
145 " WHERE parent = ".$ilDB->quote($a_class,
"text")
147 while ($rec = $ilDB->fetchAssoc($set))
149 if (!is_array($this->calls[$a_class]) || !in_array($rec[
"child"], $this->calls[$a_class]))
151 if ($rec[
"child"] !=
"")
153 $this->calls[$a_class][] = $rec[
"child"];
158 $this->info_read_class[$a_class] =
true;
159 $this->info_read_cid[$this->class_cid[$a_class]] =
true;
169 $n_arr = explode(
":", $a_node);
170 foreach ($n_arr as
$cid)
185 if ($this->info_read_cid[$a_cid])
189 $set = $ilDB->query(
"SELECT * FROM ctrl_classfile ".
190 " WHERE cid = ".$ilDB->quote($a_cid,
"text")
192 if ($rec = $ilDB->fetchAssoc($set))
194 $this->cid_class[$a_cid] = $rec[
"class"];
195 $this->class_cid[$rec[
"class"]] = $a_cid;
197 $set = $ilDB->query(
"SELECT * FROM ctrl_calls ".
198 " WHERE parent = ".$ilDB->quote($rec[
"class"],
"text")
200 while ($rec2 = $ilDB->fetchAssoc($set))
202 if (!is_array($this->calls[$rec[
"class"]]) || !in_array($rec2[
"child"], $this->calls[$rec[
"class"]]))
204 if ($rec2[
"child"] !=
"")
206 $this->calls[$rec[
"class"]][] = $rec2[
"child"];
210 $this->info_read_class[$rec[
"class"]] =
true;
213 $this->info_read_cid[$a_cid] =
true;
221 if ($this->class_cid[$a_class] ==
"")
225 if ($this->class_cid[$a_class] ==
"")
229 $add =
"<br><br>Please make sure your GUI class name ends with 'GUI' and that the filename is 'class.[YourClassName].php'. In exceptional cases you
230 may solve the issue by putting an empty * @ilCtrl_Calls [YourClassName]: into your class header.".
231 " In both cases you need to reload the control structure in the setup.";
233 die(
"Cannot find cid for class ".$a_class.
".".$add);
235 return $this->class_cid[$a_class];
243 if ($this->cid_class[$a_cid] ==
"")
247 if ($this->cid_class[$a_cid] ==
"")
249 die(
"Cannot find class for cid ".$a_cid.
".");
251 return $this->cid_class[$a_cid];
265 if ($a_source_node ==
"1")
269 if (substr($a_target_node, 0, strlen($a_source_node)) != $a_source_node)
271 echo
"ERROR: Path not found. Source:".$a_source_node.
272 ", Target:".$a_target_node;
276 $temp_node = $a_source_node;
279 if ($a_source_node !=
"")
281 $path = array($a_source_node);
284 $diffstart = ($a_source_node ==
"")
286 : strlen($a_source_node) + 1;
287 $diff = substr($a_target_node, $diffstart);
289 $diff_arr = explode(
":",
$diff);
290 foreach($diff_arr as
$cid)
292 if ($temp_node !=
"")
297 $path[] = $temp_node;
309 $a_class = strtolower($a_class);
312 $n_arr = explode(
":", $node);
313 for($i = count($n_arr)-2; $i>=0; $i--)
341 $class = strtolower(get_class($a_gui_object));
346 $current_node = $this->current_node;
348 $this->current_node = $nr;
352 $this->call_hist[] = array(
"class" => get_class($a_gui_object),
353 "mode" =>
"execComm",
"cmd" => $this->
getCmd());
356 $html = $a_gui_object->executeCommand();
359 $this->current_node = $current_node;
364 echo
"ERROR: Can't forward to class $class.";
exit;
379 $class = strtolower(get_class($a_gui_object));
384 $current_node = $this->current_node;
387 $this->current_node = $nr;
391 $this->call_hist[] = array(
"class" => get_class($a_gui_object),
392 "mode" =>
"getHtml",
"cmd" => $this->
getCmd());
396 $html = $a_gui_object->getHTML();
399 $this->current_node = $current_node;
404 echo
"ERROR: Can't getHTML from class $class.";
exit;
425 if ($this->current_node == $cmdNode)
433 $path = $this->
getPathNew($this->current_node, $cmdNode);
453 if (!is_array($a_class))
455 $a_class = array($a_class);
458 $nr = $this->current_node;
459 foreach ($a_class as $class)
461 $class = strtolower($class);
463 $target_class = $class;
470 foreach($path as $node_id)
472 $class = ($node_id ==
"")
473 ? strtolower(
$_GET[
"baseClass"])
475 if (is_array($this->save_parameter[$class]))
477 foreach($this->save_parameter[$class] as $par)
483 if (is_array($this->parameter[$class]))
485 foreach($this->parameter[$class] as $par => $value)
497 $params[
"cmdClass"] = $target_class;