ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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.
 executeCommand ()
 execute command
 cancelCreationObject ($in_rep=false)
 cancel action and go back to previous page public
 properties ()
 edit properties of object (admin form)
 initSettingsForm ()
 Init settings form.
 getSettingsFormValues ()
 Get current values for settings from.
 toFilesystem ()
 Set start file.
 saveProperties ()
 Save properties form.
 editObject ()
 edit properties of object (admin form)
 edit ()
 edit properties of object (module form)
 cancel ()
 cancel editing
 afterSave ($newObj)
 save object public
 update ()
 update properties
 setStartFile ($a_file)
 perm ()
 permission form
 saveBibItemObject ($a_target="")
 save bib item (admin call)
 saveBibItem ()
 save bib item (module call)
 editBibItemObject ($a_target="")
 edit bib items (admin call)
 editBibItem ()
 edit bib items (module call)
 deleteBibItemObject ($a_target="")
 delete bib item (admin call)
 deleteBibItem ()
 delete bib item (module call)
 addBibItemObject ($a_target="")
 add bib item (admin call)
 addBibItem ()
 add bib item (module call)
 frameset ()
 Frameset -> Output list of files.
 getTemplate ()
 output main header (title and locator)
 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
 showInfoScreen ()
 info screen call from inside learning module
 outputInfoScreen ($a_standard_locator=true)
 info screen
 setTabs ()
 output tabs
 getTabs ()
 adds tabs to tab gui object
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 importFileObject ($parent_id=null)
 Import file.
 createFromDirectory ($a_dir)
 Create new object from a html zip file.
 exportHTML ()
 create html package
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 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
 getCreationMode ()
 get creation mode
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getHTML ()
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 createObject ()
 create new object form
 cancelCreation ()
 cancel create action and go back to repository parent
 saveObject ()
 save object
 updateObject ()
 updates object entry in object_data
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.

Static Public Member Functions

static _goto ($a_target)
 redirect script
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root.
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root.

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.
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu.
 insertHeaderAction ($a_list_gui)
 Insert header action into main template.
 addHeaderAction ()
 Add header action menu.
 redrawHeaderActionObject ()
 Ajax call: redraw action header only.
 showMountWebfolderIcon ()
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 omitLocator ($a_omit=true)
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded)
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion)
 initCreateForm ($a_new_type)
 Init object creation form.
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types.
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates.
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen.
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position.
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook.
 initEditForm ()
 Init object edit form.
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form.
 getEditFormValues ()
 Get values for edit form.
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields.
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput())
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object.
 afterUpdate ()
 Post (successful) object update hook.
 initImportForm ($a_new_type)
 Init object import form.
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook.
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 getTabs (&$tabs_gui)
 get tabs abstract method.
 __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
 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
 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.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error.
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission.
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files.
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting.

Detailed Description

Member Function Documentation

static ilObjFileBasedLMGUI::_goto (   $a_target)
static

redirect script

Parameters
string$a_target

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

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

{
global $rbacsystem, $ilErr, $lng, $ilAccess;
if ($ilAccess->checkAccess("read", "", $a_target) ||
$ilAccess->checkAccess("visible", "", $a_target))
{
ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
}
else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
{
ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
}
$ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
}

+ Here is the call graph for this function:

ilObjFileBasedLMGUI::addBibItem ( )

add bib item (module call)

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

References addBibItemObject(), and ilCtrl\IL_RTOKEN_NAME.

{
// questionable workaround to make this old stuff work
$this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());
//$this->setTabs();
$this->addBibItemObject($this->ctrl->getLinkTarget($this));
}

+ Here is the call graph for this function:

ilObjFileBasedLMGUI::addBibItemObject (   $a_target = "")

add bib item (admin call)

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

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

Referenced by addBibItem().

{
global $ilTabs;
$ilTabs->activateTab("id_bib_data");
$bibItemName = $_POST["bibItemName"] ? $_POST["bibItemName"] : $_GET["bibItemName"];
$bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
if ($bibItemName == "BibItem")
{
include_once "./Modules/LearningModule/classes/class.ilBibItem.php";
$bib_item =& new ilBibItem();
$bib_item->setId($this->object->getId());
$bib_item->setType($this->object->getType());
$bib_item->read();
}
include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
$bib_gui =& new ilBibItemGUI();
$bib_gui->setObject($this->object);
if ($bibItemIndex == "")
$bibItemIndex = 0;
$bibItemPath = $_POST["bibItemPath"] ? $_POST["bibItemPath"] : $_GET["bibItemPath"];
//if ($bibItemName != "" && $bibItemName != "BibItem")
if ($bibItemName != "")
{
$bib_gui->bib_obj->add($bibItemName, $bibItemPath, $bibItemIndex);
$data = $bib_gui->bib_obj->getElement("BibItem");
$bibItemIndex = (count($data) - 1);
}
else
{
ilUtil::sendInfo($this->lng->txt("bibitem_choose_element"), true);
}
if ($a_target == "")
{
$a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
}
$bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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.

References $_GET.

{
global $ilLocator;
if (is_object($this->object))
{
$ilLocator->addItem($this->object->getTitle(),
$this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"), "", $_GET["ref_id"]);
}
}
ilObjFileBasedLMGUI::afterSave (   $newObj)

save object public

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

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

Referenced by createFromDirectory().

{
if(!$newObj->getStartFile())
{
// try to set start file automatically
$files = array();
include_once "Services/Utilities/classes/class.ilFileUtils.php";
ilFileUtils::recursive_dirscan($newObj->getDataDirectory(), $files);
if(is_array($files["file"]))
{
$zip_file = null;
if(stristr($newObj->getTitle(), ".zip"))
{
$zip_file = strtolower($newObj->getTitle());
$suffix = strrpos($zip_file, ".");
if($suffix)
{
$zip_file = substr($zip_file, 0, $suffix);
}
}
$valid = array("index.htm", "index.html", "start.htm", "start.html");
foreach($files["file"] as $idx => $file)
{
$chk_file = null;
if(stristr($file, ".htm"))
{
$chk_file = strtolower($file);
$suffix = strrpos($chk_file, ".");
if($suffix)
{
$chk_file = substr($chk_file, 0, $suffix);
}
}
if(in_array($file, $valid) ||
($chk_file && $zip_file && $chk_file == $zip_file))
{
$newObj->setStartFile(str_replace($newObj->getDataDirectory()."/", "", $files["path"][$idx]).$file);
$newObj->update();
break;
}
}
}
}
// always send a message
ilUtil::sendSuccess($this->lng->txt("object_added"),true);
ilUtil::redirect("ilias.php?baseClass=ilHTLMEditorGUI&ref_id=".$newObj->getRefId());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjFileBasedLMGUI::cancel ( )

cancel editing

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

References ilObjectGUI\cancelObject().

{
//$this->setReturnLocation("cancel","fblm_edit.php?cmd=listFiles&ref_id=".$_GET["ref_id"]);
$this->cancelObject();
}

+ Here is the call graph for this function:

ilObjFileBasedLMGUI::cancelCreationObject (   $in_rep = false)
final

cancel action and go back to previous page public

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

References $ilCtrl.

{
global $ilCtrl;
$ilCtrl->redirectByClass("ilrepositorygui", "frameset");
}
ilObjFileBasedLMGUI::createFromDirectory (   $a_dir)

Create new object from a html zip file.

Parameters
@return

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

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

Referenced by importFileObject().

{
global $ilErr;
if (!$this->checkPermissionBool("create", "", "htlm") || $a_dir == "")
{
$ilErr->raiseError($this->lng->txt("no_create_permission"));
}
// create instance
$newObj = new ilObjFileBasedLM();
$filename = ilUtil::stripSlashes($_FILES["importfile"]["name"]);
$newObj->setTitle($filename);
$newObj->setDescription("");
$newObj->create();
$newObj->populateByDirectoy($a_dir, $filename);
$this->putObjectInTree($newObj);
$this->afterSave($newObj);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjFileBasedLMGUI::deleteBibItem ( )

delete bib item (module call)

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

References deleteBibItemObject(), and ilCtrl\IL_RTOKEN_NAME.

{
// questionable workaround to make this old stuff work
$this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());
//$this->setTabs();
$this->deleteBibItemObject($this->ctrl->getLinkTarget($this));
}

+ Here is the call graph for this function:

ilObjFileBasedLMGUI::deleteBibItemObject (   $a_target = "")

delete bib item (admin call)

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

References $_GET, and $_POST.

Referenced by deleteBibItem().

{
global $ilTabs;
$ilTabs->activateTab("id_bib_data");
include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
$bib_gui =& new ilBibItemGUI();
$bib_gui->setObject($this->object);
$bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
$bib_gui->bib_obj->delete($_GET["bibItemName"], $_GET["bibItemPath"], $bibItemIndex);
if (strpos($bibItemIndex, ",") > 0)
{
$bibItemIndex = substr($bibItemIndex, 0, strpos($bibItemIndex, ","));
}
if ($a_target == "")
{
$a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
}
$bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, max(0, $bibItemIndex - 1));
}

+ Here is the caller graph for this function:

ilObjFileBasedLMGUI::edit ( )

edit properties of object (module form)

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

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

{
$this->prepareOutput();
$this->editObject();
}

+ Here is the call graph for this function:

ilObjFileBasedLMGUI::editBibItem ( )

edit bib items (module call)

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

References editBibItemObject(), and ilCtrl\IL_RTOKEN_NAME.

{
// questionable workaround to make this old stuff work
$this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());
//$this->setTabs();
$this->editBibItemObject($this->ctrl->getLinkTarget($this));
}

+ Here is the call graph for this function:

ilObjFileBasedLMGUI::editBibItemObject (   $a_target = "")

edit bib items (admin call)

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

References $_GET, and $_POST.

Referenced by editBibItem().

{
global $ilTabs;
$ilTabs->activateTab("id_bib_data");
include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
$bib_gui =& new ilBibItemGUI();
$bib_gui->setObject($this->object);
$bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
$bibItemIndex *= 1;
if ($bibItemIndex < 0)
{
$bibItemIndex = 0;
}
if ($a_target == "")
{
$a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
}
$bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
}

+ Here is the caller graph for this function:

ilObjFileBasedLMGUI::editObject ( )

edit properties of object (admin form)

public

Reimplemented from ilObjectGUI.

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

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

Referenced by edit().

{
global $rbacsystem, $tree, $tpl;
if (!$rbacsystem->checkAccess("visible,write",$this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
}

+ Here is the caller graph for this function:

ilObjFileBasedLMGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

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

Referenced by frameset().

{
global $ilUser, $ilLocator, $ilTabs;
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
if (strtolower($_GET["baseClass"]) == "iladministrationgui" ||
$this->getCreationMode() == true)
{
$this->prepareOutput();
}
else
{
if (!in_array($cmd, array("", "framset")) || $next_class != "")
{
$this->getTemplate();
$this->setLocator();
$this->setTabs();
}
}
if(!$this->getCreationMode())
{
if(IS_PAYMENT_ENABLED)
{
include_once 'Services/Payment/classes/class.ilPaymentObject.php';
if(ilPaymentObject::_requiresPurchaseToAccess($_GET['ref_id'], $type = (isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL) ))
{
$this->tpl->getStandardTemplate();
include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php';
$pp = new ilShopPurchaseGUI((int)$_GET['ref_id']);
$ret = $this->ctrl->forwardCommand($pp);
return true;
}
}
}
switch($next_class)
{
case 'ilmdeditorgui':
$this->checkPermission("write");
$ilTabs->activateTab('id_meta_data');
include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
$md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
$md_gui->addObserver($this->object,'MDUpdateListener','General');
$this->ctrl->forwardCommand($md_gui);
break;
case "ilfilesystemgui":
$this->checkPermission("write");
$ilTabs->activateTab('id_list_files');
$fs_gui = new ilFileSystemGUI($this->object->getDataDirectory());
$fs_gui->activateLabels(true, $this->lng->txt("cont_purpose"));
$fs_gui->setUseUploadDirectory(true);
$fs_gui->setTableId("htlmfs".$this->object->getId());
if ($this->object->getStartFile() != "")
{
$fs_gui->labelFile($this->object->getStartFile(),
$this->lng->txt("cont_startfile"));
}
$fs_gui->addCommand($this, "setStartFile", $this->lng->txt("cont_set_start_file"));
$this->ctrl->forwardCommand($fs_gui);
// try to set start file automatically
require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
if (!ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId()))
{
$do_update = false;
$pcommand = $fs_gui->getLastPerformedCommand();
if (is_array($pcommand))
{
$valid = array("index.htm", "index.html", "start.htm", "start.html");
if($pcommand["cmd"] == "create_file")
{
$file = strtolower(basename($pcommand["name"]));
if(in_array($file, $valid))
{
$this->object->setStartFile($pcommand["name"]);
$do_update = $pcommand["name"];
}
}
else if($pcommand["cmd"] == "unzip_file")
{
$zip_file = strtolower(basename($pcommand["name"]));
$suffix = strrpos($zip_file, ".");
if($suffix)
{
$zip_file = substr($zip_file, 0, $suffix);
}
foreach($pcommand["added"] as $file)
{
$chk_file = null;
if(stristr($file, ".htm"))
{
$chk_file = strtolower(basename($file));
$suffix = strrpos($chk_file, ".");
if($suffix)
{
$chk_file = substr($chk_file, 0, $suffix);
}
}
if(in_array(basename($file), $valid) ||
($zip_file && $chk_file && $chk_file == $zip_file))
{
$this->object->setStartFile($file);
$do_update = $file;
break;
}
}
}
}
if($do_update)
{
ilUtil::sendInfo(sprintf($this->lng->txt("cont_start_file_set_to"), $do_update), true);
$this->object->update();
$this->ctrl->redirectByClass("ilfilesystemgui", "listFiles");
}
}
break;
case "ilinfoscreengui":
$ret =& $this->outputInfoScreen();
break;
case "illearningprogressgui":
$ilTabs->activateTab('id_learning_progress');
include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
$this->object->getRefId(),
$_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId());
$this->ctrl->forwardCommand($new_gui);
break;
case 'ilpermissiongui':
$ilTabs->activateTab('id_permissions');
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
case 'illicensegui':
$ilTabs->activateTab('id_license');
include_once("./Services/License/classes/class.ilLicenseGUI.php");
$license_gui =& new ilLicenseGUI($this);
$ret =& $this->ctrl->forwardCommand($license_gui);
break;
case "ilexportgui":
$ilTabs->activateTab("export");
include_once("./Services/Export/classes/class.ilExportGUI.php");
$exp_gui = new ilExportGUI($this);
$exp_gui->addFormat("xml");
$exp_gui->addFormat("html", "", $this, "exportHTML");
$ret = $this->ctrl->forwardCommand($exp_gui);
// $this->tpl->show();
break;
case "ilcommonactiondispatchergui":
include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
$this->ctrl->forwardCommand($gui);
break;
default:
$cmd = $this->ctrl->getCmd("frameset");
if (strtolower($_GET["baseClass"]) == "iladministrationgui" ||
$this->getCreationMode() == true)
{
$cmd.= "Object";
}
$ret =& $this->$cmd();
break;
}
$this->addHeaderAction();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjFileBasedLMGUI::exportHTML ( )

create html package

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

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

{
$inst_id = IL_INST_ID;
include_once("./Services/Export/classes/class.ilExport.php");
ilExport::_createExportDirectory($this->object->getId(), "html",
$this->object->getType());
$export_dir = ilExport::_getExportDirectory($this->object->getId(), "html",
$this->object->getType());
$subdir = $this->object->getType()."_".$this->object->getId();
$filename = $this->subdir.".zip";
$target_dir = $export_dir."/".$subdir;
ilUtil::delDir($target_dir);
ilUtil::makeDir($target_dir);
$source_dir = $this->object->getDataDirectory();
ilUtil::rCopy($source_dir, $target_dir);
// zip it all
$date = time();
$zip_file = $export_dir."/".$date."__".IL_INST_ID."__".
$this->object->getType()."_".$this->object->getId().".zip";
ilUtil::zip($target_dir, $zip_file);
ilUtil::delDir($target_dir);
}

+ Here is the call graph for this function:

ilObjFileBasedLMGUI::frameset ( )

Frameset -> Output list of files.

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

References $ilCtrl, and executeCommand().

{
global $ilCtrl;
$ilCtrl->setCmdClass("ilfilesystemgui");
$ilCtrl->setCmd("listFiles");
return $this->executeCommand();
}

+ Here is the call graph for this function:

ilObjFileBasedLMGUI::getSettingsFormValues ( )

Get current values for settings from.

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

References ilObjFileBasedLMAccess\_determineStartUrl().

Referenced by properties().

{
require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
$startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
$values = array();
$values["cobj_online"] = $this->object->getOnline();
if ($startfile != "")
{
$startfile = basename($startfile);
}
else
{
$startfile = $this->lng->txt("no_start_file");
}
$values["cobj_online"] = $this->object->getOnline();
$values["startfile"] = $startfile;
$values["title"] = $this->object->getTitle();
$values["desc"] = $this->object->getDescription();
$values["lic"] = $this->object->getShowLicense();
$values["bib"] = $this->object->getShowBibliographicalData();
$this->form->setValuesByArray($values);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjFileBasedLMGUI::getTabs ( )

adds tabs to tab gui object

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

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

Referenced by setTabs().

{
global $ilUser, $ilAccess, $ilTabs, $lng, $ilHelp;
$ilHelp->setScreenIdComponent("htlm");
if($ilAccess->checkAccess('write', '', $this->ref_id))
{
$ilTabs->addTab("id_list_files",
$lng->txt("cont_list_files"),
$this->ctrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"));
}
if($ilAccess->checkAccess('visible', '', $this->ref_id))
{
$ilTabs->addTab("id_info",
$lng->txt("info_short"),
$this->ctrl->getLinkTargetByClass(array("ilobjfilebasedlmgui", "ilinfoscreengui"), "showSummary"));
}
if($ilAccess->checkAccess('write', '', $this->ref_id))
{
$ilTabs->addTab("id_settings",
$lng->txt("settings"),
$this->ctrl->getLinkTarget($this, "properties"));
}
include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
if(ilLearningProgressAccess::checkAccess($this->object->getRefId()))
{
$ilTabs->addTab("id_learning_progress",
$lng->txt("learning_progress"),
$this->ctrl->getLinkTargetByClass(array('ilobjfilebasedlmgui','illearningprogressgui'), ''));
}
include_once("Services/License/classes/class.ilLicenseAccess.php");
if ($ilAccess->checkAccess('edit_permission', '', $this->ref_id) &&
$this->object->getShowLicense())
{
$ilTabs->addTab("id_license",
$lng->txt("license"),
$this->ctrl->getLinkTargetByClass('illicensegui', ''));
}
if($ilAccess->checkAccess('write', '', $this->ref_id))
{
$ilTabs->addTab("id_meta_data",
$lng->txt("meta_data"),
$this->ctrl->getLinkTargetByClass('ilmdeditorgui',''));
if($this->object->getShowBibliographicalData())
{
$ilTabs->addTab("id_bib_data",
$lng->txt("bib_data"),
$this->ctrl->getLinkTarget($this, "editBibItem"));
}
}
// export
if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
$ilTabs->addTab("export",
$lng->txt("export"),
$this->ctrl->getLinkTargetByClass("ilexportgui", ""));
}
if ($ilAccess->checkAccess('edit_permission', '', $this->object->getRefId()))
{
$ilTabs->addTab("id_permissions",
$lng->txt("perm_settings"),
$this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"));
}
require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
$startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
if ($startfile != "")
{
$ilTabs->addNonTabbedLink("presentation_view",
$this->lng->txt("glo_presentation_view"),
"ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=".$this->object->getRefID(),
"_blank"
);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjFileBasedLMGUI::getTemplate ( )

output main header (title and locator)

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

References ilObjectGUI\$lng.

Referenced by executeCommand().

{
global $lng;
$this->tpl->getStandardTemplate();
}

+ Here is the caller graph for this function:

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

Constructor.

public

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

References $ilCtrl, ilObjectGUI\$lng, and ilObjectGUI\ilObjectGUI().

{
global $lng, $ilCtrl;
$this->ctrl = $ilCtrl;
$this->ctrl->saveParameter($this, array("ref_id"));
$this->type = "htlm";
$lng->loadLanguageModule("content");
parent::ilObjectGUI($a_data, $a_id, $a_call_by_reference, false);
//$this->actions = $this->objDefinition->getActions("mep");
$this->output_prepared = $a_prepare_output;
}

+ Here is the call graph for this function:

ilObjFileBasedLMGUI::importFileObject (   $parent_id = null)

Import file.

Parameters
@return

Reimplemented from ilObjectGUI.

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

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

{
try
{
}
{
// since there is no manifest xml we assume that this is an HTML export file
}
}

+ Here is the call graph for this function:

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.

References outputInfoScreen().

{
$this->ctrl->setCmd("showSummary");
$this->ctrl->setCmdClass("ilinfoscreengui");
$this->outputInfoScreen();
}

+ Here is the call graph for this function:

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.

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

{
$forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
self::CFORM_IMPORT => $this->initImportForm($a_new_type));
return $forms;
}

+ Here is the call graph for this function:

ilObjFileBasedLMGUI::initSettingsForm ( )

Init settings form.

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

References $ilCtrl, ilObjectGUI\$lng, ilObjFileBasedLMAccess\_determineStartUrl(), ilLicenseAccess\_isEnabled(), ilTextAreaInputGUI\setCols(), ilFormPropertyGUI\setInfo(), ilCheckboxInputGUI\setOptionTitle(), ilTextInputGUI\setSize(), ilNonEditableValueGUI\setValue(), and ilObject\TITLE_LENGTH.

Referenced by properties(), and saveProperties().

{
global $lng, $ilCtrl, $ilAccess;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
// title
$ti = new ilTextInputGUI($this->lng->txt("title"), "title");
$ti->setMaxLength(ilObject::TITLE_LENGTH);
$ti->setRequired(true);
$this->form->addItem($ti);
// description
$ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
$ta->setCols(40);
$ta->setRows(2);
$this->form->addItem($ta);
// online
$cb = new ilCheckboxInputGUI($lng->txt("cont_online"), "cobj_online");
$cb->setOptionTitle($lng->txt(""));
$cb->setValue("y");
$this->form->addItem($cb);
// startfile
require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
$startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
$ne = new ilNonEditableValueGUI($lng->txt("cont_startfile"), "");
if ($startfile != "")
{
$ne->setValue(basename($startfile));
}
else
{
$ne->setValue(basename($this->lng->txt("no_start_file")));
}
$this->form->addItem($ne);
include_once("Services/License/classes/class.ilLicenseAccess.php");
{
$lic = new ilCheckboxInputGUI($lng->txt("cont_license"), "lic");
$lic->setInfo($lng->txt("cont_license_info"));
$this->form->addItem($lic);
if(!$ilAccess->checkAccess('edit_permission', '', $this->ref_id))
{
$lic->setDisabled(true);
}
}
$bib = new ilCheckboxInputGUI($lng->txt("cont_biblio"), "bib");
$bib->setInfo($lng->txt("cont_biblio_info"));
$this->form->addItem($bib);
$this->form->addCommandButton("saveProperties", $lng->txt("save"));
$this->form->addCommandButton("toFilesystem", $lng->txt("cont_set_start_file"));
$this->form->setTitle($lng->txt("cont_lm_properties"));
$this->form->setFormAction($ilCtrl->getFormAction($this, "saveProperties"));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjFileBasedLMGUI::outputInfoScreen (   $a_standard_locator = true)

info screen

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

References $_GET, and ilLinkButton\getInstance().

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

{
global $ilToolbar, $ilAccess, $ilTabs;
$ilTabs->activateTab('id_info');
$this->lng->loadLanguageModule("meta");
include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
$info = new ilInfoScreenGUI($this);
$info->enablePrivateNotes();
$info->enableLearningProgress();
$info->enableNews();
if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
{
$info->enableNewsEditing();
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
if ($enable_internal_rss)
{
$info->setBlockProperty("news", "settings", true);
}
}
// add read / back button
if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
{
// #15127
include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
$button->setCaption("view");
$button->setPrimary(true);
$button->setUrl("ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=".$this->object->getRefID());
$button->setTarget("ilContObj".$this->object->getId());
$ilToolbar->addButtonInstance($button);
}
// show standard meta data section
$info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
// forward the command
$this->ctrl->forwardCommand($info);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjFileBasedLMGUI::perm ( )

permission form

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

References $_GET, and ilObjectGUI\setFormAction().

{
$this->setFormAction("permSave", "fblm_edit.php?cmd=permSave&ref_id=".$_GET["ref_id"].
"&obj_id=".$_GET["obj_id"]);
$this->setFormAction("addRole", "fblm_edit.php?ref_id=".$_GET["ref_id"].
"&obj_id=".$_GET["obj_id"]."&cmd=addRole");
$this->permObject();
}

+ Here is the call graph for this function:

ilObjFileBasedLMGUI::properties ( )

edit properties of object (admin form)

public

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

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

{
global $rbacsystem, $tree, $tpl, $ilTabs;
$ilTabs->activateTab("id_settings");
$this->initSettingsForm();
$tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilObjFileBasedLMGUI::saveBibItem ( )

save bib item (module call)

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

References ilCtrl\IL_RTOKEN_NAME, and saveBibItemObject().

{
// questionable workaround to make this old stuff work
$this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());
//$this->setTabs();
$this->saveBibItemObject($this->ctrl->getLinkTarget($this));
}

+ Here is the call graph for this function:

ilObjFileBasedLMGUI::saveBibItemObject (   $a_target = "")

save bib item (admin call)

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

References $_GET, and $_POST.

Referenced by saveBibItem().

{
global $ilTabs;
$ilTabs->activateTab("id_bib_data");
include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
$bib_gui =& new ilBibItemGUI();
$bib_gui->setObject($this->object);
$bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
$bibItemIndex *= 1;
if ($bibItemIndex < 0)
{
$bibItemIndex = 0;
}
$bibItemIndex = $bib_gui->save($bibItemIndex);
if ($a_target == "")
{
$a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
}
$bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
}

+ Here is the caller graph for this function:

ilObjFileBasedLMGUI::saveProperties ( )

Save properties form.

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

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

{
global $tpl, $ilAccess, $ilTabs;
$this->initSettingsForm("");
if ($this->form->checkInput())
{
$this->object->setTitle($this->form->getInput("title"));
$this->object->setDescription($this->form->getInput("desc"));
$this->object->setOnline(ilUtil::yn2tf($_POST["cobj_online"]));
$this->object->setShowBibliographicalData($this->form->getInput("bib"));
$lic = $this->form->getItemByPostVar("lic");
if($lic && !$lic->getDisabled())
{
$this->object->setShowLicense($this->form->getInput("lic"));
}
$this->object->update();
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
$this->ctrl->redirect($this, "properties");
}
$ilTabs->activateTab("id_settings");
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}

+ Here is the call graph for this function:

ilObjFileBasedLMGUI::setStartFile (   $a_file)

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

{
$this->object->setStartFile($a_file);
$this->object->update();
$this->ctrl->redirectByClass("ilfilesystemgui", "listFiles");
}
ilObjFileBasedLMGUI::setTabs ( )

output tabs

Reimplemented from ilObjectGUI.

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

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

Referenced by executeCommand().

{
$this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
$this->getTabs();
$this->tpl->setTitle($this->object->getTitle());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjFileBasedLMGUI::showInfoScreen ( )

info screen call from inside learning module

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

References outputInfoScreen().

{
$this->outputInfoScreen(true);
}

+ Here is the call graph for this function:

ilObjFileBasedLMGUI::showLearningModule ( )

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

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

{
global $ilUser;
// Note license usage
include_once "Services/License/classes/class.ilLicense.php";
ilLicense::_noteAccess($this->object->getId(), $this->object->getType(),
$this->object->getRefId());
// #9483
if ($ilUser->getId() != ANONYMOUS_USER_ID)
{
include_once "Services/Tracking/classes/class.ilLearningProgress.php";
ilLearningProgress::_tracProgress($ilUser->getId(), $this->object->getId(),
$this->object->getRefId(), "htlm");
}
require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
$startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
if ($startfile != "")
{
ilUtil::redirect($startfile);
}
}

+ Here is the call graph for this function:

ilObjFileBasedLMGUI::toFilesystem ( )

Set start file.

Parameters
@return

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

References $ilCtrl.

{
global $ilCtrl;
$ilCtrl->redirectByClass("ilfilesystemgui", "listFiles");
}
ilObjFileBasedLMGUI::update ( )

update properties

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

References ilObjectGUI\updateObject().

{
//$this->setReturnLocation("update", "fblm_edit.php?cmd=listFiles&ref_id=".$_GET["ref_id"].
// "&obj_id=".$_GET["obj_id"]);
$this->updateObject();
}

+ Here is the call graph for this function:

Field Documentation

ilObjFileBasedLMGUI::$output_prepared

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


The documentation for this class was generated from the following file: