Public Member Functions | |
ilRepositoryGUI () | |
Constructor public. | |
& | executeCommand () |
execute command | |
frameset () | |
output tree frameset | |
prepareOutput () | |
showTree () | |
display tree view | |
setHeader ($a_tabs_out=true) | |
display header section (header, description, tree/flat icon) | |
setAdminTabs () | |
set admin tabs | |
executeAdminCommand () | |
get "visible only" item explanation link | |
Data Fields | |
$lng | |
$ilias | |
$tpl | |
$tree | |
$rbacsystem | |
$cur_ref_id | |
$cmd | |
$mode | |
$ctrl |
Definition at line 56 of file class.ilRepositoryGUI.php.
ilRepositoryGUI::executeAdminCommand | ( | ) |
get "visible only" item explanation link
(html due to performance reasons) show explanation message for items that are only visible but not readable set Locator show possible subobjects (pulldown menu) public execute administration command
Definition at line 899 of file class.ilRepositoryGUI.php.
References $_GET, $_POST, $cmd, $data, $id, and prepareOutput().
{ $cmd = $this->cmd; $tabs_out = true; if ($cmd == "delete" || $cmd == "cancelDelete" || $cmd == "confirmedDelete" || $cmd == "create" || $cmd == "save" || $cmd=="importFile" || $cmd == "cloneAll" || $_GET["mode"] == "create" || $cmd == "linkSelector" || $cmd == "importVerifiedFile" || $cmd == "cancelImport" ) { $tabs_out = false; } $this->prepareOutput($tabs_out); $id = $this->cur_ref_id; $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"]; if (!empty($new_type)) // creation { if (!$this->rbacsystem->checkAccess("create", $this->cur_ref_id, $new_type)) { $this->ilias->raiseError($this->lng->txt("msg_no_perm_create_object1")." ". $this->lng->txt($new_type."_a")." ".$this->lng->txt("msg_no_perm_create_object2"), $this->ilias->error_obj->MESSAGE); } else { $class_name = $this->objDefinition->getClassName($new_type); $module = $this->objDefinition->getModule($new_type); $module_dir = ($module == "") ? "" : $module."/"; $class_constr = "ilObj".$class_name."GUI"; include_once("./".$module_dir."classes/class.ilObj".$class_name."GUI.php"); $obj =& new $class_constr($data, $id, true, false); $method = $cmd."Object"; //$obj->setReturnLocation("save", "repository.php?ref_id=".$this->cur_ref_id); $obj->setReturnLocation("cancel", "repository.php?ref_id=".$this->cur_ref_id); $obj->setReturnLocation("addTranslation", "repository.php?cmd=".$_GET["mode"]."&entry=0&mode=session&ref_id=".$this->cur_ref_id."&new_type=".$_GET["new_type"]); $obj->setFormAction("save","repository.php?cmd=post&mode=$cmd&ref_id=".$this->cur_ref_id."&new_type=".$new_type); //$this->ctrl->setCmdClass(strtolower("Obj".$class_name."GUI")); //$this->ctrl->setCmd($method); //$this->ctrl->forwardCommand($obj); $obj->$method(); } } else // all other commands { /* $obj =& ilObjectFactory::getInstanceByRefId($this->cur_ref_id); $class_name = $objDefinition->getClassName($obj->getType()); $module = $objDefinition->getModule($obj->getType()); $module_dir = ($module == "") ? "" : $module."/"; $class_constr = "ilObj".$class_name."GUI"; include_once("./".$module_dir."classes/class.ilObj".$class_name."GUI.php"); $obj_gui =& new $class_constr("", $this->cur_ref_id, true, false);*/ $this->cmd_admin_compliance($cmd); } $this->tpl->show(); }
& ilRepositoryGUI::executeCommand | ( | ) |
execute command
Definition at line 203 of file class.ilRepositoryGUI.php.
References $_GET, $_POST, $_SESSION, $cmd, $ilias, $lng, $rbacsystem, $tree, ilObject::_lookupType(), frameset(), and showTree().
{ global $tree, $rbacsystem, $ilias, $lng; // check creation mode // determined by "new_type" parameter $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"]; if ($new_type != "") { $this->creation_mode = true; } // handle frameset command $cmd = $this->ctrl->getCmd(); if (($cmd == "frameset" || $_GET["rep_frame"] == 1) && $_SESSION["il_rep_mode"] == "tree") { $next_class = ""; $cmd = "frameset"; } else if ($cmd == "frameset" && $_SESSION["il_rep_mode"] != "tree") { $this->ctrl->setCmd(""); $cmd = ""; } // determine next class if ($cmd != "frameset") { if ($this->creation_mode) { $obj_type = $new_type; $class_name = $this->objDefinition->getClassName($obj_type); if (strtolower($class_name) != "user") { $next_class = strtolower("ilObj".$class_name."GUI"); } else { $next_class = $this->ctrl->getNextClass(); } } else if ((($next_class = $this->ctrl->getNextClass($this)) == "") || ($next_class == "ilrepositorygui" && $this->ctrl->getCmd() == "return")) { if ($cmd != "frameset" && $cmd != "showTree") { // get GUI of current object $obj_type = ilObject::_lookupType($this->cur_ref_id,true); $class_name = $this->objDefinition->getClassName($obj_type); $next_class = strtolower("ilObj".$class_name."GUI"); $this->ctrl->setCmdClass($next_class); if ($this->ctrl->getCmd() == "return") { $this->ctrl->setCmd(""); } } } } // commands that are always handled by repository gui // to do: move to container //if ($cmd == "showTree" || $cmd == "linkSelector" || $cmd == "linkChilds") if ($cmd == "showTree") { $next_class = ""; } //echo "<br>cmd:$cmd:nextclass:$next_class:"; switch ($next_class) { //case "ilobjrootfoldergui": //case "ilobjcategorygui": //case "ilobjgroupgui": //case "ilobjcoursegui": //case "ilobjfilegui": //case "ilobjforumgui": //case "ilobjfoldergui": //case "ilobjilinccoursegui": //case "ilobjfilegui": default: // forward all other classes to gui commands if ($next_class != "" && $next_class != "ilrepositorygui") { $class_path = $this->ctrl->lookupClassPath($next_class); //echo "<br>repositorygui:forwarding_to:".$next_class; //echo "<br>creation_mode:".$this->creation_mode.":"; // get gui class instance include_once($class_path); $class_name = $this->ctrl->getClassForClasspath($class_path); if (!$this->creation_mode) { $this->gui_obj = new $class_name("", $this->cur_ref_id, true, false); } else { // dirty walkaround for ilinc classrooms which need passed the ref_id of the parent iLinc course if ($class_name == 'ilObjiLincClassroomGUI') { $this->gui_obj = new $class_name("", $this->cur_ref_id, true, false); } else { $this->gui_obj = new $class_name("", 0, true, false); } } //$this->gui_obj = new $class_name("", $this->cur_ref_id, true, false); // special treatment for old admin compliance // to do: get rid of it... //$this->cmd_admin_compliance($cmd, false); $tabs_out = ($new_type == "") ? true : false; // forward command //if ($_GET["mode"] == "create" || $cmd == "linkSelector") //{ // $tabs_out = false; //} //$this->prepareOutput($tabs_out); // get standard template // add repository items to $ilLocator //$this->prepareOutput($tabs_out); $this->gui_obj->setCreationMode($this->creation_mode); $this->ctrl->setReturn($this, "return"); //echo "<br>forwarding-".$_GET["cmd"]."-"; $ret =& $this->ctrl->forwardCommand($this->gui_obj); $html = $this->gui_obj->getHTML(); if ($html != "") { $this->tpl->setVariable("OBJECTS", $html); } $this->tpl->show(); } else // { // process repository frameset if ($cmd == "frameset") { if ($_SESSION["il_rep_mode"] == "tree") { $this->frameset(); return; } $cmd = ""; $this->ctrl->setCmd(""); } // process tree command if ($cmd == "showTree") { $this->showTree(); return; } //if (!isset($obj_type)) //{ // $obj_type = ilObject::_lookupType($this->cur_ref_id,true); //} // get GUI of current object //$class_name = $this->objDefinition->getClassName($obj_type); //$module = $this->objDefinition->getModule($obj_type); //$module_dir = ($module == "") ? "" : $module."/"; //$class_constr = "ilObj".$class_name."GUI"; //include_once("./".$module_dir."classes/class.ilObj".$class_name."GUI.php"); //$this->gui_obj = new $class_constr("", $this->cur_ref_id, true, false); // execute repository cmd //if (empty($cmd)) //{ // if($obj_type == "crs" or $obj_type == 'fold' or $obj_type == 'grp' or // $obj_type == 'frm' or $obj_type == 'crsg') // { // $this->prepareOutput(); // $this->ctrl->forwardCommand($this->gui_obj); // $this->tpl->show(); // break; // } // else // { //echo "A-$cmd-$obj_type-"; $cmd = $this->ctrl->getCmd(""); // } //$next_class = ""; //} //echo "2-$cmd-$obj_type-"; // check read access for category if ($this->cur_ref_id > 0 && !$rbacsystem->checkAccess("read", $this->cur_ref_id)) { //echo "2"; $_SESSION["il_rep_ref_id"] = ""; $ilias->raiseError($lng->txt("permission_denied"), $ilias->error_obj->MESSAGE); $this->tpl->show(); } else { $this->cmd = $cmd; $this->$cmd(); } } break; } }
ilRepositoryGUI::frameset | ( | ) |
output tree frameset
Definition at line 418 of file class.ilRepositoryGUI.php.
References $_GET, $lng, and exit.
Referenced by executeCommand().
{ global $lng; include_once("Services/Frameset/classes/class.ilFramesetGUI.php"); $fs_gui = new ilFramesetGUI(); if ($_GET["rep_frame"] == 1) { // workaround for passing anchors (e.g. used in ilNoteGUI) $anchor = ($_GET["anchor"] != "") ? "#".$_GET["anchor"] : ""; $fs_gui->setMainFrameSource( str_replace("rep_frame", "rep_frame_done", $_SERVER["REQUEST_URI"]).$anchor); } else { $fs_gui->setMainFrameSource( "repository.php?getlast=true&ref_id=".$this->cur_ref_id); } $fs_gui->setSideFrameSource( "repository.php?cmd=showTree&ref_id=".$this->cur_ref_id); $fs_gui->setSideFrameTitle($lng->txt("explorer_frame")); $fs_gui->setMainFrameTitle($lng->txt("repository_frame")); $fs_gui->setSideFrameName("tree"); $fs_gui->setMainFrameName("rep_content"); $fs_gui->setFramesetTitle($this->lng->txt("repository")); $fs_gui->show(); exit; }
ilRepositoryGUI::ilRepositoryGUI | ( | ) |
Constructor public.
Definition at line 72 of file class.ilRepositoryGUI.php.
References $_GET, $_POST, $_SESSION, $ilCtrl, $ilias, $ilLog, $key, $lng, $rbacsystem, $tpl, $tree, $type, ilObject::_lookupType(), and ilUtil::isAPICall().
{ global $lng, $ilias, $tpl, $tree, $rbacsystem, $objDefinition, $_GET, $ilCtrl, $ilLog;; //var_dump($_SESSION['il_rep_clipboard']); $this->lng =& $lng; $this->ilias =& $ilias; $this->tpl =& $tpl; $this->tree =& $tree; $this->rbacsystem =& $rbacsystem; $this->objDefinition =& $objDefinition; $this->ctrl =& $ilCtrl; $this->creation_mode = false; $this->ctrl->saveParameter($this, array("ref_id")); if (!ilUtil::isAPICall()) $this->ctrl->setReturn($this,""); // determine current ref id and mode if (!empty($_GET["ref_id"]) || $this->ctrl->getCmd() == "showTree") { $this->cur_ref_id = $_GET["ref_id"]; } else { //echo "1-".$_SESSION["il_rep_ref_id"]."-"; if (!empty($_SESSION["il_rep_ref_id"]) && !empty($_GET["getlast"])) { $this->cur_ref_id = $_SESSION["il_rep_ref_id"]; //echo "2-".$this->cur_ref_id."-"; } else { $this->cur_ref_id = $this->tree->getRootId(); if ($_GET["cmd"] != "" && $_GET["cmd"] != "frameset") { //echo "hhh"; $get_str = $post_str = ""; foreach($_GET as $key => $value) { $get_str.= "-$key:$value"; } foreach($_POST as $key => $value) { $post_str.= "-$key:$value"; } $ilLog->write("Repository: command called without ref_id.". "GET:".$get_str."-POST:".$post_str, $ilLog->WARNING); } $_GET = array(); $_POST = array(); $this->ctrl->setCmd("frameset"); } } //echo "<br>+".$_GET["ref_id"]."+"; if (!$tree->isInTree($this->cur_ref_id) && $this->ctrl->getCmd() != "showTree") { $this->cur_ref_id = $this->tree->getRootId(); // check wether command has been called with // item that is not in tree if ($_GET["cmd"] != "" && $_GET["cmd"] != "frameset") { $get_str = $post_str = ""; foreach($_GET as $key => $value) { $get_str.= "-$key:$value"; } foreach($_POST as $key => $value) { $post_str.= "-$key:$value"; } $ilLog->write("Repository: command called with ref_id that is not in tree.". "GET:".$get_str."-POST:".$post_str, $ilLog->WARNING); } $_GET = array(); $_POST = array(); $this->ctrl->setCmd("frameset"); } // set current repository view mode if (!empty($_GET["set_mode"])) { $_SESSION["il_rep_mode"] = $_GET["set_mode"]; if ($this->ilias->account->getId() != ANONYMOUS_USER_ID) { $this->ilias->account->writePref("il_rep_mode", $_GET["set_mode"]); } } // get user setting if ($_SESSION["il_rep_mode"] == "") { if ($this->ilias->account->getId() != ANONYMOUS_USER_ID) { $_SESSION["il_rep_mode"] = $this->ilias->account->getPref("il_rep_mode"); } } // if nothing set, get default view if ($_SESSION["il_rep_mode"] == "") { $_SESSION["il_rep_mode"] = $this->ilias->getSetting("default_repository_view"); } $this->mode = ($_SESSION["il_rep_mode"] != "") ? $_SESSION["il_rep_mode"] : "flat"; // store current ref id if ($this->ctrl->getCmd() != "showTree" && $rbacsystem->checkAccess("read", $this->cur_ref_id)) { $type = ilObject::_lookupType($this->cur_ref_id, true); if ($type == "cat" || $type == "grp" || $type == "crs" || $type == "root") { $_SESSION["il_rep_ref_id"] = $this->cur_ref_id; } } $_GET["ref_id"] = $this->cur_ref_id; }
ilRepositoryGUI::prepareOutput | ( | ) |
Definition at line 455 of file class.ilRepositoryGUI.php.
Referenced by executeAdminCommand().
{ // output objects //$this->tpl->getStandardTemplate(); //$this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html"); //$this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html"); // output tabs //$this->setTabs(); // output locator //$this->setLocator(); // output message /* if ($this->message) { sendInfo($this->message); } // display infopanel if something happened infoPanel(); // set header //$this->setHeader($a_tabs_out); $this->setHeader();*/ }
ilRepositoryGUI::setAdminTabs | ( | ) |
set admin tabs
Definition at line 615 of file class.ilRepositoryGUI.php.
{ // todo -> done: move tabs output to object /* if (is_object($this->gui_obj)) { $tabs_gui =& new ilTabsGUI(); $this->gui_obj->getTabs($tabs_gui); // add info tab to all objects //$tabs_gui->addTarget("info_short",$this->ctrl->getLinkTarget($this->gui_obj, "info"), "info", get_class($this->gui_obj)); // output tabs $this->tpl->setVariable("TABS", $tabs_gui->getHTML()); } */ }
ilRepositoryGUI::setHeader | ( | $ | a_tabs_out = true |
) |
display header section (header, description, tree/flat icon)
Definition at line 530 of file class.ilRepositoryGUI.php.
{ if ($this->cur_ref_id == $this->tree->getRootId()) { // todo -> done: header to cmd object //$this->tpl->setVariable("HEADER", $this->lng->txt("repository")); if ($a_tabs_out) { // todo -> done: subobjects to container object //$this->showPossibleSubObjects("root"); } } else { // todo -> done: header to cmd object //$this->tpl->setVariable("HEADER", $this->gui_obj->object->getTitle()); // todo -> done: description to cmd object //$desc = ($this->gui_obj->object->getLongDescription()) // ? $this->gui_obj->object->getLongDescription() // : ""; //$desc = nl2br($desc); //$this->tpl->setVariable("H_DESCRIPTION", $desc); //if ($a_tabs_out) //{ // $this->showPossibleSubObjects($this->gui_obj->object->getType()); //} } // header icon // todo -> done: header icon to cmd object //$this->tpl->setCurrentBlock("header_image"); //$ic_type = ilObject::_lookupType($this->cur_ref_id, true); //$icon = ilUtil::getImagePath("icon_".$ic_type."_b.gif"); // custom icon // todo -> done: custom header icon to cmd object //if ($this->ilias->getSetting("custom_icons") && // in_array($ic_type, array("cat","grp","crs"))) //{ // require_once("classes/class.ilContainer.php"); // if (($path = ilContainer::_lookupIconPath(ilObject::_lookupObjId($this->cur_ref_id), "big")) != "") // { // $icon = $path; // } //} //$this->tpl->setVariable("IMG_HEADER", $icon); //$this->tpl->parseCurrentBlock(); //$this->tpl->setCurrentBlock("content"); // todo -> done: move upper icon to container //if ($this->cur_ref_id != $this->tree->getRootId() && $a_tabs_out && // ($this->gui_obj->object->getType() != "frm")) //{ // $par_id = $this->tree->getParentId($this->cur_ref_id); // $this->tpl->setCurrentBlock("top"); // $this->tpl->setVariable("LINK_TOP", "repository.php?ref_id=".$par_id); // $this->tpl->setVariable("IMG_TOP",ilUtil::getImagePath("ic_top.gif")); // $this->tpl->parseCurrentBlock(); //} // todo -> done: move tree/flat icon to container /* if ($a_tabs_out && ($this->gui_obj->object->getType() != "frm")) { $this->setAdminTabs(); $s_mode = ($_SESSION["il_rep_mode"] == "flat") ? "tree" : "flat"; $this->tpl->setCurrentBlock("tree_mode"); // $this->tpl->setVariable("LINK_MODE", "repository.php?cmd=frameset&set_mode=".$s_mode."&ref_id=".$this->cur_ref_id); $this->tpl->setVariable("IMG_TREE",ilUtil::getImagePath("ic_".$s_mode."view.gif")); $this->tpl->parseCurrentBlock(); } */ }
ilRepositoryGUI::showTree | ( | ) |
display tree view
Definition at line 487 of file class.ilRepositoryGUI.php.
References $_GET, $exp, $expanded, $output, ilUtil::getImagePath(), and ilUtil::getStyleSheetLocation().
Referenced by executeCommand().
{ $this->tpl = new ilTemplate("tpl.main.html", true, true); $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); //$this->tpl = new ilTemplate("tpl.explorer.html", false, false); $this->tpl->addBlockFile("CONTENT", "content", "tpl.explorer.html"); $this->tpl->setVariable("IMG_SPACE", ilUtil::getImagePath("spacer.gif", false)); include_once ("classes/class.ilRepositoryExplorer.php"); $exp = new ilRepositoryExplorer("repository.php?cmd=goto"); $exp->setExpandTarget("repository.php?cmd=showTree"); $exp->setTargetGet("ref_id"); if ($_GET["repexpand"] == "") { $expanded = $this->tree->readRootId(); } else { $expanded = $_GET["repexpand"]; } $exp->setExpand($expanded); // build html-output $exp->setOutput(0); $output = $exp->getOutput(); $this->tpl->setCurrentBlock("content"); //$this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("repository")); $this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh")); $this->tpl->setVariable("EXPLORER", $output); //$this->tpl->setVariable("ACTION", "repository.php?repexpand=".$_GET["repexpand"]); $this->tpl->parseCurrentBlock(); //$this->tpl->show(true); $this->tpl->show(false); }
ilRepositoryGUI::$cmd |
Definition at line 64 of file class.ilRepositoryGUI.php.
Referenced by executeAdminCommand(), and executeCommand().
ilRepositoryGUI::$ctrl |
Definition at line 66 of file class.ilRepositoryGUI.php.
ilRepositoryGUI::$cur_ref_id |
Definition at line 63 of file class.ilRepositoryGUI.php.
ilRepositoryGUI::$ilias |
Definition at line 59 of file class.ilRepositoryGUI.php.
Referenced by executeCommand(), and ilRepositoryGUI().
ilRepositoryGUI::$lng |
Definition at line 58 of file class.ilRepositoryGUI.php.
Referenced by executeCommand(), frameset(), and ilRepositoryGUI().
ilRepositoryGUI::$mode |
Definition at line 65 of file class.ilRepositoryGUI.php.
ilRepositoryGUI::$rbacsystem |
Definition at line 62 of file class.ilRepositoryGUI.php.
Referenced by executeCommand(), and ilRepositoryGUI().
ilRepositoryGUI::$tpl |
Definition at line 60 of file class.ilRepositoryGUI.php.
Referenced by ilRepositoryGUI().
ilRepositoryGUI::$tree |
Definition at line 61 of file class.ilRepositoryGUI.php.
Referenced by executeCommand(), and ilRepositoryGUI().