30 protected \ILIAS\HTMLLearningModule\InternalGUIService
$gui;
40 bool $a_call_by_reference =
true,
41 bool $a_prepare_output =
true 45 $this->
lng = $DIC->language();
46 $this->
user = $DIC->user();
47 $this->
locator = $DIC[
"ilLocator"];
48 $this->
tabs = $DIC->tabs();
49 $this->tree = $DIC->repositoryTree();
50 $this->tpl = $DIC[
"tpl"];
51 $this->
access = $DIC->access();
52 $this->
toolbar = $DIC->toolbar();
53 $this->
help = $DIC[
"ilHelp"];
54 $lng = $DIC->language();
55 $ilCtrl = $DIC->ctrl();
57 $this->
ctrl = $ilCtrl;
58 $this->
ctrl->saveParameter($this, array(
"ref_id"));
60 $this->lm_request = $DIC->htmlLearningModule()
70 $this->output_prepared = $a_prepare_output;
71 $this->gui = $DIC->htmlLearningModule()->internal()->gui();
79 $next_class = $this->
ctrl->getNextClass($this);
80 $cmd = $this->
ctrl->getCmd();
84 strtolower($this->lm_request->getBaseClass()) ===
"iladministrationgui" 87 } elseif (!in_array($cmd, array(
"",
"framset")) || $next_class !=
"") {
93 switch ($next_class) {
94 case 'ilobjectmetadatagui':
96 $ilTabs->activateTab(
'id_meta_data');
98 $this->
ctrl->forwardCommand($md_gui);
101 case "ilfilesystemgui":
103 $ilTabs->activateTab(
'id_list_files');
106 $fs_gui->setUseUploadDirectory(
true);
107 $fs_gui->setTableId(
"htlmfs" . $this->
object->getId());
108 if ($this->
object->getStartFile() !==
"") {
110 (
string) $this->
object->getStartFile(),
111 $this->
lng->txt(
"cont_startfile")
114 $fs_gui->addCommand($this,
"setStartFile", $this->
lng->txt(
"cont_set_start_file"));
116 $this->
ctrl->forwardCommand($fs_gui);
165 case "ilinfoscreengui":
169 case "illearningprogressgui":
170 $ilTabs->activateTab(
'id_learning_progress');
171 $user_id = ($this->lm_request->getUserId() > 0)
172 ? $this->lm_request->getUserId()
176 $this->
object->getRefId(),
179 $this->
ctrl->forwardCommand($new_gui);
182 case 'ilpermissiongui':
183 $ilTabs->activateTab(
'id_permissions');
185 $ret = $this->
ctrl->forwardCommand($perm_gui);
189 $ilTabs->activateTab(
"export");
191 $exp_gui->addFormat(
"xml");
192 $exp_gui->addFormat(
"html",
"", $this,
"exportHTML");
193 $ret = $this->
ctrl->forwardCommand($exp_gui);
196 case "ilcommonactiondispatchergui":
198 $this->
ctrl->forwardCommand($gui);
202 $cmd = $this->
ctrl->getCmd(
"listFiles");
205 strtolower($this->lm_request->getBaseClass()) ===
"iladministrationgui" 209 $ret = $this->$cmd();
234 $this->error->raiseError($this->
lng->txt(
"permission_denied"), $this->error->MESSAGE);
259 $ti->setRequired(
true);
260 $this->
form->addItem($ti);
266 $this->
form->addItem($ta);
270 $cb->setOptionTitle(
$lng->
txt(
""));
272 $this->
form->addItem($cb);
278 if ($startfile !==
"") {
279 $ne->setValue(basename($startfile));
281 $ne->setValue(basename($this->
lng->txt(
"no_start_file")));
283 $this->
form->addItem($ne);
286 $pres->setTitle($this->
lng->txt(
'obj_presentation'));
287 $this->
form->addItem($pres);
290 $obj_service->commonSettings()->legacyForm($this->
form, $this->
object)->addTileImage();
292 $this->
form->addCommandButton(
"saveProperties",
$lng->
txt(
"save"));
293 $this->
form->addCommandButton(
"toFilesystem",
$lng->
txt(
"cont_set_start_file"));
295 $this->
form->setTitle(
$lng->
txt(
"cont_lm_properties"));
296 $this->
form->setFormAction($ilCtrl->getFormAction($this,
"saveProperties"));
300 $section->setTitle($this->
lng->txt(
'obj_features'));
301 $this->
form->addItem($section);
317 $values[
'cobj_online'] = !$this->
object->getOfflineStatus();
318 if ($startfile !==
"") {
319 $startfile = basename($startfile);
321 $startfile = $this->
lng->txt(
"no_start_file");
324 $values[
"startfile"] = $startfile;
325 $values[
"title"] = $this->
object->getTitle();
326 $values[
"desc"] = $this->
object->getLongDescription();
327 $values[
"cont_show_info_tab"] = $this->
object->isInfoEnabled();
329 $this->
form->setValuesByArray($values);
341 $this->error->raiseError($this->
lng->txt(
"permission_denied"), $this->error->MESSAGE);
349 if ($this->
form->checkInput()) {
350 $this->
object->setTitle($this->
form->getInput(
"title"));
351 $this->
object->setDescription($this->
form->getInput(
"desc"));
352 $this->
object->setOfflineStatus(!(
bool) $this->
form->getInput(
"cobj_online"));
354 $this->
object->update();
357 $obj_service->commonSettings()->legacyForm($this->
form, $this->
object)->saveTileImage();
368 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
369 $this->
ctrl->redirect($this,
"properties");
372 $ilTabs->activateTab(
"id_settings");
373 $this->
form->setValuesByPost();
379 if (!$this->rbac_system->checkAccess(
"visible,write", $this->object->getRefId())) {
397 if (!$new_object->getStartFile()) {
401 if (isset($files[
"file"])) {
403 if (stripos($new_object->
getTitle(),
".zip") !==
false) {
404 $zip_file = strtolower($new_object->
getTitle());
405 $suffix = strrpos($zip_file,
".");
407 $zip_file = substr($zip_file, 0, $suffix);
410 $valid = array(
"index.htm",
"index.html",
"start.htm",
"start.html");
411 foreach ($files[
"file"] as $idx => $file) {
413 if (stripos($file,
".htm") !==
false) {
414 $chk_file = strtolower($file);
415 $suffix = strrpos($chk_file,
".");
417 $chk_file = substr($chk_file, 0, $suffix);
420 if (in_array($file,
$valid) ||
421 ($chk_file && $zip_file && $chk_file == $zip_file)) {
422 $new_object->setStartFile(str_replace($new_object->getDataDirectory() .
"/",
"", $files[
"path"][$idx]) . $file);
431 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
432 $this->
object = $new_object;
444 $this->error->raiseError($this->
lng->txt(
"permission_denied"), $this->error->MESSAGE);
446 $this->
object->setStartFile($a_file);
447 $this->
object->update();
448 $this->
ctrl->redirectByClass(
"ilfilesystemgui",
"listFiles");
453 $this->tpl->loadStandardTemplate();
464 $this->
object->getId(),
465 $this->
object->getRefId(),
474 if ($startfile !==
"") {
484 $this->
ctrl->setCmd(
"showSummary");
485 $this->
ctrl->setCmdClass(
"ilinfoscreengui");
497 $this->
lng->loadLanguageModule(
"meta");
500 $info->enablePrivateNotes();
501 $info->enableLearningProgress();
504 if ($ilAccess->checkAccess(
"write",
"", $this->requested_ref_id)) {
505 $info->enableNewsEditing();
508 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
509 if ($enable_internal_rss) {
510 $info->setBlockProperty(
"news",
"settings",
true);
515 if ($ilAccess->checkAccess(
"read",
"", $this->requested_ref_id)) {
518 $this->
lng->txt(
"view"),
519 "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=" . $this->
object->getRefId(),
521 )->primary()->toToolbar();
525 $info->addMetaDataSections($this->
object->getId(), 0, $this->
object->getType());
528 $this->
ctrl->forwardCommand($info);
546 if ($ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
550 $this->
ctrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles")
554 if ($ilAccess->checkAccess(
'visible',
'', $this->ref_id) && $this->
object->isInfoEnabled()) {
558 $this->
ctrl->getLinkTargetByClass(array(
"ilobjfilebasedlmgui",
"ilinfoscreengui"),
"showSummary")
562 if ($ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
566 $this->
ctrl->getLinkTarget($this,
"properties")
572 "id_learning_progress",
573 $lng->
txt(
"learning_progress"),
574 $this->
ctrl->getLinkTargetByClass(array(
'ilobjfilebasedlmgui',
'illearningprogressgui'),
'')
578 if ($ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
580 $mdtab = $mdgui->getTab();
592 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
596 $this->
ctrl->getLinkTargetByClass(
"ilexportgui",
"")
600 if ($ilAccess->checkAccess(
'edit_permission',
'', $this->object->getRefId())) {
604 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm")
609 if ($startfile !==
"" && $ilAccess->checkAccess(
'read',
'', $this->ref_id)) {
610 $ilTabs->addNonTabbedLink(
612 $this->
lng->txt(
"glo_presentation_view"),
613 "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=" . $this->
object->getRefId(),
619 public static function _goto(
string $a_target): void
622 $main_tpl = $DIC->ui()->mainTemplate();
624 $lng = $DIC->language();
625 $ilAccess = $DIC->access();
627 if ($ilAccess->checkAccess(
"read",
"", $a_target) ||
628 $ilAccess->checkAccess(
"visible",
"", $a_target)) {
631 $main_tpl->setOnScreenMessage(
'failure', sprintf(
632 $lng->
txt(
"msg_no_perm_read_item"),
645 if (is_object($this->
object)) {
647 $this->
object->getTitle(),
648 $this->
ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
658 parent::importFileObject();
667 $this->
ctrl->setParameter($this,
"ref_id", $new_object->
getRefId());
668 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
669 $this->
ctrl->redirect($this,
"properties");
682 $newObj->setDescription(
"");
684 $newObj->populateByDirectoy($a_dir,
$filename);
700 $this->
object->getType()
705 $this->
object->getType()
708 $subdir = $this->
object->getType() .
"_" . $this->
object->getId();
710 $target_dir = $export_dir .
"/" . $subdir;
715 $source_dir = $this->
object->getDataDirectory();
721 $zip_file = $export_dir .
"/" . $date .
"__" .
IL_INST_ID .
"__" .
722 $this->
object->getType() .
"_" . $this->
object->getId() .
".zip";
738 $this->
ctrl->redirectByClass(
"illearningprogressgui",
"");
redrawHeaderActionObject()
Ajax call: redraw action header only.
activateLabels(bool $a_act, string $a_label_header)
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
initImportForm(string $new_type)
__construct( $a_data, int $a_id=0, bool $a_call_by_reference=true, bool $a_prepare_output=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
cancelObject()
cancel action and go back to previous page
static _goto(string $a_target)
prepareOutput(bool $show_sub_objects=true)
createFromDirectory(string $a_dir)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _gotoRepositoryNode(int $ref_id, string $cmd="")
setParameterByClass(string $a_class, string $a_parameter, $a_value)
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
loadLanguageModule(string $a_module)
Load language module.
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
static _getExportDirectory(int $a_obj_id, string $a_type="xml", string $a_obj_type="", string $a_entity="")
Get export directory for an repository object.
infoScreen()
this one is called from the info button in the repository
static _lookupObjId(int $ref_id)
afterSave(ilObject $new_object)
static _tracProgress(int $a_user_id, int $a_obj_id, int $a_ref_id, string $a_obj_type='')
StandardGUIRequest $lm_request
Export User Interface Class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS HTMLLearningModule InternalGUIService $gui
afterImport(ilObject $new_object)
ilGlobalTemplateInterface $tpl
static _lookupTitle(int $obj_id)
setContent(string $a_html)
Sets content for standard template.
static signFolderOfStartFile(string $start_file_path)
static recursive_dirscan(string $dir, array &$arr)
Recursively scans a given directory and writes path and filename into referenced array.
setScreenIdComponent(string $a_comp)
static _createExportDirectory(int $a_obj_id, string $a_export_type="xml", string $a_obj_type="")
Class ilObjectGUI Basic methods of all Output classes.
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static redirect(string $a_script)
putObjectInTree(ilObject $obj, int $parent_node_id=null)
Add object to tree at given position.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
activateTab(string $a_id)
form( $class_path, string $cmd, string $submit_caption="")
initCreateForm(string $new_type)
const LP_CONTEXT_REPOSITORY
This class represents a text area property in a property form.
static zip(string $a_dir, string $a_file, bool $compress_content=false)
addItem(string $a_title, string $a_link, string $a_frame="", int $a_ref_id=0, ?string $type=null)
const INFO_TAB_VISIBILITY
User Interface class for file based learning modules (HTML)
updateObject()
updates object entry in object_data
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
File System Explorer GUI class.
importFileObject(int $parent_id=null)
static _determineStartUrl(int $a_id)
addHeaderAction()
Add header action menu.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
setStartFile(string $a_file)
initCreationForms(string $new_type)