ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilObjFileBasedLMGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 
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");
23 
25 {
29  protected $tabs;
30 
34  protected $rbacsystem;
35 
39  protected $error;
40 
44  protected $help;
45 
47 
53  public function __construct($a_data, $a_id = 0, $a_call_by_reference = true, $a_prepare_output = true)
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  }
81 
85  public function executeCommand()
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  }
229 
230  protected function initCreationForms($a_new_type)
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  }
237 
243  final public function cancelCreationObject($in_rep = false)
244  {
246 
247  $ilCtrl->redirectByClass("ilrepositorygui", "frameset");
248  }
249 
255  public function properties()
256  {
258  $tree = $this->tree;
259  $tpl = $this->tpl;
260  $ilTabs = $this->tabs;
261 
262  $ilTabs->activateTab("id_settings");
263 
264  $this->initSettingsForm();
265  $this->getSettingsFormValues();
266  $tpl->setContent($this->form->getHTML());
267  }
268 
272  public function initSettingsForm()
273  {
274  $lng = $this->lng;
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  }
318 
322  public function getSettingsFormValues()
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  }
343 
350  public function toFilesystem()
351  {
353 
354  $ilCtrl->redirectByClass("ilfilesystemgui", "listFiles");
355  }
356 
360  public function saveProperties()
361  {
362  $tpl = $this->tpl;
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  }
381 
387  public function editObject()
388  {
391 
392  if (!$rbacsystem->checkAccess("visible,write", $this->object->getRefId())) {
393  $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
394  }
395  }
396 
400  public function edit()
401  {
402  $this->prepareOutput();
403  $this->editObject();
404  }
405 
409  public function cancel()
410  {
411  //$this->setReturnLocation("cancel","fblm_edit.php?cmd=listFiles&ref_id=".$_GET["ref_id"]);
412  $this->cancelObject();
413  }
414 
419  public function afterSave(ilObject $newObj)
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  }
459 
460 
464  public function update()
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  }
470 
471 
472  public function setStartFile($a_file)
473  {
474  $this->object->setStartFile($a_file);
475  $this->object->update();
476  $this->ctrl->redirectByClass("ilfilesystemgui", "listFiles");
477  }
478 
482  public function perm()
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  }
490 
491 
495  public function frameset()
496  {
498 
499  $ilCtrl->setCmdClass("ilfilesystemgui");
500  $ilCtrl->setCmd("listFiles");
501  return $this->executeCommand();
502  }
503 
507  public function getTemplate()
508  {
509  $lng = $this->lng;
510 
511  $this->tpl->getStandardTemplate();
512  }
513 
514  public function showLearningModule()
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  }
538 
539  // InfoScreen methods
545  public function infoScreen()
546  {
547  $this->ctrl->setCmd("showSummary");
548  $this->ctrl->setCmdClass("ilinfoscreengui");
549  $this->outputInfoScreen();
550  }
551 
555  public function showInfoScreen()
556  {
557  $this->outputInfoScreen(true);
558  }
559 
563  public function outputInfoScreen($a_standard_locator = true)
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  }
607 
608 
609 
613  public function setTabs()
614  {
615  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
616 
617  $this->getTabs();
618  $this->tpl->setTitle($this->object->getTitle());
619  }
620 
624  public function getTabs()
625  {
627  $ilAccess = $this->access;
628  $ilTabs = $this->tabs;
629  $lng = $this->lng;
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  }
710 
716  public static function _goto($a_target)
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)) {
729  ilUtil::sendFailure(sprintf(
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  }
738 
739  public function addLocatorItems()
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  }
752 
753 
760  public function importFileObject($parent_id = null, $a_catch_errors = true)
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  }
769 
776  public function createFromDirectory($a_dir)
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  }
795 
796 
797 
798 
802 
803 
807  public function exportHTML()
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  }
844 }
$files
Definition: add-vimline.php:18
static _createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
__construct($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor.
outputInfoScreen($a_standard_locator=true)
info screen
Class ilObjectMetaDataGUI.
getTemplate()
output main header (title and locator)
Class ilInfoScreenGUI.
exportHTML()
create html package
activateLabels($a_act, $a_label_header)
activate file labels
This class represents a property form user interface.
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.
global $DIC
Definition: saml.php:7
const TITLE_LENGTH
max length of object title
$_GET["client_id"]
cancelCreationObject($in_rep=false)
cancel action and go back to previous page public
$valid
edit()
edit properties of object (module form)
File Based Learning Module (HTML) object.
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='')
This class represents a checkbox property in a property form.
static _lookupTitle($a_id)
lookup object title
editObject()
edit properties of object (admin form)
saveProperties()
Save properties form.
executeCommand()
execute command
initSettingsForm()
Init settings form.
static _goto($a_target)
redirect script
user()
Definition: user.php:4
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...
global $ilCtrl
Definition: ilias.php:18
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.
getTitle()
get object title public
$ilUser
Definition: imgupload.php:18
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 ...
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
This class represents a text area property in a property form.
properties()
edit properties of object (admin form)
$ret
Definition: parser.php:6
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
setOptionTitle($a_optiontitle)
Set Option Title (optional).
$info
Definition: index.php:5
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.
$_POST["username"]
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
setLocator()
set Locator