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":
396 $this->
ctrl->forwardCommand($gui);
399 case strtolower(TranslationGUI::class):
403 $ilTabs->activateTab(
"settings");
418 $transgui->forceContentTranslation();
419 $this->
ctrl->forwardCommand($transgui);
420 $this->tpl->printToStdout();
423 case "ilmediapoolimportgui":
427 $ilTabs->activateTab(
"import");
429 $this->
ctrl->forwardCommand($gui);
430 $this->tpl->printToStdout();
433 case "ilmobmultisrtuploadgui":
439 $this->
ctrl->forwardCommand($gui);
440 $this->tpl->printToStdout();
443 case strtolower(ilObjectMetaDataGUI::class):
447 $ilTabs->activateTab(
"meta_data");
449 $this->
ctrl->forwardCommand($gui);
452 case strtolower(SettingsGUI::class):
457 $ilTabs->activateTab(
"settings");
461 $this->
ctrl->forwardCommand($gui);
462 $this->tpl->printToStdout();
468 $cmd = $this->
ctrl->getCmd(
"listMedia") ?:
"listMedia";
471 $this->tpl->printToStdout();
485 if (
$type !==
"fold") {
486 $tree = $this->
object->getTree();
498 $this->
ctrl->redirectByClass(
"ilobjmediaobjectgui",
"create");
504 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
507 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=" . $new_object->
getRefId() .
"&cmd=listMedia");
512 $this->
ctrl->redirectByClass(SettingsGUI::class);
528 $ilCtrl->setParameter($this,
"mep_mode",
"listMedia");
532 $ilTabs->setTabActive(
"content");
535 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
536 $ilToolbar->addButton(
538 $ilCtrl->getLinkTargetByClass(
"ilMediaCreationGUI",
"")
542 if ($mset->get(
"mep_activate_pages")) {
543 $ilToolbar->addButton(
544 $lng->
txt(
"mep_create_content_snippet"),
545 $ilCtrl->getLinkTargetByClass([
"ilobjmediapoolgui",
"ilmediapoolpagegui"],
"createMediaPoolPage")
549 $ilToolbar->addButton(
550 $lng->
txt(
"mep_create_folder"),
551 $ilCtrl->getLinkTarget($this,
"createFolderForm")
554 $ilToolbar->addButton(
556 $ilCtrl->getLinkTarget($this,
"bulkUpload")
560 if (is_array($move_ids) && count($move_ids) > 0) {
561 $ilToolbar->addSeparator();
562 $ilToolbar->addButton(
564 $ilCtrl->getLinkTarget($this,
"paste")
569 $mep_table_gui =
new ilMediaPoolTableGUI($this,
"listMedia", $this->getMediaPool(),
"mepitem_id");
576 $exp->toggleExplorerNodeState();
589 $ilCtrl->setParameter($this,
"mep_mode",
"allMedia");
592 $ilTabs->setTabActive(
"content");
598 $this->getMediaPool(),
604 if ($this->mep_request->getForceFilter() > 0) {
605 $mep_table_gui->setTitleFilter(
613 $this->getMediaPool(),
631 $this->getMediaPool(),
636 $mtab->writeFilterToSession();
637 $mtab->resetOffset();
646 $this->getMediaPool(),
651 $mtab->resetFilter();
652 $mtab->resetOffset();
661 $this->tpl->loadStandardTemplate();
670 if ($this->mep_item_id == 0) {
673 $par_id = $this->
object->getPoolTree()->getParentId($this->mep_item_id);
674 if ($par_id != $this->
object->getPoolTree()->getRootId()) {
675 return (
int) $par_id;
691 $mob_id = $item->getForeignId();
693 $this->tpl =
new ilGlobalTemplate(
"tpl.fullscreen.html",
true,
true,
"components/ILIAS/COPage");
695 $this->tpl->setVariable(
696 "LOCATION_CONTENT_STYLESHEET",
705 $this->tpl->setVariable(
"TITLE",
" - " . $media_obj->getTitle());
716 $mode = ($this->
ctrl->getCmd() !==
"showPreview")
721 $this->
ctrl->getLinkTarget($this,
"showFullscreen",
"",
false,
false);
722 $params = array(
'mode' =>
$mode,
'enlarge_path' => $enlarge_path,
723 'link_params' =>
"ref_id=" . $this->requested_ref_id,
'fullscreen_link' => $fullscreen_link,
725 'ref_id' => $this->requested_ref_id,
'pg_frame' => $pg_frame,
'webspace_path' => $wb_path);
726 $output = $this->xsl->process($xml,
$params);
729 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
749 $page_gui->setTemplate(
$tpl);
751 $page_gui->setTemplateOutput(
false);
752 $page_gui->setHeader(
"");
753 $ret = $page_gui->showPage(
true);
766 $page_gui->setPoolGUI($this);
781 switch ($item->getType()) {
811 $ids = $this->mep_request->getItemIds();
812 if (count($ids) === 0) {
813 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
814 $ilCtrl->redirect($this,
"");
819 $cgui->setFormAction($this->
ctrl->getFormAction($this));
820 $cgui->setHeaderText($this->
lng->txt(
"info_remove_sure"));
821 $cgui->setCancel($this->
lng->txt(
"cancel"),
"cancelRemove");
822 $cgui->setConfirm($this->
lng->txt(
"confirm"),
"remove");
830 if (
$type ===
"pg") {
832 if (count($usages) > 0) {
833 $this->main_tpl->setOnScreenMessage(
'failure', sprintf(
$lng->
txt(
"mep_content_snippet_in_use"), $title),
true);
834 $ilCtrl->redirect($this,
"listMedia");
838 if (count($usages) > 0) {
839 $add =
"<div class='small'>" .
$lng->
txt(
"mep_content_snippet_used_in_older_versions") .
"</div>";
847 $cgui->addItem(
"id[]",
$obj_id, $caption);
850 $this->tpl->setContent($cgui->getHTML());
862 $ilCtrl->setParameterByClass(
863 "ileditclipboardgui",
865 rawurlencode($ilCtrl->getLinkTarget(
867 "insertFromClipboard",
873 $ilCtrl->redirectByClass(
"ilEditClipboardGUI",
"getObject");
884 $this->domain->mediapool($this->
object->getId())
885 ->copySelectedFromEditClipboard($this->mep_item_id);
892 $this->
ctrl->redirect($this, $this->mode);
901 $this->
ctrl->redirect($this, $this->mode);
904 public function remove():
void
908 $ids = $this->mep_request->getItemIds();
910 $this->
object->deleteChild($obj_id);
913 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"cont_obj_removed"),
true);
914 $this->
ctrl->redirect($this, $this->mode);
927 $ids = $this->mep_request->getItemIds();
928 if (count($ids) === 0) {
929 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
930 $this->
ctrl->redirect($this, $this->mode);
935 if (
$type ===
"fold") {
936 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"cont_cant_copy_folders"),
true);
937 $this->
ctrl->redirect($this, $this->mode);
943 if (
$type ===
"mob") {
944 $ilUser->addObjectToClipboard($fid,
"mob",
"");
946 if (
$type ===
"pg") {
947 $ilUser->addObjectToClipboard(
$obj_id,
"incl",
"");
950 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"copied_to_clipboard"),
true);
951 $this->
ctrl->redirect($this, $this->mode);
962 $tree = $this->
object->getTree();
965 foreach (
$path as $node) {
967 $this->
ctrl->setParameter($this,
"mepitem_id",
"");
969 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId())) {
970 $link = $this->
ctrl->getLinkTarget($this,
"listMedia");
971 } elseif ($ilAccess->checkAccess(
"visible",
"", $this->object->getRefId())) {
972 $link = $this->
ctrl->getLinkTarget($this,
"infoScreen");
974 $title = $this->
object->getTitle();
975 $this->
ctrl->setParameter($this,
"mepitem_id", $this->mep_item_id);
976 $ilLocator->addItem($title, $link,
"", $this->requested_ref_id);
1016 $this->
form->setValuesByArray($values);
1031 if ($this->
form->checkInput()) {
1032 if ($this->
object->createFolder($this->form->getInput(
"title"), $this->mep_item_id)) {
1033 $this->main_tpl->setOnScreenMessage(
'success',
$lng->
txt(
"mep_folder_created"),
true);
1035 $ilCtrl->redirect($this,
"listMedia");
1038 $this->
form->setValuesByPost();
1051 if ($this->
form->checkInput()) {
1053 $item->setTitle($this->
form->getInput(
"title"));
1055 $this->main_tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
1056 $ilCtrl->setParameter(
1059 $this->
object->getTree()->getParentId($this->mep_item_id)
1061 $ilCtrl->redirect($this,
"listMedia");
1064 $this->
form->setValuesByPost();
1081 $ti->setMaxLength(128);
1082 $ti->setRequired(
true);
1083 $this->
form->addItem($ti);
1086 if ($a_mode ===
"create") {
1087 $this->
form->addCommandButton(
"saveFolder",
$lng->
txt(
"save"));
1088 $this->
form->addCommandButton(
"cancelSave",
$lng->
txt(
"cancel"));
1089 $this->
form->setTitle(
$lng->
txt(
"mep_new_folder"));
1091 $this->
form->addCommandButton(
"updateFolder",
$lng->
txt(
"save"));
1092 $this->
form->addCommandButton(
"cancelFolderUpdate",
$lng->
txt(
"cancel"));
1093 $this->
form->setTitle(
$lng->
txt(
"mep_edit_folder"));
1096 $this->
form->setFormAction($ilCtrl->getFormAction($this));
1105 $this->
object->getTree()->getParentId($this->mep_item_id)
1107 $ilCtrl->redirect($this,
"listMedia");
1113 $ilCtrl->
redirect($this,
"listMedia");
1126 $ilAccess = $this->
access;
1130 $ilTabs->addSubTab(
"content", $this->
lng->txt(
"objs_fold"), $this->ctrl->getLinkTarget($this,
""));
1133 $ilTabs->addSubTab(
"mep_all_mobs", $this->
lng->txt(
"mep_all_mobs"), $this->ctrl->getLinkTarget($this,
"allMedia"));
1134 $ilCtrl->setParameter($this,
"mepitem_id", $this->mep_item_id);
1136 if ($ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
1139 $this->
lng->txt(
"mep_media_subtitles"),
1140 $ilCtrl->getLinkTargetByClass(
"ilmobmultisrtuploadgui",
"")
1144 $ilTabs->activateSubTab($a_active);
1149 $ilAccess = $this->access;
1150 $ilTabs = $this->tabs;
1151 $ilHelp = $this->help;
1153 $ilHelp->setScreenIdComponent(
"mep");
1155 if ($ilAccess->checkAccess(
'read',
'', $this->ref_id) ||
1156 $ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
1157 $ilTabs->addTab(
"content", $this->
lng->txt(
"mep_content"), $this->ctrl->getLinkTarget($this,
""));
1161 if ($ilAccess->checkAccess(
'visible',
'', $this->ref_id) ||
1162 $ilAccess->checkAccess(
'read',
'', $this->ref_id) ||
1163 $ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
1166 $this->
lng->txt(
"info_short"),
1167 $this->ctrl->getLinkTargetByClass(
1168 array(
"ilobjmediapoolgui",
"ilinfoscreengui"),
1174 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1177 $this->
lng->txt(
"settings"),
1178 $this->ctrl->getLinkTargetByClass(SettingsGUI::class)
1181 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1184 $this->
lng->txt(
"clipboard"),
1185 $this->ctrl->getLinkTarget($this,
"openClipboard")
1190 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1193 $mdtab = $mdgui->getTab();
1197 $this->
lng->txt(
"meta_data"),
1203 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1206 $this->
lng->txt(
"export"),
1207 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
1212 $this->
lng->txt(
"import"),
1213 $this->ctrl->getLinkTargetByClass(
"ilmediapoolimportgui",
"")
1217 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->object->getRefId())) {
1220 $this->
lng->txt(
"perm_settings"),
1221 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm")
1229 $ilTabs = $this->
tabs;
1231 $ilAccess = $this->access;
1233 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1236 $lng->txt(
"settings"),
1237 $this->ctrl->getLinkTarget($this,
"edit")
1241 if ($mset->get(
"mep_activate_pages")) {
1242 $ilTabs->addSubTabTarget(
1243 "obj_multilinguality",
1244 $this->
ctrl->getLinkTargetByClass(TranslationGUI::class,
"")
1249 $ilTabs->setSubTabActive($a_active);
1253 public static function _goto(
string $a_target): void
1256 $main_tpl =
$DIC->ui()->mainTemplate();
1258 $ilAccess =
$DIC->access();
1260 $ctrl =
$DIC->ctrl();
1263 $targets = explode(
'_', $a_target);
1265 if (count((array) $targets) > 1) {
1266 $subitem_id = $targets[1];
1269 $ctrl->setParameterByClass(
"ilMediaPoolPresentationGUI",
"ref_id",
$ref_id);
1270 if ($ilAccess->checkAccess(
"read",
"",
$ref_id)) {
1271 $ctrl->setParameterByClass(
"ilMediaPoolPresentationGUI",
"mepitem_id", $subitem_id);
1272 $ctrl->redirectByClass(
"ilMediaPoolPresentationGUI",
"");
1273 } elseif ($ilAccess->checkAccess(
"visible",
"",
$ref_id)) {
1274 $ctrl->redirectByClass(
"ilMediaPoolPresentationGUI",
"infoScreen");
1277 $lng->txt(
"msg_no_perm_read_item"),
1291 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
"showSummary");
1301 $this->
tabs->activateTab(
"info_short");
1302 $ilAccess = $this->access;
1304 if (!$ilAccess->checkAccess(
"visible",
"", $this->ref_id) &&
1305 !$ilAccess->checkAccess(
"read",
"", $this->ref_id) &&
1306 !$ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
1310 if ($this->
ctrl->getCmd() ===
"infoScreen") {
1311 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
"showSummary");
1316 $info->enablePrivateNotes();
1320 $info->addMetaDataSections($this->
object->getId(), 0, $this->object->getType());
1335 ?array $a_files =
null
1338 $ilTabs = $this->tabs;
1340 $ilCtrl = $this->ctrl;
1341 $ilToolbar = $this->toolbar;
1345 $a_files = $this->mep_request->getFiles();
1348 $ilTabs->clearTargets();
1349 $ilTabs->setBackTarget(
1351 $ilCtrl->getLinkTarget($this,
"listMedia")
1354 $this->checkPermission(
"write");
1360 "rename" =>
$lng->txt(
"mep_up_dir_move"),
1361 "copy" =>
$lng->txt(
"mep_up_dir_copy"),
1365 $tb->addInputItem($si);
1366 $tb->setCloseFormTag(
false);
1367 $tb->setFormAction($ilCtrl->getFormAction($this));
1368 $tb->setFormName(
"mep_up_form");
1372 "selectUploadDirFiles",
1375 $tab->setFormName(
"mep_up_form");
1376 $tpl->setContent($tb->getHTML() . $tab->getHTML());
1384 int $a_mpool_ref_id,
1390 $ilCtrl =
$DIC->ctrl();
1392 $internal_gui =
$DIC->mediaPool()
1395 $request = $internal_gui
1396 ->standardRequest();
1400 $tpl->addJavaScript(
"assets/js/ilMediaPool.js");
1402 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"mepitem_id",
"");
1403 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"ref_id", $a_mpool_ref_id);
1404 $tpl->addOnloadCode(
"il.MediaPool.setPreviewUrl('" . $ilCtrl->getLinkTargetByClass(array(
"ilmediapoolpresentationgui",
"ilobjmediapoolgui"),
"showPreview",
"",
false,
false) .
"');");
1405 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"mepitem_id", $request->getItemId());
1406 $ilCtrl->setParameterByClass(
1407 "ilobjmediapoolgui",
1409 $request->getRefId()
1412 $modal = $internal_gui->ui()->factory()->modal()->roundtrip(
1413 $lng->txt(
"preview"),
1414 $internal_gui->ui()->factory()->legacy()->content(
"<iframe id='ilMepPreviewContent'></iframe>")
1416 $html = $internal_gui->ui()->renderer()->render($modal);
1417 $html = str_replace(
1418 "<iframe id='ilMepPreviewContent'",
1419 "<iframe data-signal='" . $modal->getShowSignal()->getId() .
"' id='ilMepPreviewContent'",
1428 $ot = $this->
object->getObjectProperties()->getPropertyTranslations();
1430 if ($ot->getContentTranslationActivated()) {
1431 $format = explode(
"_", $this->mep_request->getExportFormat());
1435 $this->
object->exportXML($opt);
1444 $this->checkPermission(
"write");
1446 $main_tpl = $this->main_tpl;
1448 $form = $this->getBulkUploadForm();
1454 if (is_null($this->bulk_upload_form)) {
1455 $mep_hash = uniqid();
1456 $this->
ctrl->setParameter($this,
"mep_hash", $mep_hash);
1457 $this->bulk_upload_form = $this->gui
1458 ->form([self::class],
'performBulkUpload')
1459 ->section(
"props", $this->
lng->txt(
'mep_bulk_upload'))
1462 $this->
lng->txt(
"mep_media_files"),
1463 \Closure::fromCallable([$this,
'handleUploadResult']),
1470 return $this->bulk_upload_form;
1477 $title = $result->getName();
1480 $mob->setTitle($title);
1481 $mob->setDescription(
"");
1484 $media_item = $mob->addMediaItemFromUpload(
1487 $this->mep_request->getUploadHash()
1511 $med_item = $mob->getMediaItem(
"Standard");
1512 $med_item->determineDuration();
1513 $med_item->update();
1517 $mep_item->setTitle($title);
1518 $mep_item->setType(
"mob");
1519 $mep_item->setForeignId($mob->getId());
1520 $mep_item->create();
1522 $tree = $this->
object->getTree();
1523 $parent = $this->mep_item_id;
1524 $tree->insertNode($mep_item->getId(), $parent);
1538 $item_ids[] = $mob->getId();
1552 HandlerResult::STATUS_OK,
1563 $this->checkPermission(
"write");
1564 $this->
ctrl->setParameter($this,
"mep_hash", $this->mep_request->getUploadHash());
1565 $this->
ctrl->redirect($this,
"editTitlesAndDescriptions");
1570 $ctrl = $this->ctrl;
1573 $this->checkPermission(
"write");
1574 $ctrl->saveParameter($this,
"mep_hash");
1576 $main_tpl = $this->main_tpl;
1579 $this->mep_request->getUploadHash()
1583 $tb->setFormAction($ctrl->getFormAction($this));
1584 $tb->addFormButton(
$lng->txt(
"save"),
"saveTitlesAndDescriptions");
1585 $tb->setOpenFormTag(
true);
1586 $tb->setCloseFormTag(
false);
1587 $tb->setId(
"tb_top");
1589 $html = $tb->getHTML();
1590 foreach ($media_items as $mi) {
1593 $acc->setId(
"acc_" . $mi[
"mob_id"]);
1596 $form = $this->initMediaBulkForm($mi[
"mob_id"], $mob->getTitle());
1597 $acc->addItem($mob->getTitle(), $form->
getHTML());
1599 $html .= $acc->getHTML();
1602 $html .= $tb->getHTML();
1603 $tb->setOpenFormTag(
false);
1604 $tb->setCloseFormTag(
true);
1605 $tb->setId(
"tb_bottom");
1625 $ti->setValue($a_title);
1638 $ctrl = $this->ctrl;
1640 $this->checkPermission(
"write");
1642 $this->mep_request->getUploadHash()
1645 foreach ($media_items as $mi) {
1647 $form = $this->initMediaBulkForm($mi[
"mob_id"], $mob->getTitle());
1649 $title = $form->
getInput(
"title_" . $mi[
"mob_id"]);
1650 $desc = $form->
getInput(
"description_" . $mi[
"mob_id"]);
1651 if (trim($title) !==
"") {
1652 $mob->setTitle($title);
1654 $mob->setDescription($desc);
1657 $this->main_tpl->setOnScreenMessage(
'success',
$lng->txt(
"msg_obj_modified"),
true);
1658 $ctrl->redirect($this,
"listMedia");
1663 ilSession::set(
"mep_move_ids", $this->mep_request->getItemIds());
1664 $this->main_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"mep_move_select_insert"),
true);
1665 $this->
ctrl->redirect($this,
"listMedia");
1670 $target_folder_id = $this->mep_request->getItemId();
1671 $target_tree = $this->domain->tree($this->
object->getId());
1673 $target_folder_id = $target_tree->readRootId();
1677 $this->domain->mediapool($this->
object->getId())->pasteFromClipboard($target_folder_id);
1678 }
catch (Exception
$e) {
1679 $this->main_tpl->setOnScreenMessage(
1681 $this->
lng->txt(
"mep_target_in_source_not_allowed") .
" " . $e->getMessage(),
1686 $this->
ctrl->redirect($this,
"listMedia");
1691 $this->addMobsToPool($mob_ids,
"",
false);
1696 $this->addMobsToPool([$mob_id], $long_desc);
1701 string $long_desc =
"",
1702 bool $redirect =
true,
1703 bool $extract =
false
1705 $ctrl = $this->
ctrl;
1706 $user = $this->user;
1709 foreach ($mob_ids as $mob_id) {
1711 if (!is_null($object)) {
1713 $mep_item->setTitle($object->getTitle());
1714 $mep_item->setType(
"mob");
1715 $mep_item->setForeignId($object->getId());
1716 $mep_item->create();
1718 $parent = $this->mep_item_id;
1719 $tree = $this->
object->getTree();
1720 $tree->insertNode($mep_item->getId(), $parent);
1725 $ctrl->redirect($this,
"listMedia");
1731 $this->addMobsToPool($mob_ids,
"",
true,
true);
1736 $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="")