25 include_once(
"./classes/class.ilObjectGUI.php");
26 include_once(
"./Modules/MediaPool/classes/class.ilObjMediaPool.php");
27 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
28 include_once(
"./Modules/Folder/classes/class.ilObjFolderGUI.php");
29 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
30 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
31 include_once(
"./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
55 function ilObjMediaPoolGUI($a_data,$a_id = 0,$a_call_by_reference =
true, $a_prepare_output =
false)
62 $lng->loadLanguageModule(
"mep");
64 if ($this->ctrl->getCmd() ==
"explorer")
66 $this->ctrl->saveParameter($this, array(
"ref_id"));
70 $this->ctrl->saveParameter($this, array(
"ref_id",
"obj_id"));
74 $lng->loadLanguageModule(
"content");
77 $this->output_prepared = $a_prepare_output;
88 if ($this->ctrl->getRedirectSource() ==
"ilinternallinkgui")
94 $next_class = $this->ctrl->getNextClass($this);
95 $cmd = $this->ctrl->getCmd();
97 $new_type = $_POST[
"new_type"]
101 if ($new_type !=
"" && (
$cmd !=
"confirmRemove" &&
$cmd !=
"copyToClipboard"
102 &&
$cmd !=
"pasteFromClipboard"))
109 $tree =& $this->
object->getTree();
110 if (
$_GET[
"obj_id"] ==
"")
116 if (
$cmd ==
"create")
118 switch($_POST[
"new_type"])
121 $this->ctrl->redirectByClass(
"ilobjmediaobjectgui",
"create");
125 $this->ctrl->redirectByClass(
"ilobjfoldergui",
"create");
132 case "ilobjmediaobjectgui":
135 if (
$cmd ==
"create" ||
$cmd ==
"save" ||
$cmd ==
"cancel")
137 $ret_obj =
$_GET[
"obj_id"];
142 $ret_obj =
$tree->getParentId(
$_GET[
"obj_id"]);
145 $ilTabs->setBackTarget($lng->txt(
"back"),
146 $this->ctrl->getLinkTarget($this,
"listMedia"));
148 if ($this->ctrl->getCmdClass() ==
"ilinternallinkgui")
150 $this->ctrl->setReturn($this,
"explorer");
154 $this->ctrl->setParameter($this,
"obj_id", $ret_obj);
155 $this->ctrl->setReturn($this,
"listMedia");
156 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
159 $ilObjMediaObjectGUI->setAdminTabs();
164 $ret =& $this->ctrl->forwardCommand($ilObjMediaObjectGUI);
170 $parent = (
$_GET[
"obj_id"] ==
"")
173 $tree->insertNode(
$ret->getId(), $parent);
174 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=".
184 case "ilobjfoldergui":
186 $this->ctrl->setReturn($this,
"listMedia");
194 $folder_gui->setFormAction(
"save",
195 $this->ctrl->getFormActionByClass(
"ilobjfoldergui"));
196 $folder_gui->createObject();
202 $parent = (
$_GET[
"obj_id"] ==
"")
205 $folder_gui->setFolderTree(
$tree);
206 $folder_gui->saveObject($parent);
213 $this->ctrl->setParameter($this,
"foldereditmode",
"1");
214 $folder_gui->setFormAction(
"update", $this->ctrl->getFormActionByClass(
"ilobjfoldergui"));
215 $folder_gui->editObject();
222 $this->ctrl->setReturn($this,
"listMedia");
223 $folder_gui->updateObject(
true);
228 if (
$_GET[
"foldereditmode"])
232 $this->ctrl->redirect($this,
"listMedia");
237 case "ileditclipboardgui":
239 $this->ctrl->setReturn($this,
"listMedia");
241 $clip_gui->setMultipleSelections(
true);
242 $clip_gui->setInsertButtonTitle($lng->txt(
"mep_copy_to_mep"));
243 $ilTabs->setTabActive(
"clipboard");
245 $ret =& $this->ctrl->forwardCommand($clip_gui);
249 case 'ilinfoscreengui':
254 case 'ilpermissiongui':
256 include_once(
"./classes/class.ilPermissionGUI.php");
258 $ret =& $this->ctrl->forwardCommand($perm_gui);
264 $cmd = $this->ctrl->getCmd(
"frameset");
265 if ($this->creation_mode)
277 $this->tpl->setVariable(
"TARGET",
' target="'.
283 $this->ctrl->redirectByClass(
"ilobjmediaobjectgui",
"create");
315 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=".$newObj->getRefId());
328 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
330 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
334 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
353 $this->ctrl->redirect($this,
"listMedia");
376 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
378 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
386 $this->ctrl->redirect($this,
"listMedia");
396 if (!$ilAccess->checkAccess(
"read",
"", $this->object->getRefId()))
398 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
401 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
403 $tpl->setContent($mep_table_gui->getHTML());
412 $this->tpl->getStandardTemplate();
421 if (
$_GET[
"obj_id"] ==
"")
425 $par_id = $this->
object->tree->getParentId(
$_GET[
"obj_id"]);
426 if ($par_id != $this->object->tree->getRootId())
444 if ($this->ctrl->getCmd() ==
"explorer")
451 $mep_tree =& $this->
object->getTree();
452 if (
$_GET[
"obj_id"] !=
"" &&
$_GET[
"obj_id"] != $mep_tree->getRootId())
454 $this->ctrl->setParameter($this,
"obj_id",
456 $tpl->setUpperIcon($this->ctrl->getLinkTarget($this,
"listMedia"));
457 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
468 include_once(
"Services/Frameset/classes/class.ilFramesetGUI.php");
470 $fs_gui->setMainFrameName(
"content");
471 $fs_gui->setSideFrameName(
"tree");
472 $fs_gui->setMainFrameSource(
473 $this->ctrl->getLinkTarget($this,
"listMedia"));
474 $this->ctrl->setParameter($this,
"expand",
"1");
475 $fs_gui->setSideFrameSource(
476 $this->ctrl->getLinkTarget($this,
"explorer"));
477 $fs_gui->setFramesetTitle($this->object->getTitle());
489 include_once(
"Services/Frameset/classes/class.ilFramesetGUI.php");
491 $fs_gui->setMainFrameName(
"content");
492 $fs_gui->setSideFrameName(
"tree");
493 $fs_gui->setMainFrameSource(
494 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"));
495 $this->ctrl->setParameter($this,
"expand",
"1");
496 $fs_gui->setSideFrameSource(
497 $this->ctrl->getLinkTarget($this,
"explorer"));
498 $fs_gui->setFramesetTitle($this->object->getTitle());
510 $_GET[
"obj_id"] =
"";
512 if (!$ilAccess->checkAccess(
"read",
"", $this->object->getRefId()) ||
513 !$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
518 $this->tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
522 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.explorer.html");
525 require_once (
"./Modules/MediaPool/classes/class.ilMediaPoolExplorer.php");
529 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
"explorer"));
531 $exp->addFilter(
"root");
532 $exp->addFilter(
"fold");
533 $exp->setFiltered(
true);
537 if (
$_GET[
"mepexpand"] ==
"")
539 $mep_tree =& $this->
object->getTree();
540 $expanded = $mep_tree->readRootId();
544 $expanded =
$_GET[
"mepexpand"];
547 $exp->setExpand($expanded);
551 $output = $exp->getOutput();
553 $this->tpl->setCurrentBlock(
"content");
554 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"cont_mep_structure"));
555 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
556 $this->tpl->setVariable(
"EXPLORER",$output);
557 $this->ctrl->setParameter($this,
"mepexpand",
$_GET[
"mepexpand"]);
558 $this->tpl->setVariable(
"ACTION",
559 $this->ctrl->getLinkTarget($this,
"explorer"));
560 $this->tpl->parseCurrentBlock();
561 $this->tpl->show(
false);
572 if (!$ilAccess->checkAccess(
"read",
"", $this->object->getRefId()))
574 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
577 $this->tpl =&
new ilTemplate(
"tpl.fullscreen.html",
true,
true,
"Services/COPage");
578 include_once(
"Services/Style/classes/class.ilObjStyleSheet.php");
580 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
591 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
602 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
603 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
608 $mode = (
$_GET[
"cmd"] !=
"showMedia")
613 $this->ctrl->getLinkTarget($this,
"showFullscreen");
614 $params = array (
'mode' => $mode,
'enlarge_path' => $enlarge_path,
615 'link_params' =>
"ref_id=".
$_GET[
"ref_id"],
'fullscreen_link' => $fullscreen_link,
616 'ref_id' =>
$_GET[
"ref_id"],
'pg_frame' => $pg_frame,
'webspace_path' => $wb_path);
617 $output =
xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args, $params);
622 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
624 $this->tpl->parseCurrentBlock();
643 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
645 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
648 if(!isset($_POST[
"id"]))
650 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
658 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html",
"Modules/MediaPool");
662 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
665 $this->tpl->setCurrentBlock(
"table_header");
666 $this->tpl->setVariable(
"TEXT",$this->lng->txt(
"objects"));
667 $this->tpl->parseCurrentBlock();
671 foreach($_POST[
"id"] as
$obj_id)
675 $this->tpl->setCurrentBlock(
"table_row");
677 $this->tpl->setVariable(
"TEXT_CONTENT",
$title);
679 $this->tpl->parseCurrentBlock();
684 $buttons = array(
"cancelRemove" => $this->lng->txt(
"cancel"),
685 "remove" => $this->lng->txt(
"confirm"));
686 foreach ($buttons as $name => $value)
688 $this->tpl->setCurrentBlock(
"operation_btn");
689 $this->tpl->setVariable(
"BTN_NAME",$name);
690 $this->tpl->setVariable(
"BTN_VALUE",$value);
691 $this->tpl->parseCurrentBlock();
703 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
705 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
708 $ilCtrl->setParameterByClass(
"ileditclipboardgui",
"returnCommand",
709 rawurlencode($ilCtrl->getLinkTarget($this,
710 "insertFromClipboard")));
711 $ilCtrl->redirectByClass(
"ilEditClipboardGUI",
"getObject");
722 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
724 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
727 include_once(
"./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
729 $not_inserted = array();
732 foreach ($ids as $id)
734 if (!$this->object->insertInTree($id,
$_GET[
"obj_id"]))
741 if (count($not_inserted) > 0)
744 implode($not_inserted,
"<br>"),
true);
746 $this->ctrl->redirect($this,
"listMedia");
755 session_unregister(
"ilMepRemove");
756 $this->ctrl->redirect($this,
"listMedia");
766 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
768 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
773 $this->
object->deleteChild($obj_id);
777 session_unregister(
"ilMepRemove");
778 $this->ctrl->redirect($this,
"listMedia");
787 global $ilUser, $ilAccess;
789 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
791 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
794 if(!isset($_POST[
"id"]))
796 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
799 foreach ($_POST[
"id"] as
$obj_id)
804 $this->ilias->raiseError($this->lng->txt(
"cont_cant_copy_folders"), $this->ilias->error_obj->MESSAGE);
808 foreach ($_POST[
"id"] as $obj_id)
810 $ilUser->addObjectToClipboard($obj_id,
"mob",
"");
814 $this->ctrl->redirect($this,
"listMedia");
826 $tree =& $this->
object->getTree();
831 foreach($path as $node)
833 if ($node[
"child"] ==
$tree->getRootId())
835 $this->ctrl->setParameter($this,
"obj_id",
"");
836 $link = $this->ctrl->getLinkTarget($this,
"listMedia");
837 $title = $this->
object->getTitle();
838 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
839 $ilLocator->addItem(
$title, $link,
"",
$_GET[
"ref_id"]);
843 $this->ctrl->setParameter($this,
"obj_id", $node[
"child"]);
844 $link = $this->ctrl->getLinkTarget($this,
"listMedia");
846 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
847 $ilLocator->addItem(
$title, $link);
860 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
862 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
866 $this->ctrl->setParameterByClass(
"ilobjfoldergui",
"obj_id",
$_GET[
"obj_id"]);
867 $folder_gui->setFormAction(
"save",
868 $this->ctrl->getFormActionByClass(
"ilobjfoldergui"));
869 $folder_gui->createObject();
879 $this->
getTabs($this->tabs_gui);
891 if ($ilAccess->checkAccess(
'read',
'', $this->ref_id) ||
892 $ilAccess->checkAccess(
'write',
'', $this->ref_id))
894 $tabs_gui->addTarget(
"view_content", $this->ctrl->getLinkTarget($this,
"listMedia"),
899 if ($ilAccess->checkAccess(
'visible',
'', $this->ref_id))
901 $force_active = ($this->ctrl->getNextClass() ==
"ilinfoscreengui"
902 || strtolower(
$_GET[
"cmdClass"]) ==
"ilnotegui")
906 $tabs_gui->addTarget(
"info_short",
907 $this->ctrl->getLinkTargetByClass(
908 array(
"ilobjmediapoolgui",
"ilinfoscreengui"),
"showSummary"),
909 array(
"showSummary",
"infoScreen"),
910 "",
"", $force_active);
913 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
915 $tabs_gui->addTarget(
"edit_properties", $this->ctrl->getLinkTarget($this,
"edit"),
916 "edit", array(
"",
"ilobjmediapoolgui"));
919 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->object->getRefId()))
921 $tabs_gui->addTarget(
"perm_settings",
922 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
925 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
927 $tabs_gui->addTarget(
"clipboard", $this->ctrl->getLinkTarget($this,
"openClipboard"),
928 "view",
"ileditclipboardgui");
940 if ($ilAccess->checkAccess(
"read",
"", $a_target))
942 $_GET[
"cmd"] =
"frameset";
943 $_GET[
"baseClass"] =
"ilMediaPoolPresentationGUI";
944 $_GET[
"ref_id"] = $a_target;
945 include(
"ilias.php");
947 }
else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
949 $_GET[
"cmd"] =
"frameset";
950 $_GET[
"target"] =
"";
951 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
954 include(
"repository.php");
958 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
968 $this->ctrl->setCmd(
"showSummary");
969 $this->ctrl->setCmdClass(
"ilinfoscreengui");
980 if (!$ilAccess->checkAccess(
"visible",
"", $this->ref_id))
982 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
985 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
988 $info->enablePrivateNotes();
990 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
997 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
1011 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
1014 $this->ctrl->forwardCommand($info);