19require_once(
"./Services/Object/classes/class.ilObjectGUI.php");
 
   20require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php");
 
   21require_once(
"./Services/Table/classes/class.ilTableGUI.php");
 
   22require_once(
"./Services/FileSystem/classes/class.ilFileSystemGUI.php");
 
   33        function __construct($a_data,$a_id = 0,$a_call_by_reference = 
true, $a_prepare_output = 
true)
 
   38                $this->ctrl->saveParameter($this, array(
"ref_id"));
 
   41                $lng->loadLanguageModule(
"content");
 
   43                parent::__construct($a_data, $a_id, $a_call_by_reference, 
false);
 
   45                $this->output_prepared = $a_prepare_output;
 
   54                global 
$ilUser, $ilLocator, $ilTabs;
 
   56                $next_class = $this->ctrl->getNextClass($this);
 
   57                $cmd = $this->ctrl->getCmd();
 
   59                if (strtolower(
$_GET[
"baseClass"]) == 
"iladministrationgui" ||
 
   66                        if (!in_array(
$cmd, array(
"", 
"framset")) || $next_class != 
"")
 
   76                        case 'ilobjectmetadatagui':
 
   78                                $ilTabs->activateTab(
'id_meta_data');
 
   79                                include_once 
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
 
   81                                $this->ctrl->forwardCommand($md_gui);
 
   84                        case "ilfilesystemgui":
 
   86                                $ilTabs->activateTab(
'id_list_files');
 
   88                                $fs_gui->activateLabels(
true, $this->lng->txt(
"cont_purpose"));
 
   89                                $fs_gui->setUseUploadDirectory(
true);
 
   90                                $fs_gui->setTableId(
"htlmfs".$this->object->getId());                   
 
   91                                if ($this->object->getStartFile() != 
"")
 
   93                                        $fs_gui->labelFile($this->object->getStartFile(),
 
   94                                                $this->lng->txt(
"cont_startfile"));
 
   96                                $fs_gui->addCommand($this, 
"setStartFile", $this->lng->txt(
"cont_set_start_file"));
 
   98                                $this->ctrl->forwardCommand($fs_gui);
 
  101                                require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
 
  106                                        $pcommand = $fs_gui->getLastPerformedCommand();                                                 
 
  107                                        if (is_array($pcommand))
 
  109                                                $valid = array(
"index.htm", 
"index.html", 
"start.htm", 
"start.html");                                           
 
  110                                                if($pcommand[
"cmd"] == 
"create_file")
 
  112                                                        $file = strtolower(basename($pcommand[
"name"]));
 
  115                                                                $this->
object->setStartFile($pcommand[
"name"]);
 
  116                                                                $do_update = $pcommand[
"name"];
 
  119                                                else if($pcommand[
"cmd"] == 
"unzip_file")
 
  121                                                        $zip_file = strtolower(basename($pcommand[
"name"]));
 
  122                                                        $suffix = strrpos($zip_file, 
".");
 
  125                                                                $zip_file = substr($zip_file, 0, $suffix);
 
  127                                                        foreach($pcommand[
"added"] as 
$file)
 
  130                                                                if(stristr(
$file, 
".htm"))
 
  132                                                                        $chk_file = strtolower(basename(
$file));
 
  133                                                                        $suffix = strrpos($chk_file, 
".");
 
  136                                                                                $chk_file = substr($chk_file, 0, $suffix);
 
  140                                                                        ($zip_file && $chk_file && $chk_file == $zip_file))
 
  142                                                                        $this->
object->setStartFile($file);
 
  154                                                $this->
object->update();
 
  155                                                $this->ctrl->redirectByClass(
"ilfilesystemgui", 
"listFiles");
 
  160                        case "ilinfoscreengui":
 
  164                        case "illearningprogressgui":
 
  165                                $ilTabs->activateTab(
'id_learning_progress');
 
  166                                include_once 
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
 
  168                                                                                                          $this->object->getRefId(),
 
  170                                $this->ctrl->forwardCommand($new_gui);
 
  173                        case 'ilpermissiongui':
 
  174                                $ilTabs->activateTab(
'id_permissions');
 
  175                                include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
 
  177                                $ret = $this->ctrl->forwardCommand($perm_gui);
 
  181                                $ilTabs->activateTab(
"export");
 
  182                                include_once(
"./Services/Export/classes/class.ilExportGUI.php");
 
  184                                $exp_gui->addFormat(
"xml");
 
  185                                $exp_gui->addFormat(
"html", 
"", $this, 
"exportHTML");
 
  186                                $ret = $this->ctrl->forwardCommand($exp_gui);
 
  190                        case "ilcommonactiondispatchergui":
 
  191                                include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
 
  193                                $this->ctrl->forwardCommand($gui);
 
  197                                $cmd = $this->ctrl->getCmd(
"frameset");
 
  198                                if (strtolower(
$_GET[
"baseClass"]) == 
"iladministrationgui" ||
 
  212                $forms = array(self::CFORM_NEW => $this->
initCreateForm($a_new_type),
 
  227                $ilCtrl->redirectByClass(
"ilrepositorygui", 
"frameset");
 
  237                global $rbacsystem, 
$tree, 
$tpl, $ilTabs;
 
  239                $ilTabs->activateTab(
"id_settings");
 
  243                $tpl->setContent($this->form->getHTML());
 
  253                include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  260                $ti->setRequired(
true);
 
  261                $this->form->addItem($ti);
 
  267                $this->form->addItem($ta);
 
  271                $cb->setOptionTitle(
$lng->txt(
""));
 
  273                $this->form->addItem($cb);
 
  276                require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
 
  280                if ($startfile != 
"")
 
  282                        $ne->setValue(basename($startfile));
 
  286                        $ne->setValue(basename($this->lng->txt(
"no_start_file")));
 
  288                $this->form->addItem($ne);
 
  290                $this->form->addCommandButton(
"saveProperties", 
$lng->txt(
"save"));
 
  291                $this->form->addCommandButton(
"toFilesystem", 
$lng->txt(
"cont_set_start_file"));
 
  293                $this->form->setTitle(
$lng->txt(
"cont_lm_properties"));
 
  294                $this->form->setFormAction(
$ilCtrl->getFormAction($this, 
"saveProperties"));
 
  302                require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
 
  306                $values[
"cobj_online"] = $this->
object->getOnline();
 
  307                if ($startfile != 
"")
 
  309                        $startfile = basename($startfile);
 
  313                        $startfile = $this->lng->txt(
"no_start_file");
 
  316                $values[
"cobj_online"] = $this->
object->getOnline();
 
  317                $values[
"startfile"] = $startfile;
 
  318                $values[
"title"] = $this->
object->getTitle();
 
  319                $values[
"desc"] = $this->
object->getDescription();
 
  322                $this->form->setValuesByArray($values);
 
  335                $ilCtrl->redirectByClass(
"ilfilesystemgui", 
"listFiles");
 
  343                global 
$tpl, $ilAccess, $ilTabs;
 
  346                if ($this->form->checkInput())
 
  348                        $this->
object->setTitle($this->form->getInput(
"title"));
 
  349                        $this->
object->setDescription($this->form->getInput(
"desc"));
 
  352                        $this->
object->update();
 
  354                        $this->ctrl->redirect($this, 
"properties");
 
  357                $ilTabs->activateTab(
"id_settings");
 
  358                $this->form->setValuesByPost();
 
  359                $tpl->setContent($this->form->getHtml());
 
  371                if (!$rbacsystem->checkAccess(
"visible,write",$this->object->getRefId()))
 
  373                        $this->
ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
 
  402                if(!$newObj->getStartFile())
 
  406                        include_once 
"Services/Utilities/classes/class.ilFileUtils.php";
 
  408                        if(is_array(
$files[
"file"]))
 
  411                                if(stristr($newObj->
getTitle(), 
".zip"))
 
  413                                        $zip_file = strtolower($newObj->
getTitle());
 
  414                                        $suffix = strrpos($zip_file, 
".");
 
  417                                                $zip_file = substr($zip_file, 0, $suffix);
 
  420                                $valid = array(
"index.htm", 
"index.html", 
"start.htm", 
"start.html");           
 
  424                                        if(stristr(
$file, 
".htm"))
 
  426                                                $chk_file = strtolower(
$file);
 
  427                                                $suffix = strrpos($chk_file, 
".");                                      
 
  430                                                        $chk_file = substr($chk_file, 0, $suffix);
 
  434                                                ($chk_file && $zip_file && $chk_file == $zip_file))
 
  436                                                $newObj->setStartFile(str_replace($newObj->getDataDirectory().
"/", 
"", 
$files[
"path"][$idx]).$file);
 
  463                $this->
object->setStartFile($a_file);
 
  464                $this->
object->update();
 
  465                $this->ctrl->redirectByClass(
"ilfilesystemgui", 
"listFiles");
 
  473                $this->
setFormAction(
"permSave", 
"fblm_edit.php?cmd=permSave&ref_id=".
$_GET[
"ref_id"].
 
  474                        "&obj_id=".
$_GET[
"obj_id"]);
 
  475                $this->
setFormAction(
"addRole", 
"fblm_edit.php?ref_id=".$_GET[
"ref_id"].
 
  476                        "&obj_id=".
$_GET[
"obj_id"].
"&cmd=addRole");
 
  488                $ilCtrl->setCmdClass(
"ilfilesystemgui");
 
  500                $this->tpl->getStandardTemplate();
 
  508                if (
$ilUser->getId() != ANONYMOUS_USER_ID)
 
  510                        include_once 
"Services/Tracking/classes/class.ilLearningProgress.php";
 
  512                                $this->object->getRefId(), 
"htlm");     
 
  515                require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
 
  516                require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
 
  520                if ($startfile != 
"")
 
  534                $this->ctrl->setCmd(
"showSummary");
 
  535                $this->ctrl->setCmdClass(
"ilinfoscreengui");
 
  552                global $ilToolbar, $ilAccess, $ilTabs;
 
  554                $ilTabs->activateTab(
'id_info');
 
  556                $this->lng->loadLanguageModule(
"meta");
 
  557                include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
 
  560                $info->enablePrivateNotes();
 
  561                $info->enableLearningProgress();
 
  564                if ($ilAccess->checkAccess(
"write", 
"", 
$_GET[
"ref_id"]))
 
  566                        $info->enableNewsEditing();
 
  569                        $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
 
  570                        if ($enable_internal_rss)
 
  572                                $info->setBlockProperty(
"news", 
"settings", 
true);
 
  577                if ($ilAccess->checkAccess(
"read", 
"", 
$_GET[
"ref_id"]))
 
  580                        include_once 
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
 
  582                        $button->setCaption(
"view");
 
  583                        $button->setPrimary(
true);                      
 
  584                        $button->setUrl(
"ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=".$this->object->getRefID());         
 
  585                        $button->setTarget(
"ilContObj".$this->object->getId());
 
  586                        $ilToolbar->addButtonInstance($button);
 
  590                $info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
 
  593                $this->ctrl->forwardCommand(
$info);
 
  606                $this->tpl->setTitle($this->object->getTitle());
 
  616                $ilHelp->setScreenIdComponent(
"htlm");
 
  618                if($ilAccess->checkAccess(
'write', 
'', $this->ref_id))
 
  620                        $ilTabs->addTab(
"id_list_files",
 
  621                                $lng->txt(
"cont_list_files"),
 
  622                                $this->ctrl->getLinkTargetByClass(
"ilfilesystemgui", 
"listFiles"));
 
  625                if($ilAccess->checkAccess(
'visible', 
'', $this->ref_id))
 
  627                        $ilTabs->addTab(
"id_info",
 
  628                                $lng->txt(
"info_short"),
 
  629                                $this->ctrl->getLinkTargetByClass(array(
"ilobjfilebasedlmgui", 
"ilinfoscreengui"), 
"showSummary"));
 
  632                if($ilAccess->checkAccess(
'write', 
'', $this->ref_id))
 
  634                        $ilTabs->addTab(
"id_settings",
 
  635                                $lng->txt(
"settings"),
 
  636                                $this->ctrl->getLinkTarget($this, 
"properties"));
 
  639                include_once 
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
 
  642                        $ilTabs->addTab(
"id_learning_progress",
 
  643                                $lng->txt(
"learning_progress"),
 
  644                                $this->ctrl->getLinkTargetByClass(array(
'ilobjfilebasedlmgui',
'illearningprogressgui'), 
''));
 
  647                if($ilAccess->checkAccess(
'write', 
'', $this->ref_id))
 
  649                        include_once 
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
 
  651                        $mdtab = $mdgui->getTab();
 
  654                                $ilTabs->addTab(
"id_meta_data",
 
  655                                        $lng->txt(
"meta_data"),
 
  663                if ($ilAccess->checkAccess(
"write", 
"", $this->object->getRefId()))
 
  665                        $ilTabs->addTab(
"export",
 
  667                                $this->ctrl->getLinkTargetByClass(
"ilexportgui", 
""));
 
  670                if ($ilAccess->checkAccess(
'edit_permission', 
'', $this->object->getRefId()))
 
  672                        $ilTabs->addTab(
"id_permissions",
 
  673                                $lng->txt(
"perm_settings"),
 
  674                                $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'), 
"perm"));
 
  677                require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
 
  680                if ($startfile != 
"")
 
  682                        $ilTabs->addNonTabbedLink(
"presentation_view",
 
  683                                $this->lng->txt(
"glo_presentation_view"),
 
  684                                "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=".$this->object->getRefID(),
 
  696        public static function _goto($a_target)
 
  700                if ($ilAccess->checkAccess(
"read", 
"", $a_target) ||
 
  701                        $ilAccess->checkAccess(
"visible", 
"", $a_target))
 
  705                else if ($ilAccess->checkAccess(
"read", 
"", ROOT_FOLDER_ID))
 
  719                if (is_object($this->
object))
 
  721                        $ilLocator->addItem($this->object->getTitle(),
 
  722                                $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui", 
"showSummary"), 
"", 
$_GET[
"ref_id"]);
 
  737                        return parent::importFileObject();
 
  758                        $ilErr->raiseError($this->lng->txt(
"no_create_permission"));
 
  765                $newObj->setDescription(
"");
 
  767                $newObj->populateByDirectoy($a_dir, 
$filename);
 
  786                $inst_id = IL_INST_ID;
 
  788                include_once(
"./Services/Export/classes/class.ilExport.php");
 
  791                        $this->object->getType());
 
  793                        $this->object->getType());
 
  795                $subdir = $this->
object->getType().
"_".$this->
object->getId();
 
  798                $target_dir = $export_dir.
"/".$subdir;
 
  803                $source_dir = $this->
object->getDataDirectory();
 
  809                $zip_file = $export_dir.
"/".$date.
"__".IL_INST_ID.
"__".
 
  810                        $this->
object->getType().
"_".$this->
object->getId().
".zip";
 
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Export User Interface Class.
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
static _createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
File System Explorer GUI class.
static recursive_dirscan($dir, &$arr)
Recursively scans a given directory and writes path and filename into referenced array.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
const LP_CONTEXT_REPOSITORY
Class ilObjUserTrackingGUI.
static _tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type='')
manifest.xml file not found-exception for import
getTmpDir()
Get temporary directory.
This class represents a non editable value in a property form.
static _determineStartUrl($a_id)
check wether learning module is online
User Interface class for file based learning modules (HTML)
initCreationForms($a_new_type)
Init creation froms.
properties()
edit properties of object (admin form)
addLocatorItems()
should be overwritten to add object specific items (repository items are preloaded)
showInfoScreen()
info screen call from inside learning module
outputInfoScreen($a_standard_locator=true)
info screen
edit()
edit properties of object (module form)
exportHTML()
create html package
saveProperties()
Save properties form.
createFromDirectory($a_dir)
Create new object from a html zip file.
editObject()
edit properties of object (admin form)
initSettingsForm()
Init settings form.
importFileObject($parent_id=null, $a_catch_errors=true)
Import file.
update()
update properties
infoScreen()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...
__construct($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor.
toFilesystem()
Set start file.
cancelCreationObject($in_rep=false)
cancel action and go back to previous page @access public
getTabs()
adds tabs to tab gui object
getSettingsFormValues()
Get current values for settings from.
executeCommand()
execute command
static _goto($a_target)
redirect script
getTemplate()
output main header (title and locator)
frameset()
Frameset -> Output list of files.
afterSave(ilObject $newObj)
save object @access public
File Based Learning Module (HTML) object.
Class ilObjectGUI Basic methods of all Output classes.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
initImportForm($a_new_type)
Init object import form.
putObjectInTree(ilObject $a_obj, $a_parent_node_id=null)
Add object to tree at given position.
prepareOutput($a_show_subobjects=true)
prepare output
initCreateForm($a_new_type)
Init object creation form.
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
cancelObject()
cancel action and go back to previous page @access public
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
getCreationMode()
get creation mode
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
addHeaderAction()
Add header action menu.
setFormAction($a_cmd, $a_formaction)
set specific form action for command
updateObject()
updates object entry in object_data
Class ilObject Basic functions for all objects.
static _lookupObjId($a_id)
const TITLE_LENGTH
max length of object title
update()
update object in db
static _lookupTitle($a_id)
lookup object title
getRefId()
get reference id @access public
getTitle()
get object title @access public
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This class represents a text area property in a property form.
This class represents a text property in a property form.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static redirect($a_script)
http redirect to other script
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static zip($a_dir, $a_file, $compress_content=false)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static yn2tf($a_yn)
convert "y"/"n" to true/false
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static signFolderOfStartFile($start_file_path, ilWACCookieInterface $ilWACCookieInterface=null)
redirection script todo: (a better solution should control the processing via a xml file)
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file