19require_once(
"./Services/Object/classes/class.ilObjectGUI.php");
 
   20require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php");
 
   21require_once(
"./Services/Table/classes/class.ilTableGUI.php");
 
   22require_once(
"./Services/FileSystem/classes/class.ilFileSystemGUI.php");
 
   53    public function __construct($a_data, $a_id = 0, $a_call_by_reference = 
true, $a_prepare_output = 
true)
 
   57        $this->lng = 
$DIC->language();
 
   58        $this->
user = $DIC->user();
 
   59        $this->locator = 
$DIC[
"ilLocator"];
 
   60        $this->tabs = 
$DIC->tabs();
 
   61        $this->rbacsystem = 
$DIC->rbac()->system();
 
   62        $this->tree = 
$DIC->repositoryTree();
 
   63        $this->tpl = 
$DIC[
"tpl"];
 
   64        $this->access = 
$DIC->access();
 
   65        $this->
error = $DIC[
"ilErr"];
 
   66        $this->toolbar = 
$DIC->toolbar();
 
   67        $this->help = 
$DIC[
"ilHelp"];
 
   72        $this->ctrl->saveParameter($this, array(
"ref_id"));
 
   75        $lng->loadLanguageModule(
"content");
 
   77        parent::__construct($a_data, $a_id, $a_call_by_reference, 
false);
 
   79        $this->output_prepared = $a_prepare_output;
 
   91        $next_class = $this->ctrl->getNextClass($this);
 
   92        $cmd = $this->ctrl->getCmd();
 
   94        if (strtolower(
$_GET[
"baseClass"]) == 
"iladministrationgui" ||
 
   98            if (!in_array($cmd, array(
"", 
"framset")) || $next_class != 
"") {
 
  105        switch ($next_class) {
 
  106            case 'ilobjectmetadatagui':
 
  108                $ilTabs->activateTab(
'id_meta_data');
 
  109                include_once 
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
 
  111                $this->ctrl->forwardCommand($md_gui);
 
  114            case "ilfilesystemgui":
 
  116                $ilTabs->activateTab(
'id_list_files');
 
  118                $fs_gui->activateLabels(
true, $this->lng->txt(
"cont_purpose"));
 
  119                $fs_gui->setUseUploadDirectory(
true);
 
  120                $fs_gui->setTableId(
"htlmfs" . $this->object->getId());
 
  121                if ($this->object->getStartFile() != 
"") {
 
  123                        $this->object->getStartFile(),
 
  124                        $this->lng->txt(
"cont_startfile")
 
  127                $fs_gui->addCommand($this, 
"setStartFile", $this->lng->txt(
"cont_set_start_file"));
 
  129                $this->ctrl->forwardCommand($fs_gui);
 
  132                require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
 
  136                    $pcommand = $fs_gui->getLastPerformedCommand();
 
  137                    if (is_array($pcommand)) {
 
  138                        $valid = array(
"index.htm", 
"index.html", 
"start.htm", 
"start.html");
 
  139                        if ($pcommand[
"cmd"] == 
"create_file") {
 
  140                            $file = strtolower(basename($pcommand[
"name"]));
 
  142                                $this->
object->setStartFile($pcommand[
"name"]);
 
  143                                $do_update = $pcommand[
"name"];
 
  145                        } elseif ($pcommand[
"cmd"] == 
"unzip_file") {
 
  146                            $zip_file = strtolower(basename($pcommand[
"name"]));
 
  147                            $suffix = strrpos($zip_file, 
".");
 
  149                                $zip_file = substr($zip_file, 0, $suffix);
 
  151                            foreach ($pcommand[
"added"] as 
$file) {
 
  153                                if (stristr(
$file, 
".htm")) {
 
  154                                    $chk_file = strtolower(basename(
$file));
 
  155                                    $suffix = strrpos($chk_file, 
".");
 
  157                                        $chk_file = substr($chk_file, 0, $suffix);
 
  161                                    ($zip_file && $chk_file && $chk_file == $zip_file)) {
 
  162                                    $this->
object->setStartFile($file);
 
  173                        $this->
object->update();
 
  174                        $this->ctrl->redirectByClass(
"ilfilesystemgui", 
"listFiles");
 
  179            case "ilinfoscreengui":
 
  183            case "illearningprogressgui":
 
  184                $ilTabs->activateTab(
'id_learning_progress');
 
  185                include_once 
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
 
  188                    $this->object->getRefId(),
 
  191                $this->ctrl->forwardCommand($new_gui);
 
  194            case 'ilpermissiongui':
 
  195                $ilTabs->activateTab(
'id_permissions');
 
  196                include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
 
  198                $ret = $this->ctrl->forwardCommand($perm_gui);
 
  202                $ilTabs->activateTab(
"export");
 
  203                include_once(
"./Services/Export/classes/class.ilExportGUI.php");
 
  205                $exp_gui->addFormat(
"xml");
 
  206                $exp_gui->addFormat(
"html", 
"", $this, 
"exportHTML");
 
  207                $ret = $this->ctrl->forwardCommand($exp_gui);
 
  211            case "ilcommonactiondispatchergui":
 
  212                include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
 
  214                $this->ctrl->forwardCommand($gui);
 
  218                $cmd = $this->ctrl->getCmd(
"frameset");
 
  219                if (strtolower(
$_GET[
"baseClass"]) == 
"iladministrationgui" ||
 
  223                $ret = $this->$cmd();
 
  232        $forms = array(self::CFORM_NEW => $this->
initCreateForm($a_new_type),
 
  247        $ilCtrl->redirectByClass(
"ilrepositorygui", 
"frameset");
 
  262        $ilTabs->activateTab(
"id_settings");
 
  266        $tpl->setContent($this->form->getHTML());
 
  278        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  285        $ti->setRequired(
true);
 
  286        $this->form->addItem($ti);
 
  292        $this->form->addItem($ta);
 
  296        $cb->setOptionTitle(
$lng->txt(
""));
 
  298        $this->form->addItem($cb);
 
  301        require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
 
  305        if ($startfile != 
"") {
 
  306            $ne->setValue(basename($startfile));
 
  308            $ne->setValue(basename($this->lng->txt(
"no_start_file")));
 
  310        $this->form->addItem($ne);
 
  312        $this->form->addCommandButton(
"saveProperties", 
$lng->txt(
"save"));
 
  313        $this->form->addCommandButton(
"toFilesystem", 
$lng->txt(
"cont_set_start_file"));
 
  315        $this->form->setTitle(
$lng->txt(
"cont_lm_properties"));
 
  316        $this->form->setFormAction(
$ilCtrl->getFormAction($this, 
"saveProperties"));
 
  324        require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
 
  328        $values[
"cobj_online"] = $this->
object->getOnline();
 
  329        if ($startfile != 
"") {
 
  330            $startfile = basename($startfile);
 
  332            $startfile = $this->lng->txt(
"no_start_file");
 
  335        $values[
"cobj_online"] = $this->
object->getOnline();
 
  336        $values[
"startfile"] = $startfile;
 
  337        $values[
"title"] = $this->
object->getTitle();
 
  338        $values[
"desc"] = $this->
object->getDescription();
 
  341        $this->form->setValuesByArray($values);
 
  354        $ilCtrl->redirectByClass(
"ilfilesystemgui", 
"listFiles");
 
  367        if ($this->form->checkInput()) {
 
  368            $this->
object->setTitle($this->form->getInput(
"title"));
 
  369            $this->
object->setDescription($this->form->getInput(
"desc"));
 
  372            $this->
object->update();
 
  374            $this->ctrl->redirect($this, 
"properties");
 
  377        $ilTabs->activateTab(
"id_settings");
 
  378        $this->form->setValuesByPost();
 
  379        $tpl->setContent($this->form->getHtml());
 
  392        if (!
$rbacsystem->checkAccess(
"visible,write", $this->object->getRefId())) {
 
  393            $ilErr->raiseError($this->lng->txt(
"permission_denied"), 
$ilErr->MESSAGE);
 
  421        if (!$newObj->getStartFile()) {
 
  424            include_once 
"Services/Utilities/classes/class.ilFileUtils.php";
 
  426            if (is_array(
$files[
"file"])) {
 
  428                if (stristr($newObj->
getTitle(), 
".zip")) {
 
  429                    $zip_file = strtolower($newObj->
getTitle());
 
  430                    $suffix = strrpos($zip_file, 
".");
 
  432                        $zip_file = substr($zip_file, 0, $suffix);
 
  435                $valid = array(
"index.htm", 
"index.html", 
"start.htm", 
"start.html");
 
  438                    if (stristr(
$file, 
".htm")) {
 
  439                        $chk_file = strtolower(
$file);
 
  440                        $suffix = strrpos($chk_file, 
".");
 
  442                            $chk_file = substr($chk_file, 0, $suffix);
 
  446                        ($chk_file && $zip_file && $chk_file == $zip_file)) {
 
  447                        $newObj->setStartFile(str_replace($newObj->getDataDirectory() . 
"/", 
"", 
$files[
"path"][$idx]) . 
$file);
 
  474        $this->
object->setStartFile($a_file);
 
  475        $this->
object->update();
 
  476        $this->ctrl->redirectByClass(
"ilfilesystemgui", 
"listFiles");
 
  484        $this->
setFormAction(
"permSave", 
"fblm_edit.php?cmd=permSave&ref_id=" . 
$_GET[
"ref_id"] .
 
  485            "&obj_id=" . 
$_GET[
"obj_id"]);
 
  486        $this->
setFormAction(
"addRole", 
"fblm_edit.php?ref_id=" . $_GET[
"ref_id"] .
 
  487            "&obj_id=" . 
$_GET[
"obj_id"] . 
"&cmd=addRole");
 
  499        $ilCtrl->setCmdClass(
"ilfilesystemgui");
 
  511        $this->tpl->getStandardTemplate();
 
  519        if (
$ilUser->getId() != ANONYMOUS_USER_ID) {
 
  520            include_once 
"Services/Tracking/classes/class.ilLearningProgress.php";
 
  523                $this->object->getId(),
 
  524                $this->object->getRefId(),
 
  529        require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
 
  530        require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
 
  534        if ($startfile != 
"") {
 
  547        $this->ctrl->setCmd(
"showSummary");
 
  548        $this->ctrl->setCmdClass(
"ilinfoscreengui");
 
  569        $ilTabs->activateTab(
'id_info');
 
  571        $this->lng->loadLanguageModule(
"meta");
 
  572        include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
 
  575        $info->enablePrivateNotes();
 
  576        $info->enableLearningProgress();
 
  579        if ($ilAccess->checkAccess(
"write", 
"", 
$_GET[
"ref_id"])) {
 
  580            $info->enableNewsEditing();
 
  583            $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
 
  584            if ($enable_internal_rss) {
 
  585                $info->setBlockProperty(
"news", 
"settings", 
true);
 
  590        if ($ilAccess->checkAccess(
"read", 
"", 
$_GET[
"ref_id"])) {
 
  592            include_once 
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
 
  594            $button->setCaption(
"view");
 
  595            $button->setPrimary(
true);
 
  596            $button->setUrl(
"ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=" . $this->object->getRefID());
 
  597            $button->setTarget(
"ilContObj" . $this->object->getId());
 
  598            $ilToolbar->addButtonInstance($button);
 
  602        $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
 
  605        $this->ctrl->forwardCommand(
$info);
 
  618        $this->tpl->setTitle($this->object->getTitle());
 
  632        $ilHelp->setScreenIdComponent(
"htlm");
 
  634        if ($ilAccess->checkAccess(
'write', 
'', $this->ref_id)) {
 
  637                $lng->txt(
"cont_list_files"),
 
  638                $this->ctrl->getLinkTargetByClass(
"ilfilesystemgui", 
"listFiles")
 
  642        if ($ilAccess->checkAccess(
'visible', 
'', $this->ref_id)) {
 
  645                $lng->txt(
"info_short"),
 
  646                $this->ctrl->getLinkTargetByClass(array(
"ilobjfilebasedlmgui", 
"ilinfoscreengui"), 
"showSummary")
 
  650        if ($ilAccess->checkAccess(
'write', 
'', $this->ref_id)) {
 
  653                $lng->txt(
"settings"),
 
  654                $this->ctrl->getLinkTarget($this, 
"properties")
 
  658        include_once 
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
 
  661                "id_learning_progress",
 
  662                $lng->txt(
"learning_progress"),
 
  663                $this->ctrl->getLinkTargetByClass(array(
'ilobjfilebasedlmgui',
'illearningprogressgui'), 
'')
 
  667        if ($ilAccess->checkAccess(
'write', 
'', $this->ref_id)) {
 
  668            include_once 
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
 
  670            $mdtab = $mdgui->getTab();
 
  674                    $lng->txt(
"meta_data"),
 
  682        if ($ilAccess->checkAccess(
"write", 
"", $this->object->getRefId())) {
 
  686                $this->ctrl->getLinkTargetByClass(
"ilexportgui", 
"")
 
  690        if ($ilAccess->checkAccess(
'edit_permission', 
'', $this->object->getRefId())) {
 
  693                $lng->txt(
"perm_settings"),
 
  694                $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'), 
"perm")
 
  698        require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
 
  701        if ($startfile != 
"") {
 
  702            $ilTabs->addNonTabbedLink(
 
  704                $this->lng->txt(
"glo_presentation_view"),
 
  705                "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=" . $this->object->getRefID(),
 
  716    public static function _goto($a_target)
 
  723        $ilAccess = 
$DIC->access();
 
  725        if ($ilAccess->checkAccess(
"read", 
"", $a_target) ||
 
  726            $ilAccess->checkAccess(
"visible", 
"", $a_target)) {
 
  728        } elseif ($ilAccess->checkAccess(
"read", 
"", ROOT_FOLDER_ID)) {
 
  730                $lng->txt(
"msg_no_perm_read_item"),
 
  743        if (is_object($this->
object)) {
 
  745                $this->object->getTitle(),
 
  746                $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui", 
"showSummary"),
 
  763            return parent::importFileObject();
 
  781            $ilErr->raiseError($this->lng->txt(
"no_create_permission"));
 
  788        $newObj->setDescription(
"");
 
  790        $newObj->populateByDirectoy($a_dir, 
$filename);
 
  809        $inst_id = IL_INST_ID;
 
  811        include_once(
"./Services/Export/classes/class.ilExport.php");
 
  814            $this->object->getId(),
 
  816            $this->object->getType()
 
  819            $this->object->getId(),
 
  821            $this->object->getType()
 
  824        $subdir = $this->
object->getType() . 
"_" . $this->
object->getId();
 
  827        $target_dir = $export_dir . 
"/" . $subdir;
 
  832        $source_dir = $this->
object->getDataDirectory();
 
  838        $zip_file = $export_dir . 
"/" . $date . 
"__" . IL_INST_ID . 
"__" .
 
  839            $this->
object->getType() . 
"_" . $this->
object->getId() . 
".zip";
 
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
error($a_errmsg)
set error message @access public
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Export User Interface Class.
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
static _createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
File System Explorer GUI class.
static recursive_dirscan($dir, &$arr)
Recursively scans a given directory and writes path and filename into referenced array.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
const LP_CONTEXT_REPOSITORY
Class ilObjUserTrackingGUI.
static _tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type='')
manifest.xml file not found-exception for import
getTmpDir()
Get temporary directory.
This class represents a non editable value in a property form.
static _determineStartUrl($a_id)
check wether learning module is online
User Interface class for file based learning modules (HTML)
initCreationForms($a_new_type)
Init creation froms.
properties()
edit properties of object (admin form)
addLocatorItems()
should be overwritten to add object specific items (repository items are preloaded)
showInfoScreen()
info screen call from inside learning module
outputInfoScreen($a_standard_locator=true)
info screen
edit()
edit properties of object (module form)
exportHTML()
create html package
saveProperties()
Save properties form.
createFromDirectory($a_dir)
Create new object from a html zip file.
editObject()
edit properties of object (admin form)
initSettingsForm()
Init settings form.
importFileObject($parent_id=null, $a_catch_errors=true)
Import file.
update()
update properties
infoScreen()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...
__construct($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor.
toFilesystem()
Set start file.
cancelCreationObject($in_rep=false)
cancel action and go back to previous page @access public
getTabs()
adds tabs to tab gui object
getSettingsFormValues()
Get current values for settings from.
executeCommand()
execute command
static _goto($a_target)
redirect script
getTemplate()
output main header (title and locator)
frameset()
Frameset -> Output list of files.
afterSave(ilObject $newObj)
save object @access public
File Based Learning Module (HTML) object.
Class ilObjectGUI Basic methods of all Output classes.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
initImportForm($a_new_type)
Init object import form.
putObjectInTree(ilObject $a_obj, $a_parent_node_id=null)
Add object to tree at given position.
prepareOutput($a_show_subobjects=true)
prepare output
initCreateForm($a_new_type)
Init object creation form.
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
cancelObject()
cancel action and go back to previous page @access public
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
getCreationMode()
get creation mode
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
addHeaderAction()
Add header action menu.
setFormAction($a_cmd, $a_formaction)
set specific form action for command
updateObject()
updates object entry in object_data
Class ilObject Basic functions for all objects.
static _lookupObjId($a_id)
const TITLE_LENGTH
max length of object title
update()
update object in db
static _lookupTitle($a_id)
lookup object title
getRefId()
get reference id @access public
getTitle()
get object title @access public
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This class represents a text area property in a property form.
This class represents a text property in a property form.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static yn2tf($a_yn)
convert "y"/"n" to true/false
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static signFolderOfStartFile($start_file_path)
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file