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(
"frameset");
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"));
421 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
423 $tpl->setContent($mep_table_gui->getHTML());
434 $ilCtrl->setParameter($this,
"mep_mode",
"allMedia");
436 if (!$ilAccess->checkAccess(
"read",
"", $this->object->getRefId()))
438 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
440 $ilTabs->setTabActive(
"mep_all_mobs");
443 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
448 if(isset(
$_GET[
'force_filter']) and
$_GET[
'force_filter'])
452 include_once(
"./Services/Table/classes/class.ilTablePropertiesStorage.php");
454 $tprop->storeProperty(
455 $mep_table_gui->getId(),
460 $mep_table_gui->resetFilter();
461 $mep_table_gui->resetOffset();
462 $mep_table_gui->writeFilterToSession();
469 $tpl->setContent($mep_table_gui->getHTML());
478 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
481 $mtab->writeFilterToSession();
482 $mtab->resetOffset();
491 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
494 $mtab->resetFilter();
495 $mtab->resetOffset();
504 $this->tpl->getStandardTemplate();
513 if (
$_GET[
"mepitem_id"] ==
"")
517 $par_id = $this->
object->tree->getParentId(
$_GET[
"mepitem_id"]);
518 if ($par_id != $this->object->tree->getRootId())
536 include_once(
"Services/Frameset/classes/class.ilFramesetGUI.php");
538 $fs_gui->setMainFrameName(
"content");
539 $fs_gui->setSideFrameName(
"tree");
540 $fs_gui->setMainFrameSource(
541 $this->ctrl->getLinkTarget($this,
"listMedia"));
542 $this->ctrl->setParameter($this,
"expand",
"1");
543 $fs_gui->setSideFrameSource(
544 $this->ctrl->getLinkTarget($this,
"explorer"));
545 $fs_gui->setFramesetTitle($this->object->getTitle());
557 include_once(
"Services/Frameset/classes/class.ilFramesetGUI.php");
559 $fs_gui->setMainFrameName(
"content");
560 $fs_gui->setSideFrameName(
"tree");
561 $fs_gui->setMainFrameSource(
562 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"));
563 $this->ctrl->setParameter($this,
"expand",
"1");
564 $fs_gui->setSideFrameSource(
565 $this->ctrl->getLinkTarget($this,
"explorer"));
566 $fs_gui->setFramesetTitle($this->object->getTitle());
578 $ilCtrl->setParameter($this,
"obj_id",
"");
579 $ilCtrl->setParameter($this,
"mepitem_id",
"");
581 if (!$ilAccess->checkAccess(
"read",
"", $this->object->getRefId()) &&
582 !$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
587 require_once (
"./Modules/MediaPool/classes/class.ilMediaPoolExplorer.php");
590 $exp->setTargetGet(
"mepitem_id");
591 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
"explorer"));
592 $exp->setTitle($this->lng->txt(
"cont_mep_structure"));
594 $exp->addFilter(
"dummy");
595 $exp->addFilter(
"fold");
596 $exp->setFiltered(
true);
600 if (
$_GET[
"mepexpand"] ==
"")
602 $mep_tree =& $this->
object->getTree();
603 $expanded = $mep_tree->readRootId();
607 $expanded =
$_GET[
"mepexpand"];
610 $exp->setExpand($expanded);
614 $output = $exp->getOutput();
636 if (!$ilAccess->checkAccess(
"read",
"", $this->object->getRefId()))
638 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
641 $this->tpl =&
new ilTemplate(
"tpl.fullscreen.html",
true,
true,
"Services/COPage");
642 include_once(
"Services/Style/classes/class.ilObjStyleSheet.php");
644 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
655 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
656 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
668 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
669 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
674 $mode = (
$_GET[
"cmd"] !=
"showMedia")
679 $this->ctrl->getLinkTarget($this,
"showFullscreen",
"",
false,
false);
680 $params = array (
'mode' => $mode,
'enlarge_path' => $enlarge_path,
681 'link_params' =>
"ref_id=".
$_GET[
"ref_id"],
'fullscreen_link' => $fullscreen_link,
682 'ref_id' =>
$_GET[
"ref_id"],
'pg_frame' => $pg_frame,
'webspace_path' => $wb_path);
683 $output =
xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args, $params);
687 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
705 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
707 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
712 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
716 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
718 $cgui->setFormAction($this->ctrl->getFormAction($this));
719 $cgui->setHeaderText($this->lng->txt(
"info_delete_sure"));
720 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancelRemove");
721 $cgui->setConfirm($this->lng->txt(
"confirm"),
"remove");
732 include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
734 if (count($usages) > 0)
737 $ilCtrl->redirect($this,
"listMedia");
743 if (count($usages) > 0)
745 $add =
"<div class='small'>".$lng->txt(
"mep_content_snippet_used_in_older_versions").
"</div>";
753 $cgui->addItem(
"id[]", $obj_id, $caption);
756 $this->tpl->setContent($cgui->getHTML());
766 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
768 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
771 $ilCtrl->setParameterByClass(
"ileditclipboardgui",
"returnCommand",
772 rawurlencode($ilCtrl->getLinkTarget($this,
773 "insertFromClipboard",
"",
false,
false)));
774 $ilCtrl->redirectByClass(
"ilEditClipboardGUI",
"getObject");
785 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
787 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
790 include_once(
"./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
792 $not_inserted = array();
795 foreach ($ids as $id2)
797 $id = explode(
":", $id2);
803 if (ilObjMEdiaPool::isForeignIdInTree($this->object->getId(), $id))
811 $item->setType(
"mob");
812 $item->setForeignId($id);
815 if ($item->getId() > 0)
817 $this->
object->insertInTree($item->getId(),
$_GET[
"mepitem_id"]);
823 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
824 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
825 if (ilObjMEdiaPool::isItemIdInTree($this->object->getId(), $id))
836 $item->setType(
"pg");
839 if ($item->getId() > 0)
841 $this->
object->insertInTree($item->getId(),
$_GET[
"mepitem_id"]);
844 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
846 $page->setId($item->getId());
850 $page->setXMLContent($original->copyXMLContent());
858 if (count($not_inserted) > 0)
861 implode($not_inserted,
"<br>"),
true);
863 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
872 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
882 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
884 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
889 $this->
object->deleteChild($obj_id);
893 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
909 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
918 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
921 foreach (
$_POST[
"id"] as $obj_id)
927 $ilUser->addObjectToClipboard($fid,
"mob",
"");
931 $ilUser->addObjectToClipboard($obj_id,
"incl",
"");
935 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
947 $tree =& $this->
object->getTree();
950 :
$_GET[
"mepitem_id"];
952 foreach(
$path as $node)
954 if ($node[
"child"] ==
$tree->getRootId())
956 $this->ctrl->setParameter($this,
"mepitem_id",
"");
957 $link = $this->ctrl->getLinkTarget($this,
"listMedia");
958 $title = $this->
object->getTitle();
959 $this->ctrl->setParameter($this,
"mepitem_id",
$_GET[
"mepitem_id"]);
960 $ilLocator->addItem(
$title, $link,
"",
$_GET[
"ref_id"]);
964 $this->ctrl->setParameter($this,
"mepitem_id", $node[
"child"]);
965 $link = $this->ctrl->getLinkTarget($this,
"listMedia");
967 $this->ctrl->setParameter($this,
"mepitem_id",
$_GET[
"mepitem_id"]);
968 $ilLocator->addItem(
$title, $link);
983 global $ilAccess,
$tpl;
985 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
987 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
991 $tpl->setContent($this->form->getHTML());
1013 $tpl->setContent($this->form->getHTML());
1025 $this->form->setValuesByArray($values);
1036 if ($this->form->checkInput())
1038 if ($this->object->createFolder(
$_POST[
"title"], (
int)
$_GET[
"mepitem_id"]))
1042 $ilCtrl->redirect($this,
"listMedia");
1045 $this->form->setValuesByPost();
1046 $tpl->setContent($this->form->getHtml());
1057 if ($this->form->checkInput())
1060 $item->setTitle(
$_POST[
"title"]);
1063 $ilCtrl->setParameter($this,
"mepitem_id",
1064 $this->object->getTree()->getParentId(
$_GET[
"mepitem_id"]));
1065 $ilCtrl->redirect($this,
"listMedia");
1068 $this->form->setValuesByPost();
1069 $tpl->setContent($this->form->getHtml());
1081 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1087 $ti->setRequired(
true);
1088 $this->form->addItem($ti);
1091 if ($a_mode ==
"create")
1093 $this->form->addCommandButton(
"saveFolder", $lng->txt(
"save"));
1094 $this->form->addCommandButton(
"cancelSave", $lng->txt(
"cancel"));
1095 $this->form->setTitle($lng->txt(
"mep_new_folder"));
1099 $this->form->addCommandButton(
"updateFolder", $lng->txt(
"save"));
1100 $this->form->addCommandButton(
"cancelFolderUpdate", $lng->txt(
"cancel"));
1101 $this->form->setTitle($lng->txt(
"mep_edit_folder"));
1104 $this->form->setFormAction($ilCtrl->getFormAction($this));
1113 $ilCtrl->setParameter($this,
"mepitem_id",
1114 $this->object->getTree()->getParentId(
$_GET[
"mepitem_id"]));
1115 $ilCtrl->redirect($this,
"listMedia");
1124 $ilCtrl->redirect($this,
"listMedia");
1138 $tpl->setContent($this->form->getHTML());
1153 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1155 $mep_page_gui->getTabs();
1159 $tpl->setContent($this->form->getHTML());
1170 if ($this->form->checkInput())
1173 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1175 $item->setTitle(
$_POST[
"title"]);
1176 $item->setType(
"pg");
1179 if ($item->getId() > 0)
1182 $tree = $this->
object->getTree();
1183 $parent =
$_GET[
"mepitem_id"] > 0
1184 ?
$_GET[
"mepitem_id"]
1185 :
$tree->getRootId();
1186 $this->
object->insertInTree($item->getId(), $parent);
1189 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1191 $page->setId($item->getId());
1196 $ilCtrl->redirect($this,
"listMedia");
1199 $this->form->setValuesByPost();
1200 $tpl->setContent($this->form->getHtml());
1211 if ($this->form->checkInput())
1214 $item->setTitle(
$_POST[
"title"]);
1217 $ilCtrl->redirect($this,
"editMediaPoolPage");
1220 $this->form->setValuesByPost();
1221 $tpl->setContent($this->form->getHtml());
1232 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1238 $ti->setRequired(
true);
1239 $this->form->addItem($ti);
1242 if ($a_mode ==
"create")
1244 $this->form->addCommandButton(
"saveMediaPoolPage", $lng->txt(
"save"));
1245 $this->form->addCommandButton(
"cancelSave", $lng->txt(
"cancel"));
1246 $this->form->setTitle($lng->txt(
"mep_new_content_snippet"));
1250 $this->form->addCommandButton(
"updateMediaPoolPage", $lng->txt(
"save"));
1251 $this->form->setTitle($lng->txt(
"mep_edit_content_snippet"));
1254 $this->form->setFormAction($ilCtrl->getFormAction($this));
1264 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1267 $this->form->setValuesByArray($values);
1280 $ilTabs->clearTargets();
1283 $ilTabs->addTarget(
"mep_page_properties", $ilCtrl->getLinkTarget($this,
"editMediaPoolPage"),
1284 "editMediaPoolPage", get_class($this));
1285 $ilTabs->addTarget(
"cont_usage", $ilCtrl->getLinkTarget($this,
"showMediaPoolPageUsages"),
1286 array(
"showMediaPoolPageUsages",
"showAllMediaPoolPageUsages"), get_class($this));
1287 $ilCtrl->setParameter($this,
"mepitem_id", $this->object->tree->getParentId(
$_GET[
"mepitem_id"]));
1288 $ilTabs->setBackTarget($lng->txt(
"mep_folder"), $ilCtrl->getLinkTarget($this,
"listMedia"));
1289 $ilCtrl->setParameter($this,
"mepitem_id",
$_GET[
"mepitem_id"]);
1310 $ilTabs->addSubTab(
"current_usages", $lng->txt(
"cont_current_usages"),
1311 $ilCtrl->getLinkTarget($this,
"showMediaPoolPageUsages"));
1313 $ilTabs->addSubTab(
"all_usages", $lng->txt(
"cont_all_usages"),
1314 $ilCtrl->getLinkTarget($this,
"showAllMediaPoolPageUsages"));
1318 $ilTabs->activateSubTab(
"all_usages");
1319 $cmd =
"showAllMediaPoolPageUsages";
1323 $ilTabs->activateSubTab(
"current_usages");
1324 $cmd =
"showMediaPoolPageUsages";
1328 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1330 $mep_page_gui->getTabs();
1332 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1335 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageUsagesTableGUI.php");
1338 $tpl->setContent($table->getHTML());
1352 global $ilAccess, $ilTabs,
$ilCtrl, $ilHelp;
1354 $ilHelp->setScreenIdComponent(
"mep");
1356 if ($ilAccess->checkAccess(
'read',
'', $this->ref_id) ||
1357 $ilAccess->checkAccess(
'write',
'', $this->ref_id))
1359 $ilTabs->addTarget(
"objs_fold", $this->ctrl->getLinkTarget($this,
""),
1360 "listMedia",
"",
"_top");
1362 $ilCtrl->setParameter($this,
"mepitem_id",
"");
1363 $ilTabs->addTarget(
"mep_all_mobs", $this->ctrl->getLinkTarget($this,
"allMedia"),
1364 "allMedia",
"",
"_top");
1365 $ilCtrl->setParameter($this,
"mepitem_id",
$_GET[
"mepitem_id"]);
1369 if ($ilAccess->checkAccess(
'visible',
'', $this->ref_id))
1371 $force_active = ($this->ctrl->getNextClass() ==
"ilinfoscreengui"
1372 || strtolower(
$_GET[
"cmdClass"]) ==
"ilnotegui")
1376 $ilTabs->addTarget(
"info_short",
1377 $this->ctrl->getLinkTargetByClass(
1378 array(
"ilobjmediapoolgui",
"ilinfoscreengui"),
"showSummary"),
1379 array(
"showSummary",
"infoScreen"),
1380 "",
"", $force_active);
1383 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1385 $ilTabs->addTarget(
"settings", $this->ctrl->getLinkTarget($this,
"edit"),
1386 "edit", array(
"",
"ilobjmediapoolgui"));
1389 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1391 $ilTabs->addTarget(
"clipboard", $this->ctrl->getLinkTarget($this,
"openClipboard"),
1392 "view",
"ileditclipboardgui");
1395 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1397 $ilTabs->addTarget(
"export", $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""),
1401 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->object->getRefId()))
1403 $ilTabs->addTarget(
"perm_settings",
1404 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1417 $targets = explode(
'_',$a_target);
1418 if(count((array) $targets) > 1)
1421 $subitem_id = $targets[1];
1428 if ($ilAccess->checkAccess(
"read",
"",
$ref_id))
1430 $_GET[
"cmd"] =
"frameset";
1431 $_GET[
"baseClass"] =
"ilMediaPoolPresentationGUI";
1433 $_GET[
'mepitem_id'] = $subitem_id;
1434 include(
"ilias.php");
1437 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1444 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
1454 $this->ctrl->setCmd(
"showSummary");
1455 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1466 if (!$ilAccess->checkAccess(
"visible",
"", $this->ref_id))
1468 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1471 if ($this->ctrl->getCmd() ==
"infoScreen")
1473 $this->ctrl->setCmd(
"showSummary");
1474 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1477 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1480 $info->enablePrivateNotes();
1482 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
1489 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
1503 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
1506 $this->ctrl->forwardCommand($info);
1523 $ilTabs->clearTargets();
1524 $ilTabs->setBackTarget($lng->txt(
"back"),
1525 $ilCtrl->getLinkTarget($this,
"listMedia"));
1531 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
1533 "rename" => $lng->txt(
"mep_up_dir_move"),
1534 "copy" => $lng->txt(
"mep_up_dir_copy"),
1537 $si->setOptions($options);
1538 $ilToolbar->addInputItem($si);
1539 $ilToolbar->setCloseFormTag(
false);
1540 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1541 $ilToolbar->setFormName(
"mep_up_form");
1543 include_once(
"./Modules/MediaPool/classes/class.ilUploadDirFilesTableGUI.php");
1546 $tab->setFormName(
"mep_up_form");
1547 $tpl->setContent(
$tab->getHTML());
1557 $upload_dir = trim($mset->get(
"upload_dir"));
1559 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1563 foreach (
$_POST[
"file"] as $f)
1565 $f = str_replace(
"..",
"", $f);
1566 $fullpath = $upload_dir.
"/".$f;
1568 $mob->setTitle(basename($fullpath));
1569 $mob->setDescription(
"");
1574 $mob->createDirectory();
1578 $mob->addMediaItem($media_item);
1579 $media_item->setPurpose(
"Standard");
1581 $file = $mob_dir.
"/".basename($fullpath);
1583 basename($fullpath),
$file,
false,
$_POST[
"action"]);
1590 $media_item->setFormat($format);
1592 $media_item->setLocationType(
"LocalFile");
1594 $mob->setDescription($format);
1598 "File", $mob_dir.
"/".
$location, $media_item->getLocation(),
1599 true,
true,
"",
"");
1600 $media_item->setWidth($wh[
"width"]);
1601 $media_item->setHeight($wh[
"height"]);
1602 if ($wh[
"info"] !=
"")
1607 $media_item->setHAlign(
"Left");
1614 $mep_item->setTitle($mob->getTitle());
1615 $mep_item->setType(
"mob");
1616 $mep_item->setForeignId($mob->getId());
1617 $mep_item->create();
1619 $tree = $this->
object->getTree();
1620 $parent = (
$_GET[
"mepitem_id"] ==
"")
1621 ?
$tree->getRootId()
1622 :
$_GET[
"mepitem_id"];
1623 $tree->insertNode($mep_item->getId(), $parent);
1626 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=".
1627 $_GET[
"ref_id"].
"&mepitem_id=".
$_GET[
"mepitem_id"]);