4 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
27 $a_media_pool, $a_folder_par =
"obj_id",
32 if ($a_parent_tpl == null)
36 $this->parent_tpl = $a_parent_tpl;
39 $this->
setId(
"mepall".$a_parent_obj->object->getId());
43 if (is_object($a_parent_obj->object))
45 $this->
setId(
"mepfold".$a_parent_obj->object->getId());
51 $this->all_objects = $a_all_objects;
52 $lng->loadLanguageModule(
"mep");
54 $this->media_pool = $a_media_pool;
56 $this->folder_par = $a_folder_par;
58 if ($this->all_objects)
64 if (
$_GET[$this->folder_par] > 0)
66 $this->current_folder =
$_GET[$this->folder_par];
68 else if (
$_SESSION[
"mep_pool_folder"] > 0 && $this->tree->isInTree(
$_SESSION[
"mep_pool_folder"]))
70 $this->current_folder =
$_SESSION[
"mep_pool_folder"];
74 $this->current_folder = $this->tree->getRootId();
76 $_SESSION[
"mep_pool_folder"] = $this->current_folder;
79 $this->
addColumn($lng->txt(
"mep_thumbnail"),
"",
"1");
80 $this->
addColumn($lng->txt(
"mep_title_and_description"),
"",
"100%");
83 $this->
setRowTemplate(
"tpl.mep_list_row.html",
"Modules/MediaPool");
87 if ($this->current_folder != $this->tree->getRootId() && !$this->all_objects)
89 $node = $this->tree->getNodeData($this->current_folder);
91 $lng->txt(
"mep_choose_from_folder").
": ".$node[
"title"],
"icon_fold.svg",
97 $lng->txt(
"mep_choose_from_mep").
": ".
104 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
107 $this->
addMultiCommand(
"copyToClipboard", $lng->txt(
"cont_copy_to_clipboard"));
110 if (!$this->all_objects)
126 $this->
addMultiCommand(
"selectObjectReference", $lng->txt(
"cont_select"));
130 $ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()))
143 $this->insert_command = $a_val;
165 include_once(
"./Modules/MediaPool/classes/class.ilObjMediaPoolGUI.php");
179 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
184 $ti->readFromSession();
185 $this->filter[
"title"] = $ti->getValue();
188 $GLOBALS[
'lng']->loadLanguageModule(
'meta');
193 $ke->readFromSession();
194 $this->filter[
'keyword'] = $ke->getValue();
201 $ca->readFromSession();
202 $this->filter[
'caption'] = $ca->getValue();
205 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
207 "" => $lng->txt(
"mep_all"),
209 $formats = $this->media_pool->getUsedFormats();
214 $si->readFromSession();
215 $this->filter[
"format"] =
$si->getValue();
226 $this->mode = $a_mode;
244 if (!$this->all_objects)
246 $fobjs = $this->media_pool->getChilds($this->current_folder,
"fold");
248 foreach ($fobjs as $obj)
250 $f2objs[$obj[
"title"].
":".$obj[
"child"]] = $obj;
257 $mobjs = $this->media_pool->getChilds($this->current_folder,
"mob");
261 $mobjs = $this->media_pool->getChilds($this->current_folder,
"pg");
265 $mobjs = $this->media_pool->getChildsExceptFolders($this->current_folder);
268 foreach ($mobjs as $obj)
270 $m2objs[$obj[
"title"].
":".$obj[
"child"]] = $obj;
275 $objs = array_merge($f2objs, $m2objs);
279 $objs = $this->media_pool->getMediaObjects(
280 $this->filter[
"title"],
281 $this->filter[
"format"],
282 $this->filter[
'keyword'],
283 $this->filter[
'caption']
316 $this->tpl->setCurrentBlock(
"link");
318 switch($a_set[
"type"])
321 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
322 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $a_set[
"obj_id"]);
323 $this->tpl->setVariable(
"LINK_VIEW",
324 $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd));
325 $this->tpl->parseCurrentBlock();
327 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
330 $this->tpl->setCurrentBlock(
"edit");
331 $this->tpl->setVariable(
"TXT_EDIT", $lng->txt(
"edit"));
332 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $a_set[
"obj_id"]);
333 $this->tpl->setVariable(
"EDIT_LINK",
334 $ilCtrl->getLinkTarget($this->parent_obj,
"editFolder"));
335 $ilCtrl->setParameter($this->parent_obj, $this->folder_par,
$_GET[$this->folder_par]);
336 $this->tpl->parseCurrentBlock();
339 $this->tpl->setCurrentBlock(
"tbl_content");
341 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
348 $this->tpl->setVariable(
"TXT_NO_LINK_TITLE", $a_set[
"title"]);
352 $this->tpl->setVariable(
"ONCLICK",
"il.MediaPool.preview('".$a_set[
"child"].
"'); return false;");
353 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
354 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"mepitem_id", $a_set[
"child"]);
357 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
360 $this->tpl->setCurrentBlock(
"edit");
361 $this->tpl->setVariable(
"TXT_EDIT", $lng->txt(
"edit"));
362 $ilCtrl->setParameterByClass(
"ilmediapoolpagegui",
"mepitem_id", $a_set[
"child"]);
363 $this->tpl->setVariable(
"EDIT_LINK",
364 $ilCtrl->getLinkTargetByClass(
"ilmediapoolpagegui",
"edit"));
365 $this->tpl->parseCurrentBlock();
368 $this->tpl->setCurrentBlock(
"tbl_content");
370 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
374 $this->tpl->setVariable(
"ONCLICK",
"il.MediaPool.preview('".$a_set[
"child"].
"'); return false;");
375 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
376 $ilCtrl->setParameterByClass(
"ilobjmediaobjectgui",
"mepitem_id", $a_set[
"child"]);
377 $ilCtrl->setParameter($this->parent_obj,
"mob_id", $a_set[
"foreign_id"]);
380 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
383 $this->tpl->setCurrentBlock(
"edit");
384 $this->tpl->setVariable(
"TXT_EDIT", $lng->txt(
"edit"));
385 $this->tpl->setVariable(
"EDIT_LINK",
386 $ilCtrl->getLinkTargetByClass(
"ilobjmediaobjectgui",
"edit"));
387 $this->tpl->parseCurrentBlock();
390 $this->tpl->setCurrentBlock(
"link");
391 $this->tpl->setCurrentBlock(
"tbl_content");
397 $med = $mob->getMediaItem(
"Standard");
401 $target = $med->getThumbnailTarget();
405 $this->tpl->setVariable(
"IMG",
ilUtil::img($target));
409 $this->tpl->setVariable(
"IMG",
413 $med->getLocationType() ==
"Reference")
415 $size = @getimagesize($med->getLocation());
421 $w = (int) (
$size[0]/$r);
422 $h = (int) (
$size[1]/$r);
423 $this->tpl->setVariable(
"IMG",
429 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
430 $this->tpl->setVariable(
"MEDIA_INFO",
432 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
437 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()))
444 $this->tpl->setCurrentBlock(
"chbox");
445 $this->tpl->setVariable(
"CHECKBOX_ID", $a_set[
"child"]);
446 $this->tpl->parseCurrentBlock();
447 $this->tpl->setCurrentBlock(
"tbl_content");
451 $this->tpl->setCurrentBlock(
"radio");
452 $this->tpl->setVariable(
"RADIO_ID", $a_set[
"child"]);
453 $this->tpl->parseCurrentBlock();
454 $this->tpl->setCurrentBlock(
"tbl_content");
469 $mtpl =
new ilTemplate(
"tpl.media_sel_table.html",
true,
true,
"Modules/MediaPool");
472 if ($this->current_folder != $this->tree->getRootId() && !$this->all_objects)
474 $path = $this->tree->getPathFull($this->current_folder);
476 include_once(
"./Services/Locator/classes/class.ilLocatorGUI.php");
478 foreach (
$path as $p)
480 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $p[
"child"]);
482 if ($this->tree->getRootId() == $p[
"child"])
488 $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd)
491 $ilCtrl->setParameter($this->parent_obj, $this->folder_par,
492 $this->current_folder);
494 $mtpl->setCurrentBlock(
"loc");
495 $mtpl->setVariable(
"LOC", $loc->getHTML());
496 $mtpl->parseCurrentBlock();
499 $mtpl->setVariable(
"TABLE", parent::render());