19 require_once(
"./Services/Object/classes/class.ilObjectGUI.php");
20 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php");
21 require_once(
"./Services/Table/classes/class.ilTableGUI.php");
22 require_once(
"./Services/FileSystem/classes/class.ilFileSystemGUI.php");
33 function __construct($a_data,$a_id = 0,$a_call_by_reference =
true, $a_prepare_output =
true)
38 $this->ctrl->saveParameter($this,
array(
"ref_id"));
41 $lng->loadLanguageModule(
"content");
43 parent::__construct($a_data, $a_id, $a_call_by_reference,
false);
45 $this->output_prepared = $a_prepare_output;
54 global
$ilUser, $ilLocator, $ilTabs;
56 $next_class = $this->ctrl->getNextClass($this);
57 $cmd = $this->ctrl->getCmd();
59 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
66 if (!in_array(
$cmd,
array(
"",
"framset")) || $next_class !=
"")
76 case 'ilobjectmetadatagui':
78 $ilTabs->activateTab(
'id_meta_data');
79 include_once
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
81 $this->ctrl->forwardCommand($md_gui);
84 case "ilfilesystemgui":
86 $ilTabs->activateTab(
'id_list_files');
89 $fs_gui->setUseUploadDirectory(
true);
90 $fs_gui->setTableId(
"htlmfs".$this->
object->getId());
91 if ($this->
object->getStartFile() !=
"")
93 $fs_gui->labelFile($this->
object->getStartFile(),
94 $this->lng->txt(
"cont_startfile"));
96 $fs_gui->addCommand($this,
"setStartFile", $this->lng->txt(
"cont_set_start_file"));
98 $this->ctrl->forwardCommand($fs_gui);
101 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
106 $pcommand = $fs_gui->getLastPerformedCommand();
107 if (is_array($pcommand))
109 $valid =
array(
"index.htm",
"index.html",
"start.htm",
"start.html");
110 if($pcommand[
"cmd"] ==
"create_file")
112 $file = strtolower(basename($pcommand[
"name"]));
115 $this->
object->setStartFile($pcommand[
"name"]);
116 $do_update = $pcommand[
"name"];
119 else if($pcommand[
"cmd"] ==
"unzip_file")
121 $zip_file = strtolower(basename($pcommand[
"name"]));
122 $suffix = strrpos($zip_file,
".");
125 $zip_file = substr($zip_file, 0, $suffix);
127 foreach($pcommand[
"added"] as
$file)
130 if(stristr($file,
".htm"))
132 $chk_file = strtolower(basename($file));
133 $suffix = strrpos($chk_file,
".");
136 $chk_file = substr($chk_file, 0, $suffix);
139 if(in_array(basename($file),
$valid) ||
140 ($zip_file && $chk_file && $chk_file == $zip_file))
142 $this->
object->setStartFile($file);
152 ilUtil::sendInfo(sprintf($this->lng->txt(
"cont_start_file_set_to"), $do_update),
true);
154 $this->
object->update();
155 $this->ctrl->redirectByClass(
"ilfilesystemgui",
"listFiles");
160 case "ilinfoscreengui":
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);
173 case 'ilpermissiongui':
174 $ilTabs->activateTab(
'id_permissions');
175 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
177 $ret = $this->ctrl->forwardCommand($perm_gui);
181 $ilTabs->activateTab(
"export");
182 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
184 $exp_gui->addFormat(
"xml");
185 $exp_gui->addFormat(
"html",
"", $this,
"exportHTML");
186 $ret = $this->ctrl->forwardCommand($exp_gui);
190 case "ilcommonactiondispatchergui":
191 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
193 $this->ctrl->forwardCommand($gui);
197 $cmd = $this->ctrl->getCmd(
"frameset");
198 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
227 $ilCtrl->redirectByClass(
"ilrepositorygui",
"frameset");
237 global $rbacsystem,
$tree,
$tpl, $ilTabs;
239 $ilTabs->activateTab(
"id_settings");
243 $tpl->setContent($this->form->getHTML());
253 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
260 $ti->setRequired(
true);
261 $this->form->addItem($ti);
267 $this->form->addItem($ta);
273 $this->form->addItem($cb);
276 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
280 if ($startfile !=
"")
282 $ne->
setValue(basename($startfile));
286 $ne->setValue(basename($this->lng->txt(
"no_start_file")));
288 $this->form->addItem($ne);
290 $this->form->addCommandButton(
"saveProperties", $lng->txt(
"save"));
291 $this->form->addCommandButton(
"toFilesystem", $lng->txt(
"cont_set_start_file"));
293 $this->form->setTitle($lng->txt(
"cont_lm_properties"));
294 $this->form->setFormAction($ilCtrl->getFormAction($this,
"saveProperties"));
302 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
306 $values[
"cobj_online"] = $this->
object->getOnline();
307 if ($startfile !=
"")
309 $startfile = basename($startfile);
313 $startfile = $this->lng->txt(
"no_start_file");
316 $values[
"cobj_online"] = $this->
object->getOnline();
317 $values[
"startfile"] = $startfile;
318 $values[
"title"] = $this->
object->getTitle();
319 $values[
"desc"] = $this->
object->getDescription();
322 $this->form->setValuesByArray($values);
335 $ilCtrl->redirectByClass(
"ilfilesystemgui",
"listFiles");
343 global
$tpl, $ilAccess, $ilTabs;
346 if ($this->form->checkInput())
348 $this->
object->setTitle($this->form->getInput(
"title"));
349 $this->
object->setDescription($this->form->getInput(
"desc"));
352 $this->
object->update();
354 $this->ctrl->redirect($this,
"properties");
357 $ilTabs->activateTab(
"id_settings");
358 $this->form->setValuesByPost();
359 $tpl->setContent($this->form->getHtml());
371 if (!$rbacsystem->checkAccess(
"visible,write",$this->object->getRefId()))
373 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"),$this->
ilias->error_obj->MESSAGE);
402 if(!$newObj->getStartFile())
406 include_once
"Services/Utilities/classes/class.ilFileUtils.php";
408 if(is_array(
$files[
"file"]))
411 if(stristr($newObj->
getTitle(),
".zip"))
413 $zip_file = strtolower($newObj->
getTitle());
414 $suffix = strrpos($zip_file,
".");
417 $zip_file = substr($zip_file, 0, $suffix);
420 $valid =
array(
"index.htm",
"index.html",
"start.htm",
"start.html");
424 if(stristr(
$file,
".htm"))
426 $chk_file = strtolower(
$file);
427 $suffix = strrpos($chk_file,
".");
430 $chk_file = substr($chk_file, 0, $suffix);
434 ($chk_file && $zip_file && $chk_file == $zip_file))
436 $newObj->setStartFile(str_replace($newObj->getDataDirectory().
"/",
"",
$files[
"path"][$idx]).
$file);
463 $this->
object->setStartFile($a_file);
464 $this->
object->update();
465 $this->ctrl->redirectByClass(
"ilfilesystemgui",
"listFiles");
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");
488 $ilCtrl->setCmdClass(
"ilfilesystemgui");
489 $ilCtrl->setCmd(
"listFiles");
500 $this->tpl->getStandardTemplate();
508 if ($ilUser->getId() != ANONYMOUS_USER_ID)
510 include_once
"Services/Tracking/classes/class.ilLearningProgress.php";
512 $this->
object->getRefId(),
"htlm");
515 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
516 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
520 if ($startfile !=
"")
534 $this->ctrl->setCmd(
"showSummary");
535 $this->ctrl->setCmdClass(
"ilinfoscreengui");
552 global $ilToolbar, $ilAccess, $ilTabs;
554 $ilTabs->activateTab(
'id_info');
556 $this->lng->loadLanguageModule(
"meta");
557 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
560 $info->enablePrivateNotes();
561 $info->enableLearningProgress();
564 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
566 $info->enableNewsEditing();
569 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
570 if ($enable_internal_rss)
572 $info->setBlockProperty(
"news",
"settings",
true);
577 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
580 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
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);
590 $info->addMetaDataSections($this->
object->getId(),0, $this->
object->getType());
593 $this->ctrl->forwardCommand(
$info);
606 $this->tpl->setTitle($this->
object->getTitle());
616 $ilHelp->setScreenIdComponent(
"htlm");
618 if($ilAccess->checkAccess(
'write',
'', $this->ref_id))
620 $ilTabs->addTab(
"id_list_files",
621 $lng->txt(
"cont_list_files"),
622 $this->ctrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles"));
625 if($ilAccess->checkAccess(
'visible',
'', $this->ref_id))
627 $ilTabs->addTab(
"id_info",
628 $lng->txt(
"info_short"),
629 $this->ctrl->getLinkTargetByClass(
array(
"ilobjfilebasedlmgui",
"ilinfoscreengui"),
"showSummary"));
632 if($ilAccess->checkAccess(
'write',
'', $this->ref_id))
634 $ilTabs->addTab(
"id_settings",
635 $lng->txt(
"settings"),
636 $this->ctrl->getLinkTarget($this,
"properties"));
639 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
642 $ilTabs->addTab(
"id_learning_progress",
643 $lng->txt(
"learning_progress"),
644 $this->ctrl->getLinkTargetByClass(
array(
'ilobjfilebasedlmgui',
'illearningprogressgui'),
''));
647 if($ilAccess->checkAccess(
'write',
'', $this->ref_id))
649 include_once
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
651 $mdtab = $mdgui->getTab();
654 $ilTabs->addTab(
"id_meta_data",
655 $lng->txt(
"meta_data"),
663 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
665 $ilTabs->addTab(
"export",
667 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
670 if ($ilAccess->checkAccess(
'edit_permission',
'', $this->object->getRefId()))
672 $ilTabs->addTab(
"id_permissions",
673 $lng->txt(
"perm_settings"),
674 $this->ctrl->getLinkTargetByClass(
array(get_class($this),
'ilpermissiongui'),
"perm"));
677 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
680 if ($startfile !=
"")
682 $ilTabs->addNonTabbedLink(
"presentation_view",
683 $this->lng->txt(
"glo_presentation_view"),
684 "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=".$this->object->getRefID(),
696 public static function _goto($a_target)
700 if ($ilAccess->checkAccess(
"read",
"", $a_target) ||
701 $ilAccess->checkAccess(
"visible",
"", $a_target))
705 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
712 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
719 if (is_object($this->
object))
721 $ilLocator->addItem($this->
object->getTitle(),
722 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
$_GET[
"ref_id"]);
737 return parent::importFileObject();
758 $ilErr->raiseError($this->lng->txt(
"no_create_permission"));
765 $newObj->setDescription(
"");
767 $newObj->populateByDirectoy($a_dir,
$filename);
786 $inst_id = IL_INST_ID;
788 include_once(
"./Services/Export/classes/class.ilExport.php");
791 $this->
object->getType());
793 $this->
object->getType());
795 $subdir = $this->
object->getType().
"_".$this->
object->getId();
798 $target_dir = $export_dir.
"/".$subdir;
803 $source_dir = $this->
object->getDataDirectory();
809 $zip_file = $export_dir.
"/".$date.
"__".IL_INST_ID.
"__".
810 $this->
object->getType().
"_".$this->
object->getId().
".zip";
static _createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
update()
update properties
__construct($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor.
outputInfoScreen($a_standard_locator=true)
info screen
getTemplate()
output main header (title and locator)
setValue($a_value)
Set Value.
exportHTML()
create html package
activateLabels($a_act, $a_label_header)
activate file labels
cancelObject()
cancel action and go back to previous page public
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
const TITLE_LENGTH
max length of object title
static signFolderOfStartFile($start_file_path, ilWACCookieInterface $ilWACCookieInterface=null)
cancelCreationObject($in_rep=false)
cancel action and go back to previous page public
Class ilObject Basic functions for all objects.
edit()
edit properties of object (module form)
File Based Learning Module (HTML) object.
initCreationForms($a_new_type)
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
getSettingsFormValues()
Get current values for settings from.
importFileObject($parent_id=null, $a_catch_errors=true)
Import file.
setFormAction($a_cmd, $a_formaction)
set specific form action for command
static _tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type='')
static _lookupTitle($a_id)
lookup object title
editObject()
edit properties of object (admin form)
saveProperties()
Save properties form.
toFilesystem()
Set start file.
executeCommand()
execute command
initSettingsForm()
Init settings form.
static _goto($a_target)
redirect script
showInfoScreen()
info screen call from inside learning module
infoScreen()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
afterSave(ilObject $newObj)
save object public
Export User Interface Class.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
initImportForm($a_new_type)
Init object import form.
prepareOutput($a_show_subobjects=true)
prepare output
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjId($a_id)
setSize($a_size)
Set Size.
This class represents a text property in a property form.
setCols($a_cols)
Set Cols.
getTitle()
get object title public
redirection script todo: (a better solution should control the processing via a xml file) ...
frameset()
Frameset -> Output list of files.
initCreateForm($a_new_type)
Init object creation form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
manifest.xml file not found-exception for import
static _determineStartUrl($a_id)
check wether learning module is online
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
getTmpDir()
Get temporary directory.
createFromDirectory($a_dir)
Create new object from a html zip file.
This class represents a non editable value in a property form.
Create new PHPExcel object
obj_idprivate
const LP_CONTEXT_REPOSITORY
This class represents a text area property in a property form.
properties()
edit properties of object (admin form)
getCreationMode()
get creation mode
getRefId()
get reference id public
User Interface class for file based learning modules (HTML)
updateObject()
updates object entry in object_data
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
putObjectInTree(ilObject $a_obj, $a_parent_node_id=null)
Add object to tree at given position.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
getTabs()
adds tabs to tab gui object
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static recursive_dirscan($dir, &$arr)
Recursively scans a given directory and writes path and filename into referenced array.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
File System Explorer GUI class.
update()
update object in db
static yn2tf($a_yn)
convert "y"/"n" to true/false
static redirect($a_script)
http redirect to other script
addHeaderAction()
Add header action menu.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
Class ilObjUserTrackingGUI.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call