4 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
26 $a_media_pool, $a_folder_par =
"obj_id",
33 $this->
setId(
"mepall".$a_parent_obj->object->getId());
37 if (is_object($a_parent_obj->object))
39 $this->
setId(
"mepfold".$a_parent_obj->object->getId());
45 $this->all_objects = $a_all_objects;
46 $lng->loadLanguageModule(
"mep");
48 $this->media_pool = $a_media_pool;
50 $this->folder_par = $a_folder_par;
52 if ($this->all_objects)
58 if (
$_GET[$this->folder_par] > 0)
60 $this->current_folder =
$_GET[$this->folder_par];
62 else if (
$_SESSION[
"mep_pool_folder"] > 0 && $this->tree->isInTree(
$_SESSION[
"mep_pool_folder"]))
64 $this->current_folder =
$_SESSION[
"mep_pool_folder"];
68 $this->current_folder = $this->tree->getRootId();
70 $_SESSION[
"mep_pool_folder"] = $this->current_folder;
73 $this->
addColumn($lng->txt(
"mep_thumbnail"),
"",
"1");
74 $this->
addColumn($lng->txt(
"mep_title_and_description"),
"",
"100%");
77 $this->
setRowTemplate(
"tpl.mep_list_row.html",
"Modules/MediaPool");
81 if ($this->current_folder != $this->tree->getRootId() && !$this->all_objects)
83 $node = $this->tree->getNodeData($this->current_folder);
85 $lng->txt(
"mep_choose_from_folder").
": ".$node[
"title"],
"icon_fold.png",
91 $lng->txt(
"mep_choose_from_mep").
": ".
98 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
101 $this->
addMultiCommand(
"copyToClipboard", $lng->txt(
"cont_copy_to_clipboard"));
104 if (!$this->all_objects)
120 $this->
addMultiCommand(
"selectObjectReference", $lng->txt(
"cont_select"));
124 $ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()))
137 $this->insert_command = $a_val;
158 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
163 $ti->readFromSession();
164 $this->filter[
"title"] = $ti->getValue();
167 $GLOBALS[
'lng']->loadLanguageModule(
'meta');
172 $ke->readFromSession();
173 $this->filter[
'keyword'] = $ke->getValue();
180 $ca->readFromSession();
181 $this->filter[
'caption'] = $ca->getValue();
184 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
186 "" => $lng->txt(
"mep_all"),
188 $formats = $this->media_pool->getUsedFormats();
189 $options = array_merge($options, $formats);
191 $si->setOptions($options);
193 $si->readFromSession();
194 $this->filter[
"format"] =
$si->getValue();
205 $this->mode = $a_mode;
223 if (!$this->all_objects)
225 $fobjs = $this->media_pool->getChilds($this->current_folder,
"fold");
227 foreach ($fobjs as $obj)
229 $f2objs[$obj[
"title"].
":".$obj[
"child"]] = $obj;
236 $mobjs = $this->media_pool->getChilds($this->current_folder,
"mob");
240 $mobjs = $this->media_pool->getChilds($this->current_folder,
"pg");
244 $mobjs = $this->media_pool->getChildsExceptFolders($this->current_folder);
247 foreach ($mobjs as $obj)
249 $m2objs[$obj[
"title"].
":".$obj[
"child"]] = $obj;
254 $objs = array_merge($f2objs, $m2objs);
258 $objs = $this->media_pool->getMediaObjects(
259 $this->filter[
"title"],
260 $this->filter[
"format"],
261 $this->filter[
'keyword'],
262 $this->filter[
'caption']
295 $this->tpl->setCurrentBlock(
"link");
297 switch($a_set[
"type"])
300 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
301 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $a_set[
"obj_id"]);
302 $this->tpl->setVariable(
"LINK_VIEW",
303 $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd));
304 $this->tpl->parseCurrentBlock();
306 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
309 $this->tpl->setCurrentBlock(
"edit");
310 $this->tpl->setVariable(
"TXT_EDIT", $lng->txt(
"edit"));
311 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $a_set[
"obj_id"]);
312 $this->tpl->setVariable(
"EDIT_LINK",
313 $ilCtrl->getLinkTarget($this->parent_obj,
"editFolder"));
314 $ilCtrl->setParameter($this->parent_obj, $this->folder_par,
$_GET[$this->folder_par]);
315 $this->tpl->parseCurrentBlock();
318 $this->tpl->setCurrentBlock(
"tbl_content");
320 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
324 $this->tpl->setVariable(
"TXT_NO_LINK_TITLE", $a_set[
"title"]);
326 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
329 $this->tpl->setCurrentBlock(
"edit");
330 $this->tpl->setVariable(
"TXT_EDIT", $lng->txt(
"edit"));
331 $ilCtrl->setParameterByClass(
"ilmediapoolpagegui",
"mepitem_id", $a_set[
"child"]);
332 $this->tpl->setVariable(
"EDIT_LINK",
333 $ilCtrl->getLinkTargetByClass(
"ilmediapoolpagegui",
"edit"));
334 $this->tpl->parseCurrentBlock();
337 $this->tpl->setCurrentBlock(
"tbl_content");
339 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
346 $this->tpl->setVariable(
"TXT_NO_LINK_TITLE", $a_set[
"title"]);
350 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
351 $this->tpl->touchBlock(
"nf");
352 $ilCtrl->setParameterByClass(
"ilobjmediaobjectgui",
"mepitem_id", $a_set[
"child"]);
353 $ilCtrl->setParameter($this->parent_obj,
"mob_id", $a_set[
"foreign_id"]);
354 $this->tpl->setVariable(
"LINK_VIEW",
355 $ilCtrl->getLinkTarget($this->parent_obj,
"showMedia"));
359 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
362 $this->tpl->setCurrentBlock(
"edit");
363 $this->tpl->setVariable(
"TXT_EDIT", $lng->txt(
"edit"));
364 $this->tpl->setVariable(
"EDIT_LINK",
365 $ilCtrl->getLinkTargetByClass(
"ilobjmediaobjectgui",
"edit"));
366 $this->tpl->parseCurrentBlock();
369 $this->tpl->setCurrentBlock(
"link");
370 $this->tpl->setCurrentBlock(
"tbl_content");
376 $med = $mob->getMediaItem(
"Standard");
380 $target = $med->getThumbnailTarget();
384 $this->tpl->setVariable(
"IMG",
ilUtil::img($target));
388 $this->tpl->setVariable(
"IMG",
392 $med->getLocationType() ==
"Reference")
394 $size = @getimagesize($med->getLocation());
400 $w = (int) (
$size[0]/$r);
401 $h = (int) (
$size[1]/$r);
402 $this->tpl->setVariable(
"IMG",
408 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
409 $this->tpl->setVariable(
"MEDIA_INFO",
411 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
414 include_once
'./Services/MetaData/classes/class.ilMDKeyword.php';
417 $this->tpl->setCurrentBlock(
'additional_info');
418 $this->tpl->setVariable(
'ADD_INFO',$lng->txt(
'keywords').
': '.implode(
' ',$kws));
419 $this->tpl->parseCurrentBlock();
422 if($med && strlen($med->getCaption()))
424 $this->tpl->setCurrentBlock(
'additional_info');
425 $this->tpl->setVariable(
'ADD_INFO',$lng->txt(
'cont_caption').
': '.$med->getCaption());
426 $this->tpl->parseCurrentBlock();
432 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()))
439 $this->tpl->setCurrentBlock(
"chbox");
440 $this->tpl->setVariable(
"CHECKBOX_ID", $a_set[
"child"]);
441 $this->tpl->parseCurrentBlock();
442 $this->tpl->setCurrentBlock(
"tbl_content");
446 $this->tpl->setCurrentBlock(
"radio");
447 $this->tpl->setVariable(
"RADIO_ID", $a_set[
"child"]);
448 $this->tpl->parseCurrentBlock();
449 $this->tpl->setCurrentBlock(
"tbl_content");
464 $mtpl =
new ilTemplate(
"tpl.media_sel_table.html",
true,
true,
"Modules/MediaPool");
467 if ($this->current_folder != $this->tree->getRootId() && !$this->all_objects)
469 $path = $this->tree->getPathFull($this->current_folder);
471 include_once(
"./Services/Locator/classes/class.ilLocatorGUI.php");
473 foreach (
$path as $p)
475 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $p[
"child"]);
477 if ($this->tree->getRootId() == $p[
"child"])
483 $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd)
486 $ilCtrl->setParameter($this->parent_obj, $this->folder_par,
487 $this->current_folder);
489 $mtpl->setCurrentBlock(
"loc");
490 $mtpl->setVariable(
"LOC", $loc->getHTML());
491 $mtpl->parseCurrentBlock();
494 $mtpl->setVariable(
"TABLE", parent::render());