Public Member Functions | |
ilObjSAHSLearningModuleGUI ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true) | |
Constructor. | |
& | executeCommand () |
execute command | |
viewObject () | |
list childs of current object | |
properties () | |
module properties | |
saveProperties () | |
save properties | |
createObject () | |
no manual SCORM creation, only import at the time | |
importObject () | |
display dialogue for importing SCORM package | |
uploadObject () | |
display status information or report errors messages in case of error | |
upload () | |
saveObject () | |
save new learning module to db | |
perm () | |
permission form | |
info () | |
permission form | |
permSave () | |
save permissions | |
addRole () | |
add role | |
owner () | |
show owner of learning module | |
getTemplate () | |
output main header (title and locator) | |
frameset () | |
output main frameset of media pool left frame: explorer tree of folders right frame: media pool content | |
setLocator ($a_tree="", $a_id="", $scriptname="adm_object.php") | |
set locator | |
setTabs () | |
output tabs | |
getTabs (&$tabs_gui) | |
adds tabs to tab gui object | |
_goto ($a_target) | |
goto target course |
Definition at line 39 of file class.ilObjSAHSLearningModuleGUI.php.
ilObjSAHSLearningModuleGUI::_goto | ( | $ | a_target | ) |
goto target course
Definition at line 588 of file class.ilObjSAHSLearningModuleGUI.php.
References $_GET, $ilErr, ilObjectGUI::$lng, ilObject::_lookupObjId(), ilObject::_lookupTitle(), exit, and sendInfo().
{ global $ilAccess, $ilErr, $lng; // to do: force flat view if ($ilAccess->checkAccess("visible", "", $a_target)) { $_GET["cmd"] = "infoScreen"; $_GET["baseClass"] = "ilSAHSPresentationGUI"; $_GET["ref_id"] = $a_target; include("ilias.php"); exit; } else { if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) { $_GET["cmd"] = "frameset"; $_GET["target"] = ""; $_GET["ref_id"] = ROOT_FOLDER_ID; sendInfo(sprintf($lng->txt("msg_no_perm_read_item"), ilObject::_lookupTitle(ilObject::_lookupObjId($a_target))), true); include("repository.php"); exit; } } $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL); }
ilObjSAHSLearningModuleGUI::addRole | ( | ) |
add role
Definition at line 376 of file class.ilObjSAHSLearningModuleGUI.php.
References $_GET, ilObjectGUI::addRoleObject(), and ilObjectGUI::setReturnLocation().
{ $this->setReturnLocation("addRole", "sahs_edit.php?ref_id=".$_GET["ref_id"]."&obj_id=".$_GET["obj_id"]."&cmd=perm"); $this->addRoleObject(); }
ilObjSAHSLearningModuleGUI::createObject | ( | ) |
no manual SCORM creation, only import at the time
Reimplemented from ilObjectGUI.
Definition at line 170 of file class.ilObjSAHSLearningModuleGUI.php.
References importObject().
{ $this->importObject(); }
& ilObjSAHSLearningModuleGUI::executeCommand | ( | ) |
execute command
Reimplemented from ilObjectGUI.
Definition at line 60 of file class.ilObjSAHSLearningModuleGUI.php.
References $_GET, $cmd, ilObjectGUI::getCreationMode(), getTemplate(), ilObjectGUI::prepareOutput(), ilObjectGUI::setLocator(), and setTabs().
{ if (strtolower($_GET["baseClass"]) == "iladministrationgui" || $this->getCreationMode() == true) { $this->prepareOutput(); } else { $this->getTemplate(); $this->setLocator(); $this->setTabs(); } $next_class = $this->ctrl->getNextClass($this); $cmd = $this->ctrl->getCmd(); switch($next_class) { case 'ilmdeditorgui': include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php'; $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType()); $md_gui->addObserver($this->object,'MDUpdateListener','General'); $this->ctrl->forwardCommand($md_gui); break; case 'ilpermissiongui': include_once("./classes/class.ilPermissionGUI.php"); $perm_gui =& new ilPermissionGUI($this); $ret =& $this->ctrl->forwardCommand($perm_gui); break; case "ilfilesystemgui": $this->fs_gui =& new ilFileSystemGUI($this->object->getDataDirectory()); $ret =& $this->ctrl->forwardCommand($this->fs_gui); break; case "illearningprogressgui": include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php'; $new_gui =& new ilLearningProgressGUI(LP_MODE_REPOSITORY,$this->object->getRefId()); $this->ctrl->forwardCommand($new_gui); break; default: $cmd = $this->ctrl->getCmd("frameset"); if ((strtolower($_GET["baseClass"]) == "iladministrationgui" || $this->getCreationMode() == true) && $cmd != "frameset") { $cmd.= "Object"; } $ret =& $this->$cmd(); break; } }
ilObjSAHSLearningModuleGUI::frameset | ( | ) |
output main frameset of media pool left frame: explorer tree of folders right frame: media pool content
Definition at line 410 of file class.ilObjSAHSLearningModuleGUI.php.
References exit.
{ $this->tpl = new ilTemplate("tpl.sahs_edit_frameset.html", false, false, "content"); $this->tpl->setVariable("REF_ID",$this->ref_id); $this->tpl->show("DEFAULT", false); exit; }
ilObjSAHSLearningModuleGUI::getTabs | ( | &$ | tabs_gui | ) |
adds tabs to tab gui object
object | $tabs_gui ilTabsGUI object |
Reimplemented from ilObjectGUI.
Definition at line 526 of file class.ilObjSAHSLearningModuleGUI.php.
References $rbacsystem, and ilObjUserTracking::_enabledLearningProgress().
Referenced by setTabs().
{ global $rbacsystem; if ($this->ctrl->getCmd() == "delete") { return; } // properties $tabs_gui->addTarget("properties", $this->ctrl->getLinkTarget($this, "properties"), "properties", get_class($this)); // file system gui tabs // properties $tabs_gui->addTarget("cont_list_files", $this->ctrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"), "", "ilfilesystemgui"); // tracking data $tabs_gui->addTarget("cont_tracking_data", $this->ctrl->getLinkTarget($this, "showTrackingItems"), "showTrackingItems", get_class($this)); // edit meta /* $tabs_gui->addTarget("meta_data", $this->ctrl->getLinkTarget($this, "editMeta"), "editMeta", get_class($this)); */ $tabs_gui->addTarget("meta_data", $this->ctrl->getLinkTargetByClass('ilmdeditorgui',''), "", "ilmdeditorgui"); // learning progress include_once("Services/Tracking/classes/class.ilObjUserTracking.php"); if(ilObjUserTracking::_enabledLearningProgress()) { $tabs_gui->addTarget('learning_progress', $this->ctrl->getLinkTargetByClass(array('illearningprogressgui'),''), '', array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui')); } // perm if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId())) { $tabs_gui->addTarget("perm_settings", $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui'); } // owner /* $tabs_gui->addTarget("owner", $this->ctrl->getLinkTarget($this, "owner"), "owner", get_class($this)); */ }
ilObjSAHSLearningModuleGUI::getTemplate | ( | ) |
output main header (title and locator)
Definition at line 394 of file class.ilObjSAHSLearningModuleGUI.php.
References ilObjectGUI::$lng.
Referenced by executeCommand().
{ global $lng; $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html"); //$this->tpl->setVariable("HEADER", $a_header_title); $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html"); //$this->tpl->setVariable("TXT_LOCATOR",$this->lng->txt("locator")); }
ilObjSAHSLearningModuleGUI::ilObjSAHSLearningModuleGUI | ( | $ | a_data, | |
$ | a_id, | |||
$ | a_call_by_reference, | |||
$ | a_prepare_output = true | |||
) |
Constructor.
public
Definition at line 46 of file class.ilObjSAHSLearningModuleGUI.php.
References ilObjectGUI::$lng, and ilObjectGUI::ilObjectGUI().
{ global $lng; $lng->loadLanguageModule("content"); $this->type = "sahs"; $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,false); #$this->tabs_gui =& new ilTabsGUI(); }
ilObjSAHSLearningModuleGUI::importObject | ( | ) |
display dialogue for importing SCORM package
public
Reimplemented from ilObjectGUI.
Definition at line 180 of file class.ilObjSAHSLearningModuleGUI.php.
References ilFrameTargetInfo::_getFrame(), and ilUtil::getImagePath().
Referenced by createObject().
{ // display import form $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.slm_import.html"); $this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_slm.gif')); $this->tpl->setVariable("ALT_IMG", $this->lng->txt("obj_sahs")); $this->ctrl->setParameter($this, "new_type", "sahs"); $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this)); $this->tpl->setVariable("BTN_NAME", "save"); $this->tpl->setVariable("TARGET", ' target="'. ilFrameTargetInfo::_getFrame("MainContent").'" '); $this->tpl->setVariable("TXT_SELECT_LMTYPE", $this->lng->txt("type")); $this->tpl->setVariable("TXT_TYPE_AICC", $this->lng->txt("lm_type_aicc")); $this->tpl->setVariable("TXT_TYPE_HACP", $this->lng->txt("lm_type_hacp")); $this->tpl->setVariable("TXT_TYPE_SCORM", $this->lng->txt("lm_type_scorm")); $this->tpl->setVariable("TXT_UPLOAD", $this->lng->txt("upload")); $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel")); $this->tpl->setVariable("TXT_IMPORT_LM", $this->lng->txt("import_sahs")); $this->tpl->setVariable("TXT_SELECT_FILE", $this->lng->txt("select_file")); $this->tpl->setVariable("TXT_VALIDATE_FILE", $this->lng->txt("cont_validate_file")); // get the value for the maximal uploadable filesize from the php.ini (if available) $umf=get_cfg_var("upload_max_filesize"); // get the value for the maximal post data from the php.ini (if available) $pms=get_cfg_var("post_max_size"); // use the smaller one as limit $max_filesize=min($umf, $pms); if (!$max_filesize) $max_filesize=max($umf, $pms); // gives out the limit as a littel notice :) $this->tpl->setVariable("TXT_FILE_INFO", $this->lng->txt("file_notice")." $max_filesize."); }
ilObjSAHSLearningModuleGUI::info | ( | ) |
permission form
Definition at line 358 of file class.ilObjSAHSLearningModuleGUI.php.
References ilObjectGUI::infoObject().
{ $this->infoObject(); }
ilObjSAHSLearningModuleGUI::owner | ( | ) |
show owner of learning module
Definition at line 386 of file class.ilObjSAHSLearningModuleGUI.php.
References ilObjectGUI::ownerObject().
{ $this->ownerObject(); }
ilObjSAHSLearningModuleGUI::perm | ( | ) |
permission form
Definition at line 346 of file class.ilObjSAHSLearningModuleGUI.php.
References $_GET, ilObjectGUI::permObject(), and ilObjectGUI::setFormAction().
{ $this->setFormAction("permSave", "sahs_edit.php?cmd=permSave&ref_id=".$_GET["ref_id"]. "&obj_id=".$_GET["obj_id"]); $this->setFormAction("addRole", "sahs_edit.php?ref_id=".$_GET["ref_id"]. "&obj_id=".$_GET["obj_id"]."&cmd=addRole"); $this->permObject(); }
ilObjSAHSLearningModuleGUI::permSave | ( | ) |
save permissions
Definition at line 366 of file class.ilObjSAHSLearningModuleGUI.php.
References $_GET, ilObjectGUI::permSaveObject(), and ilObjectGUI::setReturnLocation().
{ $this->setReturnLocation("permSave", "sahs_edit.php?ref_id=".$_GET["ref_id"]."&obj_id=".$_GET["obj_id"]."&cmd=perm"); $this->permSaveObject(); }
ilObjSAHSLearningModuleGUI::properties | ( | ) |
module properties
Reimplemented in ilObjSCORMLearningModuleGUI.
Definition at line 155 of file class.ilObjSAHSLearningModuleGUI.php.
{ }
ilObjSAHSLearningModuleGUI::saveObject | ( | ) |
save new learning module to db
Reimplemented from ilObjectGUI.
Definition at line 336 of file class.ilObjSAHSLearningModuleGUI.php.
References $rbacadmin, and uploadObject().
{ global $rbacadmin; $this->uploadObject(); }
ilObjSAHSLearningModuleGUI::saveProperties | ( | ) |
save properties
Reimplemented in ilObjSCORMLearningModuleGUI.
Definition at line 162 of file class.ilObjSAHSLearningModuleGUI.php.
{ }
ilObjSAHSLearningModuleGUI::setLocator | ( | $ | a_tree = "" , |
|
$ | a_id = "" , |
|||
$ | scriptname = "adm_object.php" | |||
) |
set locator
Definition at line 421 of file class.ilObjSAHSLearningModuleGUI.php.
References $_GET, $key, $row, ilObjectGUI::$tree, ilFrameTargetInfo::_getFrame(), and ilObjectGUI::setLocator().
{ global $ilias_locator, $tree; if (!defined("ILIAS_MODULE")) { parent::setLocator(); } else { $a_tree =& $tree; $a_id = $_GET["ref_id"]; $this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html"); $path = $a_tree->getPathFull($a_id); // this is a stupid workaround for a bug in PEAR:IT $modifier = 1; if (!empty($_GET["obj_id"])) { $modifier = 0; } // ### AA 03.11.10 added new locator GUI class ### $i = 1; if ($this->object->getType() != "grp" && ($_GET["cmd"] == "delete" || $_GET["cmd"] == "edit")) { unset($path[count($path) - 1]); } foreach ($path as $key => $row) { if ($key < count($path) - $modifier) { $this->tpl->touchBlock("locator_separator"); } $this->tpl->setCurrentBlock("locator_item"); if ($row["child"] != $a_tree->getRootId()) { $this->tpl->setVariable("ITEM", $row["title"]); } else { $this->tpl->setVariable("ITEM", $this->lng->txt("repository")); } if($row["type"] == "sahs") { $this->tpl->setVariable("LINK_ITEM", "sahs_edit.php?ref_id=".$row["child"]."&type=".$row["type"]); } else { $this->tpl->setVariable("LINK_ITEM", "../repository.php?cmd=frameset&ref_id=".$row["child"]); $t_frame = ilFrameTargetInfo::_getFrame("MainContent"); $this->tpl->setVariable("LINK_TARGET", " target=\"$t_frame\" "); } //$this->tpl->setVariable("LINK_TARGET", " target=\"bottom\" "); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("locator"); // ### AA 03.11.10 added new locator GUI class ### // navigate locator if ($row["child"] != $a_tree->getRootId()) { $ilias_locator->navigate($i++,$row["title"],"../repository.php?ref_id=".$row["child"], ilFrameTargetInfo::_getFrame("MainContent")); } else { $ilias_locator->navigate($i++,$this->lng->txt("repository"),"../repository.php?ref_id=".$row["child"], ilFrameTargetInfo::_getFrame("MainContent")); } } $this->tpl->setVariable("TXT_LOCATOR",$debug.$this->lng->txt("locator")); $this->tpl->parseCurrentBlock(); } }
ilObjSAHSLearningModuleGUI::setTabs | ( | ) |
output tabs
Reimplemented from ilObjectGUI.
Definition at line 510 of file class.ilObjSAHSLearningModuleGUI.php.
References ilUtil::getImagePath(), and getTabs().
Referenced by executeCommand().
{ $this->tpl->setCurrentBlock("header_image"); $this->tpl->setVariable("IMG_HEADER", ilUtil::getImagePath("icon_lm_b.gif")); $this->tpl->parseCurrentBlock(); $this->getTabs($this->tabs_gui); #$this->tpl->setVariable("TABS", $this->tabs_gui->getHTML()); $this->tpl->setVariable("HEADER", $this->object->getTitle()); }
ilObjSAHSLearningModuleGUI::upload | ( | ) |
Definition at line 328 of file class.ilObjSAHSLearningModuleGUI.php.
References uploadObject().
{ $this->uploadObject(); }
ilObjSAHSLearningModuleGUI::uploadObject | ( | ) |
display status information or report errors messages in case of error
public
Definition at line 224 of file class.ilObjSAHSLearningModuleGUI.php.
References $_GET, $_POST, $file, $rbacsystem, $title, ilObject::_writeTitle(), ilUtil::moveUploadedFile(), ilUtil::redirect(), ilUtil::renameExecutables(), sendInfo(), and ilUtil::unzip().
Referenced by saveObject(), and upload().
{ global $_FILES, $rbacsystem; // check if file was uploaded $source = $_FILES["scormfile"]["tmp_name"]; if (($source == 'none') || (!$source)) { $this->ilias->raiseError("No file selected!",$this->ilias->error_obj->MESSAGE); } // check create permission if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], "sahs")) { $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->WARNING); } // get_cfg_var("upload_max_filesize"); // get the may filesize form t he php.ini switch ($__FILES["scormfile"]["error"]) { case UPLOAD_ERR_INI_SIZE: $this->ilias->raiseError($this->lng->txt("err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE); break; case UPLOAD_ERR_FORM_SIZE: $this->ilias->raiseError($this->lng->txt("err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE); break; case UPLOAD_ERR_PARTIAL: $this->ilias->raiseError($this->lng->txt("err_partial_file_upload"),$this->ilias->error_obj->MESSAGE); break; case UPLOAD_ERR_NO_FILE: $this->ilias->raiseError($this->lng->txt("err_no_file_uploaded"),$this->ilias->error_obj->MESSAGE); break; } $file = pathinfo($_FILES["scormfile"]["name"]); $name = substr($file["basename"], 0, strlen($file["basename"]) - strlen($file["extension"]) - 1); if ($name == "") { $name = $this->lng->txt("no_title"); } // create and insert object in objecttree switch ($_POST["sub_type"]) { case "scorm": include_once("content/classes/class.ilObjSCORMLearningModule.php"); $newObj = new ilObjSCORMLearningModule(); break; case "aicc": include_once("content/classes/class.ilObjAICCLearningModule.php"); $newObj = new ilObjAICCLearningModule(); break; case "hacp": include_once("content/classes/class.ilObjHACPLearningModule.php"); $newObj = new ilObjHACPLearningModule(); break; } //$newObj->setType("slm"); //$dummy_meta =& new ilMetaData(); //$dummy_meta->setObject($newObj); //$newObj->assignMetaData($dummy_meta); $newObj->setTitle($name); $newObj->setSubType($_POST["sub_type"]); $newObj->setDescription(""); $newObj->create(); $newObj->createReference(); $newObj->putInTree($_GET["ref_id"]); $newObj->setPermissions($_GET["ref_id"]); $newObj->notify("new",$_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$newObj->getRefId()); // create data directory, copy file to directory $newObj->createDataDirectory(); // copy uploaded file to data directory $file_path = $newObj->getDataDirectory()."/".$_FILES["scormfile"]["name"]; ilUtil::moveUploadedFile($_FILES["scormfile"]["tmp_name"], $_FILES["scormfile"]["name"], $file_path); //move_uploaded_file($_FILES["scormfile"]["tmp_name"], $file_path); ilUtil::unzip($file_path); ilUtil::renameExecutables($newObj->getDataDirectory()); $title = $newObj->readObject(); if ($title != "") { ilObject::_writeTitle($newObj->getId(), $title); $md = new ilMD($newObj->getId(),0, $newObj->getType()); if(is_object($md_gen = $md->getGeneral())) { $md_gen->setTitle($title); $md_gen->update(); } } sendInfo( $this->lng->txt($newObj->getType()."_added"), true); ilUtil::redirect("content/sahs_edit.php?ref_id=".$newObj->getRefId()); }
ilObjSAHSLearningModuleGUI::viewObject | ( | ) |
list childs of current object
public
Reimplemented from ilObjectGUI.
Definition at line 123 of file class.ilObjSAHSLearningModuleGUI.php.
References $_GET, and ilFrameTargetInfo::_getFrame().
{ if (strtolower($_GET["baseClass"]) == "iladministrationgui") { parent::viewObject(); } else { //add template for view button $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html"); // view button $this->tpl->setCurrentBlock("btn_cell"); $this->tpl->setVariable("BTN_LINK","content/sahs_presentation.php?ref_id=".$this->object->getRefID()); $this->tpl->setVariable("BTN_TARGET"," target=\"ilContObj".$this->object->getID()."\" "); $this->tpl->setVariable("BTN_TXT",$this->lng->txt("view")); $this->tpl->parseCurrentBlock(); // view button $this->tpl->setCurrentBlock("btn_cell"); $this->tpl->setVariable("BTN_LINK","content/sahs_edit.php?ref_id=".$this->object->getRefID()); $this->tpl->setVariable("BTN_TARGET"," target=\"". ilFrameTargetInfo::_getFrame("MainContent")."\" "); $this->tpl->setVariable("BTN_TXT",$this->lng->txt("edit")); $this->tpl->parseCurrentBlock(); } }