ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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...
 
 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)
 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...
 

Detailed Description

Member Function Documentation

◆ _goto()

static ilObjFileBasedLMGUI::_goto (   $a_target)
static

redirect script

Parameters
string$a_target

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

935 {
936 global $rbacsystem, $ilErr, $lng, $ilAccess;
937
938 if ($ilAccess->checkAccess("read", "", $a_target) ||
939 $ilAccess->checkAccess("visible", "", $a_target))
940 {
941 ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
942 }
943 else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
944 {
945 ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
948 }
949
950 $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
951 }
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 698 of file class.ilObjFileBasedLMGUI.php.

699 {
700 // questionable workaround to make this old stuff work
701 $this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());
702
703 //$this->setTabs();
704 $this->addBibItemObject($this->ctrl->getLinkTarget($this));
705 }
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 652 of file class.ilObjFileBasedLMGUI.php.

653 {
654 global $ilTabs;
655
656 $ilTabs->activateTab("id_bib_data");
657
658 $bibItemName = $_POST["bibItemName"] ? $_POST["bibItemName"] : $_GET["bibItemName"];
659 $bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
660 if ($bibItemName == "BibItem")
661 {
662 include_once "./Modules/LearningModule/classes/class.ilBibItem.php";
663 $bib_item =& new ilBibItem();
664 $bib_item->setId($this->object->getId());
665 $bib_item->setType($this->object->getType());
666 $bib_item->read();
667 }
668
669 include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
670 $bib_gui =& new ilBibItemGUI();
671 $bib_gui->setObject($this->object);
672 if ($bibItemIndex == "")
673 $bibItemIndex = 0;
674 $bibItemPath = $_POST["bibItemPath"] ? $_POST["bibItemPath"] : $_GET["bibItemPath"];
675
676 //if ($bibItemName != "" && $bibItemName != "BibItem")
677 if ($bibItemName != "")
678 {
679 $bib_gui->bib_obj->add($bibItemName, $bibItemPath, $bibItemIndex);
680 $data = $bib_gui->bib_obj->getElement("BibItem");
681 $bibItemIndex = (count($data) - 1);
682 }
683 else
684 {
685 ilUtil::sendInfo($this->lng->txt("bibitem_choose_element"), true);
686 }
687 if ($a_target == "")
688 {
689 $a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
690 }
691
692 $bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
693 }
$_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 953 of file class.ilObjFileBasedLMGUI.php.

954 {
955 global $ilLocator;
956
957 if (is_object($this->object))
958 {
959 $ilLocator->addItem($this->object->getTitle(),
960 $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"), "", $_GET["ref_id"]);
961 }
962 }

References $_GET.

◆ afterSave()

ilObjFileBasedLMGUI::afterSave (   $newObj)

save object @access public

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

454 {
455 if(!$newObj->getStartFile())
456 {
457 // try to set start file automatically
458 $files = array();
459 include_once "Services/Utilities/classes/class.ilFileUtils.php";
460 ilFileUtils::recursive_dirscan($newObj->getDataDirectory(), $files);
461 if(is_array($files["file"]))
462 {
463 $zip_file = null;
464 if(stristr($newObj->getTitle(), ".zip"))
465 {
466 $zip_file = strtolower($newObj->getTitle());
467 $suffix = strrpos($zip_file, ".");
468 if($suffix)
469 {
470 $zip_file = substr($zip_file, 0, $suffix);
471 }
472 }
473 $valid = array("index.htm", "index.html", "start.htm", "start.html");
474 foreach($files["file"] as $idx => $file)
475 {
476 $chk_file = null;
477 if(stristr($file, ".htm"))
478 {
479 $chk_file = strtolower($file);
480 $suffix = strrpos($chk_file, ".");
481 if($suffix)
482 {
483 $chk_file = substr($chk_file, 0, $suffix);
484 }
485 }
486 if(in_array($file, $valid) ||
487 ($chk_file && $zip_file && $chk_file == $zip_file))
488 {
489 $newObj->setStartFile(str_replace($newObj->getDataDirectory()."/", "", $files["path"][$idx]).$file);
490 $newObj->update();
491 break;
492 }
493 }
494 }
495 }
496
497 // always send a message
498 ilUtil::sendSuccess($this->lng->txt("object_added"),true);
499 ilUtil::redirect("ilias.php?baseClass=ilHTLMEditorGUI&ref_id=".$newObj->getRefId());
500 }
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 443 of file class.ilObjFileBasedLMGUI.php.

444 {
445 //$this->setReturnLocation("cancel","fblm_edit.php?cmd=listFiles&ref_id=".$_GET["ref_id"]);
446 $this->cancelObject();
447 }
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 251 of file class.ilObjFileBasedLMGUI.php.

252 {
253 global $ilCtrl;
254
255 $ilCtrl->redirectByClass("ilrepositorygui", "frameset");
256 }
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 990 of file class.ilObjFileBasedLMGUI.php.

991 {
992 global $ilErr;
993
994 if (!$this->checkPermissionBool("create", "", "htlm") || $a_dir == "")
995 {
996 $ilErr->raiseError($this->lng->txt("no_create_permission"));
997 }
998
999 // create instance
1000 $newObj = new ilObjFileBasedLM();
1001 $filename = ilUtil::stripSlashes($_FILES["importfile"]["name"]);
1002 $newObj->setTitle($filename);
1003 $newObj->setDescription("");
1004 $newObj->create();
1005 $newObj->populateByDirectoy($a_dir, $filename);
1006 $this->putObjectInTree($newObj);
1007
1008 $this->afterSave($newObj);
1009 }
$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 640 of file class.ilObjFileBasedLMGUI.php.

641 {
642 // questionable workaround to make this old stuff work
643 $this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());
644
645 //$this->setTabs();
646 $this->deleteBibItemObject($this->ctrl->getLinkTarget($this));
647 }
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 614 of file class.ilObjFileBasedLMGUI.php.

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

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 434 of file class.ilObjFileBasedLMGUI.php.

435 {
436 $this->prepareOutput();
437 $this->editObject();
438 }
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 602 of file class.ilObjFileBasedLMGUI.php.

603 {
604 // questionable workaround to make this old stuff work
605 $this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());
606
607 //$this->setTabs();
608 $this->editBibItemObject($this->ctrl->getLinkTarget($this));
609 }
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 576 of file class.ilObjFileBasedLMGUI.php.

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

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 420 of file class.ilObjFileBasedLMGUI.php.

421 {
422 global $rbacsystem, $tree, $tpl;
423
424 if (!$rbacsystem->checkAccess("visible,write",$this->object->getRefId()))
425 {
426 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
427 }
428
429 }
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 'ilmdeditorgui':
95 $this->checkPermission("write");
96 $ilTabs->activateTab('id_meta_data');
97 include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
98
99 $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
100 $md_gui->addObserver($this->object,'MDUpdateListener','General');
101
102 $this->ctrl->forwardCommand($md_gui);
103 break;
104
105 case "ilfilesystemgui":
106 $this->checkPermission("write");
107 $ilTabs->activateTab('id_list_files');
108 $fs_gui = new ilFileSystemGUI($this->object->getDataDirectory());
109 $fs_gui->activateLabels(true, $this->lng->txt("cont_purpose"));
110 $fs_gui->setUseUploadDirectory(true);
111 $fs_gui->setTableId("htlmfs".$this->object->getId());
112 if ($this->object->getStartFile() != "")
113 {
114 $fs_gui->labelFile($this->object->getStartFile(),
115 $this->lng->txt("cont_startfile"));
116 }
117 $fs_gui->addCommand($this, "setStartFile", $this->lng->txt("cont_set_start_file"));
118
119 $this->ctrl->forwardCommand($fs_gui);
120
121 // try to set start file automatically
122 require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
123 if (!ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId()))
124 {
125 $do_update = false;
126
127 $pcommand = $fs_gui->getLastPerformedCommand();
128 if (is_array($pcommand))
129 {
130 $valid = array("index.htm", "index.html", "start.htm", "start.html");
131 if($pcommand["cmd"] == "create_file")
132 {
133 $file = strtolower(basename($pcommand["name"]));
134 if(in_array($file, $valid))
135 {
136 $this->object->setStartFile($pcommand["name"]);
137 $do_update = $pcommand["name"];
138 }
139 }
140 else if($pcommand["cmd"] == "unzip_file")
141 {
142 $zip_file = strtolower(basename($pcommand["name"]));
143 $suffix = strrpos($zip_file, ".");
144 if($suffix)
145 {
146 $zip_file = substr($zip_file, 0, $suffix);
147 }
148 foreach($pcommand["added"] as $file)
149 {
150 $chk_file = null;
151 if(stristr($file, ".htm"))
152 {
153 $chk_file = strtolower(basename($file));
154 $suffix = strrpos($chk_file, ".");
155 if($suffix)
156 {
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 {
163 $this->object->setStartFile($file);
164 $do_update = $file;
165 break;
166 }
167 }
168 }
169 }
170
171 if($do_update)
172 {
173 ilUtil::sendInfo(sprintf($this->lng->txt("cont_start_file_set_to"), $do_update), true);
174
175 $this->object->update();
176 $this->ctrl->redirectByClass("ilfilesystemgui", "listFiles");
177 }
178 }
179 break;
180
181 case "ilinfoscreengui":
182 $ret =& $this->outputInfoScreen();
183 break;
184
185 case "illearningprogressgui":
186 $ilTabs->activateTab('id_learning_progress');
187 include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
189 $this->object->getRefId(),
190 $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId());
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 'illicensegui':
202 $ilTabs->activateTab('id_license');
203 include_once("./Services/License/classes/class.ilLicenseGUI.php");
204 $license_gui =& new ilLicenseGUI($this);
205 $ret =& $this->ctrl->forwardCommand($license_gui);
206 break;
207
208 case "ilexportgui":
209 $ilTabs->activateTab("export");
210 include_once("./Services/Export/classes/class.ilExportGUI.php");
211 $exp_gui = new ilExportGUI($this);
212 $exp_gui->addFormat("xml");
213 $exp_gui->addFormat("html", "", $this, "exportHTML");
214 $ret = $this->ctrl->forwardCommand($exp_gui);
215// $this->tpl->show();
216 break;
217
218 case "ilcommonactiondispatchergui":
219 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
221 $this->ctrl->forwardCommand($gui);
222 break;
223
224 default:
225 $cmd = $this->ctrl->getCmd("frameset");
226 if (strtolower($_GET["baseClass"]) == "iladministrationgui" ||
227 $this->getCreationMode() == true)
228 {
229 $cmd.= "Object";
230 }
231 $ret =& $this->$cmd();
232 break;
233 }
234
235 $this->addHeaderAction();
236 }
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
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 1022 of file class.ilObjFileBasedLMGUI.php.

1023 {
1024 $inst_id = IL_INST_ID;
1025
1026 include_once("./Services/Export/classes/class.ilExport.php");
1027
1028 ilExport::_createExportDirectory($this->object->getId(), "html",
1029 $this->object->getType());
1030 $export_dir = ilExport::_getExportDirectory($this->object->getId(), "html",
1031 $this->object->getType());
1032
1033 $subdir = $this->object->getType()."_".$this->object->getId();
1034 $filename = $this->subdir.".zip";
1035
1036 $target_dir = $export_dir."/".$subdir;
1037
1038 ilUtil::delDir($target_dir);
1039 ilUtil::makeDir($target_dir);
1040
1041 $source_dir = $this->object->getDataDirectory();
1042
1043 ilUtil::rCopy($source_dir, $target_dir);
1044
1045 // zip it all
1046 $date = time();
1047 $zip_file = $export_dir."/".$date."__".IL_INST_ID."__".
1048 $this->object->getType()."_".$this->object->getId().".zip";
1049 ilUtil::zip($target_dir, $zip_file);
1050
1051 ilUtil::delDir($target_dir);
1052 }
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 710 of file class.ilObjFileBasedLMGUI.php.

711 {
712 global $ilCtrl;
713
714 $ilCtrl->setCmdClass("ilfilesystemgui");
715 $ilCtrl->setCmd("listFiles");
716 return $this->executeCommand();
717 }

References $ilCtrl, and executeCommand().

+ Here is the call graph for this function:

◆ getSettingsFormValues()

ilObjFileBasedLMGUI::getSettingsFormValues ( )

Get current values for settings from.

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

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

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 $ilTabs->addTab("id_meta_data",
888 $lng->txt("meta_data"),
889 $this->ctrl->getLinkTargetByClass('ilmdeditorgui',''));
890
891 if($this->object->getShowBibliographicalData())
892 {
893 $ilTabs->addTab("id_bib_data",
894 $lng->txt("bib_data"),
895 $this->ctrl->getLinkTarget($this, "editBibItem"));
896 }
897 }
898
899
900 // export
901 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
902 {
903 $ilTabs->addTab("export",
904 $lng->txt("export"),
905 $this->ctrl->getLinkTargetByClass("ilexportgui", ""));
906 }
907
908 if ($ilAccess->checkAccess('edit_permission', '', $this->object->getRefId()))
909 {
910 $ilTabs->addTab("id_permissions",
911 $lng->txt("perm_settings"),
912 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"));
913 }
914
915 require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
916 $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
917
918 if ($startfile != "")
919 {
920 $ilTabs->addNonTabbedLink("presentation_view",
921 $this->lng->txt("glo_presentation_view"),
922 "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=".$this->object->getRefID(),
923 "_blank"
924 );
925 }
926
927 }
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 722 of file class.ilObjFileBasedLMGUI.php.

723 {
724 global $lng;
725
726 $this->tpl->getStandardTemplate();
727 }

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

Reimplemented from ilObjectGUI.

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

972 {
973 try
974 {
975 return parent::importFileObject();
976 }
978 {
979 // since there is no manifest xml we assume that this is an HTML export file
980 $this->createFromDirectory($e->getTmpDir());
981 }
982 }
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 238 of file class.ilObjFileBasedLMGUI.php.

239 {
240 $forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
241 self::CFORM_IMPORT => $this->initImportForm($a_new_type));
242
243 return $forms;
244 }
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 277 of file class.ilObjFileBasedLMGUI.php.

278 {
279 global $lng, $ilCtrl, $ilAccess;
280
281 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
282 $this->form = new ilPropertyFormGUI();
283
284 // title
285 $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
286 $ti->setSize(min(40, ilObject::TITLE_LENGTH));
287 $ti->setMaxLength(ilObject::TITLE_LENGTH);
288 $ti->setRequired(true);
289 $this->form->addItem($ti);
290
291 // description
292 $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
293 $ta->setCols(40);
294 $ta->setRows(2);
295 $this->form->addItem($ta);
296
297 // online
298 $cb = new ilCheckboxInputGUI($lng->txt("cont_online"), "cobj_online");
299 $cb->setOptionTitle($lng->txt(""));
300 $cb->setValue("y");
301 $this->form->addItem($cb);
302
303 // startfile
304 require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
305 $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
306
307 $ne = new ilNonEditableValueGUI($lng->txt("cont_startfile"), "");
308 if ($startfile != "")
309 {
310 $ne->setValue(basename($startfile));
311 }
312 else
313 {
314 $ne->setValue(basename($this->lng->txt("no_start_file")));
315 }
316 $this->form->addItem($ne);
317
318 include_once("Services/License/classes/class.ilLicenseAccess.php");
320 {
321 $lic = new ilCheckboxInputGUI($lng->txt("cont_license"), "lic");
322 $lic->setInfo($lng->txt("cont_license_info"));
323 $this->form->addItem($lic);
324
325 if(!$ilAccess->checkAccess('edit_permission', '', $this->ref_id))
326 {
327 $lic->setDisabled(true);
328 }
329 }
330
331 $bib = new ilCheckboxInputGUI($lng->txt("cont_biblio"), "bib");
332 $bib->setInfo($lng->txt("cont_biblio_info"));
333 $this->form->addItem($bib);
334
335 $this->form->addCommandButton("saveProperties", $lng->txt("save"));
336 $this->form->addCommandButton("toFilesystem", $lng->txt("cont_set_start_file"));
337
338 $this->form->setTitle($lng->txt("cont_lm_properties"));
339 $this->form->setFormAction($ilCtrl->getFormAction($this, "saveProperties"));
340 }
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.

References $_GET, 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 524 of file class.ilObjFileBasedLMGUI.php.

525 {
526 $this->setFormAction("permSave", "fblm_edit.php?cmd=permSave&ref_id=".$_GET["ref_id"].
527 "&obj_id=".$_GET["obj_id"]);
528 $this->setFormAction("addRole", "fblm_edit.php?ref_id=".$_GET["ref_id"].
529 "&obj_id=".$_GET["obj_id"]."&cmd=addRole");
530 $this->permObject();
531 }
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 263 of file class.ilObjFileBasedLMGUI.php.

264 {
265 global $rbacsystem, $tree, $tpl, $ilTabs;
266
267 $ilTabs->activateTab("id_settings");
268
269 $this->initSettingsForm();
270 $this->getSettingsFormValues();
271 $tpl->setContent($this->form->getHTML());
272 }
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 564 of file class.ilObjFileBasedLMGUI.php.

565 {
566 // questionable workaround to make this old stuff work
567 $this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());
568
569 //$this->setTabs();
570 $this->saveBibItemObject($this->ctrl->getLinkTarget($this));
571 }
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 536 of file class.ilObjFileBasedLMGUI.php.

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

References $_GET, and $_POST.

Referenced by saveBibItem().

+ Here is the caller graph for this function:

◆ saveProperties()

ilObjFileBasedLMGUI::saveProperties ( )

Save properties form.

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

388 {
389 global $tpl, $ilAccess, $ilTabs;
390
391 $this->initSettingsForm("");
392 if ($this->form->checkInput())
393 {
394 $this->object->setTitle($this->form->getInput("title"));
395 $this->object->setDescription($this->form->getInput("desc"));
396 $this->object->setOnline(ilUtil::yn2tf($_POST["cobj_online"]));
397 $this->object->setShowBibliographicalData($this->form->getInput("bib"));
398
399 $lic = $this->form->getItemByPostVar("lic");
400 if($lic && !$lic->getDisabled())
401 {
402 $this->object->setShowLicense($this->form->getInput("lic"));
403 }
404
405 $this->object->update();
406 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
407 $this->ctrl->redirect($this, "properties");
408 }
409
410 $ilTabs->activateTab("id_settings");
411 $this->form->setValuesByPost();
412 $tpl->setContent($this->form->getHtml());
413 }
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 514 of file class.ilObjFileBasedLMGUI.php.

515 {
516 $this->object->setStartFile($a_file);
517 $this->object->update();
518 $this->ctrl->redirectByClass("ilfilesystemgui", "listFiles");
519 }

◆ 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 729 of file class.ilObjFileBasedLMGUI.php.

730 {
731 global $ilUser;
732
733 // Note license usage
734 include_once "Services/License/classes/class.ilLicense.php";
735 ilLicense::_noteAccess($this->object->getId(), $this->object->getType(),
736 $this->object->getRefId());
737
738 // #9483
739 if ($ilUser->getId() != ANONYMOUS_USER_ID)
740 {
741 include_once "Services/Tracking/classes/class.ilLearningProgress.php";
742 ilLearningProgress::_tracProgress($ilUser->getId(), $this->object->getId(),
743 $this->object->getRefId(), "htlm");
744 }
745
746 require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
747 $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.

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

+ Here is the call graph for this function:

◆ toFilesystem()

ilObjFileBasedLMGUI::toFilesystem ( )

Set start file.

Parameters

return

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

378 {
379 global $ilCtrl;
380
381 $ilCtrl->redirectByClass("ilfilesystemgui", "listFiles");
382 }

References $ilCtrl.

◆ update()

ilObjFileBasedLMGUI::update ( )

update properties

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

507 {
508 //$this->setReturnLocation("update", "fblm_edit.php?cmd=listFiles&ref_id=".$_GET["ref_id"].
509 // "&obj_id=".$_GET["obj_id"]);
510 $this->updateObject();
511 }
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: