44 protected \ILIAS\MediaPool\InternalDomainService
$domain;
45 protected \ILIAS\COPage\Xsl\XslManager
$xsl;
62 int $a_id_type = self::REPOSITORY_NODE_ID,
63 int $a_parent_node_id = 0
67 $this->mep_request =
$DIC->mediaPool()
71 $this->mep_item_id = $this->mep_request->getItemId();
75 $this->
tabs = $DIC->tabs();
76 $this->
locator = $DIC[
"ilLocator"];
77 $this->
help = $DIC[
"ilHelp"];
79 $this->main_tpl =
$DIC->ui()->mainTemplate();
81 $this->
upload = $DIC->upload();
85 $this->db =
$DIC->database();
87 $this->mode = ($this->mep_request->getMode() !==
"")
88 ? $this->mep_request->getMode()
90 $this->gui =
$DIC->mediaPool()->internal()->gui();
91 $this->domain =
$DIC->mediaPool()->internal()->domain();
92 $this->xsl =
$DIC->copage()->internal()->domain()->xsl();
109 $tree = $this->
object->getTree();
115 if ($this->
ctrl->getCmd() ===
"explorer") {
116 $this->
ctrl->saveParameter($this, array(
"ref_id"));
118 $this->
ctrl->saveParameter($this, array(
"ref_id",
"mepitem_id"));
120 $this->
ctrl->saveParameter($this, array(
"mep_mode"));
145 $tree = $this->
object->getTree();
148 $next_class = $this->
ctrl->getNextClass($this);
149 $cmd = $this->
ctrl->getCmd();
150 $new_type = $this->mep_request->getNewType();
154 if ($new_type !==
"" && ($cmd !==
"confirmRemove" && $cmd !==
"copyToClipboard"
155 && $cmd !==
"pasteFromClipboard")) {
156 $this->tpl->setPermanentLink(
"mep", $this->ref_id);
160 if ($cmd ===
"create") {
161 switch ($this->mep_request->getNewType()) {
163 $this->
ctrl->redirectByClass(
"ilobjmediaobjectgui",
"create");
167 $this->
ctrl->redirectByClass(
"ilobjfoldergui",
"create");
172 switch ($next_class) {
173 case 'ilobjectmetadatagui':
179 $this->tabs_gui->activateTab(
'meta_data');
181 $this->
ctrl->forwardCommand($md_gui);
182 $this->tpl->printToStdout();
185 case strtolower(ilRepoStandardUploadHandlerGUI::class):
188 $gui =
$form->getRepoStandardUploadHandlerGUI(
"media_files");
189 $this->
ctrl->forwardCommand($gui);
192 case 'ilmediapoolpagegui':
196 $ilTabs->clearTargets();
197 $ilCtrl->setReturn($this,
"returnFromItem");
200 $this->mep_request->getOldNr()
202 $mep_page_gui->setPoolGUI($this);
203 $mep_page_gui->setAdvMdRecordObject($this->
object->getRefId(),
"mep",
"mpg");
205 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
206 $mep_page_gui->setEnableEditing(
false);
208 $ret = $this->
ctrl->forwardCommand($mep_page_gui);
212 $this->tpl->printToStdout();
215 case "ilobjmediaobjectgui":
217 if ($cmd ===
"create" || $cmd ===
"save" || $cmd ===
"cancel") {
220 $ilObjMediaObjectGUI->setWidthPreset((
int) $this->getMediaPool()->getDefaultWidth());
221 $ilObjMediaObjectGUI->setHeightPreset((
int) $this->getMediaPool()->getDefaultHeight());
226 $ilTabs->setBackTarget(
228 $this->ctrl->getLinkTarget(
234 if ($this->
ctrl->getCmdClass() ===
"ilinternallinkgui") {
235 $this->
ctrl->setReturn($this,
"explorer");
237 $this->
ctrl->setParameter($this,
"mepitem_id", $ret_obj);
238 $this->
ctrl->setReturn(
242 $this->
ctrl->setParameter($this,
"mepitem_id", $this->mep_item_id);
245 $ilObjMediaObjectGUI->setTabs();
249 $ilObjMediaObjectGUI->setAdvMdRecordObject($this->
object->getRefId(),
"mep",
"mob");
251 $ret = $this->
ctrl->forwardCommand($ilObjMediaObjectGUI);
252 if ($cmd ===
"save") {
253 $object = $ilObjMediaObjectGUI->getObject();
257 $mep_item->setType(
"mob");
264 "ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
265 $this->requested_ref_id .
"&mepitem_id=" . $this->mep_item_id
269 $this->tpl->printToStdout();
272 case "ilmediacreationgui":
275 $this->
ctrl->setReturn($this,
"listMedia");
281 },
function ($mob_id, $long_desc) {
283 },
function ($mob_ids) {
285 },
function ($mob_id) {
287 },
function ($mob_id) {
290 $this->
ctrl->forwardCommand($creation);
291 $this->tpl->printToStdout();
295 case "ilobjfoldergui":
299 $this->
ctrl->setReturn($this,
"listMedia");
305 $folder_gui->setFormAction(
307 $this->
ctrl->getFormActionByClass(
"ilobjfoldergui")
309 $folder_gui->createObject();
310 $this->tpl->printToStdout();
315 $folder_gui->setFolderTree(
$tree);
316 $folder_gui->saveObject();
327 $this->
ctrl->setParameter($this,
"foldereditmode",
"1");
328 $folder_gui->setFormAction(
"update", $this->
ctrl->getFormActionByClass(
"ilobjfoldergui"));
329 $folder_gui->editObject();
330 $this->tpl->printToStdout();
341 $this->
ctrl->setReturn($this,
"listMedia");
342 $folder_gui->updateObject();
346 if ($this->mep_request->getFolderEditMode()) {
349 $this->
ctrl->redirect($this,
"listMedia");
354 case "ileditclipboardgui":
357 $this->
ctrl->setReturn($this, $this->mode);
359 $clip_gui->setMultipleSelections(
true);
360 $clip_gui->setInsertButtonTitle(
$lng->
txt(
"mep_copy_to_mep"));
361 $ilTabs->setTabActive(
"clipboard");
362 $this->
ctrl->forwardCommand($clip_gui);
363 $this->tpl->printToStdout();
366 case 'ilinfoscreengui':
370 $this->tpl->printToStdout();
373 case 'ilpermissiongui':
378 $ilTabs->activateTab(
"perm_settings");
379 $this->
ctrl->forwardCommand($perm_gui);
380 $this->tpl->printToStdout();
387 $ilTabs->activateTab(
"export");
389 $this->
ctrl->forwardCommand($exp_gui);
390 $this->tpl->printToStdout();
393 case "ilcommonactiondispatchergui":
395 $this->
ctrl->forwardCommand($gui);
398 case strtolower(TranslationGUI::class):
402 $ilTabs->activateTab(
"settings");
417 $transgui->forceContentTranslation();
418 $this->
ctrl->forwardCommand($transgui);
419 $this->tpl->printToStdout();
422 case "ilmediapoolimportgui":
426 $ilTabs->activateTab(
"import");
428 $this->
ctrl->forwardCommand($gui);
429 $this->tpl->printToStdout();
432 case "ilmobmultisrtuploadgui":
438 $this->
ctrl->forwardCommand($gui);
439 $this->tpl->printToStdout();
442 case strtolower(ilObjectMetaDataGUI::class):
446 $ilTabs->activateTab(
"meta_data");
448 $this->
ctrl->forwardCommand($gui);
451 case strtolower(SettingsGUI::class):
456 $ilTabs->activateTab(
"settings");
460 $this->
ctrl->forwardCommand($gui);
461 $this->tpl->printToStdout();
467 $cmd = $this->
ctrl->getCmd(
"listMedia") ?:
"listMedia";
470 $this->tpl->printToStdout();
484 if (
$type !==
"fold") {
485 $tree = $this->
object->getTree();
497 $this->
ctrl->redirectByClass(
"ilobjmediaobjectgui",
"create");
503 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
506 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=" . $new_object->
getRefId() .
"&cmd=listMedia");
511 $this->
ctrl->redirectByClass(SettingsGUI::class);
527 $ilCtrl->setParameter($this,
"mep_mode",
"listMedia");
531 $ilTabs->setTabActive(
"content");
534 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
535 $ilToolbar->addButton(
537 $ilCtrl->getLinkTargetByClass(
"ilMediaCreationGUI",
"")
541 if ($mset->get(
"mep_activate_pages")) {
542 $ilToolbar->addButton(
543 $lng->
txt(
"mep_create_content_snippet"),
544 $ilCtrl->getLinkTargetByClass([
"ilobjmediapoolgui",
"ilmediapoolpagegui"],
"createMediaPoolPage")
548 $ilToolbar->addButton(
549 $lng->
txt(
"mep_create_folder"),
550 $ilCtrl->getLinkTarget($this,
"createFolderForm")
553 $ilToolbar->addButton(
555 $ilCtrl->getLinkTarget($this,
"bulkUpload")
559 if (is_array($move_ids) && count($move_ids) > 0) {
560 $ilToolbar->addSeparator();
561 $ilToolbar->addButton(
563 $ilCtrl->getLinkTarget($this,
"paste")
568 $mep_table_gui =
new ilMediaPoolTableGUI($this,
"listMedia", $this->getMediaPool(),
"mepitem_id");
575 $exp->toggleExplorerNodeState();
588 $ilCtrl->setParameter($this,
"mep_mode",
"allMedia");
591 $ilTabs->setTabActive(
"content");
597 $this->getMediaPool(),
603 if ($this->mep_request->getForceFilter() > 0) {
604 $mep_table_gui->setTitleFilter(
612 $this->getMediaPool(),
630 $this->getMediaPool(),
635 $mtab->writeFilterToSession();
636 $mtab->resetOffset();
645 $this->getMediaPool(),
650 $mtab->resetFilter();
651 $mtab->resetOffset();
660 $this->tpl->loadStandardTemplate();
669 if ($this->mep_item_id == 0) {
672 $par_id = $this->
object->getPoolTree()->getParentId($this->mep_item_id);
673 if ($par_id != $this->
object->getPoolTree()->getRootId()) {
674 return (
int) $par_id;
690 $mob_id = $item->getForeignId();
692 $this->tpl =
new ilGlobalTemplate(
"tpl.fullscreen.html",
true,
true,
"components/ILIAS/COPage");
694 $this->tpl->setVariable(
695 "LOCATION_CONTENT_STYLESHEET",
704 $this->tpl->setVariable(
"TITLE",
" - " . $media_obj->getTitle());
715 $mode = ($this->
ctrl->getCmd() !==
"showPreview")
720 $this->
ctrl->getLinkTarget($this,
"showFullscreen",
"",
false,
false);
721 $params = array(
'mode' =>
$mode,
'enlarge_path' => $enlarge_path,
722 'link_params' =>
"ref_id=" . $this->requested_ref_id,
'fullscreen_link' => $fullscreen_link,
724 'ref_id' => $this->requested_ref_id,
'pg_frame' => $pg_frame,
'webspace_path' => $wb_path);
725 $output = $this->xsl->process($xml,
$params);
728 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
748 $page_gui->setTemplate(
$tpl);
750 $page_gui->setTemplateOutput(
false);
751 $page_gui->setHeader(
"");
752 $ret = $page_gui->showPage(
true);
765 $page_gui->setPoolGUI($this);
780 switch ($item->getType()) {
810 $ids = $this->mep_request->getItemIds();
811 if (count($ids) === 0) {
812 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
813 $ilCtrl->redirect($this,
"");
818 $cgui->setFormAction($this->
ctrl->getFormAction($this));
819 $cgui->setHeaderText($this->
lng->txt(
"info_remove_sure"));
820 $cgui->setCancel($this->
lng->txt(
"cancel"),
"cancelRemove");
821 $cgui->setConfirm($this->
lng->txt(
"confirm"),
"remove");
829 if (
$type ===
"pg") {
831 if (count($usages) > 0) {
832 $this->main_tpl->setOnScreenMessage(
'failure', sprintf(
$lng->
txt(
"mep_content_snippet_in_use"), $title),
true);
833 $ilCtrl->redirect($this,
"listMedia");
837 if (count($usages) > 0) {
838 $add =
"<div class='small'>" .
$lng->
txt(
"mep_content_snippet_used_in_older_versions") .
"</div>";
846 $cgui->addItem(
"id[]",
$obj_id, $caption);
849 $this->tpl->setContent($cgui->getHTML());
861 $ilCtrl->setParameterByClass(
862 "ileditclipboardgui",
864 rawurlencode($ilCtrl->getLinkTarget(
866 "insertFromClipboard",
872 $ilCtrl->redirectByClass(
"ilEditClipboardGUI",
"getObject");
883 $this->domain->mediapool($this->
object->getId())
884 ->copySelectedFromEditClipboard($this->mep_item_id);
891 $this->
ctrl->redirect($this, $this->mode);
900 $this->
ctrl->redirect($this, $this->mode);
903 public function remove():
void
907 $ids = $this->mep_request->getItemIds();
909 $this->
object->deleteChild($obj_id);
912 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"cont_obj_removed"),
true);
913 $this->
ctrl->redirect($this, $this->mode);
926 $ids = $this->mep_request->getItemIds();
927 if (count($ids) === 0) {
928 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
929 $this->
ctrl->redirect($this, $this->mode);
934 if (
$type ===
"fold") {
935 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"cont_cant_copy_folders"),
true);
936 $this->
ctrl->redirect($this, $this->mode);
942 if (
$type ===
"mob") {
943 $ilUser->addObjectToClipboard($fid,
"mob",
"");
945 if (
$type ===
"pg") {
946 $ilUser->addObjectToClipboard(
$obj_id,
"incl",
"");
949 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"copied_to_clipboard"),
true);
950 $this->
ctrl->redirect($this, $this->mode);
961 $tree = $this->
object->getTree();
964 foreach (
$path as $node) {
966 $this->
ctrl->setParameter($this,
"mepitem_id",
"");
968 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId())) {
969 $link = $this->
ctrl->getLinkTarget($this,
"listMedia");
970 } elseif ($ilAccess->checkAccess(
"visible",
"", $this->object->getRefId())) {
971 $link = $this->
ctrl->getLinkTarget($this,
"infoScreen");
973 $title = $this->
object->getTitle();
974 $this->
ctrl->setParameter($this,
"mepitem_id", $this->mep_item_id);
975 $ilLocator->addItem($title, $link,
"", $this->requested_ref_id);
1015 $this->
form->setValuesByArray($values);
1030 if ($this->
form->checkInput()) {
1031 if ($this->
object->createFolder($this->form->getInput(
"title"), $this->mep_item_id)) {
1032 $this->main_tpl->setOnScreenMessage(
'success',
$lng->
txt(
"mep_folder_created"),
true);
1034 $ilCtrl->redirect($this,
"listMedia");
1037 $this->
form->setValuesByPost();
1050 if ($this->
form->checkInput()) {
1052 $item->setTitle($this->
form->getInput(
"title"));
1054 $this->main_tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
1055 $ilCtrl->setParameter(
1058 $this->
object->getTree()->getParentId($this->mep_item_id)
1060 $ilCtrl->redirect($this,
"listMedia");
1063 $this->
form->setValuesByPost();
1080 $ti->setMaxLength(128);
1081 $ti->setRequired(
true);
1082 $this->
form->addItem($ti);
1085 if ($a_mode ===
"create") {
1086 $this->
form->addCommandButton(
"saveFolder",
$lng->
txt(
"save"));
1087 $this->
form->addCommandButton(
"cancelSave",
$lng->
txt(
"cancel"));
1088 $this->
form->setTitle(
$lng->
txt(
"mep_new_folder"));
1090 $this->
form->addCommandButton(
"updateFolder",
$lng->
txt(
"save"));
1091 $this->
form->addCommandButton(
"cancelFolderUpdate",
$lng->
txt(
"cancel"));
1092 $this->
form->setTitle(
$lng->
txt(
"mep_edit_folder"));
1095 $this->
form->setFormAction($ilCtrl->getFormAction($this));
1104 $this->
object->getTree()->getParentId($this->mep_item_id)
1106 $ilCtrl->redirect($this,
"listMedia");
1112 $ilCtrl->
redirect($this,
"listMedia");
1125 $ilAccess = $this->
access;
1129 $ilTabs->addSubTab(
"content", $this->
lng->txt(
"objs_fold"), $this->ctrl->getLinkTarget($this,
""));
1132 $ilTabs->addSubTab(
"mep_all_mobs", $this->
lng->txt(
"mep_all_mobs"), $this->ctrl->getLinkTarget($this,
"allMedia"));
1133 $ilCtrl->setParameter($this,
"mepitem_id", $this->mep_item_id);
1135 if ($ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
1138 $this->
lng->txt(
"mep_media_subtitles"),
1139 $ilCtrl->getLinkTargetByClass(
"ilmobmultisrtuploadgui",
"")
1143 $ilTabs->activateSubTab($a_active);
1148 $ilAccess = $this->access;
1149 $ilTabs = $this->tabs;
1150 $ilHelp = $this->help;
1152 $ilHelp->setScreenIdComponent(
"mep");
1154 if ($ilAccess->checkAccess(
'read',
'', $this->ref_id) ||
1155 $ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
1156 $ilTabs->addTab(
"content", $this->
lng->txt(
"mep_content"), $this->ctrl->getLinkTarget($this,
""));
1160 if ($ilAccess->checkAccess(
'visible',
'', $this->ref_id) ||
1161 $ilAccess->checkAccess(
'read',
'', $this->ref_id) ||
1162 $ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
1165 $this->
lng->txt(
"info_short"),
1166 $this->ctrl->getLinkTargetByClass(
1167 array(
"ilobjmediapoolgui",
"ilinfoscreengui"),
1173 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1176 $this->
lng->txt(
"settings"),
1177 $this->ctrl->getLinkTargetByClass(SettingsGUI::class)
1180 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1183 $this->
lng->txt(
"clipboard"),
1184 $this->ctrl->getLinkTarget($this,
"openClipboard")
1189 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1192 $mdtab = $mdgui->getTab();
1196 $this->
lng->txt(
"meta_data"),
1202 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1205 $this->
lng->txt(
"export"),
1206 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
1211 $this->
lng->txt(
"import"),
1212 $this->ctrl->getLinkTargetByClass(
"ilmediapoolimportgui",
"")
1216 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->object->getRefId())) {
1219 $this->
lng->txt(
"perm_settings"),
1220 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm")
1228 $ilTabs = $this->
tabs;
1230 $ilAccess = $this->access;
1232 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1235 $lng->txt(
"settings"),
1236 $this->ctrl->getLinkTarget($this,
"edit")
1240 if ($mset->get(
"mep_activate_pages")) {
1241 $ilTabs->addSubTabTarget(
1242 "obj_multilinguality",
1243 $this->
ctrl->getLinkTargetByClass(TranslationGUI::class,
"")
1248 $ilTabs->setSubTabActive($a_active);
1252 public static function _goto(
string $a_target): void
1255 $main_tpl =
$DIC->ui()->mainTemplate();
1257 $ilAccess =
$DIC->access();
1259 $ctrl =
$DIC->ctrl();
1262 $targets = explode(
'_', $a_target);
1264 if (count((array) $targets) > 1) {
1265 $subitem_id = $targets[1];
1268 $ctrl->setParameterByClass(
"ilMediaPoolPresentationGUI",
"ref_id",
$ref_id);
1269 if ($ilAccess->checkAccess(
"read",
"",
$ref_id)) {
1270 $ctrl->setParameterByClass(
"ilMediaPoolPresentationGUI",
"mepitem_id", $subitem_id);
1271 $ctrl->redirectByClass(
"ilMediaPoolPresentationGUI",
"");
1272 } elseif ($ilAccess->checkAccess(
"visible",
"",
$ref_id)) {
1273 $ctrl->redirectByClass(
"ilMediaPoolPresentationGUI",
"infoScreen");
1276 $lng->txt(
"msg_no_perm_read_item"),
1290 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
"showSummary");
1300 $this->
tabs->activateTab(
"info_short");
1301 $ilAccess = $this->access;
1303 if (!$ilAccess->checkAccess(
"visible",
"", $this->ref_id) &&
1304 !$ilAccess->checkAccess(
"read",
"", $this->ref_id) &&
1305 !$ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
1309 if ($this->
ctrl->getCmd() ===
"infoScreen") {
1310 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
"showSummary");
1315 $info->enablePrivateNotes();
1319 $info->addMetaDataSections($this->
object->getId(), 0, $this->object->getType());
1334 ?array $a_files =
null
1337 $ilTabs = $this->tabs;
1339 $ilCtrl = $this->ctrl;
1340 $ilToolbar = $this->toolbar;
1344 $a_files = $this->mep_request->getFiles();
1347 $ilTabs->clearTargets();
1348 $ilTabs->setBackTarget(
1350 $ilCtrl->getLinkTarget($this,
"listMedia")
1353 $this->checkPermission(
"write");
1359 "rename" =>
$lng->txt(
"mep_up_dir_move"),
1360 "copy" =>
$lng->txt(
"mep_up_dir_copy"),
1364 $tb->addInputItem($si);
1365 $tb->setCloseFormTag(
false);
1366 $tb->setFormAction($ilCtrl->getFormAction($this));
1367 $tb->setFormName(
"mep_up_form");
1371 "selectUploadDirFiles",
1374 $tab->setFormName(
"mep_up_form");
1375 $tpl->setContent($tb->getHTML() . $tab->getHTML());
1383 int $a_mpool_ref_id,
1389 $ilCtrl =
$DIC->ctrl();
1391 $internal_gui =
$DIC->mediaPool()
1394 $request = $internal_gui
1395 ->standardRequest();
1399 $tpl->addJavaScript(
"assets/js/ilMediaPool.js");
1401 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"mepitem_id",
"");
1402 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"ref_id", $a_mpool_ref_id);
1403 $tpl->addOnloadCode(
"il.MediaPool.setPreviewUrl('" . $ilCtrl->getLinkTargetByClass(array(
"ilmediapoolpresentationgui",
"ilobjmediapoolgui"),
"showPreview",
"",
false,
false) .
"');");
1404 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"mepitem_id", $request->getItemId());
1405 $ilCtrl->setParameterByClass(
1406 "ilobjmediapoolgui",
1408 $request->getRefId()
1411 $modal = $internal_gui->ui()->factory()->modal()->roundtrip(
1412 $lng->txt(
"preview"),
1413 $internal_gui->ui()->factory()->legacy()->content(
"<iframe id='ilMepPreviewContent'></iframe>")
1415 $html = $internal_gui->ui()->renderer()->render($modal);
1416 $html = str_replace(
1417 "<iframe id='ilMepPreviewContent'",
1418 "<iframe data-signal='" . $modal->getShowSignal()->getId() .
"' id='ilMepPreviewContent'",
1427 $ot = $this->
object->getObjectProperties()->getPropertyTranslations();
1429 if ($ot->getContentTranslationActivated()) {
1430 $format = explode(
"_", $this->mep_request->getExportFormat());
1434 $this->
object->exportXML($opt);
1443 $this->checkPermission(
"write");
1445 $main_tpl = $this->main_tpl;
1447 $form = $this->getBulkUploadForm();
1453 if (is_null($this->bulk_upload_form)) {
1454 $mep_hash = uniqid();
1455 $this->
ctrl->setParameter($this,
"mep_hash", $mep_hash);
1456 $this->bulk_upload_form = $this->gui
1457 ->form([self::class],
'performBulkUpload')
1458 ->section(
"props", $this->
lng->txt(
'mep_bulk_upload'))
1461 $this->
lng->txt(
"mep_media_files"),
1462 \Closure::fromCallable([$this,
'handleUploadResult']),
1469 return $this->bulk_upload_form;
1476 $title = $result->getName();
1479 $mob->setTitle($title);
1480 $mob->setDescription(
"");
1483 $media_item = $mob->addMediaItemFromUpload(
1486 $this->mep_request->getUploadHash()
1510 $med_item = $mob->getMediaItem(
"Standard");
1511 $med_item->determineDuration();
1512 $med_item->update();
1516 $mep_item->setTitle($title);
1517 $mep_item->setType(
"mob");
1518 $mep_item->setForeignId($mob->getId());
1519 $mep_item->create();
1521 $tree = $this->
object->getTree();
1522 $parent = $this->mep_item_id;
1523 $tree->insertNode($mep_item->getId(), $parent);
1537 $item_ids[] = $mob->getId();
1551 HandlerResult::STATUS_OK,
1562 $this->checkPermission(
"write");
1563 $this->
ctrl->setParameter($this,
"mep_hash", $this->mep_request->getUploadHash());
1564 $this->
ctrl->redirect($this,
"editTitlesAndDescriptions");
1569 $ctrl = $this->ctrl;
1572 $this->checkPermission(
"write");
1573 $ctrl->saveParameter($this,
"mep_hash");
1575 $main_tpl = $this->main_tpl;
1578 $this->mep_request->getUploadHash()
1582 $tb->setFormAction($ctrl->getFormAction($this));
1583 $tb->addFormButton(
$lng->txt(
"save"),
"saveTitlesAndDescriptions");
1584 $tb->setOpenFormTag(
true);
1585 $tb->setCloseFormTag(
false);
1586 $tb->setId(
"tb_top");
1588 $html = $tb->getHTML();
1589 foreach ($media_items as $mi) {
1592 $acc->setId(
"acc_" . $mi[
"mob_id"]);
1595 $form = $this->initMediaBulkForm($mi[
"mob_id"], $mob->getTitle());
1596 $acc->addItem($mob->getTitle(), $form->
getHTML());
1598 $html .= $acc->getHTML();
1601 $html .= $tb->getHTML();
1602 $tb->setOpenFormTag(
false);
1603 $tb->setCloseFormTag(
true);
1604 $tb->setId(
"tb_bottom");
1624 $ti->setValue($a_title);
1637 $ctrl = $this->ctrl;
1639 $this->checkPermission(
"write");
1641 $this->mep_request->getUploadHash()
1644 foreach ($media_items as $mi) {
1646 $form = $this->initMediaBulkForm($mi[
"mob_id"], $mob->getTitle());
1648 $title = $form->
getInput(
"title_" . $mi[
"mob_id"]);
1649 $desc = $form->
getInput(
"description_" . $mi[
"mob_id"]);
1650 if (trim($title) !==
"") {
1651 $mob->setTitle($title);
1653 $mob->setDescription($desc);
1656 $this->main_tpl->setOnScreenMessage(
'success',
$lng->txt(
"msg_obj_modified"),
true);
1657 $ctrl->redirect($this,
"listMedia");
1662 ilSession::set(
"mep_move_ids", $this->mep_request->getItemIds());
1663 $this->main_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"mep_move_select_insert"),
true);
1664 $this->
ctrl->redirect($this,
"listMedia");
1669 $target_folder_id = $this->mep_request->getItemId();
1670 $target_tree = $this->domain->tree($this->
object->getId());
1672 $target_folder_id = $target_tree->readRootId();
1676 $this->domain->mediapool($this->
object->getId())->pasteFromClipboard($target_folder_id);
1677 }
catch (Exception
$e) {
1678 $this->main_tpl->setOnScreenMessage(
1680 $this->
lng->txt(
"mep_target_in_source_not_allowed") .
" " . $e->getMessage(),
1685 $this->
ctrl->redirect($this,
"listMedia");
1690 $this->addMobsToPool($mob_ids,
"",
false);
1695 $this->addMobsToPool([$mob_id], $long_desc);
1700 string $long_desc =
"",
1701 bool $redirect =
true,
1702 bool $extract =
false
1704 $ctrl = $this->
ctrl;
1705 $user = $this->user;
1708 foreach ($mob_ids as $mob_id) {
1710 if (!is_null($object)) {
1712 $mep_item->setTitle($object->getTitle());
1713 $mep_item->setType(
"mob");
1714 $mep_item->setForeignId($object->getId());
1715 $mep_item->create();
1717 $parent = $this->mep_item_id;
1718 $tree = $this->
object->getTree();
1719 $tree->insertNode($mep_item->getId(), $parent);
1724 $ctrl->redirect($this,
"listMedia");
1730 $this->addMobsToPool($mob_ids,
"",
true,
true);
1735 $this->
ctrl->redirect($this,
"listMedia");
Class BasicHandlerResult.
GUI class for object translation handling.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Export User Interface Class.
static getWebspaceDir(string $mode="filesystem")
get webspace directory
special template class to simplify handling of ITX/PEAR
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getLogger(string $a_component_id)
Get component logger.
Component logger with individual log levels by component id.
Class ilMediaPoolPage GUI class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
static getSyntaxStylePath()
New implementation of ilObjectGUI.
ilGlobalTemplateInterface $tpl
setCreationMode(bool $mode=true)
If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode...
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
prepareOutput(bool $show_sub_objects=true)
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
addHeaderAction()
Add header action menu.
Class ilObject Basic functions for all objects.
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
static getUsages(string $a_pc_type, int $a_pc_id, bool $a_incl_hist=true)
Get usages.
static get(string $a_var)
static set(string $a_var, $a_val)
Set a value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
This class represents a text property in a property form.
getPathFull(int $a_endnode_id, int $a_startnode_id=0)
get path from a given startnode to a given endnode if startnode is not given the rootnode is startnod...
insertNode(int $a_node_id, int $a_parent_id, int $a_pos=self::POS_LAST_NODE, bool $a_reset_deletion_date=false)
insert new node with node_id under parent node with parent_id
getParentId(int $a_node_id)
get parent id of given node
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static redirect(string $a_script)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.
printToStdout(string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)
setContent(string $a_html)
Sets content for standard template.
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
form(?array $class_path, string $cmd, string $submit_caption="")