40 protected \ILIAS\MediaPool\InternalDomainService
$domain;
41 protected \ILIAS\COPage\Xsl\XslManager
$xsl;
57 int $a_id_type = self::REPOSITORY_NODE_ID,
58 int $a_parent_node_id = 0
62 $this->mep_request = $DIC->mediaPool()
66 $this->mep_item_id = $this->mep_request->getItemId();
70 $this->
tabs = $DIC->tabs();
71 $this->
locator = $DIC[
"ilLocator"];
72 $this->
help = $DIC[
"ilHelp"];
74 $this->main_tpl = $DIC->ui()->mainTemplate();
76 $this->
upload = $DIC->upload();
81 $this->mode = ($this->mep_request->getMode() !==
"")
82 ? $this->mep_request->getMode()
84 $this->gui = $DIC->mediaPool()->internal()->gui();
85 $this->domain = $DIC->mediaPool()->internal()->domain();
86 $this->xsl = $DIC->copage()->internal()->domain()->xsl();
103 $tree = $this->
object->getTree();
109 if ($this->
ctrl->getCmd() ===
"explorer") {
110 $this->
ctrl->saveParameter($this, array(
"ref_id"));
112 $this->
ctrl->saveParameter($this, array(
"ref_id",
"mepitem_id"));
114 $this->
ctrl->saveParameter($this, array(
"mep_mode"));
139 $tree = $this->
object->getTree();
142 $next_class = $this->
ctrl->getNextClass($this);
143 $cmd = $this->
ctrl->getCmd();
144 $new_type = $this->mep_request->getNewType();
148 if ($new_type !==
"" && ($cmd !==
"confirmRemove" && $cmd !==
"copyToClipboard" 149 && $cmd !==
"pasteFromClipboard")) {
150 $this->tpl->setPermanentLink(
"mep", $this->ref_id);
154 if ($cmd ===
"create") {
155 switch ($this->mep_request->getNewType()) {
157 $this->
ctrl->redirectByClass(
"ilobjmediaobjectgui",
"create");
161 $this->
ctrl->redirectByClass(
"ilobjfoldergui",
"create");
166 switch ($next_class) {
167 case 'ilobjectmetadatagui':
173 $this->tabs_gui->activateTab(
'meta_data');
175 $this->
ctrl->forwardCommand($md_gui);
176 $this->tpl->printToStdout();
179 case strtolower(ilRepoStandardUploadHandlerGUI::class):
182 $gui = $form->getRepoStandardUploadHandlerGUI(
"media_files");
183 $this->
ctrl->forwardCommand($gui);
186 case 'ilmediapoolpagegui':
190 $ilTabs->clearTargets();
191 $ilCtrl->setReturn($this,
"returnFromItem");
194 $this->mep_request->getOldNr()
196 $mep_page_gui->setPoolGUI($this);
199 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
200 $mep_page_gui->setEnableEditing(
false);
202 $ret = $this->
ctrl->forwardCommand($mep_page_gui);
206 $this->tpl->printToStdout();
209 case "ilobjmediaobjectgui":
211 if ($cmd ===
"create" || $cmd ===
"save" || $cmd ===
"cancel") {
214 $ilObjMediaObjectGUI->setWidthPreset((
int) $this->getMediaPool()->getDefaultWidth());
215 $ilObjMediaObjectGUI->setHeightPreset((
int) $this->getMediaPool()->getDefaultHeight());
220 $ilTabs->setBackTarget(
222 $this->
ctrl->getLinkTarget(
228 if ($this->
ctrl->getCmdClass() ===
"ilinternallinkgui") {
229 $this->
ctrl->setReturn($this,
"explorer");
231 $this->
ctrl->setParameter($this,
"mepitem_id", $ret_obj);
232 $this->
ctrl->setReturn(
236 $this->
ctrl->setParameter($this,
"mepitem_id", $this->mep_item_id);
239 $ilObjMediaObjectGUI->setTabs();
243 $ilObjMediaObjectGUI->setAdvMdRecordObject($this->
object->getRefId(),
"mep",
"mob");
245 $ret = $this->
ctrl->forwardCommand($ilObjMediaObjectGUI);
246 if ($cmd ===
"save") {
247 $object = $ilObjMediaObjectGUI->getObject();
251 $mep_item->setType(
"mob");
258 "ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
259 $this->requested_ref_id .
"&mepitem_id=" . $this->mep_item_id
263 $this->tpl->printToStdout();
266 case "ilmediacreationgui":
269 $this->
ctrl->setReturn($this,
"listMedia");
275 },
function ($mob_id, $long_desc) {
277 },
function ($mob_ids) {
279 },
function ($mob_id) {
281 },
function ($mob_id) {
284 $this->
ctrl->forwardCommand($creation);
285 $this->tpl->printToStdout();
289 case "ilobjfoldergui":
293 $this->
ctrl->setReturn($this,
"listMedia");
299 $folder_gui->setFormAction(
301 $this->
ctrl->getFormActionByClass(
"ilobjfoldergui")
303 $folder_gui->createObject();
304 $this->tpl->printToStdout();
309 $folder_gui->setFolderTree(
$tree);
310 $folder_gui->saveObject();
321 $this->
ctrl->setParameter($this,
"foldereditmode",
"1");
322 $folder_gui->setFormAction(
"update", $this->
ctrl->getFormActionByClass(
"ilobjfoldergui"));
323 $folder_gui->editObject();
324 $this->tpl->printToStdout();
335 $this->
ctrl->setReturn($this,
"listMedia");
336 $folder_gui->updateObject();
340 if ($this->mep_request->getFolderEditMode()) {
343 $this->
ctrl->redirect($this,
"listMedia");
348 case "ileditclipboardgui":
351 $this->
ctrl->setReturn($this, $this->mode);
353 $clip_gui->setMultipleSelections(
true);
354 $clip_gui->setInsertButtonTitle(
$lng->
txt(
"mep_copy_to_mep"));
355 $ilTabs->setTabActive(
"clipboard");
356 $this->
ctrl->forwardCommand($clip_gui);
357 $this->tpl->printToStdout();
360 case 'ilinfoscreengui':
364 $this->tpl->printToStdout();
367 case 'ilpermissiongui':
372 $ilTabs->activateTab(
"perm_settings");
373 $this->
ctrl->forwardCommand($perm_gui);
374 $this->tpl->printToStdout();
381 $ilTabs->activateTab(
"export");
383 $exp_gui->addFormat(
"xml");
385 if ($ot->getContentActivated()) {
386 $exp_gui->addFormat(
"xml_master",
"XML (" .
$lng->
txt(
"mep_master_language_only") .
")", $this,
"export");
387 $exp_gui->addFormat(
"xml_masternomedia",
"XML (" .
$lng->
txt(
"mep_master_language_only_no_media") .
")", $this,
"export");
389 $this->
ctrl->forwardCommand($exp_gui);
390 $this->tpl->printToStdout();
393 case "ilfilesystemgui":
397 $ilTabs->clearTargets();
398 $ilTabs->setBackTarget(
400 $ilCtrl->getLinkTarget($this,
"listMedia")
405 if ($mob_import_directory->exists()) {
406 $fs_gui =
new ilFileSystemGUI($mob_import_directory->getAbsolutePath());
408 $fs_gui->setTableId(
"mepud" . $this->
object->getId());
409 $fs_gui->setAllowFileCreation(
false);
410 $fs_gui->setAllowDirectoryCreation(
false);
411 $fs_gui->clearCommands();
414 "selectUploadDirFiles",
415 $this->
lng->txt(
"mep_sel_upload_dir_files"),
419 $this->
ctrl->forwardCommand($fs_gui);
421 $this->tpl->printToStdout();
424 case "ilcommonactiondispatchergui":
426 $this->
ctrl->forwardCommand($gui);
429 case 'ilobjecttranslationgui':
433 $ilTabs->activateTab(
"settings");
436 $transgui->setTitleDescrOnlyMode(
false);
437 $this->
ctrl->forwardCommand($transgui);
438 $this->tpl->printToStdout();
441 case "ilmediapoolimportgui":
445 $ilTabs->activateTab(
"import");
447 $this->
ctrl->forwardCommand($gui);
448 $this->tpl->printToStdout();
451 case "ilmobmultisrtuploadgui":
457 $this->
ctrl->forwardCommand($gui);
458 $this->tpl->printToStdout();
465 $cmd = $this->
ctrl->getCmd(
"listMedia") ?:
"listMedia";
468 $this->tpl->printToStdout();
482 if (
$type !==
"fold") {
483 $tree = $this->
object->getTree();
495 $this->
ctrl->redirectByClass(
"ilobjmediaobjectgui",
"create");
500 $forms = array(self::CFORM_NEW => $this->
initCreateForm($new_type),
509 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
512 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=" . $new_object->
getRefId() .
"&cmd=listMedia");
522 $ni->setSuffix(
"px");
523 $ni->setMaxLength(5);
529 $ni->setSuffix(
"px");
531 $ni->setMaxLength(5);
533 $ni->setInfo($this->
lng->txt(
"mep_default_width_height_info"));
538 $pres->setTitle($this->
lng->txt(
'obj_presentation'));
542 $obj_service->commonSettings()->legacyForm($a_form, $this->
object)->addTileImage();
546 $feat->setTitle($this->
lng->txt(
'obj_features'));
572 $ilTabs->activateTab(
"settings");
589 if ($ot->getContentActivated()) {
590 $a_values[
"title"] = $ot->getDefaultTitle();
591 $a_values[
"desc"] = $ot->getDefaultDescription();
593 if ($this->getMediaPool()->getDefaultWidth() > 0) {
594 $a_values[
"default_width"] = $this->
object->getDefaultWidth();
596 if ($this->getMediaPool()->getDefaultHeight() > 0) {
597 $a_values[
"default_height"] = $this->
object->getDefaultHeight();
606 if ($ot->getContentActivated()) {
607 $ot->setDefaultTitle($form->
getInput(
'title'));
608 $ot->setDefaultDescription($form->
getInput(
'desc'));
612 $this->getMediaPool()->setDefaultWidth($form->
getInput(
"default_width"));
613 $this->
object->setDefaultHeight($form->
getInput(
"default_height"));
625 $obj_service->commonSettings()->legacyForm($form, $this->
object)->saveTileImage();
640 $ilCtrl->setParameter($this,
"mep_mode",
"listMedia");
644 $ilTabs->setTabActive(
"content");
647 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
648 $ilToolbar->addButton(
650 $ilCtrl->getLinkTargetByClass(
"ilMediaCreationGUI",
"")
654 if ($mset->get(
"mep_activate_pages")) {
655 $ilToolbar->addButton(
656 $lng->
txt(
"mep_create_content_snippet"),
657 $ilCtrl->getLinkTargetByClass([
"ilobjmediapoolgui",
"ilmediapoolpagegui"],
"createMediaPoolPage")
661 $ilToolbar->addButton(
662 $lng->
txt(
"mep_create_folder"),
663 $ilCtrl->getLinkTarget($this,
"createFolderForm")
668 if ($media_upload->exists() && $this->rbac_system->checkAccess(
"visible",
SYSTEM_FOLDER_ID)) {
669 $ilToolbar->addButton(
670 $lng->
txt(
"mep_create_from_upload_dir"),
671 $ilCtrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles")
675 $ilToolbar->addButton(
677 $ilCtrl->getLinkTarget($this,
"bulkUpload")
681 if (is_array($move_ids) && count($move_ids) > 0) {
682 $ilToolbar->addSeparator();
683 $ilToolbar->addButton(
685 $ilCtrl->getLinkTarget($this,
"paste")
690 $mep_table_gui =
new ilMediaPoolTableGUI($this,
"listMedia", $this->getMediaPool(),
"mepitem_id");
697 $exp->toggleExplorerNodeState();
710 $ilCtrl->setParameter($this,
"mep_mode",
"allMedia");
713 $ilTabs->setTabActive(
"content");
719 $this->getMediaPool(),
725 if ($this->mep_request->getForceFilter() > 0) {
726 $mep_table_gui->setTitleFilter(
734 $this->getMediaPool(),
752 $this->getMediaPool(),
757 $mtab->writeFilterToSession();
758 $mtab->resetOffset();
767 $this->getMediaPool(),
772 $mtab->resetFilter();
773 $mtab->resetOffset();
782 $this->tpl->loadStandardTemplate();
791 if ($this->mep_item_id == 0) {
794 $par_id = $this->
object->getPoolTree()->getParentId($this->mep_item_id);
795 if ($par_id != $this->
object->getPoolTree()->getRootId()) {
796 return (
int) $par_id;
812 $mob_id = $item->getForeignId();
814 $this->tpl =
new ilGlobalTemplate(
"tpl.fullscreen.html",
true,
true,
"Services/COPage");
816 $this->tpl->setVariable(
817 "LOCATION_CONTENT_STYLESHEET",
826 $this->tpl->setVariable(
"TITLE",
" - " . $media_obj->getTitle());
838 $mode = ($this->
ctrl->getCmd() !==
"showPreview")
843 $this->
ctrl->getLinkTarget($this,
"showFullscreen",
"",
false,
false);
844 $params = array(
'mode' => $mode,
'enlarge_path' => $enlarge_path,
845 'link_params' =>
"ref_id=" . $this->requested_ref_id,
'fullscreen_link' => $fullscreen_link,
847 'ref_id' => $this->requested_ref_id,
'pg_frame' => $pg_frame,
'webspace_path' => $wb_path);
848 $output = $this->xsl->process($xml,
$params);
851 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
871 $page_gui->setTemplate(
$tpl);
873 $page_gui->setTemplateOutput(
false);
874 $page_gui->setHeader(
"");
875 $ret = $page_gui->showPage(
true);
892 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
894 $page_gui->setPoolGUI($this);
909 switch ($item->getType()) {
939 $ids = $this->mep_request->getItemIds();
940 if (count($ids) === 0) {
941 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
942 $ilCtrl->redirect($this,
"");
947 $cgui->setFormAction($this->
ctrl->getFormAction($this));
948 $cgui->setHeaderText($this->
lng->txt(
"info_remove_sure"));
949 $cgui->setCancel($this->
lng->txt(
"cancel"),
"cancelRemove");
950 $cgui->setConfirm($this->
lng->txt(
"confirm"),
"remove");
958 if (
$type ===
"pg") {
960 if (count($usages) > 0) {
961 $this->main_tpl->setOnScreenMessage(
'failure', sprintf(
$lng->
txt(
"mep_content_snippet_in_use"), $title),
true);
962 $ilCtrl->redirect($this,
"listMedia");
966 if (count($usages) > 0) {
967 $add =
"<div class='small'>" .
$lng->
txt(
"mep_content_snippet_used_in_older_versions") .
"</div>";
975 $cgui->addItem(
"id[]", $obj_id, $caption);
978 $this->tpl->setContent($cgui->getHTML());
990 $ilCtrl->setParameterByClass(
991 "ileditclipboardgui",
993 rawurlencode($ilCtrl->getLinkTarget(
995 "insertFromClipboard",
1001 $ilCtrl->redirectByClass(
"ilEditClipboardGUI",
"getObject");
1012 $this->domain->mediapool($this->
object->getId())
1013 ->copySelectedFromEditClipboard($this->mep_item_id);
1020 $this->
ctrl->redirect($this, $this->mode);
1029 $this->
ctrl->redirect($this, $this->mode);
1032 public function remove():
void 1036 $ids = $this->mep_request->getItemIds();
1038 $this->
object->deleteChild($obj_id);
1041 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"cont_obj_removed"),
true);
1042 $this->
ctrl->redirect($this, $this->mode);
1055 $ids = $this->mep_request->getItemIds();
1056 if (count($ids) === 0) {
1057 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
1058 $this->
ctrl->redirect($this, $this->mode);
1063 if (
$type ===
"fold") {
1064 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"cont_cant_copy_folders"),
true);
1065 $this->
ctrl->redirect($this, $this->mode);
1068 foreach ($ids as $obj_id) {
1071 if (
$type ===
"mob") {
1072 $ilUser->addObjectToClipboard($fid,
"mob",
"");
1074 if (
$type ===
"pg") {
1075 $ilUser->addObjectToClipboard($obj_id,
"incl",
"");
1078 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"copied_to_clipboard"),
true);
1079 $this->
ctrl->redirect($this, $this->mode);
1090 $tree = $this->
object->getTree();
1093 foreach (
$path as $node) {
1095 $this->
ctrl->setParameter($this,
"mepitem_id",
"");
1097 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId())) {
1098 $link = $this->
ctrl->getLinkTarget($this,
"listMedia");
1099 } elseif ($ilAccess->checkAccess(
"visible",
"", $this->object->getRefId())) {
1100 $link = $this->
ctrl->getLinkTarget($this,
"infoScreen");
1102 $title = $this->
object->getTitle();
1103 $this->
ctrl->setParameter($this,
"mepitem_id", $this->mep_item_id);
1104 $ilLocator->addItem($title, $link,
"", $this->requested_ref_id);
1144 $this->
form->setValuesByArray($values);
1159 if ($this->
form->checkInput()) {
1161 $this->main_tpl->setOnScreenMessage(
'success',
$lng->
txt(
"mep_folder_created"),
true);
1163 $ilCtrl->redirect($this,
"listMedia");
1166 $this->
form->setValuesByPost();
1179 if ($this->
form->checkInput()) {
1181 $item->setTitle($this->
form->getInput(
"title"));
1183 $this->main_tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
1184 $ilCtrl->setParameter(
1187 $this->
object->getTree()->getParentId($this->mep_item_id)
1189 $ilCtrl->redirect($this,
"listMedia");
1192 $this->
form->setValuesByPost();
1209 $ti->setMaxLength(128);
1210 $ti->setRequired(
true);
1211 $this->
form->addItem($ti);
1214 if ($a_mode ===
"create") {
1215 $this->
form->addCommandButton(
"saveFolder",
$lng->
txt(
"save"));
1216 $this->
form->addCommandButton(
"cancelSave",
$lng->
txt(
"cancel"));
1217 $this->
form->setTitle(
$lng->
txt(
"mep_new_folder"));
1219 $this->
form->addCommandButton(
"updateFolder",
$lng->
txt(
"save"));
1220 $this->
form->addCommandButton(
"cancelFolderUpdate",
$lng->
txt(
"cancel"));
1221 $this->
form->setTitle(
$lng->
txt(
"mep_edit_folder"));
1224 $this->
form->setFormAction($ilCtrl->getFormAction($this));
1233 $this->
object->getTree()->getParentId($this->mep_item_id)
1235 $ilCtrl->redirect($this,
"listMedia");
1241 $ilCtrl->
redirect($this,
"listMedia");
1258 $ilTabs->addSubTab(
"content", $this->
lng->txt(
"objs_fold"), $this->
ctrl->getLinkTarget($this,
""));
1261 $ilTabs->addSubTab(
"mep_all_mobs", $this->
lng->txt(
"mep_all_mobs"), $this->
ctrl->getLinkTarget($this,
"allMedia"));
1262 $ilCtrl->setParameter($this,
"mepitem_id", $this->mep_item_id);
1264 if ($ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
1267 $this->
lng->txt(
"mep_media_subtitles"),
1268 $ilCtrl->getLinkTargetByClass(
"ilmobmultisrtuploadgui",
"")
1272 $ilTabs->activateSubTab($a_active);
1283 if ($ilAccess->checkAccess(
'read',
'', $this->ref_id) ||
1284 $ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
1285 $ilTabs->addTab(
"content", $this->
lng->txt(
"mep_content"), $this->
ctrl->getLinkTarget($this,
""));
1289 if ($ilAccess->checkAccess(
'visible',
'', $this->ref_id) ||
1290 $ilAccess->checkAccess(
'read',
'', $this->ref_id) ||
1291 $ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
1292 $force_active = $this->
ctrl->getNextClass() ===
"ilinfoscreengui" 1293 || strtolower($this->
ctrl->getCmdClass()) ===
"ilnotegui";
1296 $this->
ctrl->getLinkTargetByClass(
1297 array(
"ilobjmediapoolgui",
"ilinfoscreengui"),
1300 array(
"showSummary",
"infoScreen"),
1307 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1310 $this->
ctrl->getLinkTarget($this,
"edit"),
1312 array(
"",
"ilobjmediapoolgui")
1315 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1318 $this->
ctrl->getLinkTarget($this,
"openClipboard"),
1320 "ileditclipboardgui" 1325 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1328 $mdtab = $mdgui->getTab();
1334 "ilobjectmetadatagui" 1339 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1342 $this->
ctrl->getLinkTargetByClass(
"ilexportgui",
""),
1349 $this->
ctrl->getLinkTargetByClass(
"ilmediapoolimportgui",
""),
1351 "ilmediapoolimportgui" 1355 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->object->getRefId())) {
1358 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
1359 array(
"perm",
"info",
"owner"),
1372 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1376 $this->
ctrl->getLinkTarget($this,
"edit")
1380 if ($mset->get(
"mep_activate_pages")) {
1381 $ilTabs->addSubTabTarget(
1382 "obj_multilinguality",
1383 $this->
ctrl->getLinkTargetByClass(
"ilobjecttranslationgui",
"")
1388 $ilTabs->setSubTabActive($a_active);
1392 public static function _goto(
string $a_target): void
1395 $main_tpl = $DIC->ui()->mainTemplate();
1397 $ilAccess = $DIC->access();
1398 $lng = $DIC->language();
1399 $ctrl = $DIC->ctrl();
1402 $targets = explode(
'_', $a_target);
1404 if (count((array) $targets) > 1) {
1405 $subitem_id = $targets[1];
1409 if ($ilAccess->checkAccess(
"read",
"",
$ref_id)) {
1412 } elseif ($ilAccess->checkAccess(
"visible",
"",
$ref_id)) {
1416 $lng->
txt(
"msg_no_perm_read_item"),
1430 $this->
ctrl->setCmd(
"showSummary");
1431 $this->
ctrl->setCmdClass(
"ilinfoscreengui");
1442 $this->
tabs->activateTab(
"info_short");
1445 if (!$ilAccess->checkAccess(
"visible",
"", $this->ref_id) &&
1446 !$ilAccess->checkAccess(
"read",
"", $this->ref_id) &&
1447 !$ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
1451 if ($this->
ctrl->getCmd() ===
"infoScreen") {
1452 $this->
ctrl->setCmd(
"showSummary");
1453 $this->
ctrl->setCmdClass(
"ilinfoscreengui");
1458 $info->enablePrivateNotes();
1462 $info->addMetaDataSections($this->
object->getId(), 0, $this->
object->getType());
1465 $this->
ctrl->forwardCommand($info);
1477 ?array $a_files = null
1487 $a_files = $this->mep_request->getFiles();
1490 $ilTabs->clearTargets();
1491 $ilTabs->setBackTarget(
1493 $ilCtrl->getLinkTarget($this,
"listMedia")
1502 "rename" =>
$lng->
txt(
"mep_up_dir_move"),
1503 "copy" =>
$lng->
txt(
"mep_up_dir_copy"),
1506 $si->setOptions($options);
1507 $tb->addInputItem($si);
1508 $tb->setCloseFormTag(
false);
1509 $tb->setFormAction($ilCtrl->getFormAction($this));
1510 $tb->setFormName(
"mep_up_form");
1514 "selectUploadDirFiles",
1517 $tab->setFormName(
"mep_up_form");
1531 $upload_dir = $mob_import_directory->getAbsolutePath();
1533 $files = $this->mep_request->getFiles();
1535 foreach ($files as
$f) {
1536 $f = str_replace(
"..",
"", $f);
1537 $fullpath = $upload_dir .
"/" .
$f;
1539 $mob->setTitle(basename($fullpath));
1540 $mob->setDescription(
"");
1545 $mob->createDirectory();
1549 $mob->addMediaItem($media_item);
1550 $media_item->setPurpose(
"Standard");
1552 $file = $mob_dir .
"/" . basename($fullpath);
1557 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"file_is_infected") .
"<br />" . $vir[1],
true);
1558 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
1559 $this->requested_ref_id .
"&mepitem_id=" . $this->mep_item_id);
1562 switch ($this->mep_request->getFileAction()) {
1564 rename($fullpath, $file);
1568 copy($fullpath, $file);
1577 $media_item->setFormat($format);
1579 $media_item->setLocationType(
"LocalFile");
1581 $mob->setDescription($format);
1588 $media_item->getLocation(),
1594 $media_item->setWidth($wh[
"width"]);
1595 $media_item->setHeight($wh[
"height"]);
1597 $media_item->setHAlign(
"Left");
1604 $mep_item->setTitle($mob->getTitle());
1605 $mep_item->setType(
"mob");
1606 $mep_item->setForeignId($mob->getId());
1607 $mep_item->create();
1609 $tree = $this->
object->getTree();
1614 ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
1615 $this->requested_ref_id .
"&mepitem_id=" . $this->mep_item_id);
1622 int $a_mpool_ref_id,
1628 $ilCtrl = $DIC->ctrl();
1629 $lng = $DIC->language();
1633 ->standardRequest();
1639 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"mepitem_id",
"");
1640 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"ref_id", $a_mpool_ref_id);
1641 $tpl->addOnloadCode(
"il.MediaPool.setPreviewUrl('" . $ilCtrl->getLinkTargetByClass(array(
"ilmediapoolpresentationgui",
"ilobjmediapoolgui"),
"showPreview",
"",
false,
false) .
"');");
1642 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"mepitem_id",
$request->getItemId());
1643 $ilCtrl->setParameterByClass(
1644 "ilobjmediapoolgui",
1650 $modal->setHeading(
$lng->
txt(
"preview"));
1651 $modal->setId(
"ilMepPreview");
1653 $modal->setBody(
"<iframe id='ilMepPreviewContent'></iframe>");
1655 return $modal->getHTML();
1662 if ($ot->getContentActivated()) {
1663 $format = explode(
"_", $this->mep_request->getExportFormat());
1667 $this->
object->exportXML($opt);
1686 if (is_null($this->bulk_upload_form)) {
1687 $mep_hash = uniqid();
1688 $this->
ctrl->setParameter($this,
"mep_hash", $mep_hash);
1689 $this->bulk_upload_form = $this->gui
1690 ->form(self::class,
'performBulkUpload')
1691 ->section(
"props", $this->
lng->txt(
'mep_bulk_upload'))
1694 $this->
lng->txt(
"mep_media_files"),
1695 \Closure::fromCallable([$this,
'handleUploadResult']),
1712 $mob->setTitle($title);
1713 $mob->setDescription(
"");
1716 $mob->createDirectory();
1718 $mob->addMediaItem($media_item);
1719 $media_item->setPurpose(
"Standard");
1723 $file = $mob_dir .
"/" . $file_name;
1734 $mep_item->setTitle($title);
1735 $mep_item->setType(
"mob");
1736 $mep_item->setForeignId($mob->getId());
1737 $mep_item->create();
1739 $tree = $this->
object->getTree();
1748 $media_item->setFormat($format);
1750 $media_item->setLocationType(
"LocalFile");
1751 $media_item->setUploadHash($this->mep_request->getUploadHash());
1754 $item_ids[] = $mob->getId();
1757 $mob->generatePreviewPic(320, 240);
1761 $med_item->determineDuration();
1762 $med_item->update();
1766 HandlerResult::STATUS_OK,
1778 $this->
ctrl->setParameter($this,
"mep_hash", $this->mep_request->getUploadHash());
1779 $this->
ctrl->redirect($this,
"editTitlesAndDescriptions");
1793 $this->mep_request->getUploadHash()
1798 $tb->addFormButton(
$lng->
txt(
"save"),
"saveTitlesAndDescriptions");
1799 $tb->setOpenFormTag(
true);
1800 $tb->setCloseFormTag(
false);
1801 $tb->setId(
"tb_top");
1803 $html = $tb->getHTML();
1804 foreach ($media_items as $mi) {
1807 $acc->setId(
"acc_" . $mi[
"mob_id"]);
1811 $acc->addItem($mob->getTitle(), $form->
getHTML());
1813 $html .= $acc->getHTML();
1816 $html .= $tb->getHTML();
1817 $tb->setOpenFormTag(
false);
1818 $tb->setCloseFormTag(
true);
1819 $tb->setId(
"tb_bottom");
1839 $ti->setValue($a_title);
1856 $this->mep_request->getUploadHash()
1859 foreach ($media_items as $mi) {
1863 $title = $form->
getInput(
"title_" . $mi[
"mob_id"]);
1864 $desc = $form->
getInput(
"description_" . $mi[
"mob_id"]);
1865 if (trim($title) !==
"") {
1866 $mob->setTitle($title);
1868 $mob->setDescription($desc);
1871 $this->main_tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
1877 ilSession::set(
"mep_move_ids", $this->mep_request->getItemIds());
1878 $this->main_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"mep_move_select_insert"),
true);
1879 $this->
ctrl->redirect($this,
"listMedia");
1884 $target_folder_id = $this->mep_request->getItemId();
1885 $target_tree = $this->domain->tree($this->
object->getId());
1887 $target_folder_id = $target_tree->readRootId();
1891 $this->domain->mediapool($this->
object->getId())->pasteFromClipboard($target_folder_id);
1893 $this->main_tpl->setOnScreenMessage(
1895 $this->
lng->txt(
"mep_target_in_source_not_allowed") .
" " . $e->getMessage(),
1900 $this->
ctrl->redirect($this,
"listMedia");
1915 string $long_desc =
"",
1916 bool $redirect =
true,
1917 bool $extract =
false 1923 foreach ($mob_ids as $mob_id) {
1928 $mep_item->setType(
"mob");
1930 $mep_item->create();
1933 $tree = $this->
object->getTree();
1950 $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)
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.
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)
Export User Interface Class.
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
ilObjectService $object_service
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)
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)
form( $class_path, string $cmd, string $submit_caption="")
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
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.
Class ilMediaPoolPage GUI class.
static set(string $a_var, $a_val)
Set a value.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
GUI class for object translation handling.
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.