39 bool $a_call_by_reference =
true,
40 bool $a_prepare_output =
true 44 $this->
lng = $DIC->language();
45 $this->
user = $DIC->user();
46 $this->
locator = $DIC[
"ilLocator"];
47 $this->
tabs = $DIC->tabs();
48 $this->tree = $DIC->repositoryTree();
49 $this->tpl = $DIC[
"tpl"];
50 $this->
access = $DIC->access();
51 $this->
toolbar = $DIC->toolbar();
52 $this->
help = $DIC[
"ilHelp"];
53 $lng = $DIC->language();
54 $ilCtrl = $DIC->ctrl();
56 $this->
ctrl = $ilCtrl;
57 $this->
ctrl->saveParameter($this, array(
"ref_id"));
59 $this->lm_request = $DIC->htmlLearningModule()
69 $this->output_prepared = $a_prepare_output;
77 $next_class = $this->
ctrl->getNextClass($this);
78 $cmd = $this->
ctrl->getCmd();
82 strtolower($this->lm_request->getBaseClass()) ===
"iladministrationgui" 85 } elseif (!in_array($cmd, array(
"",
"framset")) || $next_class !=
"") {
91 switch ($next_class) {
92 case 'ilobjectmetadatagui':
94 $ilTabs->activateTab(
'id_meta_data');
96 $this->
ctrl->forwardCommand($md_gui);
99 case "ilfilesystemgui":
101 $ilTabs->activateTab(
'id_list_files');
104 $fs_gui->setUseUploadDirectory(
true);
105 $fs_gui->setTableId(
"htlmfs" . $this->
object->getId());
106 if ($this->
object->getStartFile() !==
"") {
108 (
string) $this->
object->getStartFile(),
109 $this->
lng->txt(
"cont_startfile")
112 $fs_gui->addCommand($this,
"setStartFile", $this->
lng->txt(
"cont_set_start_file"));
114 $this->
ctrl->forwardCommand($fs_gui);
163 case "ilinfoscreengui":
167 case "illearningprogressgui":
168 $ilTabs->activateTab(
'id_learning_progress');
169 $user_id = ($this->lm_request->getUserId() > 0)
170 ? $this->lm_request->getUserId()
174 $this->
object->getRefId(),
177 $this->
ctrl->forwardCommand($new_gui);
180 case 'ilpermissiongui':
181 $ilTabs->activateTab(
'id_permissions');
183 $ret = $this->
ctrl->forwardCommand($perm_gui);
187 $ilTabs->activateTab(
"export");
189 $exp_gui->addFormat(
"xml");
190 $exp_gui->addFormat(
"html",
"", $this,
"exportHTML");
191 $ret = $this->
ctrl->forwardCommand($exp_gui);
194 case "ilcommonactiondispatchergui":
196 $this->
ctrl->forwardCommand($gui);
200 $cmd = $this->
ctrl->getCmd(
"listFiles");
203 strtolower($this->lm_request->getBaseClass()) ===
"iladministrationgui" 207 $ret = $this->$cmd();
232 $this->error->raiseError($this->
lng->txt(
"permission_denied"), $this->error->MESSAGE);
257 $ti->setRequired(
true);
258 $this->
form->addItem($ti);
264 $this->
form->addItem($ta);
270 $this->
form->addItem($cb);
276 if ($startfile !==
"") {
277 $ne->
setValue(basename($startfile));
279 $ne->setValue(basename($this->
lng->txt(
"no_start_file")));
281 $this->
form->addItem($ne);
284 $pres->setTitle($this->
lng->txt(
'obj_presentation'));
285 $this->
form->addItem($pres);
288 $obj_service->commonSettings()->legacyForm($this->
form, $this->
object)->addTileImage();
290 $this->
form->addCommandButton(
"saveProperties",
$lng->
txt(
"save"));
291 $this->
form->addCommandButton(
"toFilesystem",
$lng->
txt(
"cont_set_start_file"));
293 $this->
form->setTitle(
$lng->
txt(
"cont_lm_properties"));
294 $this->
form->setFormAction($ilCtrl->getFormAction($this,
"saveProperties"));
298 $section->setTitle($this->
lng->txt(
'obj_features'));
299 $this->
form->addItem($section);
315 $values[
'cobj_online'] = !$this->
object->getOfflineStatus();
316 if ($startfile !==
"") {
317 $startfile = basename($startfile);
319 $startfile = $this->
lng->txt(
"no_start_file");
322 $values[
"startfile"] = $startfile;
323 $values[
"title"] = $this->
object->getTitle();
324 $values[
"desc"] = $this->
object->getLongDescription();
325 $values[
"cont_show_info_tab"] = $this->
object->isInfoEnabled();
327 $this->
form->setValuesByArray($values);
339 $this->error->raiseError($this->
lng->txt(
"permission_denied"), $this->error->MESSAGE);
347 if ($this->
form->checkInput()) {
348 $this->
object->setTitle($this->
form->getInput(
"title"));
349 $this->
object->setDescription($this->
form->getInput(
"desc"));
350 $this->
object->setOfflineStatus(!(
bool) $this->
form->getInput(
"cobj_online"));
352 $this->
object->update();
355 $obj_service->commonSettings()->legacyForm($this->
form, $this->
object)->saveTileImage();
366 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
367 $this->
ctrl->redirect($this,
"properties");
370 $ilTabs->activateTab(
"id_settings");
371 $this->
form->setValuesByPost();
377 if (!$this->rbac_system->checkAccess(
"visible,write", $this->object->getRefId())) {
395 if (!$new_object->getStartFile()) {
399 if (isset($files[
"file"])) {
401 if (stripos($new_object->
getTitle(),
".zip") !==
false) {
402 $zip_file = strtolower($new_object->
getTitle());
403 $suffix = strrpos($zip_file,
".");
405 $zip_file = substr($zip_file, 0, $suffix);
408 $valid = array(
"index.htm",
"index.html",
"start.htm",
"start.html");
409 foreach ($files[
"file"] as $idx => $file) {
411 if (stripos($file,
".htm") !==
false) {
412 $chk_file = strtolower($file);
413 $suffix = strrpos($chk_file,
".");
415 $chk_file = substr($chk_file, 0, $suffix);
418 if (in_array($file,
$valid) ||
419 ($chk_file && $zip_file && $chk_file == $zip_file)) {
420 $new_object->setStartFile(str_replace($new_object->getDataDirectory() .
"/",
"", $files[
"path"][$idx]) . $file);
429 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
430 $this->
object = $new_object;
442 $this->error->raiseError($this->
lng->txt(
"permission_denied"), $this->error->MESSAGE);
445 $this->
object->setStartFile($a_file);
446 $this->
object->update();
447 $this->
ctrl->redirectByClass(
"ilfilesystemgui",
"listFiles");
452 $this->tpl->loadStandardTemplate();
463 $this->
object->getId(),
464 $this->
object->getRefId(),
473 if ($startfile !==
"") {
483 $this->
ctrl->setCmd(
"showSummary");
484 $this->
ctrl->setCmdClass(
"ilinfoscreengui");
496 $this->
lng->loadLanguageModule(
"meta");
499 $info->enablePrivateNotes();
500 $info->enableLearningProgress();
503 if ($ilAccess->checkAccess(
"write",
"", $this->requested_ref_id)) {
504 $info->enableNewsEditing();
507 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
508 if ($enable_internal_rss) {
509 $info->setBlockProperty(
"news",
"settings",
true);
514 if ($ilAccess->checkAccess(
"read",
"", $this->requested_ref_id)) {
517 $button->setCaption(
"view");
518 $button->setPrimary(
true);
519 $button->setUrl(
"ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=" . $this->
object->getRefId());
520 $button->setTarget(
"ilContObj" . $this->
object->getId());
521 $ilToolbar->addButtonInstance($button);
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
form( $class_path, string $cmd)
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
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)
zips given directory/file into given zip.file
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)