ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjFileBasedLMGUI Class Reference

User Interface class for file based learning modules (HTML) More...

+ Inheritance diagram for ilObjFileBasedLMGUI:
+ Collaboration diagram for ilObjFileBasedLMGUI:

Public Member Functions

 ilObjFileBasedLMGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 cancelCreationObject ($in_rep=false)
 cancel action and go back to previous page @access public More...
 
 properties ()
 edit properties of object (admin form) More...
 
 initSettingsForm ()
 Init settings form. More...
 
 getSettingsFormValues ()
 Get current values for settings from. More...
 
 toFilesystem ()
 Set start file. More...
 
 saveProperties ()
 Save properties form. More...
 
 editObject ()
 edit properties of object (admin form) More...
 
 edit ()
 edit properties of object (module form) More...
 
 cancel ()
 cancel editing More...
 
 afterSave ($newObj)
 save object @access public More...
 
 update ()
 update properties More...
 
 setStartFile ($a_file)
 
 perm ()
 permission form More...
 
 saveBibItemObject ($a_target="")
 save bib item (admin call) More...
 
 saveBibItem ()
 save bib item (module call) More...
 
 editBibItemObject ($a_target="")
 edit bib items (admin call) More...
 
 editBibItem ()
 edit bib items (module call) More...
 
 deleteBibItemObject ($a_target="")
 delete bib item (admin call) More...
 
 deleteBibItem ()
 delete bib item (module call) More...
 
 addBibItemObject ($a_target="")
 add bib item (admin call) More...
 
 addBibItem ()
 add bib item (module call) More...
 
 frameset ()
 Frameset -> Output list of files. More...
 
 getTemplate ()
 output main header (title and locator) More...
 
 showLearningModule ()
 
 infoScreen ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 showInfoScreen ()
 info screen call from inside learning module More...
 
 outputInfoScreen ($a_standard_locator=true)
 info screen More...
 
 setTabs ()
 output tabs More...
 
 getTabs ()
 adds tabs to tab gui object More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 importFileObject ($parent_id=null)
 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
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
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...
 
 getAdminTabs (&$tabs_gui)
 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 ($in_rep=false)
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 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)
 Init creation froms. More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 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...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 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 ($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
 

Detailed Description

Member Function Documentation

◆ _goto()

static ilObjFileBasedLMGUI::_goto (   $a_target)
static

redirect script

Parameters
string$a_target

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

941 {
942 global $rbacsystem, $ilErr, $lng, $ilAccess;
943
944 if ($ilAccess->checkAccess("read", "", $a_target) ||
945 $ilAccess->checkAccess("visible", "", $a_target))
946 {
947 ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
948 }
949 else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
950 {
951 ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
954 }
955
956 $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
957 }
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

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

+ Here is the call graph for this function:

◆ addBibItem()

ilObjFileBasedLMGUI::addBibItem ( )

add bib item (module call)

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

696 {
697 // questionable workaround to make this old stuff work
698 $this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());
699
700 //$this->setTabs();
701 $this->addBibItemObject($this->ctrl->getLinkTarget($this));
702 }
const IL_RTOKEN_NAME
addBibItemObject($a_target="")
add bib item (admin call)

References addBibItemObject(), and ilCtrl\IL_RTOKEN_NAME.

+ Here is the call graph for this function:

◆ addBibItemObject()

ilObjFileBasedLMGUI::addBibItemObject (   $a_target = "")

add bib item (admin call)

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

650 {
651 global $ilTabs;
652
653 $ilTabs->activateTab("id_bib_data");
654
655 $bibItemName = $_POST["bibItemName"] ? $_POST["bibItemName"] : $_GET["bibItemName"];
656 $bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
657 if ($bibItemName == "BibItem")
658 {
659 include_once "./Modules/LearningModule/classes/class.ilBibItem.php";
660 $bib_item =& new ilBibItem();
661 $bib_item->setId($this->object->getId());
662 $bib_item->setType($this->object->getType());
663 $bib_item->read();
664 }
665
666 include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
667 $bib_gui =& new ilBibItemGUI();
668 $bib_gui->setObject($this->object);
669 if ($bibItemIndex == "")
670 $bibItemIndex = 0;
671 $bibItemPath = $_POST["bibItemPath"] ? $_POST["bibItemPath"] : $_GET["bibItemPath"];
672
673 //if ($bibItemName != "" && $bibItemName != "BibItem")
674 if ($bibItemName != "")
675 {
676 $bib_gui->bib_obj->add($bibItemName, $bibItemPath, $bibItemIndex);
677 $data = $bib_gui->bib_obj->getElement("BibItem");
678 $bibItemIndex = (count($data) - 1);
679 }
680 else
681 {
682 ilUtil::sendInfo($this->lng->txt("bibitem_choose_element"), true);
683 }
684 if ($a_target == "")
685 {
686 $a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
687 }
688
689 $bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
690 }
$_GET["client_id"]
Class ilBibItemGUI.
Class ilBibItem.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST['username']
Definition: cron.php:12

References $_GET, $_POST, ilObjectGUI\$data, and ilUtil\sendInfo().

Referenced by addBibItem().

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

◆ addLocatorItems()

ilObjFileBasedLMGUI::addLocatorItems ( )

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

Reimplemented from ilObjectGUI.

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

960 {
961 global $ilLocator;
962
963 if (is_object($this->object))
964 {
965 $ilLocator->addItem($this->object->getTitle(),
966 $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"), "", $_GET["ref_id"]);
967 }
968 }

References $_GET.

◆ afterSave()

ilObjFileBasedLMGUI::afterSave (   $newObj)

save object @access public

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

451 {
452 if(!$newObj->getStartFile())
453 {
454 // try to set start file automatically
455 $files = array();
456 include_once "Services/Utilities/classes/class.ilFileUtils.php";
457 ilFileUtils::recursive_dirscan($newObj->getDataDirectory(), $files);
458 if(is_array($files["file"]))
459 {
460 $zip_file = null;
461 if(stristr($newObj->getTitle(), ".zip"))
462 {
463 $zip_file = strtolower($newObj->getTitle());
464 $suffix = strrpos($zip_file, ".");
465 if($suffix)
466 {
467 $zip_file = substr($zip_file, 0, $suffix);
468 }
469 }
470 $valid = array("index.htm", "index.html", "start.htm", "start.html");
471 foreach($files["file"] as $idx => $file)
472 {
473 $chk_file = null;
474 if(stristr($file, ".htm"))
475 {
476 $chk_file = strtolower($file);
477 $suffix = strrpos($chk_file, ".");
478 if($suffix)
479 {
480 $chk_file = substr($chk_file, 0, $suffix);
481 }
482 }
483 if(in_array($file, $valid) ||
484 ($chk_file && $zip_file && $chk_file == $zip_file))
485 {
486 $newObj->setStartFile(str_replace($newObj->getDataDirectory()."/", "", $files["path"][$idx]).$file);
487 $newObj->update();
488 break;
489 }
490 }
491 }
492 }
493
494 // always send a message
495 ilUtil::sendSuccess($this->lng->txt("object_added"),true);
496 ilUtil::redirect("ilias.php?baseClass=ilHTLMEditorGUI&ref_id=".$newObj->getRefId());
497 }
print $file
recursive_dirscan($dir, &$arr)
Recursively scans a given directory and writes path and filename into referenced array.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
http redirect to other script
$valid

References $file, $valid, ilFileUtils\recursive_dirscan(), ilUtil\redirect(), and ilUtil\sendSuccess().

Referenced by createFromDirectory().

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

◆ cancel()

ilObjFileBasedLMGUI::cancel ( )

cancel editing

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

441 {
442 //$this->setReturnLocation("cancel","fblm_edit.php?cmd=listFiles&ref_id=".$_GET["ref_id"]);
443 $this->cancelObject();
444 }
cancelObject($in_rep=false)
cancel action and go back to previous page @access public

References ilObjectGUI\cancelObject().

+ Here is the call graph for this function:

◆ cancelCreationObject()

ilObjFileBasedLMGUI::cancelCreationObject (   $in_rep = false)
final

cancel action and go back to previous page @access public

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

249 {
250 global $ilCtrl;
251
252 $ilCtrl->redirectByClass("ilrepositorygui", "frameset");
253 }
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl.

◆ createFromDirectory()

ilObjFileBasedLMGUI::createFromDirectory (   $a_dir)

Create new object from a html zip file.

Parameters

return

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

997 {
998 global $ilErr;
999
1000 if (!$this->checkPermissionBool("create", "", "htlm") || $a_dir == "")
1001 {
1002 $ilErr->raiseError($this->lng->txt("no_create_permission"));
1003 }
1004
1005 // create instance
1006 $newObj = new ilObjFileBasedLM();
1007 $filename = ilUtil::stripSlashes($_FILES["importfile"]["name"]);
1008 $newObj->setTitle($filename);
1009 $newObj->setDescription("");
1010 $newObj->create();
1011 $newObj->populateByDirectoy($a_dir, $filename);
1012 $this->putObjectInTree($newObj);
1013
1014 $this->afterSave($newObj);
1015 }
$filename
Definition: buildRTE.php:89
afterSave($newObj)
save object @access public
File Based Learning Module (HTML) object.
putObjectInTree(ilObject $a_obj, $a_parent_node_id=null)
Add object to tree at given position.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

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

Referenced by importFileObject().

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

◆ deleteBibItem()

ilObjFileBasedLMGUI::deleteBibItem ( )

delete bib item (module call)

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

638 {
639 // questionable workaround to make this old stuff work
640 $this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());
641
642 //$this->setTabs();
643 $this->deleteBibItemObject($this->ctrl->getLinkTarget($this));
644 }
deleteBibItemObject($a_target="")
delete bib item (admin call)

References deleteBibItemObject(), and ilCtrl\IL_RTOKEN_NAME.

+ Here is the call graph for this function:

◆ deleteBibItemObject()

ilObjFileBasedLMGUI::deleteBibItemObject (   $a_target = "")

delete bib item (admin call)

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

612 {
613 global $ilTabs;
614
615 $ilTabs->activateTab("id_bib_data");
616
617 include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
618 $bib_gui =& new ilBibItemGUI();
619 $bib_gui->setObject($this->object);
620 $bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
621 $bib_gui->bib_obj->delete($_GET["bibItemName"], $_GET["bibItemPath"], $bibItemIndex);
622 if (strpos($bibItemIndex, ",") > 0)
623 {
624 $bibItemIndex = substr($bibItemIndex, 0, strpos($bibItemIndex, ","));
625 }
626 if ($a_target == "")
627 {
628 $a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
629 }
630
631 $bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, max(0, $bibItemIndex - 1));
632 }

References $_GET, and $_POST.

Referenced by deleteBibItem().

+ Here is the caller graph for this function:

◆ edit()

ilObjFileBasedLMGUI::edit ( )

edit properties of object (module form)

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

432 {
433 $this->prepareOutput();
434 $this->editObject();
435 }
editObject()
edit properties of object (admin form)
prepareOutput()
prepare output

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

+ Here is the call graph for this function:

◆ editBibItem()

ilObjFileBasedLMGUI::editBibItem ( )

edit bib items (module call)

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

600 {
601 // questionable workaround to make this old stuff work
602 $this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());
603
604 //$this->setTabs();
605 $this->editBibItemObject($this->ctrl->getLinkTarget($this));
606 }
editBibItemObject($a_target="")
edit bib items (admin call)

References editBibItemObject(), and ilCtrl\IL_RTOKEN_NAME.

+ Here is the call graph for this function:

◆ editBibItemObject()

ilObjFileBasedLMGUI::editBibItemObject (   $a_target = "")

edit bib items (admin call)

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

574 {
575 global $ilTabs;
576
577 $ilTabs->activateTab("id_bib_data");
578
579 include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
580 $bib_gui =& new ilBibItemGUI();
581 $bib_gui->setObject($this->object);
582 $bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
583 $bibItemIndex *= 1;
584 if ($bibItemIndex < 0)
585 {
586 $bibItemIndex = 0;
587 }
588 if ($a_target == "")
589 {
590 $a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
591 }
592
593 $bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
594 }

References $_GET, and $_POST.

Referenced by editBibItem().

+ Here is the caller graph for this function:

◆ editObject()

ilObjFileBasedLMGUI::editObject ( )

edit properties of object (admin form)

@access public

Reimplemented from ilObjectGUI.

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

418 {
419 global $rbacsystem, $tree, $tpl;
420
421 if (!$rbacsystem->checkAccess("visible,write",$this->object->getRefId()))
422 {
423 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
424 }
425
426 }
redirection script todo: (a better solution should control the processing via a xml file)

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

Referenced by edit().

+ Here is the caller graph for this function:

◆ executeCommand()

ilObjFileBasedLMGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

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
75 if(!$this->getCreationMode())
76 {
77 if(IS_PAYMENT_ENABLED)
78 {
79 include_once 'Services/Payment/classes/class.ilPaymentObject.php';
80 if(ilPaymentObject::_requiresPurchaseToAccess($_GET['ref_id'], $type = (isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL) ))
81 {
82 $this->tpl->getStandardTemplate();
83
84 include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php';
85 $pp = new ilShopPurchaseGUI((int)$_GET['ref_id']);
86 $ret = $this->ctrl->forwardCommand($pp);
87 return true;
88 }
89 }
90 }
91
92 switch($next_class)
93 {
94 case 'ilobjectmetadatagui':
95 $this->checkPermission("write");
96 $ilTabs->activateTab('id_meta_data');
97 include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
98 $md_gui = new ilObjectMetaDataGUI($this->object);
99 $this->ctrl->forwardCommand($md_gui);
100 break;
101
102 case "ilfilesystemgui":
103 $this->checkPermission("write");
104 $ilTabs->activateTab('id_list_files');
105 $fs_gui = new ilFileSystemGUI($this->object->getDataDirectory());
106 $fs_gui->activateLabels(true, $this->lng->txt("cont_purpose"));
107 $fs_gui->setUseUploadDirectory(true);
108 $fs_gui->setTableId("htlmfs".$this->object->getId());
109 if ($this->object->getStartFile() != "")
110 {
111 $fs_gui->labelFile($this->object->getStartFile(),
112 $this->lng->txt("cont_startfile"));
113 }
114 $fs_gui->addCommand($this, "setStartFile", $this->lng->txt("cont_set_start_file"));
115
116 $this->ctrl->forwardCommand($fs_gui);
117
118 // try to set start file automatically
119 require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
120 if (!ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId()))
121 {
122 $do_update = false;
123
124 $pcommand = $fs_gui->getLastPerformedCommand();
125 if (is_array($pcommand))
126 {
127 $valid = array("index.htm", "index.html", "start.htm", "start.html");
128 if($pcommand["cmd"] == "create_file")
129 {
130 $file = strtolower(basename($pcommand["name"]));
131 if(in_array($file, $valid))
132 {
133 $this->object->setStartFile($pcommand["name"]);
134 $do_update = $pcommand["name"];
135 }
136 }
137 else if($pcommand["cmd"] == "unzip_file")
138 {
139 $zip_file = strtolower(basename($pcommand["name"]));
140 $suffix = strrpos($zip_file, ".");
141 if($suffix)
142 {
143 $zip_file = substr($zip_file, 0, $suffix);
144 }
145 foreach($pcommand["added"] as $file)
146 {
147 $chk_file = null;
148 if(stristr($file, ".htm"))
149 {
150 $chk_file = strtolower(basename($file));
151 $suffix = strrpos($chk_file, ".");
152 if($suffix)
153 {
154 $chk_file = substr($chk_file, 0, $suffix);
155 }
156 }
157 if(in_array(basename($file), $valid) ||
158 ($zip_file && $chk_file && $chk_file == $zip_file))
159 {
160 $this->object->setStartFile($file);
161 $do_update = $file;
162 break;
163 }
164 }
165 }
166 }
167
168 if($do_update)
169 {
170 ilUtil::sendInfo(sprintf($this->lng->txt("cont_start_file_set_to"), $do_update), true);
171
172 $this->object->update();
173 $this->ctrl->redirectByClass("ilfilesystemgui", "listFiles");
174 }
175 }
176 break;
177
178 case "ilinfoscreengui":
179 $ret =& $this->outputInfoScreen();
180 break;
181
182 case "illearningprogressgui":
183 $ilTabs->activateTab('id_learning_progress');
184 include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
186 $this->object->getRefId(),
187 $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId());
188 $this->ctrl->forwardCommand($new_gui);
189 break;
190
191 case 'ilpermissiongui':
192 $ilTabs->activateTab('id_permissions');
193 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
194 $perm_gui =& new ilPermissionGUI($this);
195 $ret =& $this->ctrl->forwardCommand($perm_gui);
196 break;
197
198 case 'illicensegui':
199 $ilTabs->activateTab('id_license');
200 include_once("./Services/License/classes/class.ilLicenseGUI.php");
201 $license_gui =& new ilLicenseGUI($this);
202 $ret =& $this->ctrl->forwardCommand($license_gui);
203 break;
204
205 case "ilexportgui":
206 $ilTabs->activateTab("export");
207 include_once("./Services/Export/classes/class.ilExportGUI.php");
208 $exp_gui = new ilExportGUI($this);
209 $exp_gui->addFormat("xml");
210 $exp_gui->addFormat("html", "", $this, "exportHTML");
211 $ret = $this->ctrl->forwardCommand($exp_gui);
212// $this->tpl->show();
213 break;
214
215 case "ilcommonactiondispatchergui":
216 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
218 $this->ctrl->forwardCommand($gui);
219 break;
220
221 default:
222 $cmd = $this->ctrl->getCmd("frameset");
223 if (strtolower($_GET["baseClass"]) == "iladministrationgui" ||
224 $this->getCreationMode() == true)
225 {
226 $cmd.= "Object";
227 }
228 $ret =& $this->$cmd();
229 break;
230 }
231
232 $this->addHeaderAction();
233 }
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Export User Interface Class.
File System Explorer GUI class.
Class ilObjUserTrackingGUI.
_determineStartUrl($a_id)
check wether learning module is online
outputInfoScreen($a_standard_locator=true)
info screen
getTemplate()
output main header (title and locator)
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
getCreationMode()
get creation mode
addHeaderAction()
Add header action menu.
setLocator()
set Locator
Class ilObjectMetaDataGUI.
static _requiresPurchaseToAccess($a_ref_id, $a_purchasetype='')
this function should be used by all buyable repository objects !!
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
Class ilShopPurchaseGUI.
$cmd
Definition: sahs_server.php:35
global $ilUser
Definition: imgupload.php:15

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

Referenced by frameset().

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

◆ exportHTML()

ilObjFileBasedLMGUI::exportHTML ( )

create html package

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

1029 {
1030 $inst_id = IL_INST_ID;
1031
1032 include_once("./Services/Export/classes/class.ilExport.php");
1033
1034 ilExport::_createExportDirectory($this->object->getId(), "html",
1035 $this->object->getType());
1036 $export_dir = ilExport::_getExportDirectory($this->object->getId(), "html",
1037 $this->object->getType());
1038
1039 $subdir = $this->object->getType()."_".$this->object->getId();
1040 $filename = $this->subdir.".zip";
1041
1042 $target_dir = $export_dir."/".$subdir;
1043
1044 ilUtil::delDir($target_dir);
1045 ilUtil::makeDir($target_dir);
1046
1047 $source_dir = $this->object->getDataDirectory();
1048
1049 ilUtil::rCopy($source_dir, $target_dir);
1050
1051 // zip it all
1052 $date = time();
1053 $zip_file = $export_dir."/".$date."__".IL_INST_ID."__".
1054 $this->object->getType()."_".$this->object->getId().".zip";
1055 ilUtil::zip($target_dir, $zip_file);
1056
1057 ilUtil::delDir($target_dir);
1058 }
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
_createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
Create export directory.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static zip($a_dir, $a_file, $compress_content=false)
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...

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

+ Here is the call graph for this function:

◆ frameset()

ilObjFileBasedLMGUI::frameset ( )

Frameset -> Output list of files.

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

708 {
709 global $ilCtrl;
710
711 $ilCtrl->setCmdClass("ilfilesystemgui");
712 $ilCtrl->setCmd("listFiles");
713 return $this->executeCommand();
714 }

References $ilCtrl, and executeCommand().

+ Here is the call graph for this function:

◆ getSettingsFormValues()

ilObjFileBasedLMGUI::getSettingsFormValues ( )

Get current values for settings from.

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

343 {
344 require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
345 $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
346
347 $values = array();
348 $values["cobj_online"] = $this->object->getOnline();
349 if ($startfile != "")
350 {
351 $startfile = basename($startfile);
352 }
353 else
354 {
355 $startfile = $this->lng->txt("no_start_file");
356 }
357
358 $values["cobj_online"] = $this->object->getOnline();
359 $values["startfile"] = $startfile;
360 $values["title"] = $this->object->getTitle();
361 $values["desc"] = $this->object->getDescription();
362 $values["lic"] = $this->object->getShowLicense();
363 $values["bib"] = $this->object->getShowBibliographicalData();
364
365 $this->form->setValuesByArray($values);
366 }

References ilObjFileBasedLMAccess\_determineStartUrl().

Referenced by properties().

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

◆ getTabs()

ilObjFileBasedLMGUI::getTabs ( )

adds tabs to tab gui object

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

841 {
842 global $ilUser, $ilAccess, $ilTabs, $lng, $ilHelp;
843
844 $ilHelp->setScreenIdComponent("htlm");
845
846 if($ilAccess->checkAccess('write', '', $this->ref_id))
847 {
848 $ilTabs->addTab("id_list_files",
849 $lng->txt("cont_list_files"),
850 $this->ctrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"));
851 }
852
853 if($ilAccess->checkAccess('visible', '', $this->ref_id))
854 {
855 $ilTabs->addTab("id_info",
856 $lng->txt("info_short"),
857 $this->ctrl->getLinkTargetByClass(array("ilobjfilebasedlmgui", "ilinfoscreengui"), "showSummary"));
858 }
859
860 if($ilAccess->checkAccess('write', '', $this->ref_id))
861 {
862 $ilTabs->addTab("id_settings",
863 $lng->txt("settings"),
864 $this->ctrl->getLinkTarget($this, "properties"));
865 }
866
867 include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
868 if(ilLearningProgressAccess::checkAccess($this->object->getRefId()))
869 {
870 $ilTabs->addTab("id_learning_progress",
871 $lng->txt("learning_progress"),
872 $this->ctrl->getLinkTargetByClass(array('ilobjfilebasedlmgui','illearningprogressgui'), ''));
873 }
874
875 include_once("Services/License/classes/class.ilLicenseAccess.php");
876 if ($ilAccess->checkAccess('edit_permission', '', $this->ref_id) &&
878 $this->object->getShowLicense())
879 {
880 $ilTabs->addTab("id_license",
881 $lng->txt("license"),
882 $this->ctrl->getLinkTargetByClass('illicensegui', ''));
883 }
884
885 if($ilAccess->checkAccess('write', '', $this->ref_id))
886 {
887 include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
888 $mdgui = new ilObjectMetaDataGUI($this->object);
889 $mdtab = $mdgui->getTab();
890 if($mdtab)
891 {
892 $ilTabs->addTab("id_meta_data",
893 $lng->txt("meta_data"),
894 $mdtab);
895 }
896
897 if($this->object->getShowBibliographicalData())
898 {
899 $ilTabs->addTab("id_bib_data",
900 $lng->txt("bib_data"),
901 $this->ctrl->getLinkTarget($this, "editBibItem"));
902 }
903 }
904
905
906 // export
907 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
908 {
909 $ilTabs->addTab("export",
910 $lng->txt("export"),
911 $this->ctrl->getLinkTargetByClass("ilexportgui", ""));
912 }
913
914 if ($ilAccess->checkAccess('edit_permission', '', $this->object->getRefId()))
915 {
916 $ilTabs->addTab("id_permissions",
917 $lng->txt("perm_settings"),
918 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"));
919 }
920
921 require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
922 $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
923
924 if ($startfile != "")
925 {
926 $ilTabs->addNonTabbedLink("presentation_view",
927 $this->lng->txt("glo_presentation_view"),
928 "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=".$this->object->getRefID(),
929 "_blank"
930 );
931 }
932
933 }
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
static _isEnabled()
Check, if licencing is enabled This check is called from the ilAccessHandler class.

References $ilUser, ilObjectGUI\$lng, ilObjFileBasedLMAccess\_determineStartUrl(), ilLicenseAccess\_isEnabled(), and ilLearningProgressAccess\checkAccess().

Referenced by setTabs().

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

◆ getTemplate()

ilObjFileBasedLMGUI::getTemplate ( )

output main header (title and locator)

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

720 {
721 global $lng;
722
723 $this->tpl->getStandardTemplate();
724 }

References ilObjectGUI\$lng.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ ilObjFileBasedLMGUI()

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

Constructor.

@access public

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

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::ilObjectGUI($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 }

References $ilCtrl, and ilObjectGUI\$lng.

◆ importFileObject()

ilObjFileBasedLMGUI::importFileObject (   $parent_id = null)

Import file.

Parameters

return

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

978 {
979 try
980 {
981 return parent::importFileObject();
982 }
984 {
985 // since there is no manifest xml we assume that this is an HTML export file
986 $this->createFromDirectory($e->getTmpDir());
987 }
988 }
manifest.xml file not found-exception for import
createFromDirectory($a_dir)
Create new object from a html zip file.

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

+ Here is the call graph for this function:

◆ infoScreen()

ilObjFileBasedLMGUI::infoScreen ( )

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

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

761 {
762 $this->ctrl->setCmd("showSummary");
763 $this->ctrl->setCmdClass("ilinfoscreengui");
764 $this->outputInfoScreen();
765 }

References outputInfoScreen().

+ Here is the call graph for this function:

◆ initCreationForms()

ilObjFileBasedLMGUI::initCreationForms (   $a_new_type)
protected

Init creation froms.

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

Parameters
string$a_new_type
Returns
array

Reimplemented from ilObjectGUI.

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

236 {
237 $forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
238 self::CFORM_IMPORT => $this->initImportForm($a_new_type));
239
240 return $forms;
241 }
initImportForm($a_new_type)
Init object import form.
initCreateForm($a_new_type)
Init object creation form.

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

+ Here is the call graph for this function:

◆ initSettingsForm()

ilObjFileBasedLMGUI::initSettingsForm ( )

Init settings form.

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

275 {
276 global $lng, $ilCtrl, $ilAccess;
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 {
307 $ne->setValue(basename($startfile));
308 }
309 else
310 {
311 $ne->setValue(basename($this->lng->txt("no_start_file")));
312 }
313 $this->form->addItem($ne);
314
315 include_once("Services/License/classes/class.ilLicenseAccess.php");
317 {
318 $lic = new ilCheckboxInputGUI($lng->txt("cont_license"), "lic");
319 $lic->setInfo($lng->txt("cont_license_info"));
320 $this->form->addItem($lic);
321
322 if(!$ilAccess->checkAccess('edit_permission', '', $this->ref_id))
323 {
324 $lic->setDisabled(true);
325 }
326 }
327
328 $bib = new ilCheckboxInputGUI($lng->txt("cont_biblio"), "bib");
329 $bib->setInfo($lng->txt("cont_biblio_info"));
330 $this->form->addItem($bib);
331
332 $this->form->addCommandButton("saveProperties", $lng->txt("save"));
333 $this->form->addCommandButton("toFilesystem", $lng->txt("cont_set_start_file"));
334
335 $this->form->setTitle($lng->txt("cont_lm_properties"));
336 $this->form->setFormAction($ilCtrl->getFormAction($this, "saveProperties"));
337 }
This class represents a checkbox property in a property form.
This class represents a non editable value in a property form.
const TITLE_LENGTH
max length of object title
This class represents a property form user interface.
This class represents a text area property in a property form.
This class represents a text property in a property form.

References $ilCtrl, ilObjectGUI\$lng, ilObjFileBasedLMAccess\_determineStartUrl(), ilLicenseAccess\_isEnabled(), and ilObject\TITLE_LENGTH.

Referenced by properties(), and saveProperties().

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

◆ outputInfoScreen()

ilObjFileBasedLMGUI::outputInfoScreen (   $a_standard_locator = true)

info screen

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

779 {
780 global $ilToolbar, $ilAccess, $ilTabs;
781
782 $ilTabs->activateTab('id_info');
783
784 $this->lng->loadLanguageModule("meta");
785 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
786
787 $info = new ilInfoScreenGUI($this);
788 $info->enablePrivateNotes();
789 $info->enableLearningProgress();
790
791 $info->enableNews();
792 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
793 {
794 $info->enableNewsEditing();
795
796 $news_set = new ilSetting("news");
797 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
798 if ($enable_internal_rss)
799 {
800 $info->setBlockProperty("news", "settings", true);
801 }
802 }
803
804 // add read / back button
805 if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
806 {
807 // #15127
808 include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
809 $button = ilLinkButton::getInstance();
810 $button->setCaption("view");
811 $button->setPrimary(true);
812 $button->setUrl("ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=".$this->object->getRefID());
813 $button->setTarget("ilContObj".$this->object->getId());
814 $ilToolbar->addButtonInstance($button);
815 }
816
817 // show standard meta data section
818 $info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
819
820 // forward the command
821 $this->ctrl->forwardCommand($info);
822 }
Class ilInfoScreenGUI.
static getInstance()
Factory.
ILIAS Setting Class.
$info
Definition: example_052.php:80

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

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

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

◆ perm()

ilObjFileBasedLMGUI::perm ( )

permission form

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

522 {
523 $this->setFormAction("permSave", "fblm_edit.php?cmd=permSave&ref_id=".$_GET["ref_id"].
524 "&obj_id=".$_GET["obj_id"]);
525 $this->setFormAction("addRole", "fblm_edit.php?ref_id=".$_GET["ref_id"].
526 "&obj_id=".$_GET["obj_id"]."&cmd=addRole");
527 $this->permObject();
528 }
setFormAction($a_cmd, $a_formaction)
set specific form action for command

References $_GET, and ilObjectGUI\setFormAction().

+ Here is the call graph for this function:

◆ properties()

ilObjFileBasedLMGUI::properties ( )

edit properties of object (admin form)

@access public

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

261 {
262 global $rbacsystem, $tree, $tpl, $ilTabs;
263
264 $ilTabs->activateTab("id_settings");
265
266 $this->initSettingsForm();
267 $this->getSettingsFormValues();
268 $tpl->setContent($this->form->getHTML());
269 }
initSettingsForm()
Init settings form.
getSettingsFormValues()
Get current values for settings from.

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

+ Here is the call graph for this function:

◆ saveBibItem()

ilObjFileBasedLMGUI::saveBibItem ( )

save bib item (module call)

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

562 {
563 // questionable workaround to make this old stuff work
564 $this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());
565
566 //$this->setTabs();
567 $this->saveBibItemObject($this->ctrl->getLinkTarget($this));
568 }
saveBibItemObject($a_target="")
save bib item (admin call)

References ilCtrl\IL_RTOKEN_NAME, and saveBibItemObject().

+ Here is the call graph for this function:

◆ saveBibItemObject()

ilObjFileBasedLMGUI::saveBibItemObject (   $a_target = "")

save bib item (admin call)

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

534 {
535 global $ilTabs;
536
537 $ilTabs->activateTab("id_bib_data");
538
539 include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
540 $bib_gui =& new ilBibItemGUI();
541 $bib_gui->setObject($this->object);
542 $bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
543 $bibItemIndex *= 1;
544 if ($bibItemIndex < 0)
545 {
546 $bibItemIndex = 0;
547 }
548 $bibItemIndex = $bib_gui->save($bibItemIndex);
549
550 if ($a_target == "")
551 {
552 $a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
553 }
554
555 $bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
556 }

References $_GET, and $_POST.

Referenced by saveBibItem().

+ Here is the caller graph for this function:

◆ saveProperties()

ilObjFileBasedLMGUI::saveProperties ( )

Save properties form.

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

385 {
386 global $tpl, $ilAccess, $ilTabs;
387
388 $this->initSettingsForm("");
389 if ($this->form->checkInput())
390 {
391 $this->object->setTitle($this->form->getInput("title"));
392 $this->object->setDescription($this->form->getInput("desc"));
393 $this->object->setOnline(ilUtil::yn2tf($_POST["cobj_online"]));
394 $this->object->setShowBibliographicalData($this->form->getInput("bib"));
395
396 $lic = $this->form->getItemByPostVar("lic");
397 if($lic && !$lic->getDisabled())
398 {
399 $this->object->setShowLicense($this->form->getInput("lic"));
400 }
401
402 $this->object->update();
403 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
404 $this->ctrl->redirect($this, "properties");
405 }
406
407 $ilTabs->activateTab("id_settings");
408 $this->form->setValuesByPost();
409 $tpl->setContent($this->form->getHtml());
410 }
static yn2tf($a_yn)
convert "y"/"n" to true/false

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

+ Here is the call graph for this function:

◆ setStartFile()

ilObjFileBasedLMGUI::setStartFile (   $a_file)

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

512 {
513 $this->object->setStartFile($a_file);
514 $this->object->update();
515 $this->ctrl->redirectByClass("ilfilesystemgui", "listFiles");
516 }

◆ setTabs()

ilObjFileBasedLMGUI::setTabs ( )

output tabs

Reimplemented from ilObjectGUI.

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

830 {
831 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
832
833 $this->getTabs();
834 $this->tpl->setTitle($this->object->getTitle());
835 }
getTabs()
adds tabs to tab gui object
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

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

Referenced by executeCommand().

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

◆ showInfoScreen()

ilObjFileBasedLMGUI::showInfoScreen ( )

info screen call from inside learning module

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

771 {
772 $this->outputInfoScreen(true);
773 }

References outputInfoScreen().

+ Here is the call graph for this function:

◆ showLearningModule()

ilObjFileBasedLMGUI::showLearningModule ( )

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

727 {
728 global $ilUser;
729
730 // Note license usage
731 include_once "Services/License/classes/class.ilLicense.php";
732 ilLicense::_noteAccess($this->object->getId(), $this->object->getType(),
733 $this->object->getRefId());
734
735 // #9483
736 if ($ilUser->getId() != ANONYMOUS_USER_ID)
737 {
738 include_once "Services/Tracking/classes/class.ilLearningProgress.php";
739 ilLearningProgress::_tracProgress($ilUser->getId(), $this->object->getId(),
740 $this->object->getRefId(), "htlm");
741 }
742
743 require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
744 require_once('./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
745
746 $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
748 if ($startfile != "")
749 {
750 ilUtil::redirect($startfile);
751 }
752 }
static _tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type='')
_noteAccess($a_obj_id, $a_type, $a_ref_id)
Note the access of the current usr to an object.
static signFolderOfStartFile($start_file_path, ilWACCookieInterface $ilWACCookieInterface=null)

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

+ Here is the call graph for this function:

◆ toFilesystem()

ilObjFileBasedLMGUI::toFilesystem ( )

Set start file.

Parameters

return

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

375 {
376 global $ilCtrl;
377
378 $ilCtrl->redirectByClass("ilfilesystemgui", "listFiles");
379 }

References $ilCtrl.

◆ update()

ilObjFileBasedLMGUI::update ( )

update properties

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

504 {
505 //$this->setReturnLocation("update", "fblm_edit.php?cmd=listFiles&ref_id=".$_GET["ref_id"].
506 // "&obj_id=".$_GET["obj_id"]);
507 $this->updateObject();
508 }
updateObject()
updates object entry in object_data

References ilObjectGUI\updateObject().

+ 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: