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");
101 $this->ctrl->redirectByClass(
"ilobjfoldergui",
"create");
108 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":
131 if (
$cmd ==
"create" ||
$cmd ==
"save" ||
$cmd ==
"cancel")
133 $ret_obj =
$_GET[
"mepitem_id"];
135 $ilObjMediaObjectGUI->setWidthPreset($this->object->getDefaultWidth());
136 $ilObjMediaObjectGUI->setHeightPreset($this->object->getDefaultHeight());
140 $ret_obj =
$tree->getParentId(
$_GET[
"mepitem_id"]);
143 $ilTabs->setBackTarget($lng->txt(
"back"),
144 $this->ctrl->getLinkTarget($this,
145 $_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia"));
147 if ($this->ctrl->getCmdClass() ==
"ilinternallinkgui")
149 $this->ctrl->setReturn($this,
"explorer");
153 $this->ctrl->setParameter($this,
"mepitem_id", $ret_obj);
154 $this->ctrl->setReturn($this,
155 $_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
156 $this->ctrl->setParameter($this,
"mepitem_id", $_GET[
"mepitem_id"]);
159 $ilObjMediaObjectGUI->setTabs();
163 $ret = $this->ctrl->forwardCommand($ilObjMediaObjectGUI);
165 if (
$cmd ==
"save" &&
$ret !=
false)
168 $mep_item->setTitle(
$ret->getTitle());
169 $mep_item->setType(
"mob");
170 $mep_item->setForeignId(
$ret->getId());
173 $parent = (
$_GET[
"mepitem_id"] ==
"")
175 :
$_GET[
"mepitem_id"];
176 $tree->insertNode($mep_item->getId(), $parent);
177 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=".
178 $_GET[
"ref_id"].
"&mepitem_id=".
$_GET[
"mepitem_id"]);
186 case "ilobjfoldergui":
190 $this->ctrl->setReturn($this,
"listMedia");
197 $folder_gui->setFormAction(
"save",
198 $this->ctrl->getFormActionByClass(
"ilobjfoldergui"));
199 $folder_gui->createObject();
205 $parent = (
$_GET[
"mepitem_id"] ==
"")
207 :
$_GET[
"mepitem_id"];
208 $folder_gui->setFolderTree(
$tree);
209 $folder_gui->saveObject($parent);
216 $this->ctrl->setParameter($this,
"foldereditmode",
"1");
217 $folder_gui->setFormAction(
"update", $this->ctrl->getFormActionByClass(
"ilobjfoldergui"));
218 $folder_gui->editObject();
225 $this->ctrl->setReturn($this,
"listMedia");
226 $folder_gui->updateObject(
true);
230 if (
$_GET[
"foldereditmode"])
234 $this->ctrl->redirect($this,
"listMedia");
239 case "ileditclipboardgui":
242 $this->ctrl->setReturn($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
244 $clip_gui->setMultipleSelections(
true);
245 $clip_gui->setInsertButtonTitle($lng->txt(
"mep_copy_to_mep"));
246 $ilTabs->setTabActive(
"clipboard");
248 $ret =& $this->ctrl->forwardCommand($clip_gui);
252 case 'ilinfoscreengui':
259 case 'ilpermissiongui':
263 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
265 $ret =& $this->ctrl->forwardCommand($perm_gui);
273 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
275 $exp_gui->addFormat(
"xml");
276 $ret = $this->ctrl->forwardCommand($exp_gui);
280 case "ilfilesystemgui":
284 $ilTabs->clearTargets();
285 $ilTabs->setBackTarget($lng->txt(
"back"),
286 $ilCtrl->getLinkTarget($this,
"listMedia"));
288 if (trim($mset->get(
"upload_dir")) !=
"")
290 include_once(
"./Services/FileSystem/classes/class.ilFileSystemGUI.php");
293 $fs_gui->setTableId(
"mepud".$this->object->getId());
294 $fs_gui->setAllowFileCreation(
false);
295 $fs_gui->setAllowDirectoryCreation(
false);
296 $fs_gui->clearCommands();
297 $fs_gui->addCommand($this,
"selectUploadDirFiles", $this->lng->txt(
"mep_sel_upload_dir_files"),
300 $ret =& $this->ctrl->forwardCommand($fs_gui);
305 case "ilcommonactiondispatchergui":
306 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
308 $this->ctrl->forwardCommand($gui);
314 $cmd = $this->ctrl->getCmd(
"listMedia");
329 $this->ctrl->redirectByClass(
"ilobjmediaobjectgui",
"create");
334 $forms = array(self::CFORM_NEW => $this->
initCreateForm($a_new_type),
349 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=".$newObj->getRefId().
"&cmd=listMedia");
355 $ni =
new ilNumberInputGUI($this->lng->txt(
"mep_default_width"),
"default_width");
357 $ni->setSuffix(
"px");
358 $ni->setMaxLength(5);
363 $ni =
new ilNumberInputGUI($this->lng->txt(
"mep_default_height"),
"default_height");
366 $ni->setMaxLength(5);
368 $ni->setInfo($this->lng->txt(
"mep_default_width_height_info"));
374 if ($this->object->getDefaultWidth() > 0)
376 $a_values[
"default_width"] = $this->
object->getDefaultWidth();
378 if ($this->object->getDefaultHeight() > 0)
380 $a_values[
"default_height"] = $this->
object->getDefaultHeight();
386 $this->
object->setDefaultWidth($a_form->
getInput(
"default_width"));
387 $this->
object->setDefaultHeight($a_form->
getInput(
"default_height"));
397 $ilCtrl->setParameter($this,
"mep_mode",
"listMedia");
401 $ilTabs->setTabActive(
"objs_fold");
403 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
405 $ilToolbar->addButton($lng->txt(
"mep_create_mob"),
406 $ilCtrl->getLinkTarget($this,
"createMediaObject"));
409 if ($mset->get(
"mep_activate_pages"))
411 $ilToolbar->addButton($lng->txt(
"mep_create_content_snippet"),
412 $ilCtrl->getLinkTarget($this,
"createMediaPoolPage"));
415 $ilToolbar->addButton($lng->txt(
"mep_create_folder"),
416 $ilCtrl->getLinkTarget($this,
"createFolderForm"));
420 $ilToolbar->addButton($lng->txt(
"mep_create_from_upload_dir"),
421 $ilCtrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles"));
426 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolExplorerGUI.php");
428 if (!$exp->handleCommand())
430 $this->tpl->setLeftNavContent($exp->getHTML());
437 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
439 $tpl->setContent($mep_table_gui->getHTML());
450 $ilCtrl->setParameter($this,
"mep_mode",
"allMedia");
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())
551 $mob_id = $item->getForeignId();
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",
560 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
561 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
566 $this->tpl->setVariable(
"TITLE",
" - ".$media_obj->getTitle());
576 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
577 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
582 $mode = ($_GET[
"cmd"] !=
"showPreview")
587 $this->ctrl->getLinkTarget($this,
"showFullscreen",
"",
false,
false);
588 $params = array (
'mode' => $mode,
'enlarge_path' => $enlarge_path,
589 'link_params' =>
"ref_id=".$_GET[
"ref_id"],
'fullscreen_link' => $fullscreen_link,
590 'ref_id' => $_GET[
"ref_id"],
'pg_frame' => $pg_frame,
'webspace_path' => $wb_path);
591 $output = xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args, $params);
595 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
608 $tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
610 include_once(
"./Services/Container/classes/class.ilContainerPage.php");
611 include_once(
"./Services/Container/classes/class.ilContainerPageGUI.php");
613 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
615 $tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
617 $tpl->setCurrentBlock(
"SyntaxStyle");
618 $tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
620 $tpl->parseCurrentBlock();
626 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
628 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
632 $page_gui->setTemplateOutput(
false);
633 $page_gui->setHeader(
"");
634 $ret = $page_gui->showPage(
true);
636 $tpl->setBodyClass(
"ilMediaPoolPagePreviewBody");
637 $tpl->setVariable(
"CONTENT",
$ret);
655 switch ($item->getType())
687 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
691 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
693 $cgui->setFormAction($this->ctrl->getFormAction($this));
694 $cgui->setHeaderText($this->lng->txt(
"info_delete_sure"));
695 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancelRemove");
696 $cgui->setConfirm($this->lng->txt(
"confirm"),
"remove");
707 include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
709 if (count($usages) > 0)
712 $ilCtrl->redirect($this,
"listMedia");
718 if (count($usages) > 0)
720 $add =
"<div class='small'>".$lng->txt(
"mep_content_snippet_used_in_older_versions").
"</div>";
728 $cgui->addItem(
"id[]", $obj_id, $caption);
731 $this->tpl->setContent($cgui->getHTML());
743 $ilCtrl->setParameterByClass(
"ileditclipboardgui",
"returnCommand",
744 rawurlencode($ilCtrl->getLinkTarget($this,
745 "insertFromClipboard",
"",
false,
false)));
746 $ilCtrl->redirectByClass(
"ilEditClipboardGUI",
"getObject");
759 include_once(
"./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
761 $not_inserted = array();
764 foreach ($ids as $id2)
766 $id = explode(
":", $id2);
772 if (ilObjMEdiaPool::isForeignIdInTree($this->object->getId(), $id))
780 $item->setType(
"mob");
781 $item->setForeignId($id);
784 if ($item->getId() > 0)
786 $this->
object->insertInTree($item->getId(),
$_GET[
"mepitem_id"]);
792 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
793 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
794 if (ilObjMEdiaPool::isItemIdInTree($this->object->getId(), $id))
805 $item->setType(
"pg");
808 if ($item->getId() > 0)
810 $this->
object->insertInTree($item->getId(),
$_GET[
"mepitem_id"]);
813 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
815 $page->setId($item->getId());
819 $original->copy($page->getId(), $page->getParentType(), $page->getParentId(),
true);
829 if (count($not_inserted) > 0)
832 implode($not_inserted,
"<br>"),
true);
834 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
843 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
857 $this->
object->deleteChild($obj_id);
861 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
877 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
886 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
889 foreach (
$_POST[
"id"] as $obj_id)
895 $ilUser->addObjectToClipboard($fid,
"mob",
"");
899 $ilUser->addObjectToClipboard($obj_id,
"incl",
"");
903 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
911 global $ilLocator, $ilAccess;
915 $tree =& $this->
object->getTree();
918 :
$_GET[
"mepitem_id"];
920 foreach(
$path as $node)
922 if ($node[
"child"] ==
$tree->getRootId())
924 $this->ctrl->setParameter($this,
"mepitem_id",
"");
925 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId()))
927 $link = $this->ctrl->getLinkTarget($this,
"listMedia");
929 else if ($ilAccess->checkAccess(
"visible",
"", $this->object->getRefId()))
931 $link = $this->ctrl->getLinkTarget($this,
"infoScreen");
933 $title = $this->
object->getTitle();
934 $this->ctrl->setParameter($this,
"mepitem_id",
$_GET[
"mepitem_id"]);
935 $ilLocator->addItem($title, $link,
"",
$_GET[
"ref_id"]);
950 global $ilAccess,
$tpl;
955 $tpl->setContent($this->form->getHTML());
979 $tpl->setContent($this->form->getHTML());
991 $this->form->setValuesByArray($values);
1004 if ($this->form->checkInput())
1006 if ($this->object->createFolder(
$_POST[
"title"], (
int)
$_GET[
"mepitem_id"]))
1010 $ilCtrl->redirect($this,
"listMedia");
1013 $this->form->setValuesByPost();
1014 $tpl->setContent($this->form->getHtml());
1027 if ($this->form->checkInput())
1030 $item->setTitle(
$_POST[
"title"]);
1033 $ilCtrl->setParameter($this,
"mepitem_id",
1034 $this->object->getTree()->getParentId(
$_GET[
"mepitem_id"]));
1035 $ilCtrl->redirect($this,
"listMedia");
1038 $this->form->setValuesByPost();
1039 $tpl->setContent($this->form->getHtml());
1051 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1057 $ti->setRequired(
true);
1058 $this->form->addItem($ti);
1061 if ($a_mode ==
"create")
1063 $this->form->addCommandButton(
"saveFolder", $lng->txt(
"save"));
1064 $this->form->addCommandButton(
"cancelSave", $lng->txt(
"cancel"));
1065 $this->form->setTitle($lng->txt(
"mep_new_folder"));
1069 $this->form->addCommandButton(
"updateFolder", $lng->txt(
"save"));
1070 $this->form->addCommandButton(
"cancelFolderUpdate", $lng->txt(
"cancel"));
1071 $this->form->setTitle($lng->txt(
"mep_edit_folder"));
1074 $this->form->setFormAction($ilCtrl->getFormAction($this));
1083 $ilCtrl->setParameter($this,
"mepitem_id",
1084 $this->object->getTree()->getParentId(
$_GET[
"mepitem_id"]));
1085 $ilCtrl->redirect($this,
"listMedia");
1094 $ilCtrl->redirect($this,
"listMedia");
1111 $tpl->setContent($this->form->getHTML());
1128 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1130 $mep_page_gui->getTabs();
1134 $tpl->setContent($this->form->getHTML());
1147 if ($this->form->checkInput())
1150 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1152 $item->setTitle(
$_POST[
"title"]);
1153 $item->setType(
"pg");
1156 if ($item->getId() > 0)
1159 $tree = $this->
object->getTree();
1160 $parent =
$_GET[
"mepitem_id"] > 0
1161 ?
$_GET[
"mepitem_id"]
1162 :
$tree->getRootId();
1163 $this->
object->insertInTree($item->getId(), $parent);
1166 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1168 $page->setId($item->getId());
1171 $ilCtrl->setParameterByClass(
"ilmediapoolpagegui",
"mepitem_id", $item->getId());
1172 $ilCtrl->redirectByClass(
"ilmediapoolpagegui",
"edit");
1175 $ilCtrl->redirect($this,
"listMedia");
1178 $this->form->setValuesByPost();
1179 $tpl->setContent($this->form->getHtml());
1192 if ($this->form->checkInput())
1195 $item->setTitle(
$_POST[
"title"]);
1198 $ilCtrl->redirect($this,
"editMediaPoolPage");
1201 $this->form->setValuesByPost();
1202 $tpl->setContent($this->form->getHtml());
1213 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1219 $ti->setRequired(
true);
1220 $this->form->addItem($ti);
1223 if ($a_mode ==
"create")
1225 $this->form->addCommandButton(
"saveMediaPoolPage", $lng->txt(
"save"));
1226 $this->form->addCommandButton(
"cancelSave", $lng->txt(
"cancel"));
1227 $this->form->setTitle($lng->txt(
"mep_new_content_snippet"));
1231 $this->form->addCommandButton(
"updateMediaPoolPage", $lng->txt(
"save"));
1232 $this->form->setTitle($lng->txt(
"mep_edit_content_snippet"));
1235 $this->form->setFormAction($ilCtrl->getFormAction($this));
1245 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1248 $this->form->setValuesByArray($values);
1261 $ilTabs->clearTargets();
1264 $ilTabs->addTarget(
"mep_page_properties", $ilCtrl->getLinkTarget($this,
"editMediaPoolPage"),
1265 "editMediaPoolPage", get_class($this));
1266 $ilTabs->addTarget(
"cont_usage", $ilCtrl->getLinkTarget($this,
"showMediaPoolPageUsages"),
1267 array(
"showMediaPoolPageUsages",
"showAllMediaPoolPageUsages"), get_class($this));
1268 $ilCtrl->setParameter($this,
"mepitem_id", $this->object->tree->getParentId(
$_GET[
"mepitem_id"]));
1269 $ilTabs->setBackTarget($lng->txt(
"mep_folder"), $ilCtrl->getLinkTarget($this,
"listMedia"));
1270 $ilCtrl->setParameter($this,
"mepitem_id",
$_GET[
"mepitem_id"]);
1293 $ilTabs->addSubTab(
"current_usages", $lng->txt(
"cont_current_usages"),
1294 $ilCtrl->getLinkTarget($this,
"showMediaPoolPageUsages"));
1296 $ilTabs->addSubTab(
"all_usages", $lng->txt(
"cont_all_usages"),
1297 $ilCtrl->getLinkTarget($this,
"showAllMediaPoolPageUsages"));
1301 $ilTabs->activateSubTab(
"all_usages");
1302 $cmd =
"showAllMediaPoolPageUsages";
1306 $ilTabs->activateSubTab(
"current_usages");
1307 $cmd =
"showMediaPoolPageUsages";
1311 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1313 $mep_page_gui->getTabs();
1315 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1318 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageUsagesTableGUI.php");
1321 $tpl->setContent($table->getHTML());
1335 global $ilAccess, $ilTabs,
$ilCtrl, $ilHelp;
1337 $ilHelp->setScreenIdComponent(
"mep");
1339 if ($ilAccess->checkAccess(
'read',
'', $this->ref_id) ||
1340 $ilAccess->checkAccess(
'write',
'', $this->ref_id))
1342 $ilTabs->addTarget(
"objs_fold", $this->ctrl->getLinkTarget($this,
""),
1343 "listMedia",
"",
"_top");
1345 $ilCtrl->setParameter($this,
"mepitem_id",
"");
1346 $ilTabs->addTarget(
"mep_all_mobs", $this->ctrl->getLinkTarget($this,
"allMedia"),
1347 "allMedia",
"",
"_top");
1348 $ilCtrl->setParameter($this,
"mepitem_id",
$_GET[
"mepitem_id"]);
1352 if ($ilAccess->checkAccess(
'visible',
'', $this->ref_id) ||
1353 $ilAccess->checkAccess(
'read',
'', $this->ref_id) ||
1354 $ilAccess->checkAccess(
'write',
'', $this->ref_id))
1356 $force_active = ($this->ctrl->getNextClass() ==
"ilinfoscreengui"
1357 || strtolower(
$_GET[
"cmdClass"]) ==
"ilnotegui")
1361 $ilTabs->addTarget(
"info_short",
1362 $this->ctrl->getLinkTargetByClass(
1363 array(
"ilobjmediapoolgui",
"ilinfoscreengui"),
"showSummary"),
1364 array(
"showSummary",
"infoScreen"),
1365 "",
"", $force_active);
1368 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1370 $ilTabs->addTarget(
"settings", $this->ctrl->getLinkTarget($this,
"edit"),
1371 "edit", array(
"",
"ilobjmediapoolgui"));
1374 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1376 $ilTabs->addTarget(
"clipboard", $this->ctrl->getLinkTarget($this,
"openClipboard"),
1377 "view",
"ileditclipboardgui");
1380 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1382 $ilTabs->addTarget(
"export", $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""),
1386 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->object->getRefId()))
1388 $ilTabs->addTarget(
"perm_settings",
1389 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1402 $targets = explode(
'_',$a_target);
1403 if(count((array) $targets) > 1)
1406 $subitem_id = $targets[1];
1413 if ($ilAccess->checkAccess(
"read",
"",
$ref_id))
1415 $_GET[
"baseClass"] =
"ilMediaPoolPresentationGUI";
1417 $_GET[
'mepitem_id'] = $subitem_id;
1418 include(
"ilias.php");
1420 }
else if ($ilAccess->checkAccess(
"visible",
"",
$ref_id))
1422 $_GET[
"baseClass"] =
"ilMediaPoolPresentationGUI";
1424 $_GET[
"cmd"] =
"infoScreen";
1425 include(
"ilias.php");
1428 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1435 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
1445 $this->ctrl->setCmd(
"showSummary");
1446 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1457 if (!$ilAccess->checkAccess(
"visible",
"", $this->ref_id) &&
1458 !$ilAccess->checkAccess(
"read",
"", $this->ref_id) &&
1459 !$ilAccess->checkAccess(
"write",
"", $this->ref_id))
1461 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1464 if ($this->ctrl->getCmd() ==
"infoScreen")
1466 $this->ctrl->setCmd(
"showSummary");
1467 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1470 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1473 $info->enablePrivateNotes();
1475 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
1482 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
1496 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
1499 $this->ctrl->forwardCommand($info);
1516 $ilTabs->clearTargets();
1517 $ilTabs->setBackTarget($lng->txt(
"back"),
1518 $ilCtrl->getLinkTarget($this,
"listMedia"));
1526 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
1528 "rename" => $lng->txt(
"mep_up_dir_move"),
1529 "copy" => $lng->txt(
"mep_up_dir_copy"),
1533 $ilToolbar->addInputItem($si);
1534 $ilToolbar->setCloseFormTag(
false);
1535 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1536 $ilToolbar->setFormName(
"mep_up_form");
1538 include_once(
"./Modules/MediaPool/classes/class.ilUploadDirFilesTableGUI.php");
1541 $tab->setFormName(
"mep_up_form");
1542 $tpl->setContent(
$tab->getHTML());
1554 $upload_dir = trim($mset->get(
"upload_dir"));
1556 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1560 foreach (
$_POST[
"file"] as $f)
1562 $f = str_replace(
"..",
"", $f);
1563 $fullpath = $upload_dir.
"/".$f;
1565 $mob->setTitle(basename($fullpath));
1566 $mob->setDescription(
"");
1571 $mob->createDirectory();
1575 $mob->addMediaItem($media_item);
1576 $media_item->setPurpose(
"Standard");
1578 $file = $mob_dir.
"/".basename($fullpath);
1580 basename($fullpath),
$file,
false,
$_POST[
"action"]);
1587 $media_item->setFormat($format);
1589 $media_item->setLocationType(
"LocalFile");
1591 $mob->setDescription($format);
1595 "File", $mob_dir.
"/".
$location, $media_item->getLocation(),
1596 true,
true,
"",
"");
1597 $media_item->setWidth($wh[
"width"]);
1598 $media_item->setHeight($wh[
"height"]);
1599 if ($wh[
"info"] !=
"")
1604 $media_item->setHAlign(
"Left");
1611 $mep_item->setTitle($mob->getTitle());
1612 $mep_item->setType(
"mob");
1613 $mep_item->setForeignId($mob->getId());
1614 $mep_item->create();
1616 $tree = $this->
object->getTree();
1617 $parent = (
$_GET[
"mepitem_id"] ==
"")
1618 ?
$tree->getRootId()
1619 :
$_GET[
"mepitem_id"];
1620 $tree->insertNode($mep_item->getId(), $parent);
1623 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=".
1624 $_GET[
"ref_id"].
"&mepitem_id=".
$_GET[
"mepitem_id"]);
1635 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1638 $tpl->addJavaScript(
"./Modules/MediaPool/js/ilMediaPool.js");
1640 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"mepitem_id",
"");
1641 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"ref_id", $a_mpool_ref_id);
1642 $tpl->addOnloadCode(
"il.MediaPool.setPreviewUrl('".$ilCtrl->getLinkTargetByClass(array(
"ilmediapoolpresentationgui",
"ilobjmediapoolgui"),
"showPreview",
"",
false,
false).
"');");
1643 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"mepitem_id",
$_GET[
"mepitem_id"]);
1644 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"ref_id",
$_GET[
"red_id"]);
1646 include_once(
"./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
1648 $modal->setHeading($lng->txt(
"preview"));
1649 $modal->setId(
"ilMepPreview");
1651 $modal->setBody(
"<iframe id='ilMepPreviewContent'></iframe>");
1653 return $modal->getHTML();