4 include_once(
"./Services/Object/classes/class.ilObject2GUI.php");
5 include_once(
"./Modules/MediaPool/classes/class.ilObjMediaPool.php");
6 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
7 include_once(
"./Modules/Folder/classes/class.ilObjFolderGUI.php");
8 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
9 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
10 include_once(
"./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
36 $lng->loadLanguageModule(
"mep");
38 if ($this->ctrl->getCmd() ==
"explorer")
40 $this->ctrl->saveParameter($this, array(
"ref_id"));
44 $this->ctrl->saveParameter($this, array(
"ref_id",
"mepitem_id"));
46 $this->ctrl->saveParameter($this, array(
"mep_mode"));
48 $lng->loadLanguageModule(
"content");
66 if ($this->ctrl->getRedirectSource() ==
"ilinternallinkgui")
72 $next_class = $this->ctrl->getNextClass($this);
73 $cmd = $this->ctrl->getCmd();
74 $new_type =
$_POST[
"new_type"]
78 if ($new_type !=
"" && (
$cmd !=
"confirmRemove" &&
$cmd !=
"copyToClipboard"
79 &&
$cmd !=
"pasteFromClipboard"))
86 $tree =& $this->
object->getTree();
87 if (
$_GET[
"mepitem_id"] ==
"")
97 $this->ctrl->redirectByClass(
"ilobjmediaobjectgui",
"create");
102 $this->ctrl->redirectByClass(
"ilobjfoldergui",
"create");
109 case 'ilmediapoolpagegui':
113 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
116 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
118 $mep_page_gui->setEnableEditing(
false);
120 $ret = $this->ctrl->forwardCommand($mep_page_gui);
123 $tpl->setContent(
$ret);
128 case "ilobjmediaobjectgui":
130 if (
$cmd ==
"create" ||
$cmd ==
"save" ||
$cmd ==
"cancel")
132 $ret_obj =
$_GET[
"mepitem_id"];
134 $ilObjMediaObjectGUI->setWidthPreset($this->object->getDefaultWidth());
135 $ilObjMediaObjectGUI->setHeightPreset($this->object->getDefaultHeight());
139 $ret_obj =
$tree->getParentId(
$_GET[
"mepitem_id"]);
142 $ilTabs->setBackTarget($lng->txt(
"back"),
143 $this->ctrl->getLinkTarget($this,
144 $_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia"));
146 if ($this->ctrl->getCmdClass() ==
"ilinternallinkgui")
148 $this->ctrl->setReturn($this,
"explorer");
152 $this->ctrl->setParameter($this,
"mepitem_id", $ret_obj);
153 $this->ctrl->setReturn($this,
154 $_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
155 $this->ctrl->setParameter($this,
"mepitem_id", $_GET[
"mepitem_id"]);
158 $ilObjMediaObjectGUI->setTabs();
162 $ret = $this->ctrl->forwardCommand($ilObjMediaObjectGUI);
164 if (
$cmd ==
"save" &&
$ret !=
false)
167 $mep_item->setTitle(
$ret->getTitle());
168 $mep_item->setType(
"mob");
169 $mep_item->setForeignId(
$ret->getId());
172 $parent = (
$_GET[
"mepitem_id"] ==
"")
174 :
$_GET[
"mepitem_id"];
175 $tree->insertNode($mep_item->getId(), $parent);
176 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=".
177 $_GET[
"ref_id"].
"&mepitem_id=".
$_GET[
"mepitem_id"]);
185 case "ilobjfoldergui":
189 $this->ctrl->setReturn($this,
"listMedia");
196 $folder_gui->setFormAction(
"save",
197 $this->ctrl->getFormActionByClass(
"ilobjfoldergui"));
198 $folder_gui->createObject();
204 $parent = (
$_GET[
"mepitem_id"] ==
"")
206 :
$_GET[
"mepitem_id"];
207 $folder_gui->setFolderTree(
$tree);
208 $folder_gui->saveObject($parent);
215 $this->ctrl->setParameter($this,
"foldereditmode",
"1");
216 $folder_gui->setFormAction(
"update", $this->ctrl->getFormActionByClass(
"ilobjfoldergui"));
217 $folder_gui->editObject();
224 $this->ctrl->setReturn($this,
"listMedia");
225 $folder_gui->updateObject(
true);
229 if (
$_GET[
"foldereditmode"])
233 $this->ctrl->redirect($this,
"listMedia");
238 case "ileditclipboardgui":
241 $this->ctrl->setReturn($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
243 $clip_gui->setMultipleSelections(
true);
244 $clip_gui->setInsertButtonTitle($lng->txt(
"mep_copy_to_mep"));
245 $ilTabs->setTabActive(
"clipboard");
247 $ret =& $this->ctrl->forwardCommand($clip_gui);
251 case 'ilinfoscreengui':
258 case 'ilpermissiongui':
261 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
263 $ret =& $this->ctrl->forwardCommand($perm_gui);
270 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
272 $exp_gui->addFormat(
"xml");
273 $ret = $this->ctrl->forwardCommand($exp_gui);
277 case "ilfilesystemgui":
280 $ilTabs->clearTargets();
281 $ilTabs->setBackTarget($lng->txt(
"back"),
282 $ilCtrl->getLinkTarget($this,
"listMedia"));
284 if (trim($mset->get(
"upload_dir")) !=
"")
286 include_once(
"./Services/FileSystem/classes/class.ilFileSystemGUI.php");
289 $fs_gui->setTableId(
"mepud".$this->object->getId());
290 $fs_gui->setAllowFileCreation(
false);
291 $fs_gui->setAllowDirectoryCreation(
false);
292 $fs_gui->clearCommands();
293 $fs_gui->addCommand($this,
"selectUploadDirFiles", $this->lng->txt(
"mep_sel_upload_dir_files"),
296 $ret =& $this->ctrl->forwardCommand($fs_gui);
301 case "ilcommonactiondispatchergui":
302 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
304 $this->ctrl->forwardCommand($gui);
310 $cmd = $this->ctrl->getCmd(
"listMedia");
325 $this->ctrl->redirectByClass(
"ilobjmediaobjectgui",
"create");
330 $forms = array(self::CFORM_NEW => $this->
initCreateForm($a_new_type),
345 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=".$newObj->getRefId().
"&cmd=edit");
351 $ni =
new ilNumberInputGUI($this->lng->txt(
"mep_default_width"),
"default_width");
353 $ni->setMaxLength(5);
358 $ni =
new ilNumberInputGUI($this->lng->txt(
"mep_default_height"),
"default_height");
360 $ni->setMaxLength(5);
362 $ni->setInfo($this->lng->txt(
"mep_default_width_height_info"));
368 if ($this->object->getDefaultWidth() > 0)
370 $a_values[
"default_width"] = $this->
object->getDefaultWidth();
372 if ($this->object->getDefaultHeight() > 0)
374 $a_values[
"default_height"] = $this->
object->getDefaultHeight();
380 $this->
object->setDefaultWidth($a_form->
getInput(
"default_width"));
381 $this->
object->setDefaultHeight($a_form->
getInput(
"default_height"));
391 $ilCtrl->setParameter($this,
"mep_mode",
"listMedia");
393 if (!$ilAccess->checkAccess(
"read",
"", $this->object->getRefId()))
395 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
397 $ilTabs->setTabActive(
"objs_fold");
399 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
401 $ilToolbar->addButton($lng->txt(
"mep_create_mob"),
402 $ilCtrl->getLinkTarget($this,
"createMediaObject"));
405 if ($mset->get(
"mep_activate_pages"))
407 $ilToolbar->addButton($lng->txt(
"mep_create_content_snippet"),
408 $ilCtrl->getLinkTarget($this,
"createMediaPoolPage"));
411 $ilToolbar->addButton($lng->txt(
"mep_create_folder"),
412 $ilCtrl->getLinkTarget($this,
"createFolderForm"));
416 $ilToolbar->addButton($lng->txt(
"mep_create_from_upload_dir"),
417 $ilCtrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles"));
422 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolExplorerGUI.php");
424 if (!$exp->handleCommand())
426 $this->tpl->setLeftNavContent($exp->getHTML());
434 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
436 $tpl->setContent($mep_table_gui->getHTML());
447 $ilCtrl->setParameter($this,
"mep_mode",
"allMedia");
449 if (!$ilAccess->checkAccess(
"read",
"", $this->object->getRefId()))
451 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
453 $ilTabs->setTabActive(
"mep_all_mobs");
456 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
461 if(isset(
$_GET[
'force_filter']) and
$_GET[
'force_filter'])
465 include_once(
"./Services/Table/classes/class.ilTablePropertiesStorage.php");
467 $tprop->storeProperty(
468 $mep_table_gui->getId(),
473 $mep_table_gui->resetFilter();
474 $mep_table_gui->resetOffset();
475 $mep_table_gui->writeFilterToSession();
482 $tpl->setContent($mep_table_gui->getHTML());
491 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
494 $mtab->writeFilterToSession();
495 $mtab->resetOffset();
504 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
507 $mtab->resetFilter();
508 $mtab->resetOffset();
517 $this->tpl->getStandardTemplate();
526 if (
$_GET[
"mepitem_id"] ==
"")
530 $par_id = $this->
object->tree->getParentId(
$_GET[
"mepitem_id"]);
531 if ($par_id != $this->object->tree->getRootId())
548 if (!$ilAccess->checkAccess(
"read",
"", $this->object->getRefId()))
550 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
553 $this->tpl =&
new ilTemplate(
"tpl.fullscreen.html",
true,
true,
"Services/COPage");
554 include_once(
"Services/Style/classes/class.ilObjStyleSheet.php");
556 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
567 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
568 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
580 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
581 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
586 $mode = (
$_GET[
"cmd"] !=
"showMedia")
591 $this->ctrl->getLinkTarget($this,
"showFullscreen",
"",
false,
false);
592 $params = array (
'mode' => $mode,
'enlarge_path' => $enlarge_path,
593 'link_params' =>
"ref_id=".
$_GET[
"ref_id"],
'fullscreen_link' => $fullscreen_link,
594 'ref_id' =>
$_GET[
"ref_id"],
'pg_frame' => $pg_frame,
'webspace_path' => $wb_path);
595 $output =
xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args, $params);
599 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
617 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
619 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
624 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
628 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
630 $cgui->setFormAction($this->ctrl->getFormAction($this));
631 $cgui->setHeaderText($this->lng->txt(
"info_delete_sure"));
632 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancelRemove");
633 $cgui->setConfirm($this->lng->txt(
"confirm"),
"remove");
644 include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
646 if (count($usages) > 0)
649 $ilCtrl->redirect($this,
"listMedia");
655 if (count($usages) > 0)
657 $add =
"<div class='small'>".$lng->txt(
"mep_content_snippet_used_in_older_versions").
"</div>";
665 $cgui->addItem(
"id[]", $obj_id, $caption);
668 $this->tpl->setContent($cgui->getHTML());
678 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
680 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
683 $ilCtrl->setParameterByClass(
"ileditclipboardgui",
"returnCommand",
684 rawurlencode($ilCtrl->getLinkTarget($this,
685 "insertFromClipboard",
"",
false,
false)));
686 $ilCtrl->redirectByClass(
"ilEditClipboardGUI",
"getObject");
697 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
699 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
702 include_once(
"./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
704 $not_inserted = array();
707 foreach ($ids as $id2)
709 $id = explode(
":", $id2);
715 if (ilObjMEdiaPool::isForeignIdInTree($this->object->getId(), $id))
723 $item->setType(
"mob");
724 $item->setForeignId($id);
727 if ($item->getId() > 0)
729 $this->
object->insertInTree($item->getId(),
$_GET[
"mepitem_id"]);
735 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
736 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
737 if (ilObjMEdiaPool::isItemIdInTree($this->object->getId(), $id))
748 $item->setType(
"pg");
751 if ($item->getId() > 0)
753 $this->
object->insertInTree($item->getId(),
$_GET[
"mepitem_id"]);
756 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
758 $page->setId($item->getId());
762 $original->copy($page->getId(), $page->getParentType(), $page->getParentId(),
true);
772 if (count($not_inserted) > 0)
775 implode($not_inserted,
"<br>"),
true);
777 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
786 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
796 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
798 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
803 $this->
object->deleteChild($obj_id);
807 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
823 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
832 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
835 foreach (
$_POST[
"id"] as $obj_id)
841 $ilUser->addObjectToClipboard($fid,
"mob",
"");
845 $ilUser->addObjectToClipboard($obj_id,
"incl",
"");
849 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
861 $tree =& $this->
object->getTree();
864 :
$_GET[
"mepitem_id"];
866 foreach(
$path as $node)
868 if ($node[
"child"] ==
$tree->getRootId())
870 $this->ctrl->setParameter($this,
"mepitem_id",
"");
871 $link = $this->ctrl->getLinkTarget($this,
"listMedia");
872 $title = $this->
object->getTitle();
873 $this->ctrl->setParameter($this,
"mepitem_id",
$_GET[
"mepitem_id"]);
874 $ilLocator->addItem($title, $link,
"",
$_GET[
"ref_id"]);
878 $this->ctrl->setParameter($this,
"mepitem_id", $node[
"child"]);
879 $link = $this->ctrl->getLinkTarget($this,
"listMedia");
880 $title = $node[
"title"];
881 $this->ctrl->setParameter($this,
"mepitem_id",
$_GET[
"mepitem_id"]);
882 $ilLocator->addItem($title, $link);
897 global $ilAccess,
$tpl;
899 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
901 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
905 $tpl->setContent($this->form->getHTML());
927 $tpl->setContent($this->form->getHTML());
939 $this->form->setValuesByArray($values);
950 if ($this->form->checkInput())
952 if ($this->object->createFolder(
$_POST[
"title"], (
int)
$_GET[
"mepitem_id"]))
956 $ilCtrl->redirect($this,
"listMedia");
959 $this->form->setValuesByPost();
960 $tpl->setContent($this->form->getHtml());
971 if ($this->form->checkInput())
974 $item->setTitle(
$_POST[
"title"]);
977 $ilCtrl->setParameter($this,
"mepitem_id",
978 $this->object->getTree()->getParentId(
$_GET[
"mepitem_id"]));
979 $ilCtrl->redirect($this,
"listMedia");
982 $this->form->setValuesByPost();
983 $tpl->setContent($this->form->getHtml());
995 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1001 $ti->setRequired(
true);
1002 $this->form->addItem($ti);
1005 if ($a_mode ==
"create")
1007 $this->form->addCommandButton(
"saveFolder", $lng->txt(
"save"));
1008 $this->form->addCommandButton(
"cancelSave", $lng->txt(
"cancel"));
1009 $this->form->setTitle($lng->txt(
"mep_new_folder"));
1013 $this->form->addCommandButton(
"updateFolder", $lng->txt(
"save"));
1014 $this->form->addCommandButton(
"cancelFolderUpdate", $lng->txt(
"cancel"));
1015 $this->form->setTitle($lng->txt(
"mep_edit_folder"));
1018 $this->form->setFormAction($ilCtrl->getFormAction($this));
1027 $ilCtrl->setParameter($this,
"mepitem_id",
1028 $this->object->getTree()->getParentId(
$_GET[
"mepitem_id"]));
1029 $ilCtrl->redirect($this,
"listMedia");
1038 $ilCtrl->redirect($this,
"listMedia");
1052 $tpl->setContent($this->form->getHTML());
1067 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1069 $mep_page_gui->getTabs();
1073 $tpl->setContent($this->form->getHTML());
1084 if ($this->form->checkInput())
1087 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1089 $item->setTitle(
$_POST[
"title"]);
1090 $item->setType(
"pg");
1093 if ($item->getId() > 0)
1096 $tree = $this->
object->getTree();
1097 $parent =
$_GET[
"mepitem_id"] > 0
1098 ?
$_GET[
"mepitem_id"]
1099 :
$tree->getRootId();
1100 $this->
object->insertInTree($item->getId(), $parent);
1103 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1105 $page->setId($item->getId());
1110 $ilCtrl->redirect($this,
"listMedia");
1113 $this->form->setValuesByPost();
1114 $tpl->setContent($this->form->getHtml());
1125 if ($this->form->checkInput())
1128 $item->setTitle(
$_POST[
"title"]);
1131 $ilCtrl->redirect($this,
"editMediaPoolPage");
1134 $this->form->setValuesByPost();
1135 $tpl->setContent($this->form->getHtml());
1146 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1152 $ti->setRequired(
true);
1153 $this->form->addItem($ti);
1156 if ($a_mode ==
"create")
1158 $this->form->addCommandButton(
"saveMediaPoolPage", $lng->txt(
"save"));
1159 $this->form->addCommandButton(
"cancelSave", $lng->txt(
"cancel"));
1160 $this->form->setTitle($lng->txt(
"mep_new_content_snippet"));
1164 $this->form->addCommandButton(
"updateMediaPoolPage", $lng->txt(
"save"));
1165 $this->form->setTitle($lng->txt(
"mep_edit_content_snippet"));
1168 $this->form->setFormAction($ilCtrl->getFormAction($this));
1178 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1181 $this->form->setValuesByArray($values);
1194 $ilTabs->clearTargets();
1197 $ilTabs->addTarget(
"mep_page_properties", $ilCtrl->getLinkTarget($this,
"editMediaPoolPage"),
1198 "editMediaPoolPage", get_class($this));
1199 $ilTabs->addTarget(
"cont_usage", $ilCtrl->getLinkTarget($this,
"showMediaPoolPageUsages"),
1200 array(
"showMediaPoolPageUsages",
"showAllMediaPoolPageUsages"), get_class($this));
1201 $ilCtrl->setParameter($this,
"mepitem_id", $this->object->tree->getParentId(
$_GET[
"mepitem_id"]));
1202 $ilTabs->setBackTarget($lng->txt(
"mep_folder"), $ilCtrl->getLinkTarget($this,
"listMedia"));
1203 $ilCtrl->setParameter($this,
"mepitem_id",
$_GET[
"mepitem_id"]);
1224 $ilTabs->addSubTab(
"current_usages", $lng->txt(
"cont_current_usages"),
1225 $ilCtrl->getLinkTarget($this,
"showMediaPoolPageUsages"));
1227 $ilTabs->addSubTab(
"all_usages", $lng->txt(
"cont_all_usages"),
1228 $ilCtrl->getLinkTarget($this,
"showAllMediaPoolPageUsages"));
1232 $ilTabs->activateSubTab(
"all_usages");
1233 $cmd =
"showAllMediaPoolPageUsages";
1237 $ilTabs->activateSubTab(
"current_usages");
1238 $cmd =
"showMediaPoolPageUsages";
1242 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1244 $mep_page_gui->getTabs();
1246 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1249 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageUsagesTableGUI.php");
1252 $tpl->setContent($table->getHTML());
1266 global $ilAccess, $ilTabs,
$ilCtrl, $ilHelp;
1268 $ilHelp->setScreenIdComponent(
"mep");
1270 if ($ilAccess->checkAccess(
'read',
'', $this->ref_id) ||
1271 $ilAccess->checkAccess(
'write',
'', $this->ref_id))
1273 $ilTabs->addTarget(
"objs_fold", $this->ctrl->getLinkTarget($this,
""),
1274 "listMedia",
"",
"_top");
1276 $ilCtrl->setParameter($this,
"mepitem_id",
"");
1277 $ilTabs->addTarget(
"mep_all_mobs", $this->ctrl->getLinkTarget($this,
"allMedia"),
1278 "allMedia",
"",
"_top");
1279 $ilCtrl->setParameter($this,
"mepitem_id",
$_GET[
"mepitem_id"]);
1283 if ($ilAccess->checkAccess(
'visible',
'', $this->ref_id))
1285 $force_active = ($this->ctrl->getNextClass() ==
"ilinfoscreengui"
1286 || strtolower(
$_GET[
"cmdClass"]) ==
"ilnotegui")
1290 $ilTabs->addTarget(
"info_short",
1291 $this->ctrl->getLinkTargetByClass(
1292 array(
"ilobjmediapoolgui",
"ilinfoscreengui"),
"showSummary"),
1293 array(
"showSummary",
"infoScreen"),
1294 "",
"", $force_active);
1297 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1299 $ilTabs->addTarget(
"settings", $this->ctrl->getLinkTarget($this,
"edit"),
1300 "edit", array(
"",
"ilobjmediapoolgui"));
1303 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1305 $ilTabs->addTarget(
"clipboard", $this->ctrl->getLinkTarget($this,
"openClipboard"),
1306 "view",
"ileditclipboardgui");
1309 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1311 $ilTabs->addTarget(
"export", $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""),
1315 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->object->getRefId()))
1317 $ilTabs->addTarget(
"perm_settings",
1318 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1331 $targets = explode(
'_',$a_target);
1332 if(count((array) $targets) > 1)
1335 $subitem_id = $targets[1];
1342 if ($ilAccess->checkAccess(
"read",
"",
$ref_id))
1344 $_GET[
"baseClass"] =
"ilMediaPoolPresentationGUI";
1346 $_GET[
'mepitem_id'] = $subitem_id;
1347 include(
"ilias.php");
1350 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1357 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
1367 $this->ctrl->setCmd(
"showSummary");
1368 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1379 if (!$ilAccess->checkAccess(
"visible",
"", $this->ref_id))
1381 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1384 if ($this->ctrl->getCmd() ==
"infoScreen")
1386 $this->ctrl->setCmd(
"showSummary");
1387 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1390 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1393 $info->enablePrivateNotes();
1395 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
1402 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
1416 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
1419 $this->ctrl->forwardCommand($info);
1436 $ilTabs->clearTargets();
1437 $ilTabs->setBackTarget($lng->txt(
"back"),
1438 $ilCtrl->getLinkTarget($this,
"listMedia"));
1444 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
1446 "rename" => $lng->txt(
"mep_up_dir_move"),
1447 "copy" => $lng->txt(
"mep_up_dir_copy"),
1451 $ilToolbar->addInputItem($si);
1452 $ilToolbar->setCloseFormTag(
false);
1453 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1454 $ilToolbar->setFormName(
"mep_up_form");
1456 include_once(
"./Modules/MediaPool/classes/class.ilUploadDirFilesTableGUI.php");
1459 $tab->setFormName(
"mep_up_form");
1460 $tpl->setContent(
$tab->getHTML());
1470 $upload_dir = trim($mset->get(
"upload_dir"));
1472 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1476 foreach (
$_POST[
"file"] as $f)
1478 $f = str_replace(
"..",
"", $f);
1479 $fullpath = $upload_dir.
"/".$f;
1481 $mob->setTitle(basename($fullpath));
1482 $mob->setDescription(
"");
1487 $mob->createDirectory();
1491 $mob->addMediaItem($media_item);
1492 $media_item->setPurpose(
"Standard");
1494 $file = $mob_dir.
"/".basename($fullpath);
1496 basename($fullpath),
$file,
false,
$_POST[
"action"]);
1503 $media_item->setFormat($format);
1505 $media_item->setLocationType(
"LocalFile");
1507 $mob->setDescription($format);
1511 "File", $mob_dir.
"/".
$location, $media_item->getLocation(),
1512 true,
true,
"",
"");
1513 $media_item->setWidth($wh[
"width"]);
1514 $media_item->setHeight($wh[
"height"]);
1515 if ($wh[
"info"] !=
"")
1520 $media_item->setHAlign(
"Left");
1527 $mep_item->setTitle($mob->getTitle());
1528 $mep_item->setType(
"mob");
1529 $mep_item->setForeignId($mob->getId());
1530 $mep_item->create();
1532 $tree = $this->
object->getTree();
1533 $parent = (
$_GET[
"mepitem_id"] ==
"")
1534 ?
$tree->getRootId()
1535 :
$_GET[
"mepitem_id"];
1536 $tree->insertNode($mep_item->getId(), $parent);
1539 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=".
1540 $_GET[
"ref_id"].
"&mepitem_id=".
$_GET[
"mepitem_id"]);