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");
53 public function __construct($a_data, $a_id = 0, $a_call_by_reference =
true, $a_prepare_output =
true)
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();
72 $this->ctrl->saveParameter($this, array(
"ref_id"));
75 $lng->loadLanguageModule(
"content");
76 $lng->loadLanguageModule(
"obj");
78 parent::__construct($a_data, $a_id, $a_call_by_reference,
false);
80 $this->output_prepared = $a_prepare_output;
92 $next_class = $this->ctrl->getNextClass($this);
93 $cmd = $this->ctrl->getCmd();
95 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
99 if (!in_array($cmd, array(
"",
"framset")) || $next_class !=
"") {
106 switch ($next_class) {
107 case 'ilobjectmetadatagui':
109 $ilTabs->activateTab(
'id_meta_data');
110 include_once
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
112 $this->ctrl->forwardCommand($md_gui);
115 case "ilfilesystemgui":
117 $ilTabs->activateTab(
'id_list_files');
120 $fs_gui->setUseUploadDirectory(
true);
121 $fs_gui->setTableId(
"htlmfs" . $this->object->getId());
122 if ($this->object->getStartFile() !=
"") {
124 $this->object->getStartFile(),
125 $this->lng->txt(
"cont_startfile")
128 $fs_gui->addCommand($this,
"setStartFile", $this->lng->txt(
"cont_set_start_file"));
130 $this->ctrl->forwardCommand($fs_gui);
133 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
137 $pcommand = $fs_gui->getLastPerformedCommand();
138 if (is_array($pcommand)) {
139 $valid = array(
"index.htm",
"index.html",
"start.htm",
"start.html");
140 if ($pcommand[
"cmd"] ==
"create_file") {
141 $file = strtolower(basename($pcommand[
"name"]));
142 if (in_array($file,
$valid)) {
143 $this->
object->setStartFile($pcommand[
"name"]);
144 $do_update = $pcommand[
"name"];
146 } elseif ($pcommand[
"cmd"] ==
"unzip_file") {
147 $zip_file = strtolower(basename($pcommand[
"name"]));
148 $suffix = strrpos($zip_file,
".");
150 $zip_file = substr($zip_file, 0, $suffix);
152 foreach ($pcommand[
"added"] as $file) {
154 if (stristr($file,
".htm")) {
155 $chk_file = strtolower(basename($file));
156 $suffix = strrpos($chk_file,
".");
158 $chk_file = substr($chk_file, 0, $suffix);
161 if (in_array(basename($file),
$valid) ||
162 ($zip_file && $chk_file && $chk_file == $zip_file)) {
163 $this->
object->setStartFile($file);
172 ilUtil::sendInfo(sprintf($this->lng->txt(
"cont_start_file_set_to"), $do_update),
true);
174 $this->
object->update();
175 $this->ctrl->redirectByClass(
"ilfilesystemgui",
"listFiles");
180 case "ilinfoscreengui":
184 case "illearningprogressgui":
185 $ilTabs->activateTab(
'id_learning_progress');
186 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
189 $this->object->getRefId(),
192 $this->ctrl->forwardCommand($new_gui);
195 case 'ilpermissiongui':
196 $ilTabs->activateTab(
'id_permissions');
197 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
199 $ret = $this->ctrl->forwardCommand($perm_gui);
203 $ilTabs->activateTab(
"export");
204 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
206 $exp_gui->addFormat(
"xml");
207 $exp_gui->addFormat(
"html",
"", $this,
"exportHTML");
208 $ret = $this->ctrl->forwardCommand($exp_gui);
212 case "ilcommonactiondispatchergui":
213 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
215 $this->ctrl->forwardCommand($gui);
219 $cmd = $this->ctrl->getCmd(
"frameset");
220 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
224 $ret = $this->$cmd();
233 $forms = array(self::CFORM_NEW => $this->
initCreateForm($a_new_type),
248 $ilCtrl->redirectByClass(
"ilrepositorygui",
"frameset");
263 $ilTabs->activateTab(
"id_settings");
267 $tpl->setContent($this->form->getHTML());
280 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
287 $ti->setRequired(
true);
288 $this->form->addItem($ti);
294 $this->form->addItem($ta);
300 $this->form->addItem($cb);
303 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
307 if ($startfile !=
"") {
308 $ne->
setValue(basename($startfile));
310 $ne->setValue(basename($this->lng->txt(
"no_start_file")));
312 $this->form->addItem($ne);
315 $pres->setTitle($this->lng->txt(
'obj_presentation'));
316 $this->form->addItem($pres);
319 $obj_service->commonSettings()->legacyForm($this->form, $this->
object)->addTileImage();
321 $this->form->addCommandButton(
"saveProperties",
$lng->txt(
"save"));
322 $this->form->addCommandButton(
"toFilesystem",
$lng->txt(
"cont_set_start_file"));
324 $this->form->setTitle(
$lng->txt(
"cont_lm_properties"));
325 $this->form->setFormAction(
$ilCtrl->getFormAction($this,
"saveProperties"));
333 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
337 $values[
'cobj_online'] = !$this->
object->getOfflineStatus();
338 if ($startfile !=
"") {
339 $startfile = basename($startfile);
341 $startfile = $this->lng->txt(
"no_start_file");
344 $values[
"startfile"] = $startfile;
345 $values[
"title"] = $this->
object->getTitle();
346 $values[
"desc"] = $this->
object->getLongDescription();
349 $this->form->setValuesByArray($values);
362 $ilCtrl->redirectByClass(
"ilfilesystemgui",
"listFiles");
376 if ($this->form->checkInput()) {
377 $this->
object->setTitle($this->form->getInput(
"title"));
378 $this->
object->setDescription($this->form->getInput(
"desc"));
379 $this->
object->setOfflineStatus(!(
bool)
$_POST[
'cobj_online']);
381 $this->
object->update();
384 $obj_service->commonSettings()->legacyForm($this->form, $this->
object)->saveTileImage();
386 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
387 $this->ctrl->redirect($this,
"properties");
390 $ilTabs->activateTab(
"id_settings");
391 $this->form->setValuesByPost();
392 $tpl->setContent($this->form->getHtml());
405 if (!
$rbacsystem->checkAccess(
"visible,write", $this->object->getRefId())) {
406 $ilErr->raiseError($this->lng->txt(
"permission_denied"),
$ilErr->MESSAGE);
434 if (!$newObj->getStartFile()) {
437 include_once
"Services/Utilities/classes/class.ilFileUtils.php";
439 if (is_array(
$files[
"file"])) {
441 if (stristr($newObj->
getTitle(),
".zip")) {
442 $zip_file = strtolower($newObj->
getTitle());
443 $suffix = strrpos($zip_file,
".");
445 $zip_file = substr($zip_file, 0, $suffix);
448 $valid = array(
"index.htm",
"index.html",
"start.htm",
"start.html");
449 foreach (
$files[
"file"] as $idx => $file) {
451 if (stristr($file,
".htm")) {
452 $chk_file = strtolower($file);
453 $suffix = strrpos($chk_file,
".");
455 $chk_file = substr($chk_file, 0, $suffix);
458 if (in_array($file,
$valid) ||
459 ($chk_file && $zip_file && $chk_file == $zip_file)) {
460 $newObj->setStartFile(str_replace($newObj->getDataDirectory() .
"/",
"",
$files[
"path"][$idx]) . $file);
469 ilUtil::sendSuccess($this->lng->txt(
"object_added"),
true);
470 $this->
object = $newObj;
488 $this->
object->setStartFile($a_file);
489 $this->
object->update();
490 $this->ctrl->redirectByClass(
"ilfilesystemgui",
"listFiles");
498 $this->
setFormAction(
"permSave",
"fblm_edit.php?cmd=permSave&ref_id=" .
$_GET[
"ref_id"] .
499 "&obj_id=" .
$_GET[
"obj_id"]);
500 $this->
setFormAction(
"addRole",
"fblm_edit.php?ref_id=" . $_GET[
"ref_id"] .
501 "&obj_id=" . $_GET[
"obj_id"] .
"&cmd=addRole");
513 $ilCtrl->setCmdClass(
"ilfilesystemgui");
525 $this->tpl->getStandardTemplate();
533 if (
$ilUser->getId() != ANONYMOUS_USER_ID) {
534 include_once
"Services/Tracking/classes/class.ilLearningProgress.php";
537 $this->
object->getId(),
538 $this->
object->getRefId(),
543 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
544 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
548 if ($startfile !=
"") {
561 $this->ctrl->setCmd(
"showSummary");
562 $this->ctrl->setCmdClass(
"ilinfoscreengui");
583 $ilTabs->activateTab(
'id_info');
585 $this->lng->loadLanguageModule(
"meta");
586 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
589 $info->enablePrivateNotes();
590 $info->enableLearningProgress();
593 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) {
594 $info->enableNewsEditing();
597 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
598 if ($enable_internal_rss) {
599 $info->setBlockProperty(
"news",
"settings",
true);
604 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"])) {
606 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
608 $button->setCaption(
"view");
609 $button->setPrimary(
true);
610 $button->setUrl(
"ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=" . $this->object->getRefID());
611 $button->setTarget(
"ilContObj" . $this->object->getId());
612 $ilToolbar->addButtonInstance($button);
616 $info->addMetaDataSections($this->object->getId(), 0, $this->
object->getType());
619 $this->ctrl->forwardCommand(
$info);
632 $this->tpl->setTitle($this->object->getTitle());
646 $ilHelp->setScreenIdComponent(
"htlm");
648 if ($ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
651 $lng->txt(
"cont_list_files"),
652 $this->ctrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles")
656 if ($ilAccess->checkAccess(
'visible',
'', $this->ref_id)) {
659 $lng->txt(
"info_short"),
660 $this->ctrl->getLinkTargetByClass(array(
"ilobjfilebasedlmgui",
"ilinfoscreengui"),
"showSummary")
664 if ($ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
667 $lng->txt(
"settings"),
668 $this->ctrl->getLinkTarget($this,
"properties")
672 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
675 "id_learning_progress",
676 $lng->txt(
"learning_progress"),
677 $this->ctrl->getLinkTargetByClass(array(
'ilobjfilebasedlmgui',
'illearningprogressgui'),
'')
681 if ($ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
682 include_once
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
684 $mdtab = $mdgui->getTab();
688 $lng->txt(
"meta_data"),
696 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
700 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
704 if ($ilAccess->checkAccess(
'edit_permission',
'', $this->object->getRefId())) {
707 $lng->txt(
"perm_settings"),
708 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm")
712 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
715 if ($startfile !=
"") {
716 $ilTabs->addNonTabbedLink(
718 $this->lng->txt(
"glo_presentation_view"),
719 "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=" . $this->
object->getRefID(),
730 public static function _goto($a_target)
736 $lng = $DIC->language();
737 $ilAccess = $DIC->access();
739 if ($ilAccess->checkAccess(
"read",
"", $a_target) ||
740 $ilAccess->checkAccess(
"visible",
"", $a_target)) {
742 } elseif ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID)) {
744 $lng->txt(
"msg_no_perm_read_item"),
757 if (is_object($this->
object)) {
759 $this->object->getTitle(),
760 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
777 return parent::importFileObject();
795 $ilErr->raiseError($this->lng->txt(
"no_create_permission"));
802 $newObj->setDescription(
"");
804 $newObj->populateByDirectoy($a_dir,
$filename);
823 $inst_id = IL_INST_ID;
825 include_once(
"./Services/Export/classes/class.ilExport.php");
828 $this->object->getId(),
830 $this->
object->getType()
833 $this->object->getId(),
835 $this->
object->getType()
838 $subdir = $this->
object->getType() .
"_" . $this->
object->getId();
841 $target_dir = $export_dir .
"/" . $subdir;
846 $source_dir = $this->
object->getDataDirectory();
852 $zip_file = $export_dir .
"/" . $date .
"__" . IL_INST_ID .
"__" .
853 $this->
object->getType() .
"_" . $this->
object->getId() .
".zip";
865 $ctrl->setParameterByClass(
"ilObjFileBasedLMGUI",
"ref_id", $this->object->getRefId());
866 $ctrl->redirectByClass([
"ilrepositorygui",
"ilObjFileBasedLMGUI"],
"properties");
static _createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
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
cancelCreationObject($in_rep=false)
cancel action and go back to previous page public
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
static signFolderOfStartFile($start_file_path)
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
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)
determine start url
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
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.
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
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.
getObjectService()
Get object service.
File System Explorer GUI class.
update()
update object in db
static redirect($a_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