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);
84 $this->
setTitle($node[
"title"],
"icon_fold.gif",
95 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
98 $this->
addMultiCommand(
"copyToClipboard", $lng->txt(
"cont_copy_to_clipboard"));
101 if (!$this->all_objects)
117 $this->
addMultiCommand(
"selectObjectReference", $lng->txt(
"cont_select"));
121 $ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()))
126 if ($this->current_folder != $this->tree->getRootId() && !$this->all_objects)
128 $ilCtrl->setParameter($this->parent_obj, $this->folder_par,
129 $this->tree->getParentId($this->current_folder));
130 $this->
addHeaderCommand($ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd),
131 $lng->txt(
"mep_parent_folder"));
132 $ilCtrl->setParameter($this->parent_obj, $this->folder_par,
133 $this->current_folder);
145 $this->insert_command = $a_val;
163 global
$lng, $rbacreview, $ilUser;
166 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
171 $ti->readFromSession();
172 $this->filter[
"title"] = $ti->getValue();
175 $GLOBALS[
'lng']->loadLanguageModule(
'meta');
180 $ke->readFromSession();
181 $this->filter[
'keyword'] = $ke->getValue();
188 $ca->readFromSession();
189 $this->filter[
'caption'] = $ca->getValue();
192 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
194 "" => $lng->txt(
"mep_all"),
196 $formats = $this->media_pool->getUsedFormats();
197 $options = array_merge($options, $formats);
201 $si->readFromSession();
202 $this->filter[
"format"] = $si->getValue();
213 $this->mode = $a_mode;
231 if (!$this->all_objects)
233 $fobjs = $this->media_pool->getChilds($this->current_folder,
"fold");
235 foreach ($fobjs as $obj)
237 $f2objs[$obj[
"title"].
":".$obj[
"child"]] = $obj;
244 $mobjs = $this->media_pool->getChilds($this->current_folder,
"mob");
248 $mobjs = $this->media_pool->getChilds($this->current_folder,
"pg");
252 $mobjs = $this->media_pool->getChildsExceptFolders($this->current_folder);
255 foreach ($mobjs as $obj)
257 $m2objs[$obj[
"title"].
":".$obj[
"child"]] = $obj;
262 $objs = array_merge($f2objs, $m2objs);
266 $objs = $this->media_pool->getMediaObjects(
267 $this->filter[
"title"],
268 $this->filter[
"format"],
269 $this->filter[
'keyword'],
270 $this->filter[
'caption']
303 $this->tpl->setCurrentBlock(
"link");
305 switch($a_set[
"type"])
308 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
309 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $a_set[
"obj_id"]);
310 $this->tpl->setVariable(
"LINK_VIEW",
311 $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd));
312 $this->tpl->parseCurrentBlock();
314 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
317 $this->tpl->setCurrentBlock(
"edit");
318 $this->tpl->setVariable(
"TXT_EDIT", $lng->txt(
"edit"));
319 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $a_set[
"obj_id"]);
320 $this->tpl->setVariable(
"EDIT_LINK",
321 $ilCtrl->getLinkTarget($this->parent_obj,
"editFolder"));
322 $ilCtrl->setParameter($this->parent_obj, $this->folder_par,
$_GET[$this->folder_par]);
323 $this->tpl->parseCurrentBlock();
326 $this->tpl->setCurrentBlock(
"tbl_content");
328 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
332 $this->tpl->setVariable(
"TXT_NO_LINK_TITLE", $a_set[
"title"]);
334 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
337 $this->tpl->setCurrentBlock(
"edit");
338 $this->tpl->setVariable(
"TXT_EDIT", $lng->txt(
"edit"));
339 $ilCtrl->setParameterByClass(
"ilmediapoolpagegui",
"mepitem_id", $a_set[
"child"]);
340 $this->tpl->setVariable(
"EDIT_LINK",
341 $ilCtrl->getLinkTargetByClass(
"ilmediapoolpagegui",
"edit"));
342 $this->tpl->parseCurrentBlock();
345 $this->tpl->setCurrentBlock(
"tbl_content");
347 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
354 $this->tpl->setVariable(
"TXT_NO_LINK_TITLE", $a_set[
"title"]);
358 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
359 $this->tpl->touchBlock(
"nf");
360 $ilCtrl->setParameterByClass(
"ilobjmediaobjectgui",
"mepitem_id", $a_set[
"child"]);
361 $ilCtrl->setParameter($this->parent_obj,
"mob_id", $a_set[
"foreign_id"]);
362 $this->tpl->setVariable(
"LINK_VIEW",
363 $ilCtrl->getLinkTarget($this->parent_obj,
"showMedia"));
367 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
370 $this->tpl->setCurrentBlock(
"edit");
371 $this->tpl->setVariable(
"TXT_EDIT", $lng->txt(
"edit"));
372 $this->tpl->setVariable(
"EDIT_LINK",
373 $ilCtrl->getLinkTargetByClass(
"ilobjmediaobjectgui",
"edit"));
374 $this->tpl->parseCurrentBlock();
377 $this->tpl->setCurrentBlock(
"link");
378 $this->tpl->setCurrentBlock(
"tbl_content");
384 $med = $mob->getMediaItem(
"Standard");
385 $target = $med->getThumbnailTarget();
388 $this->tpl->setVariable(
"IMG",
ilUtil::img($target));
392 $this->tpl->setVariable(
"IMG",
396 $med->getLocationType() ==
"Reference")
398 $size = @getimagesize($med->getLocation());
404 $w = (int) (
$size[0]/$r);
405 $h = (int) (
$size[1]/$r);
406 $this->tpl->setVariable(
"IMG",
412 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
413 $this->tpl->setVariable(
"MEDIA_INFO",
415 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
418 include_once
'./Services/MetaData/classes/class.ilMDKeyword.php';
421 $this->tpl->setCurrentBlock(
'additional_info');
422 $this->tpl->setVariable(
'ADD_INFO',$lng->txt(
'keywords').
': '.implode(
' ',$kws));
423 $this->tpl->parseCurrentBlock();
426 if(strlen($med->getCaption()))
428 $this->tpl->setCurrentBlock(
'additional_info');
429 $this->tpl->setVariable(
'ADD_INFO',$lng->txt(
'cont_caption').
': '.$med->getCaption());
430 $this->tpl->parseCurrentBlock();
436 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()))
443 $this->tpl->setCurrentBlock(
"chbox");
444 $this->tpl->setVariable(
"CHECKBOX_ID", $a_set[
"child"]);
445 $this->tpl->parseCurrentBlock();
446 $this->tpl->setCurrentBlock(
"tbl_content");
450 $this->tpl->setCurrentBlock(
"radio");
451 $this->tpl->setVariable(
"RADIO_ID", $a_set[
"child"]);
452 $this->tpl->parseCurrentBlock();
453 $this->tpl->setCurrentBlock(
"tbl_content");