55 int $a_id_type = self::REPOSITORY_NODE_ID,
56 int $a_parent_node_id = 0
60 $this->mep_request = $DIC->mediaPool()
64 $this->mep_item_id = $this->mep_request->getItemId();
68 $this->
tabs = $DIC->tabs();
69 $this->
locator = $DIC[
"ilLocator"];
70 $this->
help = $DIC[
"ilHelp"];
72 $this->main_tpl = $DIC->ui()->mainTemplate();
74 $this->
upload = $DIC->upload();
79 $this->mode = ($this->mep_request->getMode() !==
"")
80 ? $this->mep_request->getMode()
82 $this->gui = $DIC->mediaPool()->internal()->gui();
99 $tree = $this->
object->getTree();
105 if ($this->
ctrl->getCmd() ===
"explorer") {
106 $this->
ctrl->saveParameter($this, array(
"ref_id"));
108 $this->
ctrl->saveParameter($this, array(
"ref_id",
"mepitem_id"));
110 $this->
ctrl->saveParameter($this, array(
"mep_mode"));
135 $tree = $this->
object->getTree();
138 $next_class = $this->
ctrl->getNextClass($this);
139 $cmd = $this->
ctrl->getCmd();
140 $new_type = $this->mep_request->getNewType();
144 if ($new_type !==
"" && ($cmd !==
"confirmRemove" && $cmd !==
"copyToClipboard" 145 && $cmd !==
"pasteFromClipboard")) {
146 $this->tpl->setPermanentLink(
"mep", $this->ref_id);
150 if ($cmd ===
"create") {
151 switch ($this->mep_request->getNewType()) {
153 $this->
ctrl->redirectByClass(
"ilobjmediaobjectgui",
"create");
157 $this->
ctrl->redirectByClass(
"ilobjfoldergui",
"create");
162 switch ($next_class) {
163 case 'ilobjectmetadatagui':
169 $this->tabs_gui->activateTab(
'meta_data');
171 $this->
ctrl->forwardCommand($md_gui);
172 $this->tpl->printToStdout();
175 case strtolower(ilRepoStandardUploadHandlerGUI::class):
178 $gui = $form->getRepoStandardUploadHandlerGUI(
"media_files");
179 $this->
ctrl->forwardCommand($gui);
182 case 'ilmediapoolpagegui':
186 $ilTabs->clearTargets();
187 $ilCtrl->setReturn($this,
"returnFromItem");
190 $this->mep_request->getOldNr()
192 $mep_page_gui->setPoolGUI($this);
195 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
196 $mep_page_gui->setEnableEditing(
false);
198 $ret = $this->
ctrl->forwardCommand($mep_page_gui);
202 $this->tpl->printToStdout();
205 case "ilobjmediaobjectgui":
207 if ($cmd ===
"create" || $cmd ===
"save" || $cmd ===
"cancel") {
210 $ilObjMediaObjectGUI->setWidthPreset((
int) $this->getMediaPool()->getDefaultWidth());
211 $ilObjMediaObjectGUI->setHeightPreset((
int) $this->getMediaPool()->getDefaultHeight());
216 $ilTabs->setBackTarget(
218 $this->
ctrl->getLinkTarget(
224 if ($this->
ctrl->getCmdClass() ===
"ilinternallinkgui") {
225 $this->
ctrl->setReturn($this,
"explorer");
227 $this->
ctrl->setParameter($this,
"mepitem_id", $ret_obj);
228 $this->
ctrl->setReturn(
232 $this->
ctrl->setParameter($this,
"mepitem_id", $this->mep_item_id);
235 $ilObjMediaObjectGUI->setTabs();
239 $ilObjMediaObjectGUI->setAdvMdRecordObject($this->
object->getRefId(),
"mep",
"mob");
241 $ret = $this->
ctrl->forwardCommand($ilObjMediaObjectGUI);
242 if ($cmd ===
"save") {
243 $object = $ilObjMediaObjectGUI->getObject();
247 $mep_item->setType(
"mob");
254 "ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
255 $this->requested_ref_id .
"&mepitem_id=" . $this->mep_item_id
259 $this->tpl->printToStdout();
262 case "ilobjfoldergui":
266 $this->
ctrl->setReturn($this,
"listMedia");
272 $folder_gui->setFormAction(
274 $this->
ctrl->getFormActionByClass(
"ilobjfoldergui")
276 $folder_gui->createObject();
277 $this->tpl->printToStdout();
282 $folder_gui->setFolderTree(
$tree);
283 $folder_gui->saveObject();
294 $this->
ctrl->setParameter($this,
"foldereditmode",
"1");
295 $folder_gui->setFormAction(
"update", $this->
ctrl->getFormActionByClass(
"ilobjfoldergui"));
296 $folder_gui->editObject();
297 $this->tpl->printToStdout();
308 $this->
ctrl->setReturn($this,
"listMedia");
309 $folder_gui->updateObject();
313 if ($this->mep_request->getFolderEditMode()) {
316 $this->
ctrl->redirect($this,
"listMedia");
321 case "ileditclipboardgui":
324 $this->
ctrl->setReturn($this, $this->mode);
326 $clip_gui->setMultipleSelections(
true);
327 $clip_gui->setInsertButtonTitle(
$lng->
txt(
"mep_copy_to_mep"));
328 $ilTabs->setTabActive(
"clipboard");
329 $this->
ctrl->forwardCommand($clip_gui);
330 $this->tpl->printToStdout();
333 case 'ilinfoscreengui':
337 $this->tpl->printToStdout();
340 case 'ilpermissiongui':
345 $ilTabs->activateTab(
"perm_settings");
346 $this->
ctrl->forwardCommand($perm_gui);
347 $this->tpl->printToStdout();
354 $ilTabs->activateTab(
"export");
356 $exp_gui->addFormat(
"xml");
358 if ($ot->getContentActivated()) {
359 $exp_gui->addFormat(
"xml_master",
"XML (" .
$lng->
txt(
"mep_master_language_only") .
")", $this,
"export");
360 $exp_gui->addFormat(
"xml_masternomedia",
"XML (" .
$lng->
txt(
"mep_master_language_only_no_media") .
")", $this,
"export");
362 $this->
ctrl->forwardCommand($exp_gui);
363 $this->tpl->printToStdout();
366 case "ilfilesystemgui":
370 $ilTabs->clearTargets();
371 $ilTabs->setBackTarget(
373 $ilCtrl->getLinkTarget($this,
"listMedia")
378 if ($mob_import_directory->exists()) {
379 $fs_gui =
new ilFileSystemGUI($mob_import_directory->getAbsolutePath());
381 $fs_gui->setTableId(
"mepud" . $this->
object->getId());
382 $fs_gui->setAllowFileCreation(
false);
383 $fs_gui->setAllowDirectoryCreation(
false);
384 $fs_gui->clearCommands();
387 "selectUploadDirFiles",
388 $this->
lng->txt(
"mep_sel_upload_dir_files"),
392 $this->
ctrl->forwardCommand($fs_gui);
394 $this->tpl->printToStdout();
397 case "ilcommonactiondispatchergui":
399 $this->
ctrl->forwardCommand($gui);
402 case 'ilobjecttranslationgui':
406 $ilTabs->activateTab(
"settings");
409 $transgui->setTitleDescrOnlyMode(
false);
410 $this->
ctrl->forwardCommand($transgui);
411 $this->tpl->printToStdout();
414 case "ilmediapoolimportgui":
418 $ilTabs->activateTab(
"import");
420 $this->
ctrl->forwardCommand($gui);
421 $this->tpl->printToStdout();
424 case "ilmobmultisrtuploadgui":
430 $this->
ctrl->forwardCommand($gui);
431 $this->tpl->printToStdout();
438 $cmd = $this->
ctrl->getCmd(
"listMedia") ?:
"listMedia";
441 $this->tpl->printToStdout();
455 if (
$type !==
"fold") {
456 $tree = $this->
object->getTree();
468 $this->
ctrl->redirectByClass(
"ilobjmediaobjectgui",
"create");
473 $forms = array(self::CFORM_NEW => $this->
initCreateForm($new_type),
482 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
485 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=" . $new_object->
getRefId() .
"&cmd=listMedia");
495 $ni->setSuffix(
"px");
496 $ni->setMaxLength(5);
504 $ni->setMaxLength(5);
506 $ni->setInfo($this->
lng->txt(
"mep_default_width_height_info"));
511 $pres->setTitle($this->
lng->txt(
'obj_presentation'));
515 $obj_service->commonSettings()->legacyForm($a_form, $this->
object)->addTileImage();
519 $feat->setTitle($this->
lng->txt(
'obj_features'));
545 $ilTabs->activateTab(
"settings");
562 if ($ot->getContentActivated()) {
563 $a_values[
"title"] = $ot->getDefaultTitle();
564 $a_values[
"desc"] = $ot->getDefaultDescription();
566 if ($this->getMediaPool()->getDefaultWidth() > 0) {
567 $a_values[
"default_width"] = $this->
object->getDefaultWidth();
569 if ($this->getMediaPool()->getDefaultHeight() > 0) {
570 $a_values[
"default_height"] = $this->
object->getDefaultHeight();
579 if ($ot->getContentActivated()) {
580 $ot->setDefaultTitle($form->
getInput(
'title'));
581 $ot->setDefaultDescription($form->
getInput(
'desc'));
585 $this->getMediaPool()->setDefaultWidth($form->
getInput(
"default_width"));
586 $this->
object->setDefaultHeight($form->
getInput(
"default_height"));
598 $obj_service->commonSettings()->legacyForm($form, $this->
object)->saveTileImage();
613 $ilCtrl->setParameter($this,
"mep_mode",
"listMedia");
617 $ilTabs->setTabActive(
"content");
620 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
621 $ilToolbar->addButton(
623 $ilCtrl->getLinkTarget($this,
"createMediaObject")
627 if ($mset->get(
"mep_activate_pages")) {
628 $ilToolbar->addButton(
629 $lng->
txt(
"mep_create_content_snippet"),
630 $ilCtrl->getLinkTargetByClass([
"ilobjmediapoolgui",
"ilmediapoolpagegui"],
"createMediaPoolPage")
634 $ilToolbar->addButton(
635 $lng->
txt(
"mep_create_folder"),
636 $ilCtrl->getLinkTarget($this,
"createFolderForm")
641 if ($media_upload->exists() && $this->rbac_system->checkAccess(
"visible",
SYSTEM_FOLDER_ID)) {
642 $ilToolbar->addButton(
643 $lng->
txt(
"mep_create_from_upload_dir"),
644 $ilCtrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles")
648 $ilToolbar->addButton(
650 $ilCtrl->getLinkTarget($this,
"bulkUpload")
654 if (is_array($move_ids) && count($move_ids) > 0) {
655 $ilToolbar->addSeparator();
656 $ilToolbar->addButton(
658 $ilCtrl->getLinkTarget($this,
"paste")
663 $mep_table_gui =
new ilMediaPoolTableGUI($this,
"listMedia", $this->getMediaPool(),
"mepitem_id");
670 $exp->toggleExplorerNodeState();
683 $ilCtrl->setParameter($this,
"mep_mode",
"allMedia");
686 $ilTabs->setTabActive(
"content");
692 $this->getMediaPool(),
698 if ($this->mep_request->getForceFilter() > 0) {
699 $mep_table_gui->setTitleFilter(
707 $this->getMediaPool(),
725 $this->getMediaPool(),
730 $mtab->writeFilterToSession();
731 $mtab->resetOffset();
740 $this->getMediaPool(),
745 $mtab->resetFilter();
746 $mtab->resetOffset();
755 $this->tpl->loadStandardTemplate();
764 if ($this->mep_item_id == 0) {
767 $par_id = $this->
object->getPoolTree()->getParentId($this->mep_item_id);
768 if ($par_id != $this->
object->getPoolTree()->getRootId()) {
769 return (
int) $par_id;
785 $mob_id = $item->getForeignId();
787 $this->tpl =
new ilGlobalTemplate(
"tpl.fullscreen.html",
true,
true,
"Services/COPage");
789 $this->tpl->setVariable(
790 "LOCATION_CONTENT_STYLESHEET",
799 $this->tpl->setVariable(
"TITLE",
" - " . $media_obj->getTitle());
809 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
810 $args = array(
'/_xml' =>
$xml,
'/_xsl' => $xsl );
815 $mode = ($this->
ctrl->getCmd() !==
"showPreview")
820 $this->
ctrl->getLinkTarget($this,
"showFullscreen",
"",
false,
false);
821 $params = array(
'mode' => $mode,
'enlarge_path' => $enlarge_path,
822 'link_params' =>
"ref_id=" . $this->requested_ref_id,
'fullscreen_link' => $fullscreen_link,
824 'ref_id' => $this->requested_ref_id,
'pg_frame' => $pg_frame,
'webspace_path' => $wb_path);
825 $output = xslt_process($xh,
"arg:/_xml",
"arg:/_xsl", null, $args,
$params);
828 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
848 $page_gui->setTemplate(
$tpl);
850 $page_gui->setTemplateOutput(
false);
851 $page_gui->setHeader(
"");
852 $ret = $page_gui->showPage(
true);
869 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
871 $page_gui->setPoolGUI($this);
886 switch ($item->getType()) {
916 $ids = $this->mep_request->getItemIds();
917 if (count($ids) === 0) {
918 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
919 $ilCtrl->redirect($this,
"");
924 $cgui->setFormAction($this->
ctrl->getFormAction($this));
925 $cgui->setHeaderText($this->
lng->txt(
"info_remove_sure"));
926 $cgui->setCancel($this->
lng->txt(
"cancel"),
"cancelRemove");
927 $cgui->setConfirm($this->
lng->txt(
"confirm"),
"remove");
935 if (
$type ===
"pg") {
937 if (count($usages) > 0) {
938 $this->main_tpl->setOnScreenMessage(
'failure', sprintf(
$lng->
txt(
"mep_content_snippet_in_use"), $title),
true);
939 $ilCtrl->redirect($this,
"listMedia");
943 if (count($usages) > 0) {
944 $add =
"<div class='small'>" .
$lng->
txt(
"mep_content_snippet_used_in_older_versions") .
"</div>";
952 $cgui->addItem(
"id[]", $obj_id, $caption);
955 $this->tpl->setContent($cgui->getHTML());
967 $ilCtrl->setParameterByClass(
968 "ileditclipboardgui",
970 rawurlencode($ilCtrl->getLinkTarget(
972 "insertFromClipboard",
978 $ilCtrl->redirectByClass(
"ilEditClipboardGUI",
"getObject");
990 $not_inserted = array();
991 foreach ($ids as $id2) {
992 $id = explode(
":", $id2);
996 if (
$type ===
"mob") {
1002 $item->setType(
"mob");
1003 $item->setForeignId(
$id);
1006 if ($item->getId() > 0) {
1011 if (
$type ===
"incl") {
1020 $item->setType(
"pg");
1023 if ($item->getId() > 0) {
1028 $page->setId($item->getId());
1029 $page->setParentId($this->
object->getId());
1030 $page->create(
false);
1033 $original->copy($page->getId(), $page->getParentType(), $page->getParentId(),
true);
1038 if (count($not_inserted) > 0) {
1039 $this->main_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"mep_not_insert_already_exist") .
"<br>" .
1040 implode(
"<br>", $not_inserted),
true);
1042 $this->
ctrl->redirect($this, $this->mode);
1051 $this->
ctrl->redirect($this, $this->mode);
1054 public function remove():
void 1058 $ids = $this->mep_request->getItemIds();
1060 $this->
object->deleteChild($obj_id);
1063 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"cont_obj_removed"),
true);
1064 $this->
ctrl->redirect($this, $this->mode);
1077 $ids = $this->mep_request->getItemIds();
1078 if (count($ids) === 0) {
1079 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
1080 $this->
ctrl->redirect($this, $this->mode);
1085 if (
$type ===
"fold") {
1086 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"cont_cant_copy_folders"),
true);
1087 $this->
ctrl->redirect($this, $this->mode);
1090 foreach ($ids as $obj_id) {
1093 if (
$type ===
"mob") {
1094 $ilUser->addObjectToClipboard($fid,
"mob",
"");
1096 if (
$type ===
"pg") {
1097 $ilUser->addObjectToClipboard($obj_id,
"incl",
"");
1100 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"copied_to_clipboard"),
true);
1101 $this->
ctrl->redirect($this, $this->mode);
1112 $tree = $this->
object->getTree();
1115 foreach (
$path as $node) {
1117 $this->
ctrl->setParameter($this,
"mepitem_id",
"");
1119 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId())) {
1120 $link = $this->
ctrl->getLinkTarget($this,
"listMedia");
1121 } elseif ($ilAccess->checkAccess(
"visible",
"", $this->object->getRefId())) {
1122 $link = $this->
ctrl->getLinkTarget($this,
"infoScreen");
1124 $title = $this->
object->getTitle();
1125 $this->
ctrl->setParameter($this,
"mepitem_id", $this->mep_item_id);
1126 $ilLocator->addItem($title, $link,
"", $this->requested_ref_id);
1166 $this->
form->setValuesByArray($values);
1181 if ($this->
form->checkInput()) {
1183 $this->main_tpl->setOnScreenMessage(
'success',
$lng->
txt(
"mep_folder_created"),
true);
1185 $ilCtrl->redirect($this,
"listMedia");
1188 $this->
form->setValuesByPost();
1201 if ($this->
form->checkInput()) {
1203 $item->setTitle($this->
form->getInput(
"title"));
1205 $this->main_tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
1206 $ilCtrl->setParameter(
1209 $this->
object->getTree()->getParentId($this->mep_item_id)
1211 $ilCtrl->redirect($this,
"listMedia");
1214 $this->
form->setValuesByPost();
1231 $ti->setMaxLength(128);
1232 $ti->setRequired(
true);
1233 $this->
form->addItem($ti);
1236 if ($a_mode ===
"create") {
1237 $this->
form->addCommandButton(
"saveFolder",
$lng->
txt(
"save"));
1238 $this->
form->addCommandButton(
"cancelSave",
$lng->
txt(
"cancel"));
1239 $this->
form->setTitle(
$lng->
txt(
"mep_new_folder"));
1241 $this->
form->addCommandButton(
"updateFolder",
$lng->
txt(
"save"));
1242 $this->
form->addCommandButton(
"cancelFolderUpdate",
$lng->
txt(
"cancel"));
1243 $this->
form->setTitle(
$lng->
txt(
"mep_edit_folder"));
1246 $this->
form->setFormAction($ilCtrl->getFormAction($this));
1255 $this->
object->getTree()->getParentId($this->mep_item_id)
1257 $ilCtrl->redirect($this,
"listMedia");
1263 $ilCtrl->
redirect($this,
"listMedia");
1280 $ilTabs->addSubTab(
"content", $this->
lng->txt(
"objs_fold"), $this->
ctrl->getLinkTarget($this,
""));
1283 $ilTabs->addSubTab(
"mep_all_mobs", $this->
lng->txt(
"mep_all_mobs"), $this->
ctrl->getLinkTarget($this,
"allMedia"));
1284 $ilCtrl->setParameter($this,
"mepitem_id", $this->mep_item_id);
1286 if ($ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
1289 $this->
lng->txt(
"mep_media_subtitles"),
1290 $ilCtrl->getLinkTargetByClass(
"ilmobmultisrtuploadgui",
"")
1294 $ilTabs->activateSubTab($a_active);
1305 if ($ilAccess->checkAccess(
'read',
'', $this->ref_id) ||
1306 $ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
1307 $ilTabs->addTab(
"content", $this->
lng->txt(
"mep_content"), $this->
ctrl->getLinkTarget($this,
""));
1311 if ($ilAccess->checkAccess(
'visible',
'', $this->ref_id) ||
1312 $ilAccess->checkAccess(
'read',
'', $this->ref_id) ||
1313 $ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
1314 $force_active = $this->
ctrl->getNextClass() ===
"ilinfoscreengui" 1315 || strtolower($this->
ctrl->getCmdClass()) ===
"ilnotegui";
1318 $this->
ctrl->getLinkTargetByClass(
1319 array(
"ilobjmediapoolgui",
"ilinfoscreengui"),
1322 array(
"showSummary",
"infoScreen"),
1329 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1332 $this->
ctrl->getLinkTarget($this,
"edit"),
1334 array(
"",
"ilobjmediapoolgui")
1337 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1340 $this->
ctrl->getLinkTarget($this,
"openClipboard"),
1342 "ileditclipboardgui" 1347 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1350 $mdtab = $mdgui->getTab();
1356 "ilobjectmetadatagui" 1361 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1364 $this->
ctrl->getLinkTargetByClass(
"ilexportgui",
""),
1371 $this->
ctrl->getLinkTargetByClass(
"ilmediapoolimportgui",
""),
1373 "ilmediapoolimportgui" 1377 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->object->getRefId())) {
1380 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
1381 array(
"perm",
"info",
"owner"),
1394 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1398 $this->
ctrl->getLinkTarget($this,
"edit")
1402 if ($mset->get(
"mep_activate_pages")) {
1403 $ilTabs->addSubTabTarget(
1404 "obj_multilinguality",
1405 $this->
ctrl->getLinkTargetByClass(
"ilobjecttranslationgui",
"")
1410 $ilTabs->setSubTabActive($a_active);
1414 public static function _goto(
string $a_target): void
1417 $main_tpl = $DIC->ui()->mainTemplate();
1419 $ilAccess = $DIC->access();
1420 $lng = $DIC->language();
1421 $ctrl = $DIC->ctrl();
1424 $targets = explode(
'_', $a_target);
1426 if (count((array) $targets) > 1) {
1427 $subitem_id = $targets[1];
1431 if ($ilAccess->checkAccess(
"read",
"",
$ref_id)) {
1434 } elseif ($ilAccess->checkAccess(
"visible",
"",
$ref_id)) {
1438 $lng->
txt(
"msg_no_perm_read_item"),
1452 $this->
ctrl->setCmd(
"showSummary");
1453 $this->
ctrl->setCmdClass(
"ilinfoscreengui");
1464 $this->
tabs->activateTab(
"info_short");
1467 if (!$ilAccess->checkAccess(
"visible",
"", $this->ref_id) &&
1468 !$ilAccess->checkAccess(
"read",
"", $this->ref_id) &&
1469 !$ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
1473 if ($this->
ctrl->getCmd() ===
"infoScreen") {
1474 $this->
ctrl->setCmd(
"showSummary");
1475 $this->
ctrl->setCmdClass(
"ilinfoscreengui");
1480 $info->enablePrivateNotes();
1484 $info->addMetaDataSections($this->
object->getId(), 0, $this->
object->getType());
1487 $this->
ctrl->forwardCommand($info);
1499 ?array $a_files = null
1509 $a_files = $this->mep_request->getFiles();
1512 $ilTabs->clearTargets();
1513 $ilTabs->setBackTarget(
1515 $ilCtrl->getLinkTarget($this,
"listMedia")
1524 "rename" =>
$lng->
txt(
"mep_up_dir_move"),
1525 "copy" =>
$lng->
txt(
"mep_up_dir_copy"),
1528 $si->setOptions($options);
1529 $tb->addInputItem($si);
1530 $tb->setCloseFormTag(
false);
1531 $tb->setFormAction($ilCtrl->getFormAction($this));
1532 $tb->setFormName(
"mep_up_form");
1536 "selectUploadDirFiles",
1539 $tab->setFormName(
"mep_up_form");
1553 $upload_dir = $mob_import_directory->getAbsolutePath();
1555 $files = $this->mep_request->getFiles();
1557 foreach ($files as
$f) {
1558 $f = str_replace(
"..",
"", $f);
1559 $fullpath = $upload_dir .
"/" .
$f;
1561 $mob->setTitle(basename($fullpath));
1562 $mob->setDescription(
"");
1567 $mob->createDirectory();
1571 $mob->addMediaItem($media_item);
1572 $media_item->setPurpose(
"Standard");
1574 $file = $mob_dir .
"/" . basename($fullpath);
1579 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"file_is_infected") .
"<br />" . $vir[1],
true);
1580 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
1581 $this->requested_ref_id .
"&mepitem_id=" . $this->mep_item_id);
1584 switch ($this->mep_request->getFileAction()) {
1586 rename($fullpath, $file);
1590 copy($fullpath, $file);
1599 $media_item->setFormat(
$format);
1601 $media_item->setLocationType(
"LocalFile");
1603 $mob->setDescription(
$format);
1610 $media_item->getLocation(),
1616 $media_item->setWidth($wh[
"width"]);
1617 $media_item->setHeight($wh[
"height"]);
1619 $media_item->setHAlign(
"Left");
1626 $mep_item->setTitle($mob->getTitle());
1627 $mep_item->setType(
"mob");
1628 $mep_item->setForeignId($mob->getId());
1629 $mep_item->create();
1631 $tree = $this->
object->getTree();
1636 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
1637 $this->requested_ref_id .
"&mepitem_id=" . $this->mep_item_id);
1644 int $a_mpool_ref_id,
1650 $ilCtrl = $DIC->ctrl();
1651 $lng = $DIC->language();
1655 ->standardRequest();
1661 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"mepitem_id",
"");
1662 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"ref_id", $a_mpool_ref_id);
1663 $tpl->addOnloadCode(
"il.MediaPool.setPreviewUrl('" . $ilCtrl->getLinkTargetByClass(array(
"ilmediapoolpresentationgui",
"ilobjmediapoolgui"),
"showPreview",
"",
false,
false) .
"');");
1664 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"mepitem_id",
$request->getItemId());
1665 $ilCtrl->setParameterByClass(
1666 "ilobjmediapoolgui",
1672 $modal->setHeading(
$lng->
txt(
"preview"));
1673 $modal->setId(
"ilMepPreview");
1675 $modal->setBody(
"<iframe id='ilMepPreviewContent'></iframe>");
1677 return $modal->getHTML();
1684 if ($ot->getContentActivated()) {
1685 $format = explode(
"_", $this->mep_request->getExportFormat());
1689 $this->
object->exportXML($opt);
1708 if (is_null($this->bulk_upload_form)) {
1709 $mep_hash = uniqid();
1710 $this->
ctrl->setParameter($this,
"mep_hash", $mep_hash);
1711 $this->bulk_upload_form = $this->gui
1712 ->form(self::class,
'performBulkUpload')
1713 ->section(
"props", $this->
lng->txt(
'mep_bulk_upload'))
1716 $this->
lng->txt(
"mep_media_files"),
1717 \Closure::fromCallable([$this,
'handleUploadResult']),
1734 $mob->setTitle($title);
1735 $mob->setDescription(
"");
1738 $mob->createDirectory();
1740 $mob->addMediaItem($media_item);
1741 $media_item->setPurpose(
"Standard");
1745 $file = $mob_dir .
"/" . $file_name;
1756 $mep_item->setTitle($title);
1757 $mep_item->setType(
"mob");
1758 $mep_item->setForeignId($mob->getId());
1759 $mep_item->create();
1761 $tree = $this->
object->getTree();
1770 $media_item->setFormat(
$format);
1772 $media_item->setLocationType(
"LocalFile");
1773 $media_item->setUploadHash($this->mep_request->getUploadHash());
1776 $item_ids[] = $mob->getId();
1779 $mob->generatePreviewPic(320, 240);
1783 $med_item->determineDuration();
1784 $med_item->update();
1788 HandlerResult::STATUS_OK,
1800 $this->
ctrl->setParameter($this,
"mep_hash", $this->mep_request->getUploadHash());
1801 $this->
ctrl->redirect($this,
"editTitlesAndDescriptions");
1815 $this->mep_request->getUploadHash()
1820 $tb->addFormButton(
$lng->
txt(
"save"),
"saveTitlesAndDescriptions");
1821 $tb->setOpenFormTag(
true);
1822 $tb->setCloseFormTag(
false);
1823 $tb->setId(
"tb_top");
1825 $html = $tb->getHTML();
1826 foreach ($media_items as $mi) {
1829 $acc->setId(
"acc_" . $mi[
"mob_id"]);
1833 $acc->addItem($mob->getTitle(), $form->
getHTML());
1835 $html .= $acc->getHTML();
1838 $html .= $tb->getHTML();
1839 $tb->setOpenFormTag(
false);
1840 $tb->setCloseFormTag(
true);
1841 $tb->setId(
"tb_bottom");
1861 $ti->setValue($a_title);
1878 $this->mep_request->getUploadHash()
1881 foreach ($media_items as $mi) {
1885 $title = $form->
getInput(
"title_" . $mi[
"mob_id"]);
1886 $desc = $form->
getInput(
"description_" . $mi[
"mob_id"]);
1887 if (trim($title) !==
"") {
1888 $mob->setTitle($title);
1890 $mob->setDescription($desc);
1893 $this->main_tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
1899 ilSession::set(
"mep_move_ids", $this->mep_request->getItemIds());
1900 $this->main_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"mep_move_select_insert"),
true);
1901 $this->
ctrl->redirect($this,
"listMedia");
1904 protected function paste():
void 1907 $target_tree = $this->
object->getTree();
1911 if (is_array($move_ids)) {
1912 foreach ($move_ids as
$id) {
1915 $parent_id = $this->mep_request->getItemId();
1921 foreach ($pool_ids as $pool_id) {
1923 $source_tree = $pool->getTree();
1926 $subnodes = $source_tree->getSubtree($source_tree->getNodeData($id));
1927 if ($pool_id == $target_tree->getTreeId()) {
1929 foreach ($subnodes as $subnode) {
1931 $this->main_tpl->setOnScreenMessage(
1933 $this->
lng->txt(
"mep_target_in_source_not_allowed"),
1937 $this->
ctrl->redirect($this,
"listMedia");
1941 $source_tree->deleteTree($source_tree->getNodeData($id));
1945 foreach ($subnodes as $node) {
1946 if ($node[
"child"] != $id) {
1947 $target_tree->insertNode($node[
"child"], $node[
"parent"]);
1953 $this->
ctrl->redirect($this,
"listMedia");
printToStdout(string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)
static getWebspaceDir(string $mode="filesystem")
get webspace directory
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
static get(string $a_var)
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
initImportForm(string $new_type)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getLogger(string $a_component_id)
Get component logger.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
New implementation of ilObjectGUI.
special template class to simplify handling of ITX/PEAR
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static virusHandling(string $a_file, string $a_orig_name='', bool $a_clean=true)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setParameterByClass(string $a_class, string $a_parameter, $a_value)
static lookupTitle(int $a_page_id)
prepareOutput(bool $show_sub_objects=true)
loadLanguageModule(string $a_module)
Load language module.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
static getStyleSheetLocation(string $mode="output", string $a_css_name="", string $a_css_location="")
get full style sheet file name (path inclusive) of current user
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...
addExternalEditFormCustom(ilPropertyFormGUI $form)
static _lookupObjId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static renameExecutables(string $a_dir)
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...
setAdvMdRecordObject(int $a_adv_ref_id, string $a_adv_type, string $a_adv_subtype="-")
Set object, that defines the adv md records being used.
static getUsages(string $a_pc_type, int $a_pc_id, bool $a_incl_hist=true)
Get usages.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
static _lookupTitle(int $obj_id)
setContent(string $a_html)
Sets content for standard template.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setCreationMode(bool $mode=true)
ServerRequestInterface $request
setScreenIdComponent(string $a_comp)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
moveOneFileTo(UploadResult $uploadResult, string $destination, int $location=Location::STORAGE, string $file_name='', bool $override_existing=false)
Moves a single File (the attributes, metadata and upload-status of which are contained in UploadResul...
static getInstance(int $obj_id)
ilGlobalTemplateInterface $tpl
Class BasicHandlerResult.
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.
getParentId(int $a_node_id)
get parent id of given node
static getSyntaxStylePath()
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
form( $class_path, string $cmd)
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
setPostDirPath(bool $a_val)
static redirect(string $a_script)
ilObjectService $object_service
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
__construct(Container $dic, ilPlugin $plugin)
initCreateForm(string $new_type)
This class represents a text area property in a property form.
saveParameter(object $a_gui_obj, $a_parameter)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
File System Explorer GUI class.
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
getFormAction(object $a_gui_obj, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addHeaderAction()
Add header action menu.
static clear(string $a_var)
Class ilMediaPoolPage GUI class.
static set(string $a_var, $a_val)
Set a value.
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...
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.