ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 cancelCreationObject ($in_rep=false)
 cancel action and go back to previous page @access public More...
 
 properties ()
 edit properties of object (admin form) More...
 
 initSettingsForm ()
 Init settings form. More...
 
 getSettingsFormValues ()
 Get current values for settings from. More...
 
 toFilesystem ()
 Set start file. More...
 
 saveProperties ()
 Save properties form. More...
 
 editObject ()
 edit properties of object (admin form) More...
 
 edit ()
 edit properties of object (module form) More...
 
 cancel ()
 cancel editing More...
 
 afterSave (ilObject $newObj)
 save object @access public More...
 
 update ()
 update properties More...
 
 setStartFile ($a_file)
 
 perm ()
 permission form More...
 
 frameset ()
 Frameset -> Output list of files. More...
 
 getTemplate ()
 output main header (title and locator) More...
 
 showLearningModule ()
 
 infoScreen ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 showInfoScreen ()
 info screen call from inside learning module More...
 
 outputInfoScreen ($a_standard_locator=true)
 info screen More...
 
 setTabs ()
 output tabs More...
 
 getTabs ()
 adds tabs to tab gui object More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import file. More...
 
 createFromDirectory ($a_dir)
 Create new object from a html zip file. More...
 
 exportHTML ()
 create html package More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 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...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Static Public Member Functions

static _goto ($a_target)
 redirect script More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Data Fields

 $output_prepared
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 initCreationForms ($a_new_type)
 Init creation froms. More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_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 $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $tabs
 
 $rbacsystem
 
 $error
 
 $help
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $rbacsystem
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

@access public

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

54 {
55 global $DIC;
56
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"];
68 $lng = $DIC->language();
69 $ilCtrl = $DIC->ctrl();
70
71 $this->ctrl = $ilCtrl;
72 $this->ctrl->saveParameter($this, array("ref_id"));
73
74 $this->type = "htlm";
75 $lng->loadLanguageModule("content");
76
77 parent::__construct($a_data, $a_id, $a_call_by_reference, false);
78 //$this->actions = $this->objDefinition->getActions("mep");
79 $this->output_prepared = $a_prepare_output;
80 }
user()
Definition: user.php:4
error($a_errmsg)
set error message @access public
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7

References $DIC, $ilCtrl, ilObjectGUI\$lng, error(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjFileBasedLMGUI::_goto (   $a_target)
static

redirect script

Parameters
string$a_target

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

717 {
718 global $DIC;
719
720 $rbacsystem = $DIC->rbac()->system();
721 $ilErr = $DIC["ilErr"];
722 $lng = $DIC->language();
723 $ilAccess = $DIC->access();
724
725 if ($ilAccess->checkAccess("read", "", $a_target) ||
726 $ilAccess->checkAccess("visible", "", $a_target)) {
727 ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
728 } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
730 $lng->txt("msg_no_perm_read_item"),
732 ), true);
734 }
735
736 $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
737 }
sprintf('%.4f', $callTime)
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $DIC, ilObjectGUI\$ilErr, ilObjectGUI\$lng, $rbacsystem, ilObjectGUI\_gotoRepositoryNode(), ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilUtil\sendFailure(), and sprintf.

+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjFileBasedLMGUI::addLocatorItems ( )

should be overwritten to add object specific items (repository items are preloaded)

Reimplemented from ilObjectGUI.

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

740 {
741 $ilLocator = $this->locator;
742
743 if (is_object($this->object)) {
744 $ilLocator->addItem(
745 $this->object->getTitle(),
746 $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"),
747 "",
748 $_GET["ref_id"]
749 );
750 }
751 }
$_GET["client_id"]

References $_GET, and ilObjectGUI\$locator.

◆ afterSave()

ilObjFileBasedLMGUI::afterSave ( ilObject  $newObj)

save object @access public

Reimplemented from ilObjectGUI.

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

420 {
421 if (!$newObj->getStartFile()) {
422 // try to set start file automatically
423 $files = array();
424 include_once "Services/Utilities/classes/class.ilFileUtils.php";
425 ilFileUtils::recursive_dirscan($newObj->getDataDirectory(), $files);
426 if (is_array($files["file"])) {
427 $zip_file = null;
428 if (stristr($newObj->getTitle(), ".zip")) {
429 $zip_file = strtolower($newObj->getTitle());
430 $suffix = strrpos($zip_file, ".");
431 if ($suffix) {
432 $zip_file = substr($zip_file, 0, $suffix);
433 }
434 }
435 $valid = array("index.htm", "index.html", "start.htm", "start.html");
436 foreach ($files["file"] as $idx => $file) {
437 $chk_file = null;
438 if (stristr($file, ".htm")) {
439 $chk_file = strtolower($file);
440 $suffix = strrpos($chk_file, ".");
441 if ($suffix) {
442 $chk_file = substr($chk_file, 0, $suffix);
443 }
444 }
445 if (in_array($file, $valid) ||
446 ($chk_file && $zip_file && $chk_file == $zip_file)) {
447 $newObj->setStartFile(str_replace($newObj->getDataDirectory() . "/", "", $files["path"][$idx]) . $file);
448 $newObj->update();
449 break;
450 }
451 }
452 }
453 }
454
455 // always send a message
456 ilUtil::sendSuccess($this->lng->txt("object_added"), true);
457 ilUtil::redirect("ilias.php?baseClass=ilHTLMEditorGUI&ref_id=" . $newObj->getRefId());
458 }
$files
Definition: add-vimline.php:18
static recursive_dirscan($dir, &$arr)
Recursively scans a given directory and writes path and filename into referenced array.
update()
update object in db
getRefId()
get reference id @access public
getTitle()
get object title @access public
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
$valid
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file

References $file, $files, $valid, ilObject\getRefId(), ilObject\getTitle(), ilFileUtils\recursive_dirscan(), ilUtil\redirect(), ilUtil\sendSuccess(), and ilObject\update().

Referenced by createFromDirectory().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancel()

ilObjFileBasedLMGUI::cancel ( )

cancel editing

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

410 {
411 //$this->setReturnLocation("cancel","fblm_edit.php?cmd=listFiles&ref_id=".$_GET["ref_id"]);
412 $this->cancelObject();
413 }
cancelObject()
cancel action and go back to previous page @access public

References ilObjectGUI\cancelObject().

+ Here is the call graph for this function:

◆ cancelCreationObject()

ilObjFileBasedLMGUI::cancelCreationObject (   $in_rep = false)
final

cancel action and go back to previous page @access public

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

244 {
246
247 $ilCtrl->redirectByClass("ilrepositorygui", "frameset");
248 }

References ilObjectGUI\$ctrl, and $ilCtrl.

◆ createFromDirectory()

ilObjFileBasedLMGUI::createFromDirectory (   $a_dir)

Create new object from a html zip file.

Parameters

return

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

777 {
779
780 if (!$this->checkPermissionBool("create", "", "htlm") || $a_dir == "") {
781 $ilErr->raiseError($this->lng->txt("no_create_permission"));
782 }
783
784 // create instance
785 $newObj = new ilObjFileBasedLM();
786 $filename = ilUtil::stripSlashes($_FILES["importfile"]["name"]);
787 $newObj->setTitle($filename);
788 $newObj->setDescription("");
789 $newObj->create();
790 $newObj->populateByDirectoy($a_dir, $filename);
791 $this->putObjectInTree($newObj);
792
793 $this->afterSave($newObj);
794 }
afterSave(ilObject $newObj)
save object @access public
File Based Learning Module (HTML) object.
putObjectInTree(ilObject $a_obj, $a_parent_node_id=null)
Add object to tree at given position.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $error, $filename, ilObjectGUI\$ilErr, afterSave(), ilObjectGUI\checkPermissionBool(), ilObjectGUI\putObjectInTree(), and ilUtil\stripSlashes().

Referenced by importFileObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ edit()

ilObjFileBasedLMGUI::edit ( )

edit properties of object (module form)

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

401 {
402 $this->prepareOutput();
403 $this->editObject();
404 }
editObject()
edit properties of object (admin form)
prepareOutput($a_show_subobjects=true)
prepare output

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

+ Here is the call graph for this function:

◆ editObject()

ilObjFileBasedLMGUI::editObject ( )

edit properties of object (admin form)

@access public

Reimplemented from ilObjectGUI.

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

388 {
391
392 if (!$rbacsystem->checkAccess("visible,write", $this->object->getRefId())) {
393 $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
394 }
395 }

References $error, ilObjectGUI\$ilErr, and $rbacsystem.

Referenced by edit().

+ Here is the caller graph for this function:

◆ executeCommand()

ilObjFileBasedLMGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

86 {
88 $ilLocator = $this->locator;
89 $ilTabs = $this->tabs;
90
91 $next_class = $this->ctrl->getNextClass($this);
92 $cmd = $this->ctrl->getCmd();
93
94 if (strtolower($_GET["baseClass"]) == "iladministrationgui" ||
95 $this->getCreationMode() == true) {
96 $this->prepareOutput();
97 } else {
98 if (!in_array($cmd, array("", "framset")) || $next_class != "") {
99 $this->getTemplate();
100 $this->setLocator();
101 $this->setTabs();
102 }
103 }
104
105 switch ($next_class) {
106 case 'ilobjectmetadatagui':
107 $this->checkPermission("write");
108 $ilTabs->activateTab('id_meta_data');
109 include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
110 $md_gui = new ilObjectMetaDataGUI($this->object);
111 $this->ctrl->forwardCommand($md_gui);
112 break;
113
114 case "ilfilesystemgui":
115 $this->checkPermission("write");
116 $ilTabs->activateTab('id_list_files');
117 $fs_gui = new ilFileSystemGUI($this->object->getDataDirectory());
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() != "") {
122 $fs_gui->labelFile(
123 $this->object->getStartFile(),
124 $this->lng->txt("cont_startfile")
125 );
126 }
127 $fs_gui->addCommand($this, "setStartFile", $this->lng->txt("cont_set_start_file"));
128
129 $this->ctrl->forwardCommand($fs_gui);
130
131 // try to set start file automatically
132 require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
133 if (!ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId())) {
134 $do_update = false;
135
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"]));
141 if (in_array($file, $valid)) {
142 $this->object->setStartFile($pcommand["name"]);
143 $do_update = $pcommand["name"];
144 }
145 } elseif ($pcommand["cmd"] == "unzip_file") {
146 $zip_file = strtolower(basename($pcommand["name"]));
147 $suffix = strrpos($zip_file, ".");
148 if ($suffix) {
149 $zip_file = substr($zip_file, 0, $suffix);
150 }
151 foreach ($pcommand["added"] as $file) {
152 $chk_file = null;
153 if (stristr($file, ".htm")) {
154 $chk_file = strtolower(basename($file));
155 $suffix = strrpos($chk_file, ".");
156 if ($suffix) {
157 $chk_file = substr($chk_file, 0, $suffix);
158 }
159 }
160 if (in_array(basename($file), $valid) ||
161 ($zip_file && $chk_file && $chk_file == $zip_file)) {
162 $this->object->setStartFile($file);
163 $do_update = $file;
164 break;
165 }
166 }
167 }
168 }
169
170 if ($do_update) {
171 ilUtil::sendInfo(sprintf($this->lng->txt("cont_start_file_set_to"), $do_update), true);
172
173 $this->object->update();
174 $this->ctrl->redirectByClass("ilfilesystemgui", "listFiles");
175 }
176 }
177 break;
178
179 case "ilinfoscreengui":
180 $ret = $this->outputInfoScreen();
181 break;
182
183 case "illearningprogressgui":
184 $ilTabs->activateTab('id_learning_progress');
185 include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
186 $new_gui = new ilLearningProgressGUI(
188 $this->object->getRefId(),
189 $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId()
190 );
191 $this->ctrl->forwardCommand($new_gui);
192 break;
193
194 case 'ilpermissiongui':
195 $ilTabs->activateTab('id_permissions');
196 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
197 $perm_gui = new ilPermissionGUI($this);
198 $ret = $this->ctrl->forwardCommand($perm_gui);
199 break;
200
201 case "ilexportgui":
202 $ilTabs->activateTab("export");
203 include_once("./Services/Export/classes/class.ilExportGUI.php");
204 $exp_gui = new ilExportGUI($this);
205 $exp_gui->addFormat("xml");
206 $exp_gui->addFormat("html", "", $this, "exportHTML");
207 $ret = $this->ctrl->forwardCommand($exp_gui);
208// $this->tpl->show();
209 break;
210
211 case "ilcommonactiondispatchergui":
212 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
214 $this->ctrl->forwardCommand($gui);
215 break;
216
217 default:
218 $cmd = $this->ctrl->getCmd("frameset");
219 if (strtolower($_GET["baseClass"]) == "iladministrationgui" ||
220 $this->getCreationMode() == true) {
221 $cmd.= "Object";
222 }
223 $ret = $this->$cmd();
224 break;
225 }
226
227 $this->addHeaderAction();
228 }
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Export User Interface Class.
File System Explorer GUI class.
Class ilObjUserTrackingGUI.
static _determineStartUrl($a_id)
check wether learning module is online
outputInfoScreen($a_standard_locator=true)
info screen
getTemplate()
output main header (title and locator)
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
getCreationMode()
get creation mode
addHeaderAction()
Add header action menu.
setLocator()
set Locator
Class ilObjectMetaDataGUI.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$ret
Definition: parser.php:6
$ilUser
Definition: imgupload.php:18

References $_GET, $file, $ilUser, ilObjectGUI\$locator, $ret, $tabs, ilObjectGUI\$user, $valid, ilObjFileBasedLMAccess\_determineStartUrl(), ilObjectGUI\addHeaderAction(), ilObjectGUI\checkPermission(), ilObjectGUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), getTemplate(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, outputInfoScreen(), ilObjectGUI\prepareOutput(), ilUtil\sendInfo(), ilObjectGUI\setLocator(), setTabs(), and sprintf.

Referenced by frameset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportHTML()

ilObjFileBasedLMGUI::exportHTML ( )

create html package

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

808 {
809 $inst_id = IL_INST_ID;
810
811 include_once("./Services/Export/classes/class.ilExport.php");
812
814 $this->object->getId(),
815 "html",
816 $this->object->getType()
817 );
818 $export_dir = ilExport::_getExportDirectory(
819 $this->object->getId(),
820 "html",
821 $this->object->getType()
822 );
823
824 $subdir = $this->object->getType() . "_" . $this->object->getId();
825 $filename = $this->subdir . ".zip";
826
827 $target_dir = $export_dir . "/" . $subdir;
828
829 ilUtil::delDir($target_dir);
830 ilUtil::makeDir($target_dir);
831
832 $source_dir = $this->object->getDataDirectory();
833
834 ilUtil::rCopy($source_dir, $target_dir);
835
836 // zip it all
837 $date = time();
838 $zip_file = $export_dir . "/" . $date . "__" . IL_INST_ID . "__" .
839 $this->object->getType() . "_" . $this->object->getId() . ".zip";
840 ilUtil::zip($target_dir, $zip_file);
841
842 ilUtil::delDir($target_dir);
843 }
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="")
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...

References $filename, ilExport\_createExportDirectory(), ilExport\_getExportDirectory(), ilUtil\delDir(), ilUtil\makeDir(), ilUtil\rCopy(), and ilUtil\zip().

+ Here is the call graph for this function:

◆ frameset()

ilObjFileBasedLMGUI::frameset ( )

Frameset -> Output list of files.

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

496 {
498
499 $ilCtrl->setCmdClass("ilfilesystemgui");
500 $ilCtrl->setCmd("listFiles");
501 return $this->executeCommand();
502 }

References ilObjectGUI\$ctrl, $ilCtrl, and executeCommand().

+ Here is the call graph for this function:

◆ getSettingsFormValues()

ilObjFileBasedLMGUI::getSettingsFormValues ( )

Get current values for settings from.

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

323 {
324 require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
325 $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
326
327 $values = array();
328 $values["cobj_online"] = $this->object->getOnline();
329 if ($startfile != "") {
330 $startfile = basename($startfile);
331 } else {
332 $startfile = $this->lng->txt("no_start_file");
333 }
334
335 $values["cobj_online"] = $this->object->getOnline();
336 $values["startfile"] = $startfile;
337 $values["title"] = $this->object->getTitle();
338 $values["desc"] = $this->object->getDescription();
339 //$values["lic"] = $this->object->getShowLicense();
340
341 $this->form->setValuesByArray($values);
342 }

References ilObjFileBasedLMAccess\_determineStartUrl().

Referenced by properties().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTabs()

ilObjFileBasedLMGUI::getTabs ( )

adds tabs to tab gui object

Reimplemented from ilObjectGUI.

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

625 {
627 $ilAccess = $this->access;
628 $ilTabs = $this->tabs;
630 $ilHelp = $this->help;
631
632 $ilHelp->setScreenIdComponent("htlm");
633
634 if ($ilAccess->checkAccess('write', '', $this->ref_id)) {
635 $ilTabs->addTab(
636 "id_list_files",
637 $lng->txt("cont_list_files"),
638 $this->ctrl->getLinkTargetByClass("ilfilesystemgui", "listFiles")
639 );
640 }
641
642 if ($ilAccess->checkAccess('visible', '', $this->ref_id)) {
643 $ilTabs->addTab(
644 "id_info",
645 $lng->txt("info_short"),
646 $this->ctrl->getLinkTargetByClass(array("ilobjfilebasedlmgui", "ilinfoscreengui"), "showSummary")
647 );
648 }
649
650 if ($ilAccess->checkAccess('write', '', $this->ref_id)) {
651 $ilTabs->addTab(
652 "id_settings",
653 $lng->txt("settings"),
654 $this->ctrl->getLinkTarget($this, "properties")
655 );
656 }
657
658 include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
659 if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
660 $ilTabs->addTab(
661 "id_learning_progress",
662 $lng->txt("learning_progress"),
663 $this->ctrl->getLinkTargetByClass(array('ilobjfilebasedlmgui','illearningprogressgui'), '')
664 );
665 }
666
667 if ($ilAccess->checkAccess('write', '', $this->ref_id)) {
668 include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
669 $mdgui = new ilObjectMetaDataGUI($this->object);
670 $mdtab = $mdgui->getTab();
671 if ($mdtab) {
672 $ilTabs->addTab(
673 "id_meta_data",
674 $lng->txt("meta_data"),
675 $mdtab
676 );
677 }
678 }
679
680
681 // export
682 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
683 $ilTabs->addTab(
684 "export",
685 $lng->txt("export"),
686 $this->ctrl->getLinkTargetByClass("ilexportgui", "")
687 );
688 }
689
690 if ($ilAccess->checkAccess('edit_permission', '', $this->object->getRefId())) {
691 $ilTabs->addTab(
692 "id_permissions",
693 $lng->txt("perm_settings"),
694 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm")
695 );
696 }
697
698 require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
699 $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
700
701 if ($startfile != "") {
702 $ilTabs->addNonTabbedLink(
703 "presentation_view",
704 $this->lng->txt("glo_presentation_view"),
705 "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=" . $this->object->getRefID(),
706 "_blank"
707 );
708 }
709 }
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress

References ilObjectGUI\$access, $help, $ilUser, ilObjectGUI\$lng, $tabs, ilObjectGUI\$user, ilObjFileBasedLMAccess\_determineStartUrl(), and ilLearningProgressAccess\checkAccess().

Referenced by setTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTemplate()

ilObjFileBasedLMGUI::getTemplate ( )

output main header (title and locator)

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

508 {
510
511 $this->tpl->getStandardTemplate();
512 }

References ilObjectGUI\$lng.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ importFileObject()

ilObjFileBasedLMGUI::importFileObject (   $parent_id = null,
  $a_catch_errors = true 
)

Import file.

Parameters

return

Reimplemented from ilObjectGUI.

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

761 {
762 try {
763 return parent::importFileObject();
765 // since there is no manifest xml we assume that this is an HTML export file
766 $this->createFromDirectory($e->getTmpDir());
767 }
768 }
manifest.xml file not found-exception for import
createFromDirectory($a_dir)
Create new object from a html zip file.

References createFromDirectory(), and ilManifestFileNotFoundImportException\getTmpDir().

+ Here is the call graph for this function:

◆ infoScreen()

ilObjFileBasedLMGUI::infoScreen ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

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

546 {
547 $this->ctrl->setCmd("showSummary");
548 $this->ctrl->setCmdClass("ilinfoscreengui");
549 $this->outputInfoScreen();
550 }

References outputInfoScreen().

+ Here is the call graph for this function:

◆ initCreationForms()

ilObjFileBasedLMGUI::initCreationForms (   $a_new_type)
protected

Init creation froms.

this will create the default creation forms: new, import, clone

Parameters
string$a_new_type
Returns
array

Reimplemented from ilObjectGUI.

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

231 {
232 $forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
233 self::CFORM_IMPORT => $this->initImportForm($a_new_type));
234
235 return $forms;
236 }
initImportForm($a_new_type)
Init object import form.
initCreateForm($a_new_type)
Init object creation form.

References ilObjectGUI\initCreateForm(), and ilObjectGUI\initImportForm().

+ Here is the call graph for this function:

◆ initSettingsForm()

ilObjFileBasedLMGUI::initSettingsForm ( )

Init settings form.

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

273 {
276 $ilAccess = $this->access;
277
278 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
279 $this->form = new ilPropertyFormGUI();
280
281 // title
282 $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
283 $ti->setSize(min(40, ilObject::TITLE_LENGTH));
284 $ti->setMaxLength(ilObject::TITLE_LENGTH);
285 $ti->setRequired(true);
286 $this->form->addItem($ti);
287
288 // description
289 $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
290 $ta->setCols(40);
291 $ta->setRows(2);
292 $this->form->addItem($ta);
293
294 // online
295 $cb = new ilCheckboxInputGUI($lng->txt("cont_online"), "cobj_online");
296 $cb->setOptionTitle($lng->txt(""));
297 $cb->setValue("y");
298 $this->form->addItem($cb);
299
300 // startfile
301 require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
302 $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
303
304 $ne = new ilNonEditableValueGUI($lng->txt("cont_startfile"), "");
305 if ($startfile != "") {
306 $ne->setValue(basename($startfile));
307 } else {
308 $ne->setValue(basename($this->lng->txt("no_start_file")));
309 }
310 $this->form->addItem($ne);
311
312 $this->form->addCommandButton("saveProperties", $lng->txt("save"));
313 $this->form->addCommandButton("toFilesystem", $lng->txt("cont_set_start_file"));
314
315 $this->form->setTitle($lng->txt("cont_lm_properties"));
316 $this->form->setFormAction($ilCtrl->getFormAction($this, "saveProperties"));
317 }
This class represents a checkbox property in a property form.
This class represents a non editable value in a property form.
const TITLE_LENGTH
max length of object title
This class represents a property form user interface.
This class represents a text area property in a property form.
This class represents a text property in a property form.

References ilObjectGUI\$access, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, ilObjFileBasedLMAccess\_determineStartUrl(), and ilObject\TITLE_LENGTH.

Referenced by properties(), and saveProperties().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outputInfoScreen()

ilObjFileBasedLMGUI::outputInfoScreen (   $a_standard_locator = true)

info screen

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

564 {
565 $ilToolbar = $this->toolbar;
566 $ilAccess = $this->access;
567 $ilTabs = $this->tabs;
568
569 $ilTabs->activateTab('id_info');
570
571 $this->lng->loadLanguageModule("meta");
572 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
573
574 $info = new ilInfoScreenGUI($this);
575 $info->enablePrivateNotes();
576 $info->enableLearningProgress();
577
578 $info->enableNews();
579 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
580 $info->enableNewsEditing();
581
582 $news_set = new ilSetting("news");
583 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
584 if ($enable_internal_rss) {
585 $info->setBlockProperty("news", "settings", true);
586 }
587 }
588
589 // add read / back button
590 if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
591 // #15127
592 include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
593 $button = ilLinkButton::getInstance();
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);
599 }
600
601 // show standard meta data section
602 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
603
604 // forward the command
605 $this->ctrl->forwardCommand($info);
606 }
Class ilInfoScreenGUI.
static getInstance()
Factory.
ILIAS Setting Class.
$info
Definition: index.php:5

References $_GET, ilObjectGUI\$access, $info, $tabs, ilObjectGUI\$toolbar, and ilLinkButton\getInstance().

Referenced by executeCommand(), infoScreen(), and showInfoScreen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ perm()

ilObjFileBasedLMGUI::perm ( )

permission form

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

483 {
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");
488 $this->permObject();
489 }
setFormAction($a_cmd, $a_formaction)
set specific form action for command

References $_GET, and ilObjectGUI\setFormAction().

+ Here is the call graph for this function:

◆ properties()

ilObjFileBasedLMGUI::properties ( )

edit properties of object (admin form)

@access public

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

256 {
260 $ilTabs = $this->tabs;
261
262 $ilTabs->activateTab("id_settings");
263
264 $this->initSettingsForm();
265 $this->getSettingsFormValues();
266 $tpl->setContent($this->form->getHTML());
267 }
initSettingsForm()
Init settings form.
getSettingsFormValues()
Get current values for settings from.

References $rbacsystem, $tabs, ilObjectGUI\$tpl, ilObjectGUI\$tree, getSettingsFormValues(), and initSettingsForm().

+ Here is the call graph for this function:

◆ saveProperties()

ilObjFileBasedLMGUI::saveProperties ( )

Save properties form.

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

361 {
363 $ilAccess = $this->access;
364 $ilTabs = $this->tabs;
365
366 $this->initSettingsForm("");
367 if ($this->form->checkInput()) {
368 $this->object->setTitle($this->form->getInput("title"));
369 $this->object->setDescription($this->form->getInput("desc"));
370 $this->object->setOnline(ilUtil::yn2tf($_POST["cobj_online"]));
371
372 $this->object->update();
373 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
374 $this->ctrl->redirect($this, "properties");
375 }
376
377 $ilTabs->activateTab("id_settings");
378 $this->form->setValuesByPost();
379 $tpl->setContent($this->form->getHtml());
380 }
$_POST["username"]
static yn2tf($a_yn)
convert "y"/"n" to true/false

References $_POST, ilObjectGUI\$access, $tabs, ilObjectGUI\$tpl, initSettingsForm(), ilUtil\sendSuccess(), and ilUtil\yn2tf().

+ Here is the call graph for this function:

◆ setStartFile()

ilObjFileBasedLMGUI::setStartFile (   $a_file)

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

473 {
474 $this->object->setStartFile($a_file);
475 $this->object->update();
476 $this->ctrl->redirectByClass("ilfilesystemgui", "listFiles");
477 }

◆ setTabs()

ilObjFileBasedLMGUI::setTabs ( )

output tabs

Reimplemented from ilObjectGUI.

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

614 {
615 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
616
617 $this->getTabs();
618 $this->tpl->setTitle($this->object->getTitle());
619 }
getTabs()
adds tabs to tab gui object
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References ilUtil\getImagePath(), and getTabs().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showInfoScreen()

ilObjFileBasedLMGUI::showInfoScreen ( )

info screen call from inside learning module

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

556 {
557 $this->outputInfoScreen(true);
558 }

References outputInfoScreen().

+ Here is the call graph for this function:

◆ showLearningModule()

ilObjFileBasedLMGUI::showLearningModule ( )

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

515 {
517
518 // #9483
519 if ($ilUser->getId() != ANONYMOUS_USER_ID) {
520 include_once "Services/Tracking/classes/class.ilLearningProgress.php";
522 $ilUser->getId(),
523 $this->object->getId(),
524 $this->object->getRefId(),
525 "htlm"
526 );
527 }
528
529 require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
530 require_once('./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
531
532 $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
534 if ($startfile != "") {
535 ilUtil::redirect($startfile);
536 }
537 }
static _tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type='')
static signFolderOfStartFile($start_file_path)

References $ilUser, ilObjectGUI\$user, ilObjFileBasedLMAccess\_determineStartUrl(), ilLearningProgress\_tracProgress(), ilUtil\redirect(), and ilWACSignedPath\signFolderOfStartFile().

+ Here is the call graph for this function:

◆ toFilesystem()

ilObjFileBasedLMGUI::toFilesystem ( )

Set start file.

Parameters

return

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

351 {
353
354 $ilCtrl->redirectByClass("ilfilesystemgui", "listFiles");
355 }

References ilObjectGUI\$ctrl, and $ilCtrl.

◆ update()

ilObjFileBasedLMGUI::update ( )

update properties

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

465 {
466 //$this->setReturnLocation("update", "fblm_edit.php?cmd=listFiles&ref_id=".$_GET["ref_id"].
467 // "&obj_id=".$_GET["obj_id"]);
468 $this->updateObject();
469 }
updateObject()
updates object entry in object_data

References ilObjectGUI\updateObject().

+ Here is the call graph for this function:

Field Documentation

◆ $error

ilObjFileBasedLMGUI::$error
protected

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

Referenced by createFromDirectory(), and editObject().

◆ $help

ilObjFileBasedLMGUI::$help
protected

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

Referenced by getTabs().

◆ $output_prepared

ilObjFileBasedLMGUI::$output_prepared

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

◆ $rbacsystem

ilObjFileBasedLMGUI::$rbacsystem
protected

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

Referenced by _goto(), editObject(), and properties().

◆ $tabs

ilObjFileBasedLMGUI::$tabs
protected

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