6 include_once(
"./Services/Object/classes/class.ilObject2GUI.php");
7 include_once(
"./Modules/MediaPool/classes/class.ilObjMediaPool.php");
8 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
9 include_once(
"./Modules/Folder/classes/class.ilObjFolderGUI.php");
10 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
11 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
12 include_once(
"./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
66 public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
72 $this->tabs = $DIC->tabs();
73 $this->error = $DIC[
"ilErr"];
74 $this->locator = $DIC[
"ilLocator"];
75 $this->
help = $DIC[
"ilHelp"];
77 $this->main_tpl = $DIC->ui()->mainTemplate();
79 $this->upload = $DIC->upload();
82 $this->mep_item_id = (int)
$_GET[
"mepitem_id"];
94 $lng->loadLanguageModule(
"mep");
96 if ($this->ctrl->getCmd() ==
"explorer") {
97 $this->ctrl->saveParameter($this, array(
"ref_id"));
99 $this->ctrl->saveParameter($this, array(
"ref_id",
"mepitem_id"));
101 $this->ctrl->saveParameter($this, array(
"mep_mode"));
103 $lng->loadLanguageModule(
"content");
128 if ($this->ctrl->getRedirectSource() ==
"ilinternallinkgui") {
133 $next_class = $this->ctrl->getNextClass($this);
134 $cmd = $this->ctrl->getCmd();
135 $new_type =
$_POST[
"new_type"]
139 if ($new_type !=
"" && ($cmd !=
"confirmRemove" && $cmd !=
"copyToClipboard" 140 && $cmd !=
"pasteFromClipboard")) {
145 $this->tpl->setPermanentLink(
"mep", $this->ref_id);
146 $tree = $this->
object->getTree();
147 if (
$_GET[
"mepitem_id"] ==
"") {
151 if ($cmd ==
"create") {
152 switch (
$_POST[
"new_type"]) {
154 $this->ctrl->redirectByClass(
"ilobjmediaobjectgui",
"create");
158 $this->ctrl->redirectByClass(
"ilobjfoldergui",
"create");
163 switch ($next_class) {
164 case 'ilobjectmetadatagui':
170 $this->tabs_gui->activateTab(
'meta_data');
171 include_once
'Services/Object/classes/class.ilObjectMetaDataGUI.php';
173 $this->ctrl->forwardCommand($md_gui);
174 $this->tpl->printToStdout();
178 case 'ilmediapoolpagegui':
182 $ilTabs->clearTargets();
183 $ilCtrl->setReturn($this,
"returnFromItem");
185 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
186 $mep_page_gui->setEnableEditing(
false);
188 $ret = $this->ctrl->forwardCommand($mep_page_gui);
193 $this->tpl->printToStdout();
196 case "ilobjmediaobjectgui":
198 if ($cmd ==
"create" || $cmd ==
"save" || $cmd ==
"cancel") {
199 $ret_obj =
$_GET[
"mepitem_id"];
201 $ilObjMediaObjectGUI->setWidthPreset($this->object->getDefaultWidth());
202 $ilObjMediaObjectGUI->setHeightPreset($this->object->getDefaultHeight());
204 $ret_obj =
$tree->getParentId(
$_GET[
"mepitem_id"]);
207 $ilTabs->setBackTarget(
209 $this->ctrl->getLinkTarget(
211 $_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia" 215 if ($this->ctrl->getCmdClass() ==
"ilinternallinkgui") {
216 $this->ctrl->setReturn($this,
"explorer");
218 $this->ctrl->setParameter($this,
"mepitem_id", $ret_obj);
219 $this->ctrl->setReturn(
221 $_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia" 223 $this->ctrl->setParameter($this,
"mepitem_id", $_GET[
"mepitem_id"]);
226 $ilObjMediaObjectGUI->setTabs();
230 $ilObjMediaObjectGUI->setAdvMdRecordObject($this->object->getRefId(),
"mep",
"mob");
232 $ret = $this->ctrl->forwardCommand($ilObjMediaObjectGUI);
234 if ($cmd ==
"save" &&
$ret !=
false) {
236 $mep_item->setTitle(
$ret->getTitle());
237 $mep_item->setType(
"mob");
238 $mep_item->setForeignId(
$ret->getId());
241 $parent = (
$_GET[
"mepitem_id"] ==
"")
243 :
$_GET[
"mepitem_id"];
244 $tree->insertNode($mep_item->getId(), $parent);
245 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
246 $_GET[
"ref_id"] .
"&mepitem_id=" .
$_GET[
"mepitem_id"]);
248 $this->tpl->printToStdout();
252 case "ilobjfoldergui":
256 $this->ctrl->setReturn($this,
"listMedia");
262 $folder_gui->setFormAction(
264 $this->ctrl->getFormActionByClass(
"ilobjfoldergui")
266 $folder_gui->createObject();
267 $this->tpl->printToStdout();
272 $parent = (
$_GET[
"mepitem_id"] ==
"")
274 :
$_GET[
"mepitem_id"];
275 $folder_gui->setFolderTree(
$tree);
276 $folder_gui->saveObject($parent);
283 $this->ctrl->setParameter($this,
"foldereditmode",
"1");
284 $folder_gui->setFormAction(
"update", $this->ctrl->getFormActionByClass(
"ilobjfoldergui"));
285 $folder_gui->editObject();
286 $this->tpl->printToStdout();
292 $this->ctrl->setReturn($this,
"listMedia");
293 $folder_gui->updateObject(
true);
297 if (
$_GET[
"foldereditmode"]) {
300 $this->ctrl->redirect($this,
"listMedia");
305 case "ileditclipboardgui":
308 $this->ctrl->setReturn($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
310 $clip_gui->setMultipleSelections(
true);
311 $clip_gui->setInsertButtonTitle(
$lng->txt(
"mep_copy_to_mep"));
312 $ilTabs->setTabActive(
"clipboard");
313 $this->ctrl->forwardCommand($clip_gui);
314 $this->tpl->printToStdout();
317 case 'ilinfoscreengui':
321 $this->tpl->printToStdout();
324 case 'ilpermissiongui':
328 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
330 $ilTabs->activateTab(
"perm_settings");
331 $this->ctrl->forwardCommand($perm_gui);
332 $this->tpl->printToStdout();
339 $ilTabs->activateTab(
"export");
340 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
342 $exp_gui->addFormat(
"xml");
343 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
345 if ($ot->getContentActivated()) {
346 $exp_gui->addFormat(
"xml_master",
"XML (" .
$lng->txt(
"mep_master_language_only") .
")", $this,
"export");
347 $exp_gui->addFormat(
"xml_masternomedia",
"XML (" .
$lng->txt(
"mep_master_language_only_no_media") .
")", $this,
"export");
349 $this->ctrl->forwardCommand($exp_gui);
350 $this->tpl->printToStdout();
353 case "ilfilesystemgui":
357 $ilTabs->clearTargets();
358 $ilTabs->setBackTarget(
360 $ilCtrl->getLinkTarget($this,
"listMedia")
365 if ($mob_import_directory->exists()) {
366 $fs_gui =
new ilFileSystemGUI($mob_import_directory->getAbsolutePath());
368 $fs_gui->setTableId(
"mepud" . $this->object->getId());
369 $fs_gui->setAllowFileCreation(
false);
370 $fs_gui->setAllowDirectoryCreation(
false);
371 $fs_gui->clearCommands();
374 "selectUploadDirFiles",
375 $this->lng->txt(
"mep_sel_upload_dir_files"),
379 $this->ctrl->forwardCommand($fs_gui);
381 $this->tpl->printToStdout();
384 case "ilcommonactiondispatchergui":
385 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
387 $this->ctrl->forwardCommand($gui);
390 case 'ilobjecttranslationgui':
394 $ilTabs->activateTab(
"settings");
396 include_once(
"./Services/Object/classes/class.ilObjectTranslationGUI.php");
398 $transgui->setTitleDescrOnlyMode(
false);
399 $this->ctrl->forwardCommand($transgui);
400 $this->tpl->printToStdout();
403 case "ilmediapoolimportgui":
407 $ilTabs->activateTab(
"import");
408 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolImportGUI.php");
410 $this->ctrl->forwardCommand($gui);
411 $this->tpl->printToStdout();
414 case "ilmobmultisrtuploadgui":
420 include_once(
"./Services/MediaObjects/classes/class.ilMobMultiSrtUploadGUI.php");
421 include_once(
"./Modules/MediaPool/classes/class.ilMepMultiSrt.php");
423 $this->ctrl->forwardCommand($gui);
424 $this->tpl->printToStdout();
431 $cmd = $this->ctrl->getCmd(
"listMedia");
434 $this->tpl->printToStdout();
445 $this->ctrl->redirectByClass(
"ilobjmediaobjectgui",
"create");
450 $forms = array(self::CFORM_NEW => $this->
initCreateForm($a_new_type),
462 ilUtil::sendSuccess($this->lng->txt(
"object_added"),
true);
465 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=" . $newObj->
getRefId() .
"&cmd=listMedia");
473 $ni =
new ilNumberInputGUI($this->lng->txt(
"mep_default_width"),
"default_width");
475 $ni->setSuffix(
"px");
476 $ni->setMaxLength(5);
481 $ni =
new ilNumberInputGUI($this->lng->txt(
"mep_default_height"),
"default_height");
484 $ni->setMaxLength(5);
486 $ni->setInfo($this->lng->txt(
"mep_default_width_height_info"));
491 $pres->setTitle($this->lng->txt(
'obj_presentation'));
495 $obj_service->commonSettings()->legacyForm($a_form, $this->
object)->addTileImage();
499 $feat->setTitle($this->lng->txt(
'obj_features'));
502 include_once
'./Services/Container/classes/class.ilContainer.php';
503 include_once
'./Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
505 $this->object->getId(),
527 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),
$ilErr->MESSAGE);
530 $ilTabs->activateTab(
"settings");
535 $form->setValuesByArray($values,
true);
540 $tpl->setContent($form->getHTML());
546 if ($this->object->getDefaultWidth() > 0) {
547 $a_values[
"default_width"] = $this->
object->getDefaultWidth();
549 if ($this->object->getDefaultHeight() > 0) {
550 $a_values[
"default_height"] = $this->
object->getDefaultHeight();
558 $this->
object->setDefaultWidth($a_form->
getInput(
"default_width"));
559 $this->
object->setDefaultHeight($a_form->
getInput(
"default_height"));
563 include_once
'./Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
565 $this->object->getId(),
573 $obj_service->commonSettings()->legacyForm($a_form, $this->
object)->saveTileImage();
588 $ilCtrl->setParameter($this,
"mep_mode",
"listMedia");
592 $ilTabs->setTabActive(
"content");
595 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
596 $ilToolbar->addButton(
597 $lng->txt(
"mep_create_mob"),
598 $ilCtrl->getLinkTarget($this,
"createMediaObject")
602 if ($mset->get(
"mep_activate_pages")) {
603 $ilToolbar->addButton(
604 $lng->txt(
"mep_create_content_snippet"),
605 $ilCtrl->getLinkTarget($this,
"createMediaPoolPage")
609 $ilToolbar->addButton(
610 $lng->txt(
"mep_create_folder"),
611 $ilCtrl->getLinkTarget($this,
"createFolderForm")
617 $ilToolbar->addButton(
618 $lng->txt(
"mep_create_from_upload_dir"),
619 $ilCtrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles")
623 $ilToolbar->addButton(
624 $lng->txt(
"mep_bulk_upload"),
625 $ilCtrl->getLinkTarget($this,
"bulkUpload")
630 $tpl->setContent($mep_table_gui->getHTML());
639 $exp->toggleExplorerNodeState();
652 $ilCtrl->setParameter($this,
"mep_mode",
"allMedia");
655 $ilTabs->setTabActive(
"content");
659 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
670 if (isset(
$_GET[
'force_filter']) and
$_GET[
'force_filter']) {
673 include_once(
"./Services/Table/classes/class.ilTablePropertiesStorage.php");
675 $tprop->storeProperty(
676 $mep_table_gui->getId(),
681 $mep_table_gui->resetFilter();
682 $mep_table_gui->resetOffset();
683 $mep_table_gui->writeFilterToSession();
696 $tpl->setContent($mep_table_gui->getHTML());
704 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
713 $mtab->writeFilterToSession();
714 $mtab->resetOffset();
723 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
732 $mtab->resetFilter();
733 $mtab->resetOffset();
742 $this->tpl->loadStandardTemplate();
751 if (
$_GET[
"mepitem_id"] ==
"") {
754 $par_id = $this->
object->getPoolTree()->getParentId(
$_GET[
"mepitem_id"]);
755 if ($par_id != $this->object->getPoolTree()->getRootId()) {
770 $mob_id = $item->getForeignId();
772 $this->tpl =
new ilGlobalTemplate(
"tpl.fullscreen.html",
true,
true,
"Services/COPage");
773 include_once(
"Services/Style/Content/classes/class.ilObjStyleSheet.php");
775 $this->tpl->setVariable(
776 "LOCATION_CONTENT_STYLESHEET",
781 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
782 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
787 $this->tpl->setVariable(
"TITLE",
" - " . $media_obj->getTitle());
797 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
798 $args = array(
'/_xml' =>
$xml,
'/_xsl' => $xsl );
803 $mode = ($_GET[
"cmd"] !=
"showPreview")
808 $this->ctrl->getLinkTarget($this,
"showFullscreen",
"",
false,
false);
809 $params = array(
'mode' => $mode,
'enlarge_path' => $enlarge_path,
810 'link_params' =>
"ref_id=" . $_GET[
"ref_id"],
'fullscreen_link' => $fullscreen_link,
812 'ref_id' => $_GET[
"ref_id"],
'pg_frame' => $pg_frame,
'webspace_path' => $wb_path);
813 $output = xslt_process($xh,
"arg:/_xml",
"arg:/_xsl", null, $args, $params);
817 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
839 $page_gui->setTemplate(
$tpl);
841 $page_gui->setTemplateOutput(
false);
842 $page_gui->setHeader(
"");
843 $ret = $page_gui->showPage(
true);
846 $tpl->setVariable(
"MEDIA_CONTENT",
"<div>" .
$ret .
"</div>");
849 $tpl->printToStdout();
863 switch ($item->getType()) {
894 if (!isset(
$_POST[
"id"])) {
895 $ilErr->raiseError($this->lng->txt(
"no_checkbox"),
$ilErr->MESSAGE);
899 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
901 $cgui->setFormAction($this->ctrl->getFormAction($this));
902 $cgui->setHeaderText($this->lng->txt(
"info_remove_sure"));
903 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancelRemove");
904 $cgui->setConfirm($this->lng->txt(
"confirm"),
"remove");
913 include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
915 if (count($usages) > 0) {
917 $ilCtrl->redirect($this,
"listMedia");
921 if (count($usages) > 0) {
922 $add =
"<div class='small'>" .
$lng->txt(
"mep_content_snippet_used_in_older_versions") .
"</div>";
930 $cgui->addItem(
"id[]", $obj_id, $caption);
933 $this->tpl->setContent($cgui->getHTML());
946 $ilCtrl->setParameterByClass(
947 "ileditclipboardgui",
949 rawurlencode($ilCtrl->getLinkTarget(
951 "insertFromClipboard",
957 $ilCtrl->redirectByClass(
"ilEditClipboardGUI",
"getObject");
970 include_once(
"./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
972 $not_inserted = array();
973 if (is_array($ids)) {
974 foreach ($ids as $id2) {
975 $id = explode(
":", $id2);
979 if (
$type ==
"mob") {
980 if (ilObjMEdiaPool::isForeignIdInTree($this->object->getId(), $id)) {
985 $item->setType(
"mob");
986 $item->setForeignId($id);
989 if ($item->getId() > 0) {
990 $this->
object->insertInTree($item->getId(),
$_GET[
"mepitem_id"]);
994 if (
$type ==
"incl") {
995 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
996 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
997 if (ilObjMEdiaPool::isItemIdInTree($this->object->getId(), $id)) {
1005 $item->setType(
"pg");
1008 if ($item->getId() > 0) {
1009 $this->
object->insertInTree($item->getId(),
$_GET[
"mepitem_id"]);
1012 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1014 $page->setId($item->getId());
1015 $page->setParentId($this->object->getId());
1019 $original->copy($page->getId(), $page->getParentType(), $page->getParentId(),
true);
1025 if (count($not_inserted) > 0) {
1026 ilUtil::sendInfo($this->lng->txt(
"mep_not_insert_already_exist") .
"<br>" .
1027 implode(
"<br>", $not_inserted),
true);
1029 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
1038 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
1044 public function remove()
1051 $this->
object->deleteChild($obj_id);
1054 ilUtil::sendSuccess($this->lng->txt(
"cont_obj_removed"),
true);
1055 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
1069 if (!isset(
$_POST[
"id"])) {
1071 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
1076 if (
$type ==
"fold") {
1078 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
1081 foreach (
$_POST[
"id"] as $obj_id) {
1084 if (
$type ==
"mob") {
1085 $ilUser->addObjectToClipboard($fid,
"mob",
"");
1087 if (
$type ==
"pg") {
1088 $ilUser->addObjectToClipboard($obj_id,
"incl",
"");
1091 ilUtil::sendSuccess($this->lng->txt(
"copied_to_clipboard"),
true);
1092 $this->ctrl->redirect($this,
$_GET[
"mep_mode"] ?
$_GET[
"mep_mode"] :
"listMedia");
1103 if (!$this->
getCreationMode() && $this->ctrl->getCmd() !=
"explorer") {
1104 $tree = $this->
object->getTree();
1106 ?
$tree->getRootId()
1107 :
$_GET[
"mepitem_id"];
1109 foreach ($path as $node) {
1110 if ($node[
"child"] ==
$tree->getRootId()) {
1111 $this->ctrl->setParameter($this,
"mepitem_id",
"");
1112 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId())) {
1113 $link = $this->ctrl->getLinkTarget($this,
"listMedia");
1114 } elseif ($ilAccess->checkAccess(
"visible",
"", $this->object->getRefId())) {
1115 $link = $this->ctrl->getLinkTarget($this,
"infoScreen");
1117 $title = $this->
object->getTitle();
1118 $this->ctrl->setParameter($this,
"mepitem_id",
$_GET[
"mepitem_id"]);
1119 $ilLocator->addItem($title, $link,
"",
$_GET[
"ref_id"]);
1140 $tpl->setContent($this->form->getHTML());
1157 $tpl->setContent($this->form->getHTML());
1169 $this->form->setValuesByArray($values);
1184 if ($this->form->checkInput()) {
1185 if ($this->object->createFolder(
$_POST[
"title"], (
int)
$_GET[
"mepitem_id"])) {
1186 ilUtil::sendSuccess(
$lng->txt(
"mep_folder_created"),
true);
1188 $ilCtrl->redirect($this,
"listMedia");
1191 $this->form->setValuesByPost();
1192 $tpl->setContent($this->form->getHtml());
1207 if ($this->form->checkInput()) {
1209 $item->setTitle(
$_POST[
"title"]);
1211 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
1212 $ilCtrl->setParameter(
1215 $this->object->getTree()->getParentId(
$_GET[
"mepitem_id"])
1217 $ilCtrl->redirect($this,
"listMedia");
1220 $this->form->setValuesByPost();
1221 $tpl->setContent($this->form->getHtml());
1234 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1239 $ti->setMaxLength(128);
1240 $ti->setRequired(
true);
1241 $this->form->addItem($ti);
1244 if ($a_mode ==
"create") {
1245 $this->form->addCommandButton(
"saveFolder",
$lng->txt(
"save"));
1246 $this->form->addCommandButton(
"cancelSave",
$lng->txt(
"cancel"));
1247 $this->form->setTitle(
$lng->txt(
"mep_new_folder"));
1249 $this->form->addCommandButton(
"updateFolder",
$lng->txt(
"save"));
1250 $this->form->addCommandButton(
"cancelFolderUpdate",
$lng->txt(
"cancel"));
1251 $this->form->setTitle(
$lng->txt(
"mep_edit_folder"));
1254 $this->form->setFormAction($ilCtrl->getFormAction($this));
1263 $ilCtrl->setParameter(
1266 $this->object->getTree()->getParentId(
$_GET[
"mepitem_id"])
1268 $ilCtrl->redirect($this,
"listMedia");
1277 $ilCtrl->redirect($this,
"listMedia");
1294 $tpl->setContent($this->form->getHTML());
1310 $ilTabs->clearTargets();
1312 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1314 $mep_page_gui->getTabs();
1320 $tpl->setContent($this->form->getHTML());
1335 if ($this->form->checkInput()) {
1337 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1339 $item->setTitle(
$_POST[
"title"]);
1340 $item->setType(
"pg");
1343 if ($item->getId() > 0) {
1345 $tree = $this->
object->getTree();
1346 $parent =
$_GET[
"mepitem_id"] > 0
1347 ?
$_GET[
"mepitem_id"]
1348 :
$tree->getRootId();
1349 $this->
object->insertInTree($item->getId(), $parent);
1352 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1354 $page->setId($item->getId());
1355 $page->setParentId($this->object->getId());
1358 $ilCtrl->setParameterByClass(
"ilmediapoolpagegui",
"mepitem_id", $item->getId());
1359 $ilCtrl->redirectByClass(
"ilmediapoolpagegui",
"edit");
1361 $ilCtrl->redirect($this,
"listMedia");
1364 $this->form->setValuesByPost();
1365 $tpl->setContent($this->form->getHtml());
1380 if ($this->form->checkInput()) {
1382 $item->setTitle(
$_POST[
"title"]);
1384 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
1385 $ilCtrl->redirect($this,
"editMediaPoolPage");
1388 $this->form->setValuesByPost();
1389 $tpl->setContent($this->form->getHtml());
1401 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1406 $ti->setMaxLength(128);
1407 $ti->setRequired(
true);
1408 $this->form->addItem($ti);
1411 if ($a_mode ==
"create") {
1412 $this->form->addCommandButton(
"saveMediaPoolPage",
$lng->txt(
"save"));
1413 $this->form->addCommandButton(
"cancelSave",
$lng->txt(
"cancel"));
1414 $this->form->setTitle(
$lng->txt(
"mep_new_content_snippet"));
1416 $this->form->addCommandButton(
"updateMediaPoolPage",
$lng->txt(
"save"));
1417 $this->form->setTitle(
$lng->txt(
"mep_edit_content_snippet"));
1420 $this->form->setFormAction($ilCtrl->getFormAction($this));
1430 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1433 $this->form->setValuesByArray($values);
1450 $ilCtrl->getLinkTarget($this,
"showMediaPoolPageUsages"),
1451 array(
"showMediaPoolPageUsages",
"showAllMediaPoolPageUsages"),
1456 $ilCtrl->getLinkTarget($this,
"editMediaPoolPage"),
1457 "editMediaPoolPage",
1460 $ilCtrl->setParameter($this,
"mepitem_id", $this->object->getPoolTree()->getParentId(
$_GET[
"mepitem_id"]));
1461 $ilTabs->setBackTarget(
$lng->txt(
"mep_folder"), $ilCtrl->getLinkTarget($this,
"listMedia"));
1462 $ilCtrl->setParameter($this,
"mepitem_id",
$_GET[
"mepitem_id"]);
1486 $ilTabs->clearTargets();
1490 $lng->txt(
"cont_current_usages"),
1491 $ilCtrl->getLinkTarget($this,
"showMediaPoolPageUsages")
1496 $lng->txt(
"cont_all_usages"),
1497 $ilCtrl->getLinkTarget($this,
"showAllMediaPoolPageUsages")
1501 $ilTabs->activateSubTab(
"all_usages");
1502 $cmd =
"showAllMediaPoolPageUsages";
1504 $ilTabs->activateSubTab(
"current_usages");
1505 $cmd =
"showMediaPoolPageUsages";
1509 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1511 $mep_page_gui->getTabs();
1515 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1518 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageUsagesTableGUI.php");
1521 $tpl->setContent($table->getHTML());
1540 $ilTabs->addSubTab(
"content", $this->lng->txt(
"objs_fold"), $this->ctrl->getLinkTarget($this,
""));
1542 $ilCtrl->setParameter($this,
"mepitem_id",
"");
1543 $ilTabs->addSubTab(
"mep_all_mobs", $this->lng->txt(
"mep_all_mobs"), $this->ctrl->getLinkTarget($this,
"allMedia"));
1544 $ilCtrl->setParameter($this,
"mepitem_id",
$_GET[
"mepitem_id"]);
1546 if ($ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
1549 $this->lng->txt(
"mep_media_subtitles"),
1550 $ilCtrl->getLinkTargetByClass(
"ilmobmultisrtuploadgui",
"")
1554 $ilTabs->activateSubTab($a_active);
1568 $ilHelp->setScreenIdComponent(
"mep");
1570 if ($ilAccess->checkAccess(
'read',
'', $this->ref_id) ||
1571 $ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
1572 $ilTabs->addTab(
"content", $this->lng->txt(
"mep_content"), $this->ctrl->getLinkTarget($this,
""));
1576 if ($ilAccess->checkAccess(
'visible',
'', $this->ref_id) ||
1577 $ilAccess->checkAccess(
'read',
'', $this->ref_id) ||
1578 $ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
1579 $force_active = ($this->ctrl->getNextClass() ==
"ilinfoscreengui" 1580 || strtolower(
$_GET[
"cmdClass"]) ==
"ilnotegui")
1585 $this->ctrl->getLinkTargetByClass(
1586 array(
"ilobjmediapoolgui",
"ilinfoscreengui"),
1589 array(
"showSummary",
"infoScreen"),
1596 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1599 $this->ctrl->getLinkTarget($this,
"edit"),
1601 array(
"",
"ilobjmediapoolgui")
1605 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1608 $this->ctrl->getLinkTarget($this,
"openClipboard"),
1610 "ileditclipboardgui" 1615 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1617 include_once
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
1619 $mdtab = $mdgui->getTab();
1625 "ilobjectmetadatagui" 1630 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1633 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""),
1640 $this->ctrl->getLinkTargetByClass(
"ilmediapoolimportgui",
""),
1642 "ilmediapoolimportgui" 1646 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->object->getRefId())) {
1649 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
1650 array(
"perm",
"info",
"owner"),
1668 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1671 $lng->txt(
"settings"),
1672 $this->ctrl->getLinkTarget($this,
"edit")
1676 if ($mset->get(
"mep_activate_pages")) {
1677 $ilTabs->addSubTabTarget(
1678 "obj_multilinguality",
1679 $this->ctrl->getLinkTargetByClass(
"ilobjecttranslationgui",
"")
1684 $ilTabs->setSubTabActive($a_active);
1695 $ilAccess = $DIC->access();
1697 $lng = $DIC->language();
1699 $targets = explode(
'_', $a_target);
1700 if (count((array) $targets) > 1) {
1702 $subitem_id = $targets[1];
1707 if ($ilAccess->checkAccess(
"read",
"",
$ref_id)) {
1708 $_GET[
"baseClass"] =
"ilMediaPoolPresentationGUI";
1710 $_GET[
'mepitem_id'] = $subitem_id;
1711 include(
"ilias.php");
1713 } elseif ($ilAccess->checkAccess(
"visible",
"",
$ref_id)) {
1714 $_GET[
"baseClass"] =
"ilMediaPoolPresentationGUI";
1716 $_GET[
"cmd"] =
"infoScreen";
1717 include(
"ilias.php");
1721 $lng->txt(
"msg_no_perm_read_item"),
1737 $this->ctrl->setCmd(
"showSummary");
1738 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1747 $this->tabs->activateTab(
"info_short");
1751 if (!$ilAccess->checkAccess(
"visible",
"", $this->ref_id) &&
1752 !$ilAccess->checkAccess(
"read",
"", $this->ref_id) &&
1753 !$ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
1754 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"),
$ilErr->MESSAGE);
1757 if ($this->ctrl->getCmd() ==
"infoScreen") {
1758 $this->ctrl->setCmd(
"showSummary");
1759 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1762 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1765 $info->enablePrivateNotes();
1769 $info->addMetaDataSections($this->object->getId(), 0, $this->
object->getType());
1772 $this->ctrl->forwardCommand($info);
1792 $a_files =
$_POST[
"file"];
1795 $ilTabs->clearTargets();
1796 $ilTabs->setBackTarget(
1798 $ilCtrl->getLinkTarget($this,
"listMedia")
1806 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
1808 "rename" =>
$lng->txt(
"mep_up_dir_move"),
1809 "copy" =>
$lng->txt(
"mep_up_dir_copy"),
1812 $si->setOptions($options);
1813 $ilToolbar->addInputItem($si);
1814 $ilToolbar->setCloseFormTag(
false);
1815 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1816 $ilToolbar->setFormName(
"mep_up_form");
1818 include_once(
"./Modules/MediaPool/classes/class.ilUploadDirFilesTableGUI.php");
1821 "selectUploadDirFiles",
1824 $tab->setFormName(
"mep_up_form");
1825 $tpl->setContent($tab->getHTML());
1840 $upload_dir = $mob_import_directory->getAbsolutePath();
1842 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1846 $f = str_replace(
"..",
"", $f);
1847 $fullpath = $upload_dir .
"/" .
$f;
1849 $mob->setTitle(basename($fullpath));
1850 $mob->setDescription(
"");
1855 $mob->createDirectory();
1859 $mob->addMediaItem($media_item);
1860 $media_item->setPurpose(
"Standard");
1862 $file = $mob_dir .
"/" . basename($fullpath);
1868 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
1869 $_GET[
"ref_id"] .
"&mepitem_id=" .
$_GET[
"mepitem_id"]);
1872 switch (
$_POST[
"action"]) {
1874 rename($fullpath, $file);
1878 copy($fullpath, $file);
1887 $media_item->setFormat(
$format);
1889 $media_item->setLocationType(
"LocalFile");
1891 $mob->setDescription(
$format);
1898 $media_item->getLocation(),
1904 $media_item->setWidth($wh[
"width"]);
1905 $media_item->setHeight($wh[
"height"]);
1906 if ($wh[
"info"] !=
"") {
1910 $media_item->setHAlign(
"Left");
1917 $mep_item->setTitle($mob->getTitle());
1918 $mep_item->setType(
"mob");
1919 $mep_item->setForeignId($mob->getId());
1920 $mep_item->create();
1922 $tree = $this->
object->getTree();
1923 $parent = (
$_GET[
"mepitem_id"] ==
"")
1924 ?
$tree->getRootId()
1925 :
$_GET[
"mepitem_id"];
1926 $tree->insertNode($mep_item->getId(), $parent);
1929 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
1930 $_GET[
"ref_id"] .
"&mepitem_id=" .
$_GET[
"mepitem_id"]);
1941 $ilCtrl = $DIC->ctrl();
1942 $lng = $DIC->language();
1944 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1947 $tpl->addJavaScript(
"./Modules/MediaPool/js/ilMediaPool.js");
1949 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"mepitem_id",
"");
1950 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"ref_id", $a_mpool_ref_id);
1951 $tpl->addOnloadCode(
"il.MediaPool.setPreviewUrl('" . $ilCtrl->getLinkTargetByClass(array(
"ilmediapoolpresentationgui",
"ilobjmediapoolgui"),
"showPreview",
"",
false,
false) .
"');");
1952 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"mepitem_id",
$_GET[
"mepitem_id"]);
1953 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"ref_id",
$_GET[
"red_id"]);
1955 include_once(
"./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
1957 $modal->setHeading(
$lng->txt(
"preview"));
1958 $modal->setId(
"ilMepPreview");
1960 $modal->setBody(
"<iframe id='ilMepPreviewContent'></iframe>");
1962 return $modal->getHTML();
1972 if ($ot->getContentActivated()) {
1977 $this->
object->exportXML($opt);
1994 $main_tpl->setContent($form->getHTML());
2005 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2008 $form->setFormAction(
$ctrl->getFormAction($this));
2009 $form->setPreventDoubleSubmission(
false);
2013 $lng->txt(
"mep_media_files"),
2016 $item->
setUploadUrl(
$ctrl->getLinkTarget($this,
"performBulkUpload",
"",
true,
true));
2017 $item->setMaxFiles(20);
2018 $form->addItem($item);
2020 $form->addCommandButton(
"performBulkUpload",
$lng->txt(
"upload"));
2022 $form->setTitle(
$lng->txt(
"mep_bulk_upload"));
2041 if ($form->checkInput()) {
2044 $log->debug(
"checking for uploads...");
2046 $log->debug(
"has upload...");
2049 $log->debug(
"nr of results: " . count(
$upload->getResults()));
2054 $mob->setTitle($title);
2055 $mob->setDescription(
"");
2058 $mob->createDirectory();
2060 $mob->addMediaItem($media_item);
2061 $media_item->setPurpose(
"Standard");
2065 $file = $mob_dir .
"/" . $file_name;
2076 $mep_item->setTitle($title);
2077 $mep_item->setType(
"mob");
2078 $mep_item->setForeignId($mob->getId());
2079 $mep_item->create();
2081 $tree = $this->
object->getTree();
2082 $parent = (
$_GET[
"mepitem_id"] ==
"")
2083 ?
$tree->getRootId()
2084 :
$_GET[
"mepitem_id"];
2085 $tree->insertNode($mep_item->getId(), $parent);
2092 $media_item->setFormat(
$format);
2094 $media_item->setLocationType(
"LocalFile");
2097 $mep_item_ids[] = $mob->getId();
2100 $log->debug(
"Got exception: " . $e->getMessage());
2101 echo json_encode(array(
'success' =>
false,
'message' => $e->getMessage()));
2103 $log->debug(
"end of 'has_uploads'");
2105 $log->debug(
"has no upload...");
2107 $log->debug(
"calling redirect... (" .
$_POST[
"ilfilehash"] .
")");
2108 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
2109 $ctrl->setParameter($this,
"mep_hash",
$_POST[
"ilfilehash"]);
2110 $ctrl->redirect($this,
"editTitlesAndDescriptions");
2113 $form->setValuesByPost();
2114 $main_tpl->setContent($form->getHtml());
2126 $ctrl->saveParameter($this,
"mep_hash");
2130 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
2133 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
2136 $tb->setFormAction(
$ctrl->getFormAction($this));
2137 $tb->addFormButton(
$lng->txt(
"save"),
"saveTitlesAndDescriptions");
2138 $tb->setOpenFormTag(
true);
2139 $tb->setCloseFormTag(
false);
2140 $tb->setId(
"tb_top");
2142 $html = $tb->getHTML();
2143 foreach ($media_items as $mi) {
2146 $acc->setId(
"acc_" . $mi[
"mob_id"]);
2150 $acc->addItem($mob->getTitle(), $form->getHTML());
2152 $html .= $acc->getHTML();
2155 $html .= $tb->getHTML();
2156 $tb->setOpenFormTag(
false);
2157 $tb->setCloseFormTag(
true);
2158 $tb->setId(
"tb_bottom");
2170 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2172 $form->setOpenTag(
false);
2173 $form->setCloseTag(
false);
2177 $ti->setValue($a_title);
2178 $form->addItem($ti);
2182 $form->addItem($ti);
2199 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
2201 foreach ($media_items as $mi) {
2204 $form->checkInput();
2205 $title = $form->getInput(
"title_" . $mi[
"mob_id"]);
2206 $desc = $form->getInput(
"description_" . $mi[
"mob_id"]);
2207 if (trim($title) !=
"") {
2208 $mob->setTitle($title);
2210 $mob->setDescription($desc);
2213 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
2214 $ctrl->redirect($this,
"listMedia");
2225 if (
$type !==
"fold") {
2226 $tree = $this->
object->getTree();
2227 $fold_id =
$tree->getParentId($this->mep_item_id);
2229 $ctrl->setParameter($this,
"mepitem_id", $fold_id);
2230 $ctrl->redirect($this,
"listMedia");
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Class ilEditClipboardGUI.
static virusHandling($a_file, $a_orig_name="", $a_clean=true)
scan file for viruses and clean files if possible
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
New implementation of ilObjectGUI.
special template class to simplify handling of ITX/PEAR
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.
addExternalEditFormCustom(ilPropertyFormGUI $a_form)
TableGUI class for media pool page usages listing.
Handler class for multi srt upload in learning modules.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
setCreationMode($a_mode=true)
Export User Interface Class.
initImportForm($a_new_type)
Init object import form.
Upload SRT files to a set of media objects.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupObjId($a_id)
static getUsages($a_pc_type, $a_pc_id, $a_incl_hist=true)
Get usages.
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 getSyntaxStylePath()
get syntax style path
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.
initEditForm()
Init object edit form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getEditFormValues()
Get values for edit form.
static getInstance()
Get instance.
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
__construct(Container $dic, ilPlugin $plugin)
This class represents a text area property in a property form.
static getInstance($a_obj_id)
Get instance.
static _checkAdministrationPermission()
static initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Init service settings form.
getRefId()
get reference id public
prepareOutput($a_show_subobjects=true)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static getLogger($a_component_id)
Get component logger.
File System Explorer GUI class.
static redirect($a_script)
Accordion user interface class.
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.