3require_once(
'class.ilCachedCtrl.php');
 
   99        $this->stored_trees = array(
"ilrepositorygui", 
"ilpersonaldesktopgui",
 
  100            "illmpresentationgui", 
"illmeditorgui",
 
  101            "iladministrationgui");
 
  113        $this->save_parameter = array();
 
  114        $this->parameter = array();                     
 
  115        $this->
return = array();                        
 
  116        $this->tab = array();
 
  117        $this->current_node = 0;
 
  118        $this->module_dir = 
"";
 
  119        $this->service_dir = 
"";
 
  120        $this->call_node = array();
 
  121        $this->root_class = 
"";
 
  136        $baseClass = strtolower(
$_GET[
"baseClass"]);
 
  139        $mc_rec = $module_class->lookupModuleClass($baseClass);
 
  142        $class = $mc_rec[
"class"];
 
  143        $class_dir = $mc_rec[
"dir"];
 
  146            $m_set = 
$ilDB->query(
"SELECT * FROM il_component WHERE name = " .
 
  148            $m_rec = 
$ilDB->fetchAssoc($m_set);
 
  149            $this->module_dir = $m_rec[
"type"] . 
"/" . $m_rec[
"name"];
 
  150            include_once $this->module_dir . 
"/" . $class_dir . 
"/class." . $class . 
".php";
 
  152            $mc_rec = $module_class->lookupServiceClass($baseClass);
 
  154            $service = $mc_rec[
"service"];
 
  155            $class = $mc_rec[
"class"];
 
  156            $class_dir = $mc_rec[
"dir"];
 
  158            if ($service == 
"") {
 
  159                include_once(
"./Services/UICore/exceptions/class.ilCtrlException.php");
 
  160                throw new ilCtrlException(
"Could not find entry in modules.xml or services.xml for " .
 
  161                    $baseClass . 
" <br/>" . str_replace(
"&", 
"<br />&", htmlentities(
$_SERVER[
"REQUEST_URI"])));
 
  166            $this->service_dir = $m_rec[
"type"] . 
"/" . $m_rec[
"name"];
 
  168            include_once $this->service_dir . 
"/" . $class_dir . 
"/class." . $class . 
".php";
 
  174        $base_class_gui = 
new $class();
 
  183        return $this->module_dir;
 
  197        $class = strtolower(get_class($a_gui_object));
 
  199        $nr = $nr[
"node_id"];
 
  201            $current_node = $this->current_node;
 
  203            $this->current_node = $nr;
 
  207            $this->call_hist[] = array(
"class" => get_class($a_gui_object),
 
  208                    "mode" => 
"execComm", 
"cmd" => $this->
getCmd());
 
  210            $html = $a_gui_object->executeCommand();
 
  213            $this->current_node = $current_node;
 
  218        include_once(
"./Services/UICore/exceptions/class.ilCtrlException.php");
 
  231    public function getHTML($a_gui_object, array $a_parameters = 
null)
 
  233        $class = strtolower(get_class($a_gui_object));
 
  236        $nr = $nr[
"node_id"];
 
  238            $current_node = $this->current_node;
 
  241            $this->current_node = $nr;
 
  245            $this->call_hist[] = array(
"class" => get_class($a_gui_object),
 
  246                    "mode" => 
"getHtml", 
"cmd" => $this->
getCmd());
 
  249            if ($a_parameters != 
null) {
 
  250                $html = $a_gui_object->getHTML($a_parameters);
 
  252                $html = $a_gui_object->getHTML();
 
  256            $this->current_node = $current_node;
 
  262        include_once(
"./Services/UICore/exceptions/class.ilCtrlException.php");
 
  275    public function setContext($a_obj_id, $a_obj_type, $a_sub_obj_id = 0, $a_sub_obj_type = 
"")
 
  277        $this->context_obj_id = $a_obj_id;
 
  278        $this->context_obj_type = $a_obj_type;
 
  279        $this->context_sub_obj_id = $a_sub_obj_id;
 
  280        $this->context_sub_obj_type = $a_sub_obj_type;
 
  290        return $this->context_obj_id;
 
  300        return $this->context_obj_type;
 
  310        return $this->context_sub_obj_id;
 
  320        return $this->context_sub_obj_type;
 
  343        $class = strtolower($a_class);
 
  346        if ($a_par_node === 0 || $a_par_node == 
"") {
 
  357            return array(
"node_id" => $a_par_node,
 
  364            in_array($a_class, $this->calls[$this->
getClassForCid($node_cid)])) {
 
  365            return array(
"node_id" => $a_par_node . 
":" . $this->
getCidForClass($class),
 
  371        if ($par_cid != 
"") {
 
  373                in_array($a_class, $this->calls[$this->
getClassForCid($par_cid)])) {
 
  374                return array(
"node_id" =>
 
  382        while ($temp_node != 
"") {
 
  385                return array(
"node_id" => $temp_node,
 
  393        if ($a_class != 
"") {
 
  395            $mc_rec = $module_class->lookupModuleClass($class);
 
  396            $n_class = $mc_rec[
'lower_class'];
 
  398            if ($n_class == 
"") {
 
  399                $mc_rec = $module_class->lookupServiceClass($class);
 
  400                $n_class = $mc_rec[
'lower_class'];
 
  403            if ($n_class != 
"") {
 
  406                    "base_class" => $class);
 
  418        error_log(
"ERROR: Can't find target class $a_class for node $a_par_node " .
 
  421        include_once(
"./Services/UICore/exceptions/class.ilCtrlException.php");
 
  422        throw new ilCtrlException(
"ERROR: Can't find target class $a_class for node $a_par_node " .
 
  434        if (!is_array($a_class)) {
 
  435            $a_class = array($a_class);
 
  438        $nr = $this->current_node;
 
  439        foreach ($a_class as $class) {
 
  440            $class = strtolower($class);
 
  447            $nr = $nr[
"node_id"];
 
  462        return $_GET[
"cmdNode"];
 
  473    public function addTab($a_lang_var, $a_link, $a_cmd, $a_class)
 
  475        $a_class = strtolower($a_class);
 
  477        $this->tab[] = array(
"lang_var" => $a_lang_var,
 
  478            "link" => $a_link, 
"cmd" => $a_cmd, 
"class" => $a_class);
 
  532        $a_class = strtolower($a_class);
 
  537        $this->call_node[$a_nr] = array(
"class" => $a_class, 
"parent" => $a_parent);
 
  539        $call_set = 
$ilDB->query(
"SELECT * FROM ctrl_calls WHERE parent = " .
 
  540            $ilDB->quote(strtolower($a_class), 
"text") .
 
  541            " ORDER BY child", array(
"text"));
 
  543        while ($call_rec = 
$ilDB->fetchAssoc($call_set)) {
 
  545            $forw[] = $call_rec[
"child"];
 
  549        $this->root_class = $a_class;
 
  574        if (is_object($a_obj)) {
 
  587        if (is_array($a_parameter)) {
 
  589                $this->save_parameter[strtolower($a_class)][] = 
$parameter;
 
  592            $this->save_parameter[strtolower($a_class)][] = $a_parameter;
 
  621        $this->parameter[strtolower(get_class($a_obj))][$a_parameter] = $a_value;
 
  634        $this->parameter[strtolower($a_class)][$a_parameter] = $a_value;
 
  646        unset($this->parameter[strtolower($a_class)][$a_parameter]);
 
  668        $this->parameter[strtolower($a_class)] = array();
 
  675        $objDefinition = 
$DIC[
"objDefinition"];
 
  678        if (
$_GET[
"gotolp"] &&
 
  680            $ref_id = 
$_GET[
"ref_id"];
 
  682                $ref_id = $_REQUEST[
"ref_id"];
 
  685            $gui_class = get_class($a_gui_obj);
 
  687            if ($gui_class == 
"ilSAHSEditGUI") {
 
  689                include_once 
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
 
  693                        $class = 
"ilObjSCORM2004LearningModuleGUI";
 
  697                        $class = 
"ilObjSCORMLearningModuleGUI";
 
  701                        $class = 
"ilObjAICCLearningModuleGUI";
 
  705                        $class = 
"ilObjHACPLearningModuleGUI";
 
  708                if (
$GLOBALS[
"ilAccess"]->checkAccess(
"edit_learning_progress", 
"", $ref_id)) {
 
  709                    $this->
redirectByClass(array($gui_class, $class, 
"illearningprogressgui", 
"illplistofsettingsgui"), 
"");
 
  713            elseif ($gui_class == 
"ilLMPresentationGUI") {
 
  715                $this->
redirectByClass(array(
"ilLMEditorGUI", 
"ilObjLearningModuleGUI"), 
"");
 
  718            include_once 
"Services/Object/classes/class.ilObjectLP.php";
 
  720            $class = 
"ilObj" . $objDefinition->getClassName(
$type) . 
"GUI";
 
  722            if ($gui_class == $class &&
 
  724                $GLOBALS[
"ilAccess"]->checkAccess(
"edit_learning_progress", 
"", $ref_id)) {
 
  729                    $a_cmd_node = $obj_node[
"node_id"];
 
  734                $_GET[
"cmdNode"] = $lp_settings_node[
"node_id"];
 
  735                $_GET[
"cmdClass"] = 
"ilLPListOfSettingsGUI";
 
  737                return "illearningprogressgui";
 
  753        if ($cmdNode == 
"") {
 
  758            if ($this->current_node == $cmdNode) {
 
  778        $a_class_name = strtolower($a_class_name);
 
  781        $class_rec = $cached_ctrl->lookupClassFile($a_class_name);
 
  783        if ($class_rec[
"plugin_path"] != 
"") {
 
  784            return $class_rec[
"plugin_path"] . 
"/" . $class_rec[
"filename"];
 
  786            return $class_rec[
"filename"];
 
  800        $path = pathinfo($a_class_path);
 
  801        $file = 
$path[
"basename"];
 
  802        $class = substr($file, 6, strlen($file) - 10);
 
  815        if ($a_source_node == 
"1") {
 
  818        if (substr($a_target_node, 0, strlen($a_source_node)) != $a_source_node) {
 
  819            $failure = 
"ERROR: Path not found. Source:" . $a_source_node .
 
  820                ", Target:" . $a_target_node;
 
  822                include_once(
"./Services/UICore/exceptions/class.ilCtrlException.php");
 
  826            $this->
redirectToURL(
'./ilias.php?baseClass=ilRepositoryGUI');
 
  828        $temp_node = $a_source_node;
 
  831        if ($a_source_node != 
"") {
 
  832            $path = array($a_source_node);
 
  835        $diffstart = ($a_source_node == 
"")
 
  837            : strlen($a_source_node) + 1;
 
  838        $diff = substr($a_target_node, $diffstart);
 
  839        $diff_arr = explode(
":", $diff);
 
  840        foreach ($diff_arr as $cid) {
 
  841            if ($temp_node != 
"") {
 
  845            $path[] = $temp_node;
 
  857        $this->target_script = $a_target_script;
 
  882        $_GET[
"baseClass"] = $a_base_class;
 
  884        $_GET[
"cmdClass"] = 
"";
 
  885        $_GET[
"cmdNode"] = 
"";
 
  896    public function getCmd($a_default_cmd = 
"", $a_safe_commands = 
"")
 
  899        if (isset(
$_GET[
"cmd"])) {
 
  902        if ($cmd == 
"post") {
 
  906            $cmd = @key(
$_POST[
"cmd"]);
 
  909            if ($this->verified_cmd != 
"") {
 
  910                return $this->verified_cmd;
 
  913                    (!is_array($a_safe_commands) || !in_array($cmd, $a_safe_commands))) {
 
  914                    return $a_default_cmd;
 
  918            $this->verified_cmd = $cmd;
 
  919            if ($cmd == 
"" && isset(
$_POST[
"table_top_cmd"])) {         
 
  920                $cmd = @key(
$_POST[
"table_top_cmd"]);
 
  921                $this->verified_cmd = $cmd;
 
  924            if ($cmd == 
"" && isset(
$_POST[
"select_cmd2"])) {           
 
  925                if (isset(
$_POST[
"select_cmd_all2"])) {
 
  928                    $_POST[
"select_cmd_all"] = 
$_POST[
"select_cmd_all2"] = 
null;
 
  930                $cmd = 
$_POST[
"selected_cmd2"];
 
  931                $this->verified_cmd = $cmd;
 
  933            if ($cmd == 
"" && isset(
$_POST[
"select_cmd"])) {            
 
  934                if (isset(
$_POST[
"select_cmd_all"])) {
 
  937                    $_POST[
"select_cmd_all"] = 
$_POST[
"select_cmd_all2"] = 
null;
 
  939                $cmd = 
$_POST[
"selected_cmd"];
 
  940                $this->verified_cmd = $cmd;
 
  943                $cmd = 
$_GET[
"fallbackCmd"];
 
  944                $this->verified_cmd = $cmd;
 
  948            $cmd = $a_default_cmd;
 
  965        $_GET[
"cmd"] = $a_cmd;
 
  980        $a_cmd_class = strtolower($a_cmd_class);
 
  982        $nr = $nr[
"node_id"];
 
  983        $_GET[
"cmdClass"] = $a_cmd_class;
 
  984        $_GET[
"cmdNode"] = $nr;
 
  994        return strtolower(
$_GET[
"cmdClass"]);
 
 1009        $a_fallback_cmd = 
"",
 
 1015            strtolower(get_class($a_gui_obj)),
 
 1036        $a_fallback_cmd = 
"",
 
 1041        if (!is_array($a_class)) {
 
 1042            $a_class = strtolower($a_class);
 
 1052        if ($a_fallback_cmd != 
"") {
 
 1060        if ($a_anchor != 
"") {
 
 1061            $script = $script . 
"#" . $a_anchor;
 
 1095        if ($this->rtoken != 
"") {
 
 1099                $ilUser->getId() != ANONYMOUS_USER_ID) {
 
 1100                $res = 
$ilDB->query(
"SELECT token FROM il_request_token WHERE user_id = " .
 
 1102                    " AND session_id = " . 
$ilDB->quote(session_id(), 
"text"));
 
 1104                if ($rec[
"token"] != 
"") {
 
 1105                    $this->rtoken = $rec[
"token"];
 
 1106                    return $rec[
"token"];
 
 1109                $random = new \ilRandom();
 
 1110                $this->rtoken = md5(uniqid($random->int(), 
true));
 
 1113                if ($random->int(1, 200) == 2) {
 
 1117                    $dq = 
"DELETE FROM il_request_token WHERE " .
 
 1119                    $ilDB->manipulate($dq);
 
 1126                $ilDB->manipulate(
"INSERT INTO il_request_token (user_id, token, stamp, session_id) VALUES " .
 
 1129                    $ilDB->quote($this->rtoken, 
"text") . 
"," .
 
 1130                    $ilDB->now() . 
"," .
 
 1131                    $ilDB->quote(session_id(), 
"text") . 
")");
 
 1153            $ilUser->getId() != ANONYMOUS_USER_ID) {
 
 1154            if (
$_GET[
"rtoken"] == 
"") {
 
 1158            $set = 
$ilDB->query(
"SELECT * FROM il_request_token WHERE " .
 
 1159                " user_id = " . 
$ilDB->quote(
$ilUser->getId(), 
"integer") . 
" AND " .
 
 1160                " token = " . 
$ilDB->quote(
$_GET[self::IL_RTOKEN_NAME]), 
"text");
 
 1161            if (
$ilDB->numRows($set) > 0) {
 
 1172                $ilDB->manipulate(
"DELETE FROM il_request_token WHERE " .
 
 1173                    " user_id = " . 
$ilDB->quote(
$ilUser->getId(), 
"integer") . 
" AND " .
 
 1174                    " session_id != " . 
$ilDB->quote(session_id(), 
"text") . 
" AND " .
 
 1186                if (count(
$_SESSION[
"rtokens"]) > 100) {
 
 1187                    $to_remove = array();
 
 1191                        if (time() - 
$time > $sec) {
 
 1192                            $to_remove[] = $tok;
 
 1195                    foreach ($to_remove as $tok) {
 
 1217    public function redirect($a_gui_obj, $a_cmd = 
"", $a_anchor = 
"", $a_asynch = 
false)
 
 1220            strtolower(get_class($a_gui_obj)),
 
 1226        if ($a_anchor != 
"") {
 
 1227            $script = $script . 
"#" . $a_anchor;
 
 1240        $ilPluginAdmin = 
null;
 
 1241        if (isset(
$DIC[
"ilPluginAdmin"])) {
 
 1242            $ilPluginAdmin = 
$DIC[
"ilPluginAdmin"];
 
 1245        if (!is_int(strpos($a_script, 
"://"))) {
 
 1246            if (substr($a_script, 0, 1) != 
"/" && defined(
"ILIAS_HTTP_PATH")) {
 
 1247                if (is_int(strpos(
$_SERVER[
"PHP_SELF"], 
"/setup/"))) {
 
 1248                    $a_script = 
"setup/" . $a_script;
 
 1250                $a_script = ILIAS_HTTP_PATH . 
"/" . $a_script;
 
 1255        if (is_object($ilPluginAdmin)) {
 
 1256            $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE, 
"UIComponent", 
"uihk");
 
 1257            foreach ($pl_names as $pl) {
 
 1259                $gui_class = $ui_plugin->getUIClassInstance();
 
 1260                $resp = $gui_class->getHTML(
"Services/Utilities", 
"redirect", array( 
"html" => $a_script ));
 
 1262                    $a_script = $gui_class->modifyHTML($a_script, $resp);
 
 1271        session_write_close();
 
 1275        switch (
$http->request()->getHeaderLine(
'Accept')) {
 
 1276            case 'application/json':
 
 1279                    'message' => 
'Called redirect after async fileupload request',
 
 1280                    "redirect_url" => $a_script,
 
 1285                $http->saveResponse(
$http->response()->withAddedHeader(
"Location", $a_script));
 
 1288        $http->sendResponse();
 
 1302        if ($a_anchor != 
"") {
 
 1303            $script = $script . 
"#" . $a_anchor;
 
 1315        if (isset(
$_GET[
"cmdMode"]) && 
$_GET[
"cmdMode"] == 
"asynch") {
 
 1342            strtolower(get_class($a_gui_obj)),
 
 1379            $script .= $amp . 
"cmdMode=asynch";
 
 1382        if ($a_anchor != 
"") {
 
 1383            $script = $script . 
"#" . $a_anchor;
 
 1395        $script = $this->
getUrlParameters(strtolower(get_class($a_gui_obj)), $script, $a_cmd);
 
 1396        $this->
return[strtolower(get_class($a_gui_obj))] = $script;
 
 1405        $a_class = strtolower($a_class);
 
 1409        $this->
return[strtolower($a_class)] = $script;
 
 1421            "redirectSource=" . strtolower(get_class($a_gui_obj))
 
 1425            "cmdMode=" . 
$_GET[
"cmdMode"]
 
 1427        if ($a_anchor != 
"") {
 
 1428            $script = $script . 
"#" . $a_anchor;
 
 1453        $a_class = strtolower($a_class);
 
 1456            return $this->
return[$ret_class];
 
 1470        if (is_object($a_class)) {
 
 1471            $class = strtolower(get_class($a_class));
 
 1473            $class = strtolower($a_class);
 
 1484        $a_class = strtolower($a_class);
 
 1487        $node = $node[
"node_id"];
 
 1488        $n_arr = explode(
":", $node);
 
 1489        for (
$i = count($n_arr) - 2; 
$i >= 0; 
$i--) {
 
 1505        return $_GET[
"redirectSource"];
 
 1515        foreach (
$params as $par => $value) {
 
 1516            if (strlen((
string) $value)) {
 
 1543        if ($a_class == 
"") {
 
 1547        if (!is_array($a_class)) {
 
 1548            $a_class = array($a_class);
 
 1551        $nr = $this->current_node;
 
 1552        $new_baseclass = 
"";
 
 1553        foreach ($a_class as $class) {
 
 1554            $class = strtolower($class);
 
 1556            if ($nr[
"base_class"] != 
"") {
 
 1557                $new_baseclass = $nr[
"base_class"];
 
 1559            $nr = $nr[
"node_id"];
 
 1560            $target_class = $class;
 
 1567        foreach (
$path as $node_id) {
 
 1568            $class = ($node_id == 
"")
 
 1569                ? strtolower(
$_GET[
"baseClass"])
 
 1571            if (isset($this->save_parameter[$class]) && is_array($this->save_parameter[$class])) {
 
 1572                foreach ($this->save_parameter[$class] as $par) {
 
 1573                    if (isset(
$_GET[$par])) {
 
 1575                    } elseif (isset(
$_POST[$par])) {
 
 1581            if (isset($this->parameter[$class]) && is_array($this->parameter[$class])) {
 
 1582                foreach ($this->parameter[$class] as $par => $value) {
 
 1592        $params[
"cmdClass"] = $target_class;
 
 1594        if ($new_baseclass == 
"") {
 
 1597            $params[
"baseClass"] = $new_baseclass;
 
 1605        return $this->class_cid[$a_class] == 
"";
 
 1621                $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 
 1622                                        may solve the issue by putting an empty * @ilCtrl_Calls [YourClassName]: into your class header." .
 
 1623                    " In both cases you need to reload the control structure in the setup.";
 
 1625            include_once(
"./Services/UICore/exceptions/class.ilCtrlException.php");
 
 1626            throw new ilCtrlException(
"Cannot find cid for class " . $a_class . 
"." . $add);
 
 1628        return $this->class_cid[$a_class];
 
 1633        return $this->cid_class[$a_cid] == 
"";
 
 1646            include_once(
"./Services/UICore/exceptions/class.ilCtrlException.php");
 
 1647            throw new ilCtrlException(
"Cannot find class for cid " . $a_cid . 
".");
 
 1649        return $this->cid_class[$a_cid];
 
 1654        foreach ($a_cached_ctrl->
lookupCall($a_class) as $call) {
 
 1656                $this->calls[$a_class][] = $call[
"child"];
 
 1669        if (isset($this->info_read_cid[$a_cid])) {
 
 1674        $cid_info = $cached_ctrl->lookupCid($a_cid);
 
 1679            $this->info_read_class[$cid_info[
"class"]] = 
true;
 
 1682        $this->info_read_cid[$a_cid] = 
true;
 
 1693        $class_ids = explode(
":", $a_node);
 
 1694        foreach ($class_ids as $cid) {
 
 1707        $a_class = strtolower($a_class);
 
 1708        if (isset($this->info_read_class[$a_class])) {
 
 1713        $class_info = $cached_ctrl->lookupClassFile($a_class);
 
 1720        $this->info_read_class[$a_class] = 
true;
 
 1721        $this->info_read_cid[$this->class_cid[$a_class]] = 
true;
 
 1726        return !isset($this->calls[$a_class])
 
 1727                || !is_array($this->calls[$a_class])
 
 1728                || !in_array($a_child, $this->calls[$a_class]);
 
 1733        $this->cid_class[$a_cid] = $a_class;
 
 1734        $this->class_cid[$a_class] = $a_cid;
 
 1742        $class_ids = explode(
":", $a_node);
 
 1743        return $class_ids[count($class_ids) - 2];
 
 1751        $lpos = strrpos($a_node, 
":");
 
 1752        return substr($a_node, 0, $lpos);
 
 1760        $n_arr = explode(
":", $a_node);
 
 1761        return $n_arr[count($n_arr) - 1];
 
 1777        $a_parent = strtolower($a_parent);
 
 1778        $a_child = strtolower($a_child);
 
 1779        $a_comp_prefix = strtolower($a_comp_prefix);
 
 1781        $set = 
$ilDB->query(
 
 1782            "SELECT * FROM ctrl_calls WHERE " .
 
 1783            " parent = " . 
$ilDB->quote($a_parent, 
"text") . 
" AND " .
 
 1784            " child = " . 
$ilDB->quote($a_child, 
"text") . 
" AND " .
 
 1785            " comp_prefix = " . 
$ilDB->quote($a_comp_prefix, 
"text")
 
 1787        if ($rec = 
$ilDB->fetchAssoc($set)) {
 
 1790        $ilDB->manipulate(
"INSERT INTO ctrl_calls " .
 
 1791            "(parent, child, comp_prefix) VALUES (" .
 
 1792            $ilDB->quote($a_parent, 
"text") . 
"," .
 
 1793            $ilDB->quote($a_child, 
"text") . 
"," .
 
 1794            $ilDB->quote($a_comp_prefix, 
"text") .
 
 1807        foreach (explode(
":", $this->
getCmdNode()) as $cid) {
 
 1808            if ($cid != 
"" && strtolower($this->
getClassForCid($cid)) == strtolower($gui_class)) {
 
An exception for terminatinating execution or to throw for unit testing.
static ofString($string)
Creates a new stream with an initial value.
static getComponentInfo($a_type, $a_name)
This class provides processing control methods.
appendRequestTokenParameterString($a_url, $xml_style=true)
Append request token as url parameter.
initializeMemberVariables()
Initialize member variables.
getHTML($a_gui_object, array $a_parameters=null)
Gets an HTML output from another GUI class and returns the flow of control to the calling class.
getCidForClass($a_class, $a_check=false)
Get class id for class after fetching and storing corresponding information, if necessary.
checkLPSettingsForward($a_gui_obj, $a_cmd_node)
getLinkTargetByClass( $a_class, $a_cmd="", $a_anchor="", $a_asynch=false, $xml_style=true)
Get link target for command using gui class name.
getCallHistory()
Get controller call history.
setCmdClass($a_cmd_class)
Set the current command class.
clearParameterByClass($a_class, $a_parameter)
Same as setParameterByClass, except that a class name is passed.
getCmd($a_default_cmd="", $a_safe_commands="")
Determines current get/post command.
getParentReturnByClass($a_class)
Get return script url.
getContextSubObjId()
Get context subobject id.
getContextObjId()
Get context object id.
getCmdNode()
Get command target node.
readCallStructure($a_class, $a_nr=0, $a_parent=0)
Reads call structure from db.
getParentCidOfNode($a_node)
Get 2nd to last class id of node.
getFormActionByClass( $a_class, $a_fallback_cmd="", $a_anchor="", $a_asynch=false, $xml_style=true)
Get form action url for gui class name.
readCidInfo($a_cid)
Save class respective to $a_cid and store corresponding class calls for future reference.
getParentReturn($a_gui_obj)
Get return script url.
getTargetScript()
Get target script name.
getModuleDir()
get directory of current module
verifyToken()
Verify Token.
addTab($a_lang_var, $a_link, $a_cmd, $a_class)
Add a tab to tabs array (.
removeLastCid($a_node)
Remove the class id that comes at the beginning the sequence.
setReturn($a_gui_obj, $a_cmd)
Set return command.
$calls
Stores which class calls which other class.
__construct()
control class constructor
getPathNew($a_source_node, $a_target_node)
Get path in call structure.
getNodeIdForTargetClass($a_par_node, $a_class, $a_check=false)
Searches a node for a given class ($a_class) "near" another node ($a_par_node).
checkCurrentPathForClass($gui_class)
Check if current path contains a certain gui class.
getCmdClass()
Determines class that should execute the current command.
getNextClass($a_gui_class=null)
Get next class in the control path from the current class to the target command class.
getCallStructure($a_class)
Get call structure of class context.
getRequestToken()
Get request token.
getRedirectSource()
Get current redirect source.
searchReturnClass($a_class)
Determine current return class.
getClassForClasspath($a_class_path)
this method assumes that the class path has the format "dir/class.<class_name>.php"
readNodeInfo($a_node)
Save classes respective to the class id's of a node and store corresponding class calls for future re...
returnToParent($a_gui_obj, $a_anchor="")
Redirects to next parent class that used setReturn.
setContext($a_obj_id, $a_obj_type, $a_sub_obj_id=0, $a_sub_obj_type="")
Set context of current user interface.
getTabs()
Get tabs array (.
setReturnByClass($a_class, $a_cmd)
Set return command.
setTargetScript(string $a_target_script)
set target script name
getFormAction( $a_gui_obj, $a_fallback_cmd="", $a_anchor="", $a_asynch=false, $xml_style=true)
Get form action url for gui class object.
readClassInfo($a_class)
Save class id respective to $a_class and store corresponding class calls for future reference.
getReturnClass($a_class)
Get return class.
getContextObjType()
Get context object type.
getCurrentCidOfNode($a_node)
Get cid of node.
callBaseClass()
Calls base class of current request.
classCidUnknown($a_class)
fetchCallsOfClassFromCache($a_class, ilCachedCtrl $a_cached_ctrl)
getUrlParameters($a_class, $a_str, $a_cmd="", $xml_style=false)
Get URL parameters for a class and append them to a string.
getParameterArrayByClass($a_class, $a_cmd="")
Get all set/save parameters using gui class name.
saveParameter($a_obj, $a_parameter)
Set parameters that should be passed in every form and link of a gui class.
getContextSubObjType()
Get context subobject type.
$call_hist
Stores the order in which different GUI classes were called.
isAsynch()
Is current command an asynchronous command?
setParameterByClass($a_class, $a_parameter, $a_value)
Same as setParameterByClass, except that a class name is passed.
clearParametersByClass($a_class)
Clears all parameters that have been set via setParameter for a GUI class.
insertCtrlCalls($a_parent, $a_child, $a_comp_prefix)
Insert ctrl calls record.
redirectByClass($a_class, $a_cmd="", $a_anchor="", $a_asynch=false)
Redirect to other gui class using class name.
lookupClassPath($a_class_name)
Get class path that can be used in include statements for a given class name.
saveParameterByClass($a_class, $a_parameter)
Save parameter for a class.
updateClassCidMap($a_class, $a_cid)
redirect($a_gui_obj, $a_cmd="", $a_anchor="", $a_asynch=false)
Redirect to another command.
getClassForCid($a_cid)
Get class for class id after fetching and storing corresponding information, if necessary.
forwardCommand($a_gui_object)
Forward flow of control to next gui class this invokes the executeCommand() method of the gui object ...
setCmd($a_cmd)
Set the current command.
clearParameters($a_obj)
Clears all parameters that have been set via setParameter for a GUI class.
callOfClassNotKnown($a_class, $a_child)
checkTargetClass($a_class)
Check whether target is valid.
getLinkTarget( $a_gui_obj, $a_cmd="", $a_anchor="", $a_asynch=false, $xml_style=true)
Get link target for command using gui object.
setParameter($a_obj, $a_parameter, $a_value)
Set parameters that should be passed a form and link of a gui class.
initBaseClass($a_base_class)
Initialises new base class.
getParameterArray($a_gui_obj, $a_cmd="")
Get all set/save parameters for a gui object.
@classDescription Date and time handling
static _lookupSubType($a_obj_id)
lookup subtype id (scorm, )
static isSupportedObjectType($a_type)
static _lookupObjectId($a_ref_id)
lookup object id
static _lookupType($a_id, $a_reference=false)
lookup object type
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.
if($modEnd===false) $module
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
$stream
PHP stream implementation.
foreach($_POST as $key=> $value) $res
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']