From e1e7d5b11611b474ea734eb1133e3cd97081a1f2 Mon Sep 17 00:00:00 2001 From: Guido Vollbach Date: Thu, 19 Jan 2017 09:42:21 +0100 Subject: [PATCH] started import/export --- classes/class.ilInteractiveVideoExportGUI.php | 29 +++++++++++++++ ...class.ilInteractiveVideoExportTableGUI.php | 35 +++++++++++++++++++ classes/class.ilInteractiveVideoExporter.php | 24 +++++++++++++ classes/class.ilInteractiveVideoImporter.php | 14 ++++++++ classes/class.ilInteractiveVideoPlugin.php | 10 +++++- classes/class.ilObjInteractiveVideoGUI.php | 34 +++++++++++++++--- plugin.php | 5 +-- 7 files changed, 144 insertions(+), 7 deletions(-) create mode 100644 classes/class.ilInteractiveVideoExportGUI.php create mode 100755 classes/class.ilInteractiveVideoExportTableGUI.php create mode 100644 classes/class.ilInteractiveVideoExporter.php create mode 100644 classes/class.ilInteractiveVideoImporter.php diff --git a/classes/class.ilInteractiveVideoExportGUI.php b/classes/class.ilInteractiveVideoExportGUI.php new file mode 100644 index 00000000..5b43d22d --- /dev/null +++ b/classes/class.ilInteractiveVideoExportGUI.php @@ -0,0 +1,29 @@ +obj); + return $table; + } + + /** + * Download file + */ + public function download() + { + if(isset($_GET['file']) && $_GET['file']) + { + $_POST['file'] = array($_GET['file']); + } + parent::download(); + } +} \ No newline at end of file diff --git a/classes/class.ilInteractiveVideoExportTableGUI.php b/classes/class.ilInteractiveVideoExportTableGUI.php new file mode 100755 index 00000000..b8291858 --- /dev/null +++ b/classes/class.ilInteractiveVideoExportTableGUI.php @@ -0,0 +1,35 @@ +addCustomColumn($this->lng->txt('actions'), $this, 'formatActionsList'); + } + + /*** + * + */ + protected function initMultiCommands() + { + $this->addMultiCommand('confirmDeletion', $this->lng->txt('delete')); + } +} \ No newline at end of file diff --git a/classes/class.ilInteractiveVideoExporter.php b/classes/class.ilInteractiveVideoExporter.php new file mode 100644 index 00000000..74eb310b --- /dev/null +++ b/classes/class.ilInteractiveVideoExporter.php @@ -0,0 +1,24 @@ +='); + } } \ No newline at end of file diff --git a/classes/class.ilObjInteractiveVideoGUI.php b/classes/class.ilObjInteractiveVideoGUI.php index 9f4a2613..0b8a63cf 100755 --- a/classes/class.ilObjInteractiveVideoGUI.php +++ b/classes/class.ilObjInteractiveVideoGUI.php @@ -21,6 +21,7 @@ * @ilCtrl_Calls ilObjInteractiveVideoGUI: ilPermissionGUI, ilInfoScreenGUI, ilObjectCopyGUI, ilRepositorySearchGUI, ilPublicUserProfileGUI, ilCommonActionDispatcherGUI, ilMDEditorGUI * @ilCtrl_Calls ilObjInteractiveVideoGUI: ilInteractiveVideoLearningProgressGUI * @ilCtrl_Calls ilObjInteractiveVideoGUI: ilPropertyFormGUI + * @ilCtrl_Calls ilObjInteractiveVideoGUI: ilInteractiveVideoExportGUI */ class ilObjInteractiveVideoGUI extends ilObjectPluginGUI implements ilDesktopItemHandling { @@ -110,7 +111,14 @@ public function performCommand($cmd) $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall(); $this->ctrl->forwardCommand($gui); break; - + case "ilinteractivevideoexportgui": + $this->checkPermission('write'); + $ilTabs->setTabActive('export'); + $plugin->includeClass('class.ilInteractiveVideoExportGUI.php'); + $exp_gui = new ilInteractiveVideoExportGUI($this); + $exp_gui->addFormat('xml', $this->lng->txt('export')); + $this->ctrl->forwardCommand($exp_gui); + break; default: switch($cmd) { @@ -477,9 +485,20 @@ protected function updateCustom(ilPropertyFormGUI $a_form) */ protected function initCreationForms($type) { - return array( - self::CFORM_NEW => $this->initCreateForm($type) - ); + if(ilInteractiveVideoPlugin::getInstance()->isCoreMin52()) + { + $form_array = array( + self::CFORM_NEW => $this->initCreateForm($type), + self::CFORM_IMPORT => $this->initImportForm($type) + ); + } + else + { + $form_array = array( + self::CFORM_NEW => $this->initCreateForm($type) + ); + } + return $form_array; } /** @@ -801,6 +820,13 @@ protected function setTabs() $ilTabs->addTab('learning_progress', $this->lng->txt('learning_progress'), $this->ctrl->getLinkTargetByClass('ilInteractiveVideoLearningProgressGUI', 'showLPUserDetails')); } } + if($ilAccess->checkAccess('write', '', $this->object->getRefId())) + { + if(ilInteractiveVideoPlugin::getInstance()->isCoreMin52()) + { + $ilTabs->addTab('export', $this->lng->txt('export'), $this->ctrl->getLinkTargetByClass('ilInteractiveVideoExportGUI', '')); + } + } $this->addPermissionTab(); } diff --git a/plugin.php b/plugin.php index c6341521..fcf7ad1a 100755 --- a/plugin.php +++ b/plugin.php @@ -3,7 +3,7 @@ $id = 'xvid'; // code version; must be changed for all code changes -$version = '2.0.5'; +$version = '2.0.6'; // ilias min and max version; must always reflect the versions that should // run with the plugin @@ -14,4 +14,5 @@ $responsible = 'Nadia Ahmad / Michael Jansen / Max Becker / Guido Vollbach'; $responsible_mail = 'nahmad@databay.de / mjansen@databay.de / mbecker@databay.de / gvollbach@databay.de'; -$learning_progress = true; \ No newline at end of file +$learning_progress = true; +$supports_export = true; \ No newline at end of file