ILIAS  trunk Revision v11.0_alpha-1846-g895b5f47236
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjFileBasedLMGUI Class Reference

User Interface class for file based learning modules (HTML) More...

+ Inheritance diagram for ilObjFileBasedLMGUI:
+ Collaboration diagram for ilObjFileBasedLMGUI:

Public Member Functions

 __construct ( $a_data, int $a_id=0, bool $a_call_by_reference=true, bool $a_prepare_output=true)
 
 executeCommand ()
 
 cancelCreationObject ()
 
 properties ()
 
 initSettingsForm ()
 
 getSettingsFormValues ()
 
 toFilesystem ()
 
 saveProperties ()
 
 editObject ()
 
 edit ()
 
 cancel ()
 
 update ()
 
 setStartFile ()
 
 infoScreen ()
 this one is called from the info button in the repository More...
 
 showInfoScreen ()
 
 createFromDirectory (string $a_dir)
 
 exportHTML ()
 
 redirectAfterCreation ()
 
 learningProgress ()
 
 redrawHeaderAction ()
 
- Public Member Functions inherited from ilObjectGUI
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _goto (string $a_target)
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Data Fields

const CMD_LIST_FILES = "listFiles"
 
bool $output_prepared
 
- Data Fields inherited from ilObjectGUI
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

Protected Member Functions

 afterSave (ilObject $new_object)
 
 setTabs ()
 
 getTabs ()
 
 addLocatorItems ()
 
 importFileObject (?int $parent_id=null)
 
 afterImport (ilObject $new_object)
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Protected Attributes

ILIAS HTMLLearningModule InternalGUIService $gui
 
StandardGUIRequest $lm_request
 
ilPropertyFormGUI $form
 
ilTabsGUI $tabs
 
ilHelpGUI $help
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Private Member Functions

 listFiles ()
 

Private Attributes

const PARAM_PATH = "path"
 
ILIAS ResourceStorage Services $irss
 
ILIAS HTTP Services $http
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjFileBasedLMGUI::__construct (   $a_data,
int  $a_id = 0,
bool  $a_call_by_reference = true,
bool  $a_prepare_output = true 
)

Definition at line 46 of file class.ilObjFileBasedLMGUI.php.

References $DIC, ilObjectGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ILIAS\Repository\locator(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

51  {
52  global $DIC;
53 
54  $this->irss = $DIC->resourceStorage();
55  $this->lng = $DIC->language();
56  $this->user = $DIC->user();
57  $this->locator = $DIC["ilLocator"];
58  $this->tabs = $DIC->tabs();
59  $this->tree = $DIC->repositoryTree();
60  $this->tpl = $DIC["tpl"];
61  $this->access = $DIC->access();
62  $this->toolbar = $DIC->toolbar();
63  $this->help = $DIC["ilHelp"];
64  $this->http = $DIC->http();
65  $lng = $DIC->language();
66  $ilCtrl = $DIC->ctrl();
67 
68  $this->ctrl = $ilCtrl;
69  $this->ctrl->saveParameter($this, array("ref_id"));
70 
71  $this->lm_request = $DIC->htmlLearningModule()
72  ->internal()
73  ->gui()
74  ->standardRequest();
75 
76  $this->type = "htlm";
77  $lng->loadLanguageModule("content");
78  $lng->loadLanguageModule("obj");
79 
80  parent::__construct($a_data, $a_id, $a_call_by_reference, false);
81  $this->output_prepared = $a_prepare_output;
82  $this->gui = $DIC->htmlLearningModule()->internal()->gui();
83  }
loadLanguageModule(string $a_module)
Load language module.
ilLanguage $lng
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjFileBasedLMGUI::_goto ( string  $a_target)
static

Definition at line 569 of file class.ilObjFileBasedLMGUI.php.

References ilObjectGUI\$access, $DIC, ilObjectGUI\$lng, ilObjectGUI\_gotoRepositoryNode(), ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilRBACAccessHandler\checkAccess(), ROOT_FOLDER_ID, and ilLanguage\txt().

Referenced by ILIAS\StaticURL\Handler\LegacyGotoHandler\handle().

569  : void
570  {
571  global $DIC;
572  $main_tpl = $DIC->ui()->mainTemplate();
573 
574  $lng = $DIC->language();
575  $access = $DIC->access();
576 
577  if ($access->checkAccess("read", "", $a_target) ||
578  $access->checkAccess("visible", "", $a_target)) {
579  ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
580  } elseif ($access->checkAccess("read", "", ROOT_FOLDER_ID)) {
581  $main_tpl->setOnScreenMessage(
582  'failure',
583  sprintf(
584  $lng->txt("msg_no_perm_read_item"),
586  ),
587  true
588  );
590  }
591 
592  throw new ilPermissionException($lng->txt("msg_no_perm_read_lm"));
593  }
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...
const ROOT_FOLDER_ID
Definition: constants.php:32
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance) ...
static _gotoRepositoryNode(int $ref_id, string $cmd="")
static _lookupObjId(int $ref_id)
ilLanguage $lng
static _lookupTitle(int $obj_id)
global $DIC
Definition: shib_login.php:22
ilAccessHandler $access
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addLocatorItems()

ilObjFileBasedLMGUI::addLocatorItems ( )
protected

Definition at line 595 of file class.ilObjFileBasedLMGUI.php.

References ilObjectGUI\$locator, ilObjectGUI\$requested_ref_id, ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

595  : void
596  {
597  $ilLocator = $this->locator;
598 
599  if (is_object($this->object)) {
600  $ilLocator->addItem(
601  $this->object->getTitle(),
602  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"),
603  "",
605  );
606  }
607  }
ilLocatorGUI $locator
+ Here is the call graph for this function:

◆ afterImport()

ilObjFileBasedLMGUI::afterImport ( ilObject  $new_object)
protected

Definition at line 636 of file class.ilObjFileBasedLMGUI.php.

References ILIAS\Repository\ctrl(), ilObject\getRefId(), and ILIAS\Repository\lng().

636  : void
637  {
638  $this->ctrl->setParameter($this, "ref_id", $new_object->getRefId());
639  $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
640  $this->ctrl->redirect($this, "properties");
641  }
+ Here is the call graph for this function:

◆ afterSave()

ilObjFileBasedLMGUI::afterSave ( ilObject  $new_object)
protected

Definition at line 352 of file class.ilObjFileBasedLMGUI.php.

References ILIAS\Repository\lng(), and redirectAfterCreation().

Referenced by createFromDirectory().

352  : void
353  {
354  if (!$new_object->getStartFile()) {
355  $new_object->maybeDetermineStartFile();
356  }
357 
358  // always send a message
359  $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
360  $this->object = $new_object;
361  $this->redirectAfterCreation();
362  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancel()

ilObjFileBasedLMGUI::cancel ( )

Definition at line 347 of file class.ilObjFileBasedLMGUI.php.

References ilObjectGUI\cancelObject().

347  : void
348  {
349  $this->cancelObject();
350  }
cancelObject()
cancel action and go back to previous page
+ Here is the call graph for this function:

◆ cancelCreationObject()

ilObjFileBasedLMGUI::cancelCreationObject ( )
final

Definition at line 193 of file class.ilObjFileBasedLMGUI.php.

References ILIAS\Repository\ctrl().

193  : void
194  {
195  $this->ctrl->redirectByClass("ilrepositorygui", "frameset");
196  }
+ Here is the call graph for this function:

◆ createFromDirectory()

ilObjFileBasedLMGUI::createFromDirectory ( string  $a_dir)

Definition at line 643 of file class.ilObjFileBasedLMGUI.php.

References $filename, afterSave(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\lng(), ilObjectGUI\putObjectInTree(), and ilUtil\stripSlashes().

Referenced by importFileObject().

643  : void
644  {
645  if ($a_dir === "" || !$this->checkPermissionBool("create", "", "htlm")) {
646  throw new ilPermissionException($this->lng->txt("no_create_permission"));
647  }
648 
649  // create instance
650  $newObj = new ilObjFileBasedLM();
651  $filename = ilUtil::stripSlashes($_FILES["importfile"]["name"]);
652  $newObj->setTitle($filename);
653  $newObj->setDescription("");
654  $newObj->create();
655  $newObj->populateByDirectoy($a_dir, $filename);
656  $this->putObjectInTree($newObj);
657 
658  $this->afterSave($newObj);
659  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
File Based Learning Module (HTML) object.
afterSave(ilObject $new_object)
putObjectInTree(ilObject $obj, ?int $parent_node_id=null)
Add object to tree at given position.
$filename
Definition: buildRTE.php:78
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ edit()

ilObjFileBasedLMGUI::edit ( )

Definition at line 341 of file class.ilObjFileBasedLMGUI.php.

References editObject(), and ilObjectGUI\prepareOutput().

341  : void
342  {
343  $this->prepareOutput();
344  $this->editObject();
345  }
prepareOutput(bool $show_sub_objects=true)
+ Here is the call graph for this function:

◆ editObject()

ilObjFileBasedLMGUI::editObject ( )

Definition at line 334 of file class.ilObjFileBasedLMGUI.php.

References ILIAS\Repository\lng().

Referenced by edit().

334  : void
335  {
336  if (!$this->rbac_system->checkAccess("visible,write", $this->object->getRefId())) {
337  throw new ilPermissionException($this->lng->txt("permission_denied"));
338  }
339  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjFileBasedLMGUI::executeCommand ( )

Definition at line 85 of file class.ilObjFileBasedLMGUI.php.

References $user_id, ILIAS\Repository\access(), ilObjectGUI\addHeaderAction(), ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ILIAS\components\ResourceStorage\Container\View\DATA_TABLE, ilObjectGUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ILIAS\Repository\lng(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, ILIAS\Repository\object(), ilObjectGUI\prepareOutput(), ilObjectGUI\setLocator(), setTabs(), showInfoScreen(), ILIAS\Repository\tabs(), ILIAS\Repository\user(), and ILIAS\components\ResourceStorage\Container\View\Configuration\withExternalAction().

85  : void
86  {
87  $next_class = $this->ctrl->getNextClass($this);
88  $cmd = $this->ctrl->getCmd();
89 
90  if (
91  $this->getCreationMode() === true ||
92  strtolower($this->lm_request->getBaseClass()) === "iladministrationgui"
93  ) {
94  $this->prepareOutput();
95  } elseif (!in_array($cmd, array("", "framset")) || $next_class != "") {
96  $this->tpl->loadStandardTemplate();
97  $this->setLocator();
98  $this->setTabs();
99  }
100 
101  switch ($next_class) {
102  case strtolower(ilContainerResourceGUI::class):
103  $this->tabs->activateTab('id_list_files');
104  // Check wite access to determine upload and manage capabilities
105  $check_access = $this->access->checkAccess('write', '', $this->object->getRefId());
106 
107  // Build the view configuration
108  $view_configuration = new Configuration(
109  $this->object->getResource(),
110  new ilHTLMStakeholder(),
111  $this->lng->txt('files'),
113  250,
114  $check_access,
115  $check_access
116  );
117 
118  // Add a single action for text-files to set as startfile
119  $view_configuration = $view_configuration->withExternalAction(
120  $this->lng->txt('cont_set_start_file'),
121  self::class,
122  'setStartFile',
123  'lm',
124  self::PARAM_PATH,
125  false,
126  ['text/*']
127  );
128 
129  // build the collection GUI
130  $container_gui = new ilContainerResourceGUI(
131  $view_configuration
132  );
133 
134  // forward the command
135  $this->ctrl->forwardCommand($container_gui);
136  break;
137  case 'ilobjectmetadatagui':
138  $this->checkPermission("write");
139  $this->tabs->activateTab('id_meta_data');
140  $md_gui = new ilObjectMetaDataGUI($this->object);
141  $this->ctrl->forwardCommand($md_gui);
142  break;
143 
144  case "ilinfoscreengui":
145  $this->showInfoScreen();
146  break;
147 
148  case "illearningprogressgui":
149  $this->tabs->activateTab('id_learning_progress');
150  $user_id = ($this->lm_request->getUserId() > 0)
151  ? $this->lm_request->getUserId()
152  : $this->user->getId();
153  $new_gui = new ilLearningProgressGUI(
155  $this->object->getRefId(),
156  $user_id
157  );
158  $this->ctrl->forwardCommand($new_gui);
159  break;
160 
161  case 'ilpermissiongui':
162  $this->tabs->activateTab('id_permissions');
163  $perm_gui = new ilPermissionGUI($this);
164  $ret = $this->ctrl->forwardCommand($perm_gui);
165  break;
166 
167  case "ilexportgui":
168  $this->tabs->activateTab("export");
169  $exp_gui = new ilExportGUI($this);
170  $ret = $this->ctrl->forwardCommand($exp_gui);
171  break;
172 
173  case "ilcommonactiondispatchergui":
175  $this->ctrl->forwardCommand($gui);
176  break;
177 
178  default:
179  $cmd = $this->ctrl->getCmd(self::CMD_LIST_FILES);
180  if (
181  $this->getCreationMode() === true ||
182  strtolower($this->lm_request->getBaseClass()) === "iladministrationgui"
183  ) {
184  $cmd .= "Object";
185  }
186  $ret = $this->$cmd();
187  break;
188  }
189 
190  $this->addHeaderAction();
191  }
Class ilObjectMetaDataGUI.
prepareOutput(bool $show_sub_objects=true)
withExternalAction(string $label, string $target_gui, string $target_cmd, string $parameter_namespace, string $path_parameter='path', bool $supports_directories=false, array $supported_mime_types=[' *'])
ILIAS HTMLLearningModule InternalGUIService $gui
addHeaderAction()
Add header action menu.
Class ilObjUserTrackingGUI.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ exportHTML()

ilObjFileBasedLMGUI::exportHTML ( )

Definition at line 666 of file class.ilObjFileBasedLMGUI.php.

References ilExport\_createExportDirectory(), ilExport\_getExportDirectory(), ilFileUtils\delDir(), IL_INST_ID, ilFileUtils\makeDir(), ILIAS\Repository\object(), ilFileUtils\rCopy(), and ilFileUtils\zip().

666  : void
667  {
669  $this->object->getId(),
670  "html",
671  $this->object->getType()
672  );
673  $export_dir = ilExport::_getExportDirectory(
674  $this->object->getId(),
675  "html",
676  $this->object->getType()
677  );
678 
679  $subdir = $this->object->getType() . "_" . $this->object->getId();
680 
681  $target_dir = $export_dir . "/" . $subdir;
682 
683  ilFileUtils::delDir($target_dir);
684  ilFileUtils::makeDir($target_dir);
685 
686  $source_dir = $this->object->getDataDirectory();
687 
688  ilFileUtils::rCopy($source_dir, $target_dir);
689 
690  // zip it all
691  $date = time();
692  $zip_file = $export_dir . "/" . $date . "__" . IL_INST_ID . "__" .
693  $this->object->getType() . "_" . $this->object->getId() . ".zip";
694  ilFileUtils::zip($target_dir, $zip_file);
695 
696  ilFileUtils::delDir($target_dir);
697  }
const IL_INST_ID
Definition: constants.php:40
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static _getExportDirectory(int $a_obj_id, string $a_type="xml", string $a_obj_type="", string $a_entity="")
Get export directory for an repository object
static _createExportDirectory(int $a_obj_id, string $a_export_type="xml", string $a_obj_type="")
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static zip(string $a_dir, string $a_file, bool $compress_content=false)
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
+ Here is the call graph for this function:

◆ getSettingsFormValues()

ilObjFileBasedLMGUI::getSettingsFormValues ( )

Definition at line 270 of file class.ilObjFileBasedLMGUI.php.

References ilObjFileBasedLMAccess\_determineStartUrl(), ILIAS\Repository\form(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by properties().

270  : void
271  {
272  $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
273 
274  $values = array();
275  $values['cobj_online'] = !$this->object->getOfflineStatus();
276  if ($startfile !== "") {
277  $startfile = basename($startfile);
278  } else {
279  $startfile = $this->lng->txt("no_start_file");
280  }
281 
282  $values["startfile"] = $startfile;
283  $values["title"] = $this->object->getTitle();
284  $values["desc"] = $this->object->getLongDescription();
285  $values["cont_show_info_tab"] = $this->object->isInfoEnabled();
286 
287  $this->form->setValuesByArray($values);
288  }
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTabs()

ilObjFileBasedLMGUI::getTabs ( )
protected

Definition at line 486 of file class.ilObjFileBasedLMGUI.php.

References ilObjectGUI\$access, $help, ilObjectGUI\$lng, $tabs, ilObjFileBasedLMAccess\_determineStartUrl(), ILIAS\Repository\access(), ilLearningProgressAccess\checkAccess(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilHelpGUI\setScreenIdComponent(), ILIAS\Repository\tabs(), and ilLanguage\txt().

Referenced by setTabs().

486  : void
487  {
488  $this->access = $this->access;
489  $this->tabs = $this->tabs;
490  $lng = $this->lng;
491  $ilHelp = $this->help;
492 
493  $ilHelp->setScreenIdComponent("htlm");
494 
495  if ($this->access->checkAccess('write', '', $this->ref_id)) {
496  // Depending on whether the module has already been migrated to the IRSS, we add a tab to
497  // ilContainerResourceGUI or internally. internally, it is only indicated that the files cannot be edited.
498  $this->tabs->addTab(
499  "id_list_files",
500  $lng->txt("cont_list_files"),
501  $this->ctrl->getLinkTarget($this, self::CMD_LIST_FILES)
502  );
503  }
504 
505  if ($this->access->checkAccess('visible', '', $this->ref_id) && $this->object->isInfoEnabled()) {
506  $this->tabs->addTab(
507  "id_info",
508  $lng->txt("info_short"),
509  $this->ctrl->getLinkTargetByClass([self::class, ilInfoScreenGUI::class], "showSummary")
510  );
511  }
512 
513  if ($this->access->checkAccess('write', '', $this->ref_id)) {
514  $this->tabs->addTab(
515  "id_settings",
516  $lng->txt("settings"),
517  $this->ctrl->getLinkTarget($this, "properties")
518  );
519  }
520 
521  if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
522  $this->tabs->addTab(
523  "id_learning_progress",
524  $lng->txt("learning_progress"),
525  $this->ctrl->getLinkTargetByClass([self::class, ilLearningProgressGUI::class], '')
526  );
527  }
528 
529  if ($this->access->checkAccess('write', '', $this->ref_id)) {
530  $mdgui = new ilObjectMetaDataGUI($this->object);
531  $mdtab = $mdgui->getTab();
532  if ($mdtab) {
533  $this->tabs->addTab(
534  "id_meta_data",
535  $lng->txt("meta_data"),
536  $mdtab
537  );
538  }
539  }
540 
541  // export
542  if ($this->access->checkAccess("write", "", $this->object->getRefId())) {
543  $this->tabs->addTab(
544  "export",
545  $lng->txt("export"),
546  $this->ctrl->getLinkTargetByClass(ilExportGUI::class, "")
547  );
548  }
549 
550  if ($this->access->checkAccess('edit_permission', '', $this->object->getRefId())) {
551  $this->tabs->addTab(
552  "id_permissions",
553  $lng->txt("perm_settings"),
554  $this->ctrl->getLinkTargetByClass([self::class, ilPermissionGUI::class], "perm")
555  );
556  }
557 
558  $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
559  if ($startfile !== "" && $this->access->checkAccess('read', '', $this->ref_id)) {
560  $this->tabs->addNonTabbedLink(
561  "presentation_view",
562  $this->lng->txt("glo_presentation_view"),
563  "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=" . $this->object->getRefId(),
564  "_blank"
565  );
566  }
567  }
Class ilObjectMetaDataGUI.
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...
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
ilLanguage $lng
setScreenIdComponent(string $a_comp)
ilAccessHandler $access
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importFileObject()

ilObjFileBasedLMGUI::importFileObject ( ?int  $parent_id = null)
protected

Definition at line 626 of file class.ilObjFileBasedLMGUI.php.

References Vendor\Package\$e, createFromDirectory(), and ilManifestFileNotFoundImportException\getTmpDir().

626  : void
627  {
628  try {
629  parent::importFileObject();
631  // since there is no manifest xml we assume that this is an HTML export file
632  $this->createFromDirectory($e->getTmpDir());
633  }
634  }
manifest.xml file not found-exception for import
+ Here is the call graph for this function:

◆ infoScreen()

ilObjFileBasedLMGUI::infoScreen ( )

this one is called from the info button in the repository

Definition at line 437 of file class.ilObjFileBasedLMGUI.php.

References ILIAS\Repository\ctrl().

437  : void
438  {
439  $this->ctrl->redirectByClass(ilInfoScreenGUI::class, "showSummary");
440  }
+ Here is the call graph for this function:

◆ initSettingsForm()

ilObjFileBasedLMGUI::initSettingsForm ( )

Definition at line 207 of file class.ilObjFileBasedLMGUI.php.

References $form, ilObjFileBasedLMAccess\_determineStartUrl(), ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ilObjectGUI\getObjectService(), ilObjectServiceSettingsGUI\INFO_TAB_VISIBILITY, ilObjectServiceSettingsGUI\initServiceSettingsForm(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilTextAreaInputGUI\setCols(), and ilObject\TITLE_LENGTH.

Referenced by properties(), and saveProperties().

207  : void
208  {
209  $obj_service = $this->getObjectService();
210 
211  $this->form = new ilPropertyFormGUI();
212 
213  // title
214  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
215  $ti->setSize(min(40, ilObject::TITLE_LENGTH));
216  $ti->setMaxLength(ilObject::TITLE_LENGTH);
217  $ti->setRequired(true);
218  $this->form->addItem($ti);
219 
220  // description
221  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
222  $ta->setCols(40);
223  $ta->setRows(2);
224  $this->form->addItem($ta);
225 
226  // online
227  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_online"), "cobj_online");
228  $cb->setOptionTitle($this->lng->txt(""));
229  $cb->setValue("y");
230  $this->form->addItem($cb);
231 
232  // startfile
233  $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
234 
235  $ne = new ilNonEditableValueGUI($this->lng->txt("cont_startfile"), "");
236  if ($startfile !== "") {
237  $ne->setValue(basename($startfile));
238  } else {
239  $ne->setValue(basename($this->lng->txt("no_start_file")));
240  }
241  $this->form->addItem($ne);
242 
243  $pres = new ilFormSectionHeaderGUI();
244  $pres->setTitle($this->lng->txt('obj_presentation'));
245  $this->form->addItem($pres);
246 
247  // tile image
248  $obj_service->commonSettings()->legacyForm($this->form, $this->object)->addTileImage();
249 
250  $this->form->addCommandButton("saveProperties", $this->lng->txt("save"));
251  $this->form->addCommandButton("toFilesystem", $this->lng->txt("cont_set_start_file"));
252 
253  $this->form->setTitle($this->lng->txt("cont_lm_properties"));
254  $this->form->setFormAction($this->ctrl->getFormAction($this, "saveProperties"));
255 
256  // additional features
257  $section = new ilFormSectionHeaderGUI();
258  $section->setTitle($this->lng->txt('obj_features'));
259  $this->form->addItem($section);
260 
262  $this->object->getId(),
263  $this->form,
264  [
266  ]
267  );
268  }
const TITLE_LENGTH
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
form( $class_path, string $cmd, string $submit_caption="")
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ learningProgress()

ilObjFileBasedLMGUI::learningProgress ( )

Definition at line 706 of file class.ilObjFileBasedLMGUI.php.

References ILIAS\Repository\ctrl().

706  : void
707  {
708  $this->ctrl->redirectByClass("illearningprogressgui", "");
709  }
+ Here is the call graph for this function:

◆ listFiles()

ilObjFileBasedLMGUI::listFiles ( )
private

Definition at line 609 of file class.ilObjFileBasedLMGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), null, ILIAS\Repository\object(), and ILIAS\Repository\tabs().

609  : void
610  {
611  if ($this->object->getResource() !== null) {
612  $this->ctrl->redirectByClass(ilContainerResourceGUI::class);
613  return;
614  }
615  $this->tabs->activateTab("id_list_files");
616 
617  $message_box = $this->gui->ui()->factory()->messageBox()->info(
618  $this->lng->txt("infobox_files_not_migrated")
619  );
620 
621  $this->tpl->setContent(
622  $this->gui->ui()->renderer()->render([$message_box])
623  );
624  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ properties()

ilObjFileBasedLMGUI::properties ( )

Definition at line 198 of file class.ilObjFileBasedLMGUI.php.

References ILIAS\Repository\form(), getSettingsFormValues(), initSettingsForm(), and ILIAS\Repository\tabs().

198  : void
199  {
200  $this->tabs->activateTab("id_settings");
201 
202  $this->initSettingsForm();
203  $this->getSettingsFormValues();
204  $this->tpl->setContent($this->form->getHTML());
205  }
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:

◆ redirectAfterCreation()

ilObjFileBasedLMGUI::redirectAfterCreation ( )

Definition at line 699 of file class.ilObjFileBasedLMGUI.php.

References ilObjectGUI\$ctrl, ILIAS\Repository\object(), ilCtrl\redirectByClass(), and ilCtrl\setParameterByClass().

Referenced by afterSave().

699  : void
700  {
701  $ctrl = $this->ctrl;
702  $ctrl->setParameterByClass("ilObjFileBasedLMGUI", "ref_id", $this->object->getRefId());
703  $ctrl->redirectByClass(["ilrepositorygui", "ilObjFileBasedLMGUI"], "properties");
704  }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redrawHeaderAction()

ilObjFileBasedLMGUI::redrawHeaderAction ( )

Definition at line 711 of file class.ilObjFileBasedLMGUI.php.

References ilObjectGUI\redrawHeaderActionObject().

711  : void
712  {
713  $this->redrawHeaderActionObject();
714  }
redrawHeaderActionObject()
Ajax call: redraw action header only.
+ Here is the call graph for this function:

◆ saveProperties()

ilObjFileBasedLMGUI::saveProperties ( )

Definition at line 301 of file class.ilObjFileBasedLMGUI.php.

References $form, ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ilObjectGUI\getObjectService(), ilObjectServiceSettingsGUI\INFO_TAB_VISIBILITY, initSettingsForm(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ILIAS\Repository\tabs(), and ilObjectServiceSettingsGUI\updateServiceSettingsForm().

301  : void
302  {
303  $obj_service = $this->getObjectService();
304 
305  $this->initSettingsForm();
306  if ($this->form->checkInput()) {
307  $this->object->setTitle($this->form->getInput("title"));
308  $this->object->setDescription($this->form->getInput("desc"));
309  $this->object->setOfflineStatus(!(bool) $this->form->getInput("cobj_online"));
310 
311  $this->object->update();
312 
313  // tile image
314  $obj_service->commonSettings()->legacyForm($this->form, $this->object)->saveTileImage();
315 
316  // services
318  $this->object->getId(),
319  $this->form,
320  array(
322  )
323  );
324 
325  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
326  $this->ctrl->redirect($this, "properties");
327  }
328 
329  $this->tabs->activateTab("id_settings");
330  $this->form->setValuesByPost();
331  $this->tpl->setContent($this->form->getHTML());
332  }
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:

◆ setStartFile()

ilObjFileBasedLMGUI::setStartFile ( )

Definition at line 369 of file class.ilObjFileBasedLMGUI.php.

References Vendor\Package\$e, ilObjFileBasedLMAccess\_determineStartUrl(), ilLearningProgress\_tracProgress(), ilLPStatusWrapper\_updateStatus(), ANONYMOUS_USER_ID, ILIAS\Repository\ctrl(), ILIAS\UI\examples\Layout\Page\Standard\getURI(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), null, ILIAS\Repository\object(), ilUtil\redirect(), ILIAS\Repository\refinery(), ilWACSignedPath\signFolderOfStartFile(), and ILIAS\Repository\user().

369  : void
370  {
371  // try to determine start file from request
372  $start_file = $this->http->wrapper()->query()->has('lm_path')
373  ? $start_file = $this->http->wrapper()->query()->retrieve(
374  'lm_path',
375  $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string())
376  )[0] ?? ''
377  : '';
378  // the ContainerResourceGUI uses e bin2hex/hex2bin serialization of pathes. Due to the internals of
379  // UI\Table\Data it's not possible to have a different handling for the parameter in case of external actions...
380  try {
381  $start_file = hex2bin($start_file);
382  } catch (Throwable $e) {
383  $start_file = '';
384  }
385 
386  if ($start_file === '') {
387  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('cont_no_start_file'), true);
388  } else {
389  $this->object->setStartFile($start_file);
390  $this->object->update();
391  $this->tpl->setOnScreenMessage('success', $this->lng->txt('cont_start_file_set'), true);
392  }
393 
394  $this->ctrl->redirectByClass(ilContainerResourceGUI::class);
395  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ setTabs()

ilObjFileBasedLMGUI::setTabs ( )
protected

Definition at line 480 of file class.ilObjFileBasedLMGUI.php.

References getTabs(), and ilObjectGUI\setTitleAndDescription().

Referenced by executeCommand().

480  : void
481  {
482  $this->getTabs();
483  $this->setTitleAndDescription();
484  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showInfoScreen()

ilObjFileBasedLMGUI::showInfoScreen ( )

Definition at line 442 of file class.ilObjFileBasedLMGUI.php.

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ILIAS\Repository\tabs().

Referenced by executeCommand().

442  : void
443  {
444  $this->tabs->activateTab('id_info');
445 
446  $this->lng->loadLanguageModule("meta");
447 
448  $info = new ilInfoScreenGUI($this);
449  $info->enablePrivateNotes();
450  $info->enableLearningProgress();
451 
452  $info->enableNews();
453  if ($this->access->checkAccess("write", "", $this->requested_ref_id)) {
454  $info->enableNewsEditing();
455 
456  $news_set = new ilSetting("news");
457  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
458  if ($enable_internal_rss) {
459  $info->setBlockProperty("news", "settings", true);
460  }
461  }
462 
463  // add read / back button
464  if ($this->access->checkAccess("read", "", $this->requested_ref_id)) {
465  // #15127
466  $this->gui->link(
467  $this->lng->txt("view"),
468  "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=" . $this->object->getRefId(),
469  true
470  )->primary()->toToolbar();
471  }
472 
473  // show standard meta data section
474  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
475 
476  // forward the command
477  $this->ctrl->forwardCommand($info);
478  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toFilesystem()

ilObjFileBasedLMGUI::toFilesystem ( )

Definition at line 290 of file class.ilObjFileBasedLMGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

290  : void
291  {
292  // If we already have a RID, we can redirect to Container GUI
293  // otherwise we display an message which informs the user that the resource is not yet available
294  if ($this->object->getRID() != "") {
295  $this->ctrl->redirectByClass(ilContainerResourceGUI::class);
296  } else {
297  $this->ctrl->redirectByClass(static::class, "properties");
298  }
299  }
+ Here is the call graph for this function:

◆ update()

ilObjFileBasedLMGUI::update ( )

Definition at line 364 of file class.ilObjFileBasedLMGUI.php.

References ilObjectGUI\updateObject().

364  : void
365  {
366  $this->updateObject();
367  }
updateObject()
updates object entry in object_data
+ Here is the call graph for this function:

Field Documentation

◆ $form

ilPropertyFormGUI ilObjFileBasedLMGUI::$form
protected

Definition at line 41 of file class.ilObjFileBasedLMGUI.php.

Referenced by initSettingsForm(), and saveProperties().

◆ $gui

ILIAS HTMLLearningModule InternalGUIService ilObjFileBasedLMGUI::$gui
protected

Definition at line 39 of file class.ilObjFileBasedLMGUI.php.

◆ $help

ilHelpGUI ilObjFileBasedLMGUI::$help
protected

Definition at line 43 of file class.ilObjFileBasedLMGUI.php.

Referenced by getTabs().

◆ $http

ILIAS HTTP Services ilObjFileBasedLMGUI::$http
private

Definition at line 38 of file class.ilObjFileBasedLMGUI.php.

◆ $irss

ILIAS ResourceStorage Services ilObjFileBasedLMGUI::$irss
private

Definition at line 37 of file class.ilObjFileBasedLMGUI.php.

◆ $lm_request

StandardGUIRequest ilObjFileBasedLMGUI::$lm_request
protected

Definition at line 40 of file class.ilObjFileBasedLMGUI.php.

◆ $output_prepared

bool ilObjFileBasedLMGUI::$output_prepared

Definition at line 44 of file class.ilObjFileBasedLMGUI.php.

◆ $tabs

ilTabsGUI ilObjFileBasedLMGUI::$tabs
protected

Definition at line 42 of file class.ilObjFileBasedLMGUI.php.

Referenced by getTabs().

◆ CMD_LIST_FILES

const ilObjFileBasedLMGUI::CMD_LIST_FILES = "listFiles"

◆ PARAM_PATH

const ilObjFileBasedLMGUI::PARAM_PATH = "path"
private

Definition at line 35 of file class.ilObjFileBasedLMGUI.php.


The documentation for this class was generated from the following file: