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 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
278 if ($ot->getContentActivated())
280 $exp_gui->addFormat(
"xml_master",
"XML (".$lng->txt(
"mep_master_language_only").
")", $this,
"export");
282 $ret = $this->ctrl->forwardCommand($exp_gui);
286 case "ilfilesystemgui":
290 $ilTabs->clearTargets();
291 $ilTabs->setBackTarget($lng->txt(
"back"),
292 $ilCtrl->getLinkTarget($this,
"listMedia"));
294 if (trim($mset->get(
"upload_dir")) !=
"")
296 include_once(
"./Services/FileSystem/classes/class.ilFileSystemGUI.php");
299 $fs_gui->setTableId(
"mepud".$this->object->getId());
300 $fs_gui->setAllowFileCreation(
false);
301 $fs_gui->setAllowDirectoryCreation(
false);
302 $fs_gui->clearCommands();
303 $fs_gui->addCommand($this,
"selectUploadDirFiles", $this->lng->txt(
"mep_sel_upload_dir_files"),
306 $ret =& $this->ctrl->forwardCommand($fs_gui);
311 case "ilcommonactiondispatchergui":
312 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
314 $this->ctrl->forwardCommand($gui);
317 case 'ilobjecttranslationgui':
321 $ilTabs->activateTab(
"settings");
323 include_once(
"./Services/Object/classes/class.ilObjectTranslationGUI.php");
325 $transgui->setTitleDescrOnlyMode(
false);
326 $this->ctrl->forwardCommand($transgui);
330 case "ilmediapoolimportgui":
333 $ilTabs->activateTab(
"import");
334 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolImportGUI.php");
336 $this->ctrl->forwardCommand($gui);
343 $cmd = $this->ctrl->getCmd(
"listMedia");
358 $this->ctrl->redirectByClass(
"ilobjmediaobjectgui",
"create");
363 $forms = array(self::CFORM_NEW => $this->
initCreateForm($a_new_type),
378 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=".$newObj->getRefId().
"&cmd=listMedia");
384 $ni =
new ilNumberInputGUI($this->lng->txt(
"mep_default_width"),
"default_width");
386 $ni->setSuffix(
"px");
387 $ni->setMaxLength(5);
392 $ni =
new ilNumberInputGUI($this->lng->txt(
"mep_default_height"),
"default_height");
395 $ni->setMaxLength(5);
397 $ni->setInfo($this->lng->txt(
"mep_default_width_height_info"));
416 if ($this->object->getDefaultWidth() > 0)
418 $a_values[
"default_width"] = $this->
object->getDefaultWidth();
420 if ($this->object->getDefaultHeight() > 0)
422 $a_values[
"default_height"] = $this->
object->getDefaultHeight();
428 $this->
object->setDefaultWidth($a_form->
getInput(
"default_width"));
429 $this->
object->setDefaultHeight($a_form->
getInput(
"default_height"));
439 $ilCtrl->setParameter($this,
"mep_mode",
"listMedia");
443 $ilTabs->setTabActive(
"objs_fold");
445 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
447 $ilToolbar->addButton($lng->txt(
"mep_create_mob"),
448 $ilCtrl->getLinkTarget($this,
"createMediaObject"));
451 if ($mset->get(
"mep_activate_pages"))
453 $ilToolbar->addButton($lng->txt(
"mep_create_content_snippet"),
454 $ilCtrl->getLinkTarget($this,
"createMediaPoolPage"));
457 $ilToolbar->addButton($lng->txt(
"mep_create_folder"),
458 $ilCtrl->getLinkTarget($this,
"createFolderForm"));
462 $ilToolbar->addButton($lng->txt(
"mep_create_from_upload_dir"),
463 $ilCtrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles"));
468 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolExplorerGUI.php");
470 if (!$exp->handleCommand())
472 $this->tpl->setLeftNavContent($exp->getHTML());
479 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
481 $tpl->setContent($mep_table_gui->getHTML());
492 $ilCtrl->setParameter($this,
"mep_mode",
"allMedia");
495 $ilTabs->setTabActive(
"mep_all_mobs");
498 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
503 if(isset(
$_GET[
'force_filter']) and
$_GET[
'force_filter'])
507 include_once(
"./Services/Table/classes/class.ilTablePropertiesStorage.php");
509 $tprop->storeProperty(
510 $mep_table_gui->getId(),
515 $mep_table_gui->resetFilter();
516 $mep_table_gui->resetOffset();
517 $mep_table_gui->writeFilterToSession();
524 $tpl->setContent($mep_table_gui->getHTML());
533 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
536 $mtab->writeFilterToSession();
537 $mtab->resetOffset();
546 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
549 $mtab->resetFilter();
550 $mtab->resetOffset();
559 $this->tpl->getStandardTemplate();
568 if (
$_GET[
"mepitem_id"] ==
"")
572 $par_id = $this->
object->tree->getParentId(
$_GET[
"mepitem_id"]);
573 if ($par_id != $this->object->tree->getRootId())
593 $mob_id = $item->getForeignId();
595 $this->tpl =
new ilTemplate(
"tpl.fullscreen.html",
true,
true,
"Services/COPage");
596 include_once(
"Services/Style/classes/class.ilObjStyleSheet.php");
598 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
602 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
603 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
608 $this->tpl->setVariable(
"TITLE",
" - ".$media_obj->getTitle());
618 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
619 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
624 $mode = ($_GET[
"cmd"] !=
"showPreview")
629 $this->ctrl->getLinkTarget($this,
"showFullscreen",
"",
false,
false);
630 $params = array (
'mode' => $mode,
'enlarge_path' => $enlarge_path,
631 'link_params' =>
"ref_id=".$_GET[
"ref_id"],
'fullscreen_link' => $fullscreen_link,
632 'ref_id' => $_GET[
"ref_id"],
'pg_frame' => $pg_frame,
'webspace_path' => $wb_path);
633 $output = xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args,
$params);
637 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
650 $tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
652 include_once(
"./Services/Container/classes/class.ilContainerPage.php");
653 include_once(
"./Services/Container/classes/class.ilContainerPageGUI.php");
655 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
657 $tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
659 $tpl->setCurrentBlock(
"SyntaxStyle");
660 $tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
662 $tpl->parseCurrentBlock();
668 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
670 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
674 $page_gui->setTemplateOutput(
false);
675 $page_gui->setHeader(
"");
676 $ret = $page_gui->showPage(
true);
678 $tpl->setBodyClass(
"ilMediaPoolPagePreviewBody");
679 $tpl->setVariable(
"CONTENT",
$ret);
697 switch ($item->getType())
729 $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->
ilias->error_obj->MESSAGE);
733 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
735 $cgui->setFormAction($this->ctrl->getFormAction($this));
736 $cgui->setHeaderText($this->lng->txt(
"info_delete_sure"));
737 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancelRemove");
738 $cgui->setConfirm($this->lng->txt(
"confirm"),
"remove");
749 include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
751 if (count($usages) > 0)
754 $ilCtrl->redirect($this,
"listMedia");
760 if (count($usages) > 0)
762 $add =
"<div class='small'>".$lng->txt(
"mep_content_snippet_used_in_older_versions").
"</div>";
770 $cgui->addItem(
"id[]", $obj_id, $caption);
773 $this->tpl->setContent($cgui->getHTML());
785 $ilCtrl->setParameterByClass(
"ileditclipboardgui",
"returnCommand",
786 rawurlencode($ilCtrl->getLinkTarget($this,
787 "insertFromClipboard",
"",
false,
false)));
788 $ilCtrl->redirectByClass(
"ilEditClipboardGUI",
"getObject");
801 include_once(
"./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
803 $not_inserted = array();
806 foreach ($ids as $id2)
808 $id = explode(
":", $id2);
814 if (ilObjMEdiaPool::isForeignIdInTree($this->object->getId(), $id))
822 $item->setType(
"mob");
823 $item->setForeignId($id);
826 if ($item->getId() > 0)
828 $this->
object->insertInTree($item->getId(),
$_GET[
"mepitem_id"]);
834 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
835 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
836 if (ilObjMEdiaPool::isItemIdInTree($this->object->getId(), $id))
847 $item->setType(
"pg");
850 if ($item->getId() > 0)
852 $this->
object->insertInTree($item->getId(),
$_GET[
"mepitem_id"]);
855 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
857 $page->setId($item->getId());
858 $page->setParentId($this->object->getId());
862 $original->copy($page->getId(), $page->getParentType(), $page->getParentId(),
true);
872 if (count($not_inserted) > 0)
875 implode($not_inserted,
"<br>"),
true);
877 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
886 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
900 $this->
object->deleteChild($obj_id);
904 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
920 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
929 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
932 foreach (
$_POST[
"id"] as $obj_id)
938 $ilUser->addObjectToClipboard($fid,
"mob",
"");
942 $ilUser->addObjectToClipboard($obj_id,
"incl",
"");
946 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
954 global $ilLocator, $ilAccess;
958 $tree =& $this->
object->getTree();
961 :
$_GET[
"mepitem_id"];
963 foreach(
$path as $node)
965 if ($node[
"child"] ==
$tree->getRootId())
967 $this->ctrl->setParameter($this,
"mepitem_id",
"");
968 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId()))
970 $link = $this->ctrl->getLinkTarget($this,
"listMedia");
972 else if ($ilAccess->checkAccess(
"visible",
"", $this->object->getRefId()))
974 $link = $this->ctrl->getLinkTarget($this,
"infoScreen");
976 $title = $this->
object->getTitle();
977 $this->ctrl->setParameter($this,
"mepitem_id",
$_GET[
"mepitem_id"]);
978 $ilLocator->addItem($title, $link,
"",
$_GET[
"ref_id"]);
993 global $ilAccess,
$tpl;
998 $tpl->setContent($this->form->getHTML());
1022 $tpl->setContent($this->form->getHTML());
1034 $this->form->setValuesByArray($values);
1047 if ($this->form->checkInput())
1049 if ($this->object->createFolder(
$_POST[
"title"], (
int)
$_GET[
"mepitem_id"]))
1053 $ilCtrl->redirect($this,
"listMedia");
1056 $this->form->setValuesByPost();
1057 $tpl->setContent($this->form->getHtml());
1070 if ($this->form->checkInput())
1073 $item->setTitle(
$_POST[
"title"]);
1076 $ilCtrl->setParameter($this,
"mepitem_id",
1077 $this->object->getTree()->getParentId(
$_GET[
"mepitem_id"]));
1078 $ilCtrl->redirect($this,
"listMedia");
1081 $this->form->setValuesByPost();
1082 $tpl->setContent($this->form->getHtml());
1094 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1100 $ti->setRequired(
true);
1101 $this->form->addItem($ti);
1104 if ($a_mode ==
"create")
1106 $this->form->addCommandButton(
"saveFolder", $lng->txt(
"save"));
1107 $this->form->addCommandButton(
"cancelSave", $lng->txt(
"cancel"));
1108 $this->form->setTitle($lng->txt(
"mep_new_folder"));
1112 $this->form->addCommandButton(
"updateFolder", $lng->txt(
"save"));
1113 $this->form->addCommandButton(
"cancelFolderUpdate", $lng->txt(
"cancel"));
1114 $this->form->setTitle($lng->txt(
"mep_edit_folder"));
1117 $this->form->setFormAction($ilCtrl->getFormAction($this));
1126 $ilCtrl->setParameter($this,
"mepitem_id",
1127 $this->object->getTree()->getParentId(
$_GET[
"mepitem_id"]));
1128 $ilCtrl->redirect($this,
"listMedia");
1137 $ilCtrl->redirect($this,
"listMedia");
1154 $tpl->setContent($this->form->getHTML());
1171 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1173 $mep_page_gui->getTabs();
1177 $tpl->setContent($this->form->getHTML());
1190 if ($this->form->checkInput())
1193 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1195 $item->setTitle(
$_POST[
"title"]);
1196 $item->setType(
"pg");
1199 if ($item->getId() > 0)
1202 $tree = $this->
object->getTree();
1203 $parent =
$_GET[
"mepitem_id"] > 0
1204 ?
$_GET[
"mepitem_id"]
1205 :
$tree->getRootId();
1206 $this->
object->insertInTree($item->getId(), $parent);
1209 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1211 $page->setId($item->getId());
1212 $page->setParentId($this->object->getId());
1215 $ilCtrl->setParameterByClass(
"ilmediapoolpagegui",
"mepitem_id", $item->getId());
1216 $ilCtrl->redirectByClass(
"ilmediapoolpagegui",
"edit");
1219 $ilCtrl->redirect($this,
"listMedia");
1222 $this->form->setValuesByPost();
1223 $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"]);
1337 $ilTabs->addSubTab(
"current_usages", $lng->txt(
"cont_current_usages"),
1338 $ilCtrl->getLinkTarget($this,
"showMediaPoolPageUsages"));
1340 $ilTabs->addSubTab(
"all_usages", $lng->txt(
"cont_all_usages"),
1341 $ilCtrl->getLinkTarget($this,
"showAllMediaPoolPageUsages"));
1345 $ilTabs->activateSubTab(
"all_usages");
1346 $cmd =
"showAllMediaPoolPageUsages";
1350 $ilTabs->activateSubTab(
"current_usages");
1351 $cmd =
"showMediaPoolPageUsages";
1355 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1357 $mep_page_gui->getTabs();
1359 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1362 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageUsagesTableGUI.php");
1365 $tpl->setContent($table->getHTML());
1379 global $ilAccess, $ilTabs,
$ilCtrl, $ilHelp;
1381 $ilHelp->setScreenIdComponent(
"mep");
1383 if ($ilAccess->checkAccess(
'read',
'', $this->ref_id) ||
1384 $ilAccess->checkAccess(
'write',
'', $this->ref_id))
1386 $ilTabs->addTarget(
"objs_fold", $this->ctrl->getLinkTarget($this,
""),
1387 "listMedia",
"",
"_top");
1389 $ilCtrl->setParameter($this,
"mepitem_id",
"");
1390 $ilTabs->addTarget(
"mep_all_mobs", $this->ctrl->getLinkTarget($this,
"allMedia"),
1391 "allMedia",
"",
"_top");
1392 $ilCtrl->setParameter($this,
"mepitem_id",
$_GET[
"mepitem_id"]);
1396 if ($ilAccess->checkAccess(
'visible',
'', $this->ref_id) ||
1397 $ilAccess->checkAccess(
'read',
'', $this->ref_id) ||
1398 $ilAccess->checkAccess(
'write',
'', $this->ref_id))
1400 $force_active = ($this->ctrl->getNextClass() ==
"ilinfoscreengui" 1401 || strtolower(
$_GET[
"cmdClass"]) ==
"ilnotegui")
1405 $ilTabs->addTarget(
"info_short",
1406 $this->ctrl->getLinkTargetByClass(
1407 array(
"ilobjmediapoolgui",
"ilinfoscreengui"),
"showSummary"),
1408 array(
"showSummary",
"infoScreen"),
1409 "",
"", $force_active);
1412 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1414 $ilTabs->addTarget(
"settings", $this->ctrl->getLinkTarget($this,
"edit"),
1415 "edit", array(
"",
"ilobjmediapoolgui"));
1418 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1420 $ilTabs->addTarget(
"clipboard", $this->ctrl->getLinkTarget($this,
"openClipboard"),
1421 "view",
"ileditclipboardgui");
1424 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1426 $ilTabs->addTarget(
"export", $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""),
1429 $ilTabs->addTarget(
"import", $this->ctrl->getLinkTargetByClass(
"ilmediapoolimportgui",
""),
1430 "",
"ilmediapoolimportgui");
1433 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->object->getRefId()))
1435 $ilTabs->addTarget(
"perm_settings",
1436 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1449 global $ilTabs,
$lng, $ilAccess;
1451 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1453 $ilTabs->addSubTab(
"settings",
1454 $lng->txt(
"settings"),
1455 $this->ctrl->getLinkTarget($this,
"edit"));
1458 if ($mset->get(
"mep_activate_pages"))
1460 $ilTabs->addSubTabTarget(
"obj_multilinguality",
1461 $this->ctrl->getLinkTargetByClass(
"ilobjecttranslationgui",
""));
1465 $ilTabs->setSubTabActive($a_active);
1476 $targets = explode(
'_',$a_target);
1477 if(count((array) $targets) > 1)
1480 $subitem_id = $targets[1];
1487 if ($ilAccess->checkAccess(
"read",
"",
$ref_id))
1489 $_GET[
"baseClass"] =
"ilMediaPoolPresentationGUI";
1491 $_GET[
'mepitem_id'] = $subitem_id;
1492 include(
"ilias.php");
1494 }
else if ($ilAccess->checkAccess(
"visible",
"",
$ref_id))
1496 $_GET[
"baseClass"] =
"ilMediaPoolPresentationGUI";
1498 $_GET[
"cmd"] =
"infoScreen";
1499 include(
"ilias.php");
1502 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1509 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
1519 $this->ctrl->setCmd(
"showSummary");
1520 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1531 if (!$ilAccess->checkAccess(
"visible",
"", $this->ref_id) &&
1532 !$ilAccess->checkAccess(
"read",
"", $this->ref_id) &&
1533 !$ilAccess->checkAccess(
"write",
"", $this->ref_id))
1535 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->
ilias->error_obj->MESSAGE);
1538 if ($this->ctrl->getCmd() ==
"infoScreen")
1540 $this->ctrl->setCmd(
"showSummary");
1541 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1544 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1547 $info->enablePrivateNotes();
1549 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
1556 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
1570 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
1573 $this->ctrl->forwardCommand(
$info);
1592 $a_files =
$_POST[
"file"];
1595 $ilTabs->clearTargets();
1596 $ilTabs->setBackTarget($lng->txt(
"back"),
1597 $ilCtrl->getLinkTarget($this,
"listMedia"));
1605 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
1607 "rename" => $lng->txt(
"mep_up_dir_move"),
1608 "copy" => $lng->txt(
"mep_up_dir_copy"),
1612 $ilToolbar->addInputItem($si);
1613 $ilToolbar->setCloseFormTag(
false);
1614 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1615 $ilToolbar->setFormName(
"mep_up_form");
1617 include_once(
"./Modules/MediaPool/classes/class.ilUploadDirFilesTableGUI.php");
1620 $tab->setFormName(
"mep_up_form");
1621 $tpl->setContent(
$tab->getHTML());
1633 $upload_dir = trim($mset->get(
"upload_dir"));
1635 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1639 foreach (
$_POST[
"file"] as $f)
1641 $f = str_replace(
"..",
"", $f);
1642 $fullpath = $upload_dir.
"/".$f;
1644 $mob->setTitle(basename($fullpath));
1645 $mob->setDescription(
"");
1650 $mob->createDirectory();
1654 $mob->addMediaItem($media_item);
1655 $media_item->setPurpose(
"Standard");
1657 $file = $mob_dir.
"/".basename($fullpath);
1659 basename($fullpath),
$file,
false,
$_POST[
"action"]);
1666 $media_item->setFormat($format);
1668 $media_item->setLocationType(
"LocalFile");
1670 $mob->setDescription($format);
1674 "File", $mob_dir.
"/".
$location, $media_item->getLocation(),
1675 true,
true,
"",
"");
1676 $media_item->setWidth($wh[
"width"]);
1677 $media_item->setHeight($wh[
"height"]);
1678 if ($wh[
"info"] !=
"")
1683 $media_item->setHAlign(
"Left");
1690 $mep_item->setTitle($mob->getTitle());
1691 $mep_item->setType(
"mob");
1692 $mep_item->setForeignId($mob->getId());
1693 $mep_item->create();
1695 $tree = $this->
object->getTree();
1696 $parent = (
$_GET[
"mepitem_id"] ==
"")
1697 ?
$tree->getRootId()
1698 :
$_GET[
"mepitem_id"];
1699 $tree->insertNode($mep_item->getId(), $parent);
1702 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=".
1703 $_GET[
"ref_id"].
"&mepitem_id=".
$_GET[
"mepitem_id"]);
1714 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1717 $tpl->addJavaScript(
"./Modules/MediaPool/js/ilMediaPool.js");
1719 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"mepitem_id",
"");
1720 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"ref_id", $a_mpool_ref_id);
1721 $tpl->addOnloadCode(
"il.MediaPool.setPreviewUrl('".$ilCtrl->getLinkTargetByClass(array(
"ilmediapoolpresentationgui",
"ilobjmediapoolgui"),
"showPreview",
"",
false,
false).
"');");
1722 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"mepitem_id",
$_GET[
"mepitem_id"]);
1723 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"ref_id",
$_GET[
"red_id"]);
1725 include_once(
"./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
1727 $modal->setHeading($lng->txt(
"preview"));
1728 $modal->setId(
"ilMepPreview");
1730 $modal->setBody(
"<iframe id='ilMepPreviewContent'></iframe>");
1732 return $modal->getHTML();
1742 if ($ot->getContentActivated())
1744 $format = explode(
"_",
$_POST[
"format"]);
1748 $this->
object->exportXML(($opt ==
"master"));
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilEditClipboardGUI.
New implementation of ilObjectGUI.
setPostDirPath($a_val)
Set post dir path.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static getImageTagByType($a_type, $a_path, $a_big=false)
Builds an html image tag TODO: function still in use, but in future use getImagePath and move HTML-Co...
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
Saves (mostly asynchronously) user properties of tables (e.g.
static lookupTitle($a_page_id)
Lookup title.
getSyntaxStylePath()
get syntax style path
TableGUI class for media pool page usages listing.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
setCreationMode($a_mode=true)
Export User Interface Class.
checkPermission($a_perm, $a_cmd="")
initImportForm($a_new_type)
Init object import form.
if(!is_array($argv)) $options
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
_checkAdministrationPermission()
This class represents a text property in a property form.
redirection script todo: (a better solution should control the processing via a xml file) ...
setMaxLength($a_maxlength)
Set Max Length.
initCreateForm($a_new_type)
Init object creation form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getInstance()
Get instance.
getUsages($a_pc_type, $a_pc_id, $a_incl_hist=true)
Get usages.
getContentStylePath($a_style_id)
get content style path
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
static getInstance($a_obj_id)
Get instance.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
File System Explorer GUI class.
static redirect($a_script)
http redirect to other script
addHeaderAction()
Add header action menu.
static getWebspaceDir($mode="filesystem")
get webspace directory
Class ilMediaPoolPage GUI class.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
GUI class for object translation handling.
Confirmation screen class.