ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 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 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 ()
 
 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 public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object 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
 
 $ilias
 
 $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)
 
- 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 public More...
 
 setAdminTabs ()
 set admin tabs 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...
 
 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...
 
 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...
 

Additional Inherited Members

- Protected Attributes inherited from ilObjectGUI
 $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.

public

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

References $ilCtrl, ilObjectGUI\$lng, and array.

34  {
35  global $lng, $ilCtrl;
36 
37  $this->ctrl = $ilCtrl;
38  $this->ctrl->saveParameter($this, array("ref_id"));
39 
40  $this->type = "htlm";
41  $lng->loadLanguageModule("content");
42 
43  parent::__construct($a_data, $a_id, $a_call_by_reference, false);
44  //$this->actions = $this->objDefinition->getActions("mep");
45  $this->output_prepared = $a_prepare_output;
46 
47  }
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.

Member Function Documentation

◆ _goto()

static ilObjFileBasedLMGUI::_goto (   $a_target)
static

redirect script

Parameters
string$a_target

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

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

697  {
698  global $rbacsystem, $ilErr, $lng, $ilAccess;
699 
700  if ($ilAccess->checkAccess("read", "", $a_target) ||
701  $ilAccess->checkAccess("visible", "", $a_target))
702  {
703  ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
704  }
705  else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
706  {
707  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
710  }
711 
712  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
713  }
global $ilErr
Definition: raiseError.php:16
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static _lookupObjId($a_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjFileBasedLMGUI::addLocatorItems ( )

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

References $_GET, and object.

716  {
717  global $ilLocator;
718 
719  if (is_object($this->object))
720  {
721  $ilLocator->addItem($this->object->getTitle(),
722  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"), "", $_GET["ref_id"]);
723  }
724  }
$_GET["client_id"]
Create new PHPExcel object
obj_idprivate

◆ afterSave()

ilObjFileBasedLMGUI::afterSave ( ilObject  $newObj)

save object public

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

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

Referenced by createFromDirectory().

401  {
402  if(!$newObj->getStartFile())
403  {
404  // try to set start file automatically
405  $files = array();
406  include_once "Services/Utilities/classes/class.ilFileUtils.php";
407  ilFileUtils::recursive_dirscan($newObj->getDataDirectory(), $files);
408  if(is_array($files["file"]))
409  {
410  $zip_file = null;
411  if(stristr($newObj->getTitle(), ".zip"))
412  {
413  $zip_file = strtolower($newObj->getTitle());
414  $suffix = strrpos($zip_file, ".");
415  if($suffix)
416  {
417  $zip_file = substr($zip_file, 0, $suffix);
418  }
419  }
420  $valid = array("index.htm", "index.html", "start.htm", "start.html");
421  foreach($files["file"] as $idx => $file)
422  {
423  $chk_file = null;
424  if(stristr($file, ".htm"))
425  {
426  $chk_file = strtolower($file);
427  $suffix = strrpos($chk_file, ".");
428  if($suffix)
429  {
430  $chk_file = substr($chk_file, 0, $suffix);
431  }
432  }
433  if(in_array($file, $valid) ||
434  ($chk_file && $zip_file && $chk_file == $zip_file))
435  {
436  $newObj->setStartFile(str_replace($newObj->getDataDirectory()."/", "", $files["path"][$idx]).$file);
437  $newObj->update();
438  break;
439  }
440  }
441  }
442  }
443 
444  // always send a message
445  ilUtil::sendSuccess($this->lng->txt("object_added"),true);
446  ilUtil::redirect("ilias.php?baseClass=ilHTLMEditorGUI&ref_id=".$newObj->getRefId());
447  }
$files
Definition: add-vimline.php:18
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$valid
getTitle()
get object title public
Create styles array
The data for the language used.
getRefId()
get reference id public
static recursive_dirscan($dir, &$arr)
Recursively scans a given directory and writes path and filename into referenced array.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
update()
update object in db
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancel()

ilObjFileBasedLMGUI::cancel ( )

cancel editing

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

References ilObjectGUI\cancelObject().

391  {
392  //$this->setReturnLocation("cancel","fblm_edit.php?cmd=listFiles&ref_id=".$_GET["ref_id"]);
393  $this->cancelObject();
394  }
cancelObject()
cancel action and go back to previous page public
+ Here is the call graph for this function:

◆ cancelCreationObject()

ilObjFileBasedLMGUI::cancelCreationObject (   $in_rep = false)
final

cancel action and go back to previous page public

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

References $ilCtrl.

224  {
225  global $ilCtrl;
226 
227  $ilCtrl->redirectByClass("ilrepositorygui", "frameset");
228  }
global $ilCtrl
Definition: ilias.php:18

◆ createFromDirectory()

ilObjFileBasedLMGUI::createFromDirectory (   $a_dir)

Create new object from a html zip file.

Parameters

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

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

Referenced by importFileObject().

753  {
754  global $ilErr;
755 
756  if (!$this->checkPermissionBool("create", "", "htlm") || $a_dir == "")
757  {
758  $ilErr->raiseError($this->lng->txt("no_create_permission"));
759  }
760 
761  // create instance
762  $newObj = new ilObjFileBasedLM();
763  $filename = ilUtil::stripSlashes($_FILES["importfile"]["name"]);
764  $newObj->setTitle($filename);
765  $newObj->setDescription("");
766  $newObj->create();
767  $newObj->populateByDirectoy($a_dir, $filename);
768  $this->putObjectInTree($newObj);
769 
770  $this->afterSave($newObj);
771  }
global $ilErr
Definition: raiseError.php:16
File Based Learning Module (HTML) object.
afterSave(ilObject $newObj)
save object public
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
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.
+ 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 381 of file class.ilObjFileBasedLMGUI.php.

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

382  {
383  $this->prepareOutput();
384  $this->editObject();
385  }
editObject()
edit properties of object (admin form)
prepareOutput($a_show_subobjects=true)
prepare output
+ Here is the call graph for this function:

◆ editObject()

ilObjFileBasedLMGUI::editObject ( )

edit properties of object (admin form)

public

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

References ilObjectGUI\$tpl, and ilObjectGUI\$tree.

Referenced by edit().

368  {
369  global $rbacsystem, $tree, $tpl;
370 
371  if (!$rbacsystem->checkAccess("visible,write",$this->object->getRefId()))
372  {
373  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
374  }
375 
376  }
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjFileBasedLMGUI::executeCommand ( )

execute command

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

References $_GET, $cmd, $file, $ilUser, $ret, $valid, ilObjFileBasedLMAccess\_determineStartUrl(), ilFileSystemGUI\activateLabels(), ilObjectGUI\addHeaderAction(), array, ilObjectGUI\checkPermission(), ilObjectGUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), getTemplate(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, object, outputInfoScreen(), ilObjectGUI\prepareOutput(), ilUtil\sendInfo(), ilObjectGUI\setLocator(), and setTabs().

Referenced by frameset().

53  {
54  global $ilUser, $ilLocator, $ilTabs;
55 
56  $next_class = $this->ctrl->getNextClass($this);
57  $cmd = $this->ctrl->getCmd();
58 
59  if (strtolower($_GET["baseClass"]) == "iladministrationgui" ||
60  $this->getCreationMode() == true)
61  {
62  $this->prepareOutput();
63  }
64  else
65  {
66  if (!in_array($cmd, array("", "framset")) || $next_class != "")
67  {
68  $this->getTemplate();
69  $this->setLocator();
70  $this->setTabs();
71  }
72  }
73 
74  switch($next_class)
75  {
76  case 'ilobjectmetadatagui':
77  $this->checkPermission("write");
78  $ilTabs->activateTab('id_meta_data');
79  include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
80  $md_gui = new ilObjectMetaDataGUI($this->object);
81  $this->ctrl->forwardCommand($md_gui);
82  break;
83 
84  case "ilfilesystemgui":
85  $this->checkPermission("write");
86  $ilTabs->activateTab('id_list_files');
87  $fs_gui = new ilFileSystemGUI($this->object->getDataDirectory());
88  $fs_gui->activateLabels(true, $this->lng->txt("cont_purpose"));
89  $fs_gui->setUseUploadDirectory(true);
90  $fs_gui->setTableId("htlmfs".$this->object->getId());
91  if ($this->object->getStartFile() != "")
92  {
93  $fs_gui->labelFile($this->object->getStartFile(),
94  $this->lng->txt("cont_startfile"));
95  }
96  $fs_gui->addCommand($this, "setStartFile", $this->lng->txt("cont_set_start_file"));
97 
98  $this->ctrl->forwardCommand($fs_gui);
99 
100  // try to set start file automatically
101  require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
103  {
104  $do_update = false;
105 
106  $pcommand = $fs_gui->getLastPerformedCommand();
107  if (is_array($pcommand))
108  {
109  $valid = array("index.htm", "index.html", "start.htm", "start.html");
110  if($pcommand["cmd"] == "create_file")
111  {
112  $file = strtolower(basename($pcommand["name"]));
113  if(in_array($file, $valid))
114  {
115  $this->object->setStartFile($pcommand["name"]);
116  $do_update = $pcommand["name"];
117  }
118  }
119  else if($pcommand["cmd"] == "unzip_file")
120  {
121  $zip_file = strtolower(basename($pcommand["name"]));
122  $suffix = strrpos($zip_file, ".");
123  if($suffix)
124  {
125  $zip_file = substr($zip_file, 0, $suffix);
126  }
127  foreach($pcommand["added"] as $file)
128  {
129  $chk_file = null;
130  if(stristr($file, ".htm"))
131  {
132  $chk_file = strtolower(basename($file));
133  $suffix = strrpos($chk_file, ".");
134  if($suffix)
135  {
136  $chk_file = substr($chk_file, 0, $suffix);
137  }
138  }
139  if(in_array(basename($file), $valid) ||
140  ($zip_file && $chk_file && $chk_file == $zip_file))
141  {
142  $this->object->setStartFile($file);
143  $do_update = $file;
144  break;
145  }
146  }
147  }
148  }
149 
150  if($do_update)
151  {
152  ilUtil::sendInfo(sprintf($this->lng->txt("cont_start_file_set_to"), $do_update), true);
153 
154  $this->object->update();
155  $this->ctrl->redirectByClass("ilfilesystemgui", "listFiles");
156  }
157  }
158  break;
159 
160  case "ilinfoscreengui":
161  $ret = $this->outputInfoScreen();
162  break;
163 
164  case "illearningprogressgui":
165  $ilTabs->activateTab('id_learning_progress');
166  include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
168  $this->object->getRefId(),
169  $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId());
170  $this->ctrl->forwardCommand($new_gui);
171  break;
172 
173  case 'ilpermissiongui':
174  $ilTabs->activateTab('id_permissions');
175  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
176  $perm_gui = new ilPermissionGUI($this);
177  $ret = $this->ctrl->forwardCommand($perm_gui);
178  break;
179 
180  case "ilexportgui":
181  $ilTabs->activateTab("export");
182  include_once("./Services/Export/classes/class.ilExportGUI.php");
183  $exp_gui = new ilExportGUI($this);
184  $exp_gui->addFormat("xml");
185  $exp_gui->addFormat("html", "", $this, "exportHTML");
186  $ret = $this->ctrl->forwardCommand($exp_gui);
187 // $this->tpl->show();
188  break;
189 
190  case "ilcommonactiondispatchergui":
191  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
193  $this->ctrl->forwardCommand($gui);
194  break;
195 
196  default:
197  $cmd = $this->ctrl->getCmd("frameset");
198  if (strtolower($_GET["baseClass"]) == "iladministrationgui" ||
199  $this->getCreationMode() == true)
200  {
201  $cmd.= "Object";
202  }
203  $ret = $this->$cmd();
204  break;
205  }
206 
207  $this->addHeaderAction();
208  }
outputInfoScreen($a_standard_locator=true)
info screen
Class ilObjectMetaDataGUI.
getTemplate()
output main header (title and locator)
activateLabels($a_act, $a_label_header)
activate file labels
$_GET["client_id"]
$valid
$cmd
Definition: sahs_server.php:35
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Export User Interface Class.
prepareOutput($a_show_subobjects=true)
prepare output
$ilUser
Definition: imgupload.php:18
static _determineStartUrl($a_id)
check wether learning module is online
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
$ret
Definition: parser.php:6
getCreationMode()
get creation mode
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
File System Explorer GUI class.
addHeaderAction()
Add header action menu.
Class ilObjUserTrackingGUI.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
setLocator()
set Locator
+ 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 784 of file class.ilObjFileBasedLMGUI.php.

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

785  {
786  $inst_id = IL_INST_ID;
787 
788  include_once("./Services/Export/classes/class.ilExport.php");
789 
790  ilExport::_createExportDirectory($this->object->getId(), "html",
791  $this->object->getType());
792  $export_dir = ilExport::_getExportDirectory($this->object->getId(), "html",
793  $this->object->getType());
794 
795  $subdir = $this->object->getType()."_".$this->object->getId();
796  $filename = $this->subdir.".zip";
797 
798  $target_dir = $export_dir."/".$subdir;
799 
800  ilUtil::delDir($target_dir);
801  ilUtil::makeDir($target_dir);
802 
803  $source_dir = $this->object->getDataDirectory();
804 
805  ilUtil::rCopy($source_dir, $target_dir);
806 
807  // zip it all
808  $date = time();
809  $zip_file = $export_dir."/".$date."__".IL_INST_ID."__".
810  $this->object->getType()."_".$this->object->getId().".zip";
811  ilUtil::zip($target_dir, $zip_file);
812 
813  ilUtil::delDir($target_dir);
814  }
static _createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
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 ...
Create new PHPExcel object
obj_idprivate
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:

◆ frameset()

ilObjFileBasedLMGUI::frameset ( )

Frameset -> Output list of files.

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

References $ilCtrl, and executeCommand().

485  {
486  global $ilCtrl;
487 
488  $ilCtrl->setCmdClass("ilfilesystemgui");
489  $ilCtrl->setCmd("listFiles");
490  return $this->executeCommand();
491  }
executeCommand()
execute command
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ getSettingsFormValues()

ilObjFileBasedLMGUI::getSettingsFormValues ( )

Get current values for settings from.

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

References ilObjFileBasedLMAccess\_determineStartUrl(), array, and object.

Referenced by properties().

301  {
302  require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
303  $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
304 
305  $values = array();
306  $values["cobj_online"] = $this->object->getOnline();
307  if ($startfile != "")
308  {
309  $startfile = basename($startfile);
310  }
311  else
312  {
313  $startfile = $this->lng->txt("no_start_file");
314  }
315 
316  $values["cobj_online"] = $this->object->getOnline();
317  $values["startfile"] = $startfile;
318  $values["title"] = $this->object->getTitle();
319  $values["desc"] = $this->object->getDescription();
320  //$values["lic"] = $this->object->getShowLicense();
321 
322  $this->form->setValuesByArray($values);
323  }
static _determineStartUrl($a_id)
check wether learning module is online
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
+ 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

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

References $ilUser, ilObjectGUI\$lng, ilObjFileBasedLMAccess\_determineStartUrl(), array, ilLearningProgressAccess\checkAccess(), and object.

Referenced by setTabs().

613  {
614  global $ilUser, $ilAccess, $ilTabs, $lng, $ilHelp;
615 
616  $ilHelp->setScreenIdComponent("htlm");
617 
618  if($ilAccess->checkAccess('write', '', $this->ref_id))
619  {
620  $ilTabs->addTab("id_list_files",
621  $lng->txt("cont_list_files"),
622  $this->ctrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"));
623  }
624 
625  if($ilAccess->checkAccess('visible', '', $this->ref_id))
626  {
627  $ilTabs->addTab("id_info",
628  $lng->txt("info_short"),
629  $this->ctrl->getLinkTargetByClass(array("ilobjfilebasedlmgui", "ilinfoscreengui"), "showSummary"));
630  }
631 
632  if($ilAccess->checkAccess('write', '', $this->ref_id))
633  {
634  $ilTabs->addTab("id_settings",
635  $lng->txt("settings"),
636  $this->ctrl->getLinkTarget($this, "properties"));
637  }
638 
639  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
640  if(ilLearningProgressAccess::checkAccess($this->object->getRefId()))
641  {
642  $ilTabs->addTab("id_learning_progress",
643  $lng->txt("learning_progress"),
644  $this->ctrl->getLinkTargetByClass(array('ilobjfilebasedlmgui','illearningprogressgui'), ''));
645  }
646 
647  if($ilAccess->checkAccess('write', '', $this->ref_id))
648  {
649  include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
650  $mdgui = new ilObjectMetaDataGUI($this->object);
651  $mdtab = $mdgui->getTab();
652  if($mdtab)
653  {
654  $ilTabs->addTab("id_meta_data",
655  $lng->txt("meta_data"),
656  $mdtab);
657  }
658 
659  }
660 
661 
662  // export
663  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
664  {
665  $ilTabs->addTab("export",
666  $lng->txt("export"),
667  $this->ctrl->getLinkTargetByClass("ilexportgui", ""));
668  }
669 
670  if ($ilAccess->checkAccess('edit_permission', '', $this->object->getRefId()))
671  {
672  $ilTabs->addTab("id_permissions",
673  $lng->txt("perm_settings"),
674  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"));
675  }
676 
677  require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
678  $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
679 
680  if ($startfile != "")
681  {
682  $ilTabs->addNonTabbedLink("presentation_view",
683  $this->lng->txt("glo_presentation_view"),
684  "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=".$this->object->getRefID(),
685  "_blank"
686  );
687  }
688 
689  }
Class ilObjectMetaDataGUI.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
$ilUser
Definition: imgupload.php:18
static _determineStartUrl($a_id)
check wether learning module is online
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
+ 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 496 of file class.ilObjFileBasedLMGUI.php.

References ilObjectGUI\$lng.

Referenced by executeCommand().

497  {
498  global $lng;
499 
500  $this->tpl->getStandardTemplate();
501  }
+ Here is the caller graph for this function:

◆ importFileObject()

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

Import file.

Parameters

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

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

734  {
735  try
736  {
737  return parent::importFileObject();
738  }
740  {
741  // since there is no manifest xml we assume that this is an HTML export file
742  $this->createFromDirectory($e->getTmpDir());
743  }
744  }
manifest.xml file not found-exception for import
createFromDirectory($a_dir)
Create new object from a html zip file.
+ 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 532 of file class.ilObjFileBasedLMGUI.php.

References outputInfoScreen().

533  {
534  $this->ctrl->setCmd("showSummary");
535  $this->ctrl->setCmdClass("ilinfoscreengui");
536  $this->outputInfoScreen();
537  }
outputInfoScreen($a_standard_locator=true)
info screen
+ Here is the call graph for this function:

◆ initCreationForms()

ilObjFileBasedLMGUI::initCreationForms (   $a_new_type)
protected

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

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

211  {
212  $forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
213  self::CFORM_IMPORT => $this->initImportForm($a_new_type));
214 
215  return $forms;
216  }
initImportForm($a_new_type)
Init object import form.
initCreateForm($a_new_type)
Init object creation form.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ initSettingsForm()

ilObjFileBasedLMGUI::initSettingsForm ( )

Init settings form.

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

References $ilCtrl, ilObjectGUI\$lng, ilObjFileBasedLMAccess\_determineStartUrl(), object, ilTextAreaInputGUI\setCols(), ilCheckboxInputGUI\setOptionTitle(), ilTextInputGUI\setSize(), ilNonEditableValueGUI\setValue(), and ilObject\TITLE_LENGTH.

Referenced by properties(), and saveProperties().

250  {
251  global $lng, $ilCtrl, $ilAccess;
252 
253  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
254  $this->form = new ilPropertyFormGUI();
255 
256  // title
257  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
258  $ti->setSize(min(40, ilObject::TITLE_LENGTH));
259  $ti->setMaxLength(ilObject::TITLE_LENGTH);
260  $ti->setRequired(true);
261  $this->form->addItem($ti);
262 
263  // description
264  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
265  $ta->setCols(40);
266  $ta->setRows(2);
267  $this->form->addItem($ta);
268 
269  // online
270  $cb = new ilCheckboxInputGUI($lng->txt("cont_online"), "cobj_online");
271  $cb->setOptionTitle($lng->txt(""));
272  $cb->setValue("y");
273  $this->form->addItem($cb);
274 
275  // startfile
276  require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
277  $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
278 
279  $ne = new ilNonEditableValueGUI($lng->txt("cont_startfile"), "");
280  if ($startfile != "")
281  {
282  $ne->setValue(basename($startfile));
283  }
284  else
285  {
286  $ne->setValue(basename($this->lng->txt("no_start_file")));
287  }
288  $this->form->addItem($ne);
289 
290  $this->form->addCommandButton("saveProperties", $lng->txt("save"));
291  $this->form->addCommandButton("toFilesystem", $lng->txt("cont_set_start_file"));
292 
293  $this->form->setTitle($lng->txt("cont_lm_properties"));
294  $this->form->setFormAction($ilCtrl->getFormAction($this, "saveProperties"));
295  }
This class represents a property form user interface.
const TITLE_LENGTH
max length of object title
This class represents a checkbox property in a property form.
global $ilCtrl
Definition: ilias.php:18
setSize($a_size)
Set Size.
This class represents a text property in a property form.
static _determineStartUrl($a_id)
check wether learning module is online
This class represents a non editable value in a property form.
Create new PHPExcel object
obj_idprivate
This class represents a text area property in a property form.
setOptionTitle($a_optiontitle)
Set Option Title (optional).
+ 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 550 of file class.ilObjFileBasedLMGUI.php.

References $_GET, $info, ilLinkButton\getInstance(), and object.

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

551  {
552  global $ilToolbar, $ilAccess, $ilTabs;
553 
554  $ilTabs->activateTab('id_info');
555 
556  $this->lng->loadLanguageModule("meta");
557  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
558 
559  $info = new ilInfoScreenGUI($this);
560  $info->enablePrivateNotes();
561  $info->enableLearningProgress();
562 
563  $info->enableNews();
564  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
565  {
566  $info->enableNewsEditing();
567 
568  $news_set = new ilSetting("news");
569  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
570  if ($enable_internal_rss)
571  {
572  $info->setBlockProperty("news", "settings", true);
573  }
574  }
575 
576  // add read / back button
577  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
578  {
579  // #15127
580  include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
581  $button = ilLinkButton::getInstance();
582  $button->setCaption("view");
583  $button->setPrimary(true);
584  $button->setUrl("ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=".$this->object->getRefID());
585  $button->setTarget("ilContObj".$this->object->getId());
586  $ilToolbar->addButtonInstance($button);
587  }
588 
589  // show standard meta data section
590  $info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
591 
592  // forward the command
593  $this->ctrl->forwardCommand($info);
594  }
ILIAS Setting Class.
Class ilInfoScreenGUI.
$_GET["client_id"]
$info
Definition: example_052.php:80
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ perm()

ilObjFileBasedLMGUI::perm ( )

permission form

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

References $_GET, and ilObjectGUI\setFormAction().

472  {
473  $this->setFormAction("permSave", "fblm_edit.php?cmd=permSave&ref_id=".$_GET["ref_id"].
474  "&obj_id=".$_GET["obj_id"]);
475  $this->setFormAction("addRole", "fblm_edit.php?ref_id=".$_GET["ref_id"].
476  "&obj_id=".$_GET["obj_id"]."&cmd=addRole");
477  $this->permObject();
478  }
$_GET["client_id"]
setFormAction($a_cmd, $a_formaction)
set specific form action for command
+ Here is the call graph for this function:

◆ properties()

ilObjFileBasedLMGUI::properties ( )

edit properties of object (admin form)

public

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

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

236  {
237  global $rbacsystem, $tree, $tpl, $ilTabs;
238 
239  $ilTabs->activateTab("id_settings");
240 
241  $this->initSettingsForm();
242  $this->getSettingsFormValues();
243  $tpl->setContent($this->form->getHTML());
244  }
getSettingsFormValues()
Get current values for settings from.
initSettingsForm()
Init settings form.
+ Here is the call graph for this function:

◆ saveProperties()

ilObjFileBasedLMGUI::saveProperties ( )

Save properties form.

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

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

342  {
343  global $tpl, $ilAccess, $ilTabs;
344 
345  $this->initSettingsForm("");
346  if ($this->form->checkInput())
347  {
348  $this->object->setTitle($this->form->getInput("title"));
349  $this->object->setDescription($this->form->getInput("desc"));
350  $this->object->setOnline(ilUtil::yn2tf($_POST["cobj_online"]));
351 
352  $this->object->update();
353  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
354  $this->ctrl->redirect($this, "properties");
355  }
356 
357  $ilTabs->activateTab("id_settings");
358  $this->form->setValuesByPost();
359  $tpl->setContent($this->form->getHtml());
360  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
initSettingsForm()
Init settings form.
static yn2tf($a_yn)
convert "y"/"n" to true/false
$_POST["username"]
+ Here is the call graph for this function:

◆ setStartFile()

ilObjFileBasedLMGUI::setStartFile (   $a_file)

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

462  {
463  $this->object->setStartFile($a_file);
464  $this->object->update();
465  $this->ctrl->redirectByClass("ilfilesystemgui", "listFiles");
466  }

◆ setTabs()

ilObjFileBasedLMGUI::setTabs ( )

output tabs

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

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

Referenced by executeCommand().

602  {
603  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
604 
605  $this->getTabs();
606  $this->tpl->setTitle($this->object->getTitle());
607  }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Create new PHPExcel object
obj_idprivate
getTabs()
adds tabs to tab gui object
+ 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 542 of file class.ilObjFileBasedLMGUI.php.

References outputInfoScreen().

543  {
544  $this->outputInfoScreen(true);
545  }
outputInfoScreen($a_standard_locator=true)
info screen
+ Here is the call graph for this function:

◆ showLearningModule()

ilObjFileBasedLMGUI::showLearningModule ( )

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

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

504  {
505  global $ilUser;
506 
507  // #9483
508  if ($ilUser->getId() != ANONYMOUS_USER_ID)
509  {
510  include_once "Services/Tracking/classes/class.ilLearningProgress.php";
511  ilLearningProgress::_tracProgress($ilUser->getId(), $this->object->getId(),
512  $this->object->getRefId(), "htlm");
513  }
514 
515  require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
516  require_once('./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
517 
518  $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
520  if ($startfile != "")
521  {
522  ilUtil::redirect($startfile);
523  }
524  }
static signFolderOfStartFile($start_file_path, ilWACCookieInterface $ilWACCookieInterface=null)
static _tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type='')
$ilUser
Definition: imgupload.php:18
static _determineStartUrl($a_id)
check wether learning module is online
Create new PHPExcel object
obj_idprivate
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ toFilesystem()

ilObjFileBasedLMGUI::toFilesystem ( )

Set start file.

Parameters

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

References $ilCtrl.

332  {
333  global $ilCtrl;
334 
335  $ilCtrl->redirectByClass("ilfilesystemgui", "listFiles");
336  }
global $ilCtrl
Definition: ilias.php:18

◆ update()

ilObjFileBasedLMGUI::update ( )

update properties

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

References ilObjectGUI\updateObject().

454  {
455  //$this->setReturnLocation("update", "fblm_edit.php?cmd=listFiles&ref_id=".$_GET["ref_id"].
456  // "&obj_id=".$_GET["obj_id"]);
457  $this->updateObject();
458  }
updateObject()
updates object entry in object_data
+ Here is the call graph for this function:

Field Documentation

◆ $output_prepared

ilObjFileBasedLMGUI::$output_prepared

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


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