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(
"./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");
666 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
667 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
672 $mode = (
$_GET[
"cmd"] !=
"showMedia")
677 $this->ctrl->getLinkTarget($this,
"showFullscreen",
"",
false,
false);
678 $params = array (
'mode' => $mode,
'enlarge_path' => $enlarge_path,
679 'link_params' =>
"ref_id=".
$_GET[
"ref_id"],
'fullscreen_link' => $fullscreen_link,
680 'ref_id' =>
$_GET[
"ref_id"],
'pg_frame' => $pg_frame,
'webspace_path' => $wb_path);
681 $output =
xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args, $params);
685 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
687 $this->tpl->parseCurrentBlock();
706 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
708 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
713 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
721 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html",
"Modules/MediaPool");
725 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
728 $this->tpl->setCurrentBlock(
"table_header");
729 $this->tpl->setVariable(
"TEXT",$this->lng->txt(
"objects"));
730 $this->tpl->parseCurrentBlock();
743 include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
745 if (count($usages) > 0)
748 $ilCtrl->redirect($this,
"listMedia");
754 if (count($usages) > 0)
756 $add =
"<div class='small'>".$lng->txt(
"mep_content_snippet_used_in_older_versions").
"</div>";
761 $this->tpl->setCurrentBlock(
"table_row");
763 $this->tpl->setVariable(
"TEXT_CONTENT",
$title.$add);
765 $this->tpl->parseCurrentBlock();
770 $buttons = array(
"cancelRemove" => $this->lng->txt(
"cancel"),
771 "remove" => $this->lng->txt(
"confirm"));
772 foreach ($buttons as $name => $value)
774 $this->tpl->setCurrentBlock(
"operation_btn");
775 $this->tpl->setVariable(
"BTN_NAME",$name);
776 $this->tpl->setVariable(
"BTN_VALUE",$value);
777 $this->tpl->parseCurrentBlock();
789 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
791 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
794 $ilCtrl->setParameterByClass(
"ileditclipboardgui",
"returnCommand",
795 rawurlencode($ilCtrl->getLinkTarget($this,
796 "insertFromClipboard",
"",
false,
false)));
797 $ilCtrl->redirectByClass(
"ilEditClipboardGUI",
"getObject");
808 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
810 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
813 include_once(
"./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
815 $not_inserted = array();
818 foreach ($ids as $id2)
820 $id = explode(
":", $id2);
826 if (ilObjMEdiaPool::isForeignIdInTree($this->object->getId(), $id))
834 $item->setType(
"mob");
835 $item->setForeignId($id);
838 if ($item->getId() > 0)
840 $this->
object->insertInTree($item->getId(),
$_GET[
"mepitem_id"]);
846 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
847 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
848 if (ilObjMEdiaPool::isItemIdInTree($this->object->getId(), $id))
859 $item->setType(
"pg");
862 if ($item->getId() > 0)
864 $this->
object->insertInTree($item->getId(),
$_GET[
"mepitem_id"]);
867 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
869 $page->setId($item->getId());
873 $page->setXMLContent($original->copyXMLContent());
881 if (count($not_inserted) > 0)
884 implode($not_inserted,
"<br>"),
true);
886 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
895 session_unregister(
"ilMepRemove");
896 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
906 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
908 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
913 $this->
object->deleteChild($obj_id);
917 session_unregister(
"ilMepRemove");
918 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
927 global $ilUser, $ilAccess;
934 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
943 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
946 foreach (
$_POST[
"id"] as $obj_id)
952 $ilUser->addObjectToClipboard($fid,
"mob",
"");
956 $ilUser->addObjectToClipboard($obj_id,
"incl",
"");
960 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
972 $tree =& $this->
object->getTree();
975 :
$_GET[
"mepitem_id"];
977 foreach(
$path as $node)
979 if ($node[
"child"] ==
$tree->getRootId())
981 $this->ctrl->setParameter($this,
"mepitem_id",
"");
982 $link = $this->ctrl->getLinkTarget($this,
"listMedia");
983 $title = $this->
object->getTitle();
984 $this->ctrl->setParameter($this,
"mepitem_id",
$_GET[
"mepitem_id"]);
985 $ilLocator->addItem(
$title, $link,
"",
$_GET[
"ref_id"]);
989 $this->ctrl->setParameter($this,
"mepitem_id", $node[
"child"]);
990 $link = $this->ctrl->getLinkTarget($this,
"listMedia");
992 $this->ctrl->setParameter($this,
"mepitem_id",
$_GET[
"mepitem_id"]);
993 $ilLocator->addItem(
$title, $link);
1008 global $ilAccess,
$tpl;
1010 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1012 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
1016 $tpl->setContent($this->form->getHTML());
1038 $tpl->setContent($this->form->getHTML());
1050 $this->form->setValuesByArray($values);
1061 if ($this->form->checkInput())
1063 if ($this->object->createFolder(
$_POST[
"title"], (
int)
$_GET[
"mepitem_id"]))
1067 $ilCtrl->redirect($this,
"listMedia");
1070 $this->form->setValuesByPost();
1071 $tpl->setContent($this->form->getHtml());
1082 if ($this->form->checkInput())
1085 $item->setTitle(
$_POST[
"title"]);
1088 $ilCtrl->setParameter($this,
"mepitem_id",
1089 $this->object->getTree()->getParentId(
$_GET[
"mepitem_id"]));
1090 $ilCtrl->redirect($this,
"listMedia");
1093 $this->form->setValuesByPost();
1094 $tpl->setContent($this->form->getHtml());
1106 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1112 $ti->setRequired(
true);
1113 $this->form->addItem($ti);
1116 if ($a_mode ==
"create")
1118 $this->form->addCommandButton(
"saveFolder", $lng->txt(
"save"));
1119 $this->form->addCommandButton(
"cancelSave", $lng->txt(
"cancel"));
1120 $this->form->setTitle($lng->txt(
"mep_new_folder"));
1124 $this->form->addCommandButton(
"updateFolder", $lng->txt(
"save"));
1125 $this->form->addCommandButton(
"cancelFolderUpdate", $lng->txt(
"cancel"));
1126 $this->form->setTitle($lng->txt(
"mep_edit_folder"));
1129 $this->form->setFormAction($ilCtrl->getFormAction($this));
1138 $ilCtrl->setParameter($this,
"mepitem_id",
1139 $this->object->getTree()->getParentId(
$_GET[
"mepitem_id"]));
1140 $ilCtrl->redirect($this,
"listMedia");
1149 $ilCtrl->redirect($this,
"listMedia");
1163 $tpl->setContent($this->form->getHTML());
1178 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1180 $mep_page_gui->getTabs();
1184 $tpl->setContent($this->form->getHTML());
1195 if ($this->form->checkInput())
1198 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1200 $item->setTitle(
$_POST[
"title"]);
1201 $item->setType(
"pg");
1204 if ($item->getId() > 0)
1207 $tree = $this->
object->getTree();
1208 $parent =
$_GET[
"mepitem_id"] > 0
1209 ?
$_GET[
"mepitem_id"]
1210 :
$tree->getRootId();
1211 $this->
object->insertInTree($item->getId(), $parent);
1214 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1216 $page->setId($item->getId());
1221 $ilCtrl->redirect($this,
"listMedia");
1224 $this->form->setValuesByPost();
1225 $tpl->setContent($this->form->getHtml());
1236 if ($this->form->checkInput())
1239 $item->setTitle(
$_POST[
"title"]);
1242 $ilCtrl->redirect($this,
"editMediaPoolPage");
1245 $this->form->setValuesByPost();
1246 $tpl->setContent($this->form->getHtml());
1257 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1263 $ti->setRequired(
true);
1264 $this->form->addItem($ti);
1267 if ($a_mode ==
"create")
1269 $this->form->addCommandButton(
"saveMediaPoolPage", $lng->txt(
"save"));
1270 $this->form->addCommandButton(
"cancelSave", $lng->txt(
"cancel"));
1271 $this->form->setTitle($lng->txt(
"mep_new_content_snippet"));
1275 $this->form->addCommandButton(
"updateMediaPoolPage", $lng->txt(
"save"));
1276 $this->form->setTitle($lng->txt(
"mep_edit_content_snippet"));
1279 $this->form->setFormAction($ilCtrl->getFormAction($this));
1289 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1292 $this->form->setValuesByArray($values);
1305 $ilTabs->clearTargets();
1308 $ilTabs->addTarget(
"mep_page_properties", $ilCtrl->getLinkTarget($this,
"editMediaPoolPage"),
1309 "editMediaPoolPage", get_class($this));
1310 $ilTabs->addTarget(
"cont_usage", $ilCtrl->getLinkTarget($this,
"showMediaPoolPageUsages"),
1311 array(
"showMediaPoolPageUsages",
"showAllMediaPoolPageUsages"), get_class($this));
1312 $ilCtrl->setParameter($this,
"mepitem_id", $this->object->tree->getParentId(
$_GET[
"mepitem_id"]));
1313 $ilTabs->setBackTarget($lng->txt(
"mep_folder"), $ilCtrl->getLinkTarget($this,
"listMedia"));
1314 $ilCtrl->setParameter($this,
"mepitem_id",
$_GET[
"mepitem_id"]);
1335 $ilTabs->addSubTab(
"current_usages", $lng->txt(
"cont_current_usages"),
1336 $ilCtrl->getLinkTarget($this,
"showMediaPoolPageUsages"));
1338 $ilTabs->addSubTab(
"all_usages", $lng->txt(
"cont_all_usages"),
1339 $ilCtrl->getLinkTarget($this,
"showAllMediaPoolPageUsages"));
1343 $ilTabs->activateSubTab(
"all_usages");
1344 $cmd =
"showAllMediaPoolPageUsages";
1348 $ilTabs->activateSubTab(
"current_usages");
1349 $cmd =
"showMediaPoolPageUsages";
1353 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1355 $mep_page_gui->getTabs();
1357 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1360 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageUsagesTableGUI.php");
1363 $tpl->setContent($table->getHTML());
1377 global $ilAccess, $ilTabs,
$ilCtrl;
1379 if ($ilAccess->checkAccess(
'read',
'', $this->ref_id) ||
1380 $ilAccess->checkAccess(
'write',
'', $this->ref_id))
1382 $ilTabs->addTarget(
"objs_fold", $this->ctrl->getLinkTarget($this,
""),
1383 "listMedia",
"",
"_top");
1385 $ilCtrl->setParameter($this,
"mepitem_id",
"");
1386 $ilTabs->addTarget(
"mep_all_mobs", $this->ctrl->getLinkTarget($this,
"allMedia"),
1387 "allMedia",
"",
"_top");
1388 $ilCtrl->setParameter($this,
"mepitem_id",
$_GET[
"mepitem_id"]);
1392 if ($ilAccess->checkAccess(
'visible',
'', $this->ref_id))
1394 $force_active = ($this->ctrl->getNextClass() ==
"ilinfoscreengui"
1395 || strtolower(
$_GET[
"cmdClass"]) ==
"ilnotegui")
1399 $ilTabs->addTarget(
"info_short",
1400 $this->ctrl->getLinkTargetByClass(
1401 array(
"ilobjmediapoolgui",
"ilinfoscreengui"),
"showSummary"),
1402 array(
"showSummary",
"infoScreen"),
1403 "",
"", $force_active);
1406 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1408 $ilTabs->addTarget(
"settings", $this->ctrl->getLinkTarget($this,
"edit"),
1409 "edit", array(
"",
"ilobjmediapoolgui"));
1412 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1414 $ilTabs->addTarget(
"clipboard", $this->ctrl->getLinkTarget($this,
"openClipboard"),
1415 "view",
"ileditclipboardgui");
1418 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1420 $ilTabs->addTarget(
"export", $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""),
1424 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->object->getRefId()))
1426 $ilTabs->addTarget(
"perm_settings",
1427 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1440 $targets = explode(
'_',$a_target);
1441 if(count((array) $targets) > 1)
1444 $subitem_id = $targets[1];
1451 if ($ilAccess->checkAccess(
"read",
"",
$ref_id))
1453 $_GET[
"cmd"] =
"frameset";
1454 $_GET[
"baseClass"] =
"ilMediaPoolPresentationGUI";
1456 $_GET[
'mepitem_id'] = $subitem_id;
1457 include(
"ilias.php");
1460 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1462 $_GET[
"cmd"] =
"frameset";
1463 $_GET[
"target"] =
"";
1464 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
1467 include(
"repository.php");
1471 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
1481 $this->ctrl->setCmd(
"showSummary");
1482 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1493 if (!$ilAccess->checkAccess(
"visible",
"", $this->ref_id))
1495 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1498 if ($this->ctrl->getCmd() ==
"infoScreen")
1500 $this->ctrl->setCmd(
"showSummary");
1501 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1504 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1507 $info->enablePrivateNotes();
1509 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
1516 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
1530 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
1533 $this->ctrl->forwardCommand($info);
1550 $ilTabs->clearTargets();
1551 $ilTabs->setBackTarget($lng->txt(
"back"),
1552 $ilCtrl->getLinkTarget($this,
"listMedia"));
1558 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
1560 "rename" => $lng->txt(
"mep_up_dir_move"),
1561 "copy" => $lng->txt(
"mep_up_dir_copy"),
1564 $si->setOptions($options);
1565 $ilToolbar->addInputItem($si);
1566 $ilToolbar->setCloseFormTag(
false);
1567 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1568 $ilToolbar->setFormName(
"mep_up_form");
1570 include_once(
"./Modules/MediaPool/classes/class.ilUploadDirFilesTableGUI.php");
1573 $tab->setFormName(
"mep_up_form");
1574 $tpl->setContent(
$tab->getHTML());
1584 $upload_dir = trim($mset->get(
"upload_dir"));
1586 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1590 foreach (
$_POST[
"file"] as $f)
1592 $f = str_replace(
"..",
"", $f);
1593 $fullpath = $upload_dir.
"/".$f;
1595 $mob->setTitle(basename($fullpath));
1596 $mob->setDescription(
"");
1601 $mob->createDirectory();
1605 $mob->addMediaItem($media_item);
1606 $media_item->setPurpose(
"Standard");
1608 $file = $mob_dir.
"/".basename($fullpath);
1610 basename($fullpath),
$file,
false,
$_POST[
"action"]);
1617 $media_item->setFormat($format);
1619 $media_item->setLocationType(
"LocalFile");
1621 $mob->setDescription($format);
1625 "File", $mob_dir.
"/".
$location, $media_item->getLocation(),
1626 true,
true,
"",
"");
1627 $media_item->setWidth($wh[
"width"]);
1628 $media_item->setHeight($wh[
"height"]);
1629 if ($wh[
"info"] !=
"")
1634 $media_item->setHAlign(
"Left");
1641 $mep_item->setTitle($mob->getTitle());
1642 $mep_item->setType(
"mob");
1643 $mep_item->setForeignId($mob->getId());
1644 $mep_item->create();
1646 $tree = $this->
object->getTree();
1647 $parent = (
$_GET[
"mepitem_id"] ==
"")
1648 ?
$tree->getRootId()
1649 :
$_GET[
"mepitem_id"];
1650 $tree->insertNode($mep_item->getId(), $parent);
1653 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=".
1654 $_GET[
"ref_id"].
"&mepitem_id=".
$_GET[
"mepitem_id"]);