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)
103 $this->
addCommandButton(
"createFolderForm", $lng->txt(
"mep_create_folder"));
107 if ($mset->get(
"mep_activate_pages"))
109 $this->
addCommandButton(
"createMediaPoolPage", $lng->txt(
"mep_create_content_snippet"));
117 $this->
addMultiCommand(
"selectObjectReference", $lng->txt(
"cont_select"));
125 if ($this->current_folder != $this->tree->getRootId() && !$this->all_objects)
127 $ilCtrl->setParameter($this->parent_obj, $this->folder_par,
128 $this->tree->getParentId($this->current_folder));
129 $this->
addHeaderCommand($ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd),
130 $lng->txt(
"mep_parent_folder"));
131 $ilCtrl->setParameter($this->parent_obj, $this->folder_par,
132 $this->current_folder);
144 $this->insert_command = $a_val;
162 global
$lng, $rbacreview, $ilUser;
165 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
170 $ti->readFromSession();
171 $this->filter[
"title"] = $ti->getValue();
174 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
176 "" => $lng->txt(
"mep_all"),
178 $formats = $this->media_pool->getUsedFormats();
179 $options = array_merge($options, $formats);
183 $si->readFromSession();
184 $this->filter[
"format"] = $si->getValue();
195 $this->mode = $a_mode;
213 if (!$this->all_objects)
215 $fobjs = $this->media_pool->getChilds($this->current_folder,
"fold");
217 foreach ($fobjs as $obj)
219 $f2objs[$obj[
"title"].
":".$obj[
"child"]] = $obj;
226 $mobjs = $this->media_pool->getChilds($this->current_folder,
"mob");
230 $mobjs = $this->media_pool->getChilds($this->current_folder,
"pg");
234 $mobjs = $this->media_pool->getChildsExceptFolders($this->current_folder);
237 foreach ($mobjs as $obj)
239 $m2objs[$obj[
"title"].
":".$obj[
"child"]] = $obj;
244 $objs = array_merge($f2objs, $m2objs);
248 $objs = $this->media_pool->getMediaObjects($this->filter[
"title"],
249 $this->filter[
"format"]);
281 $this->tpl->setCurrentBlock(
"link");
283 switch($a_set[
"type"])
286 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
287 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $a_set[
"obj_id"]);
288 $this->tpl->setVariable(
"LINK_VIEW",
289 $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd));
290 $this->tpl->parseCurrentBlock();
292 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
295 $this->tpl->setCurrentBlock(
"edit");
296 $this->tpl->setVariable(
"TXT_EDIT", $lng->txt(
"edit"));
297 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $a_set[
"obj_id"]);
298 $this->tpl->setVariable(
"EDIT_LINK",
299 $ilCtrl->getLinkTarget($this->parent_obj,
"editFolder"));
300 $ilCtrl->setParameter($this->parent_obj, $this->folder_par,
$_GET[$this->folder_par]);
301 $this->tpl->parseCurrentBlock();
304 $this->tpl->setCurrentBlock(
"tbl_content");
306 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
310 $this->tpl->setVariable(
"TXT_NO_LINK_TITLE", $a_set[
"title"]);
312 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
315 $this->tpl->setCurrentBlock(
"edit");
316 $this->tpl->setVariable(
"TXT_EDIT", $lng->txt(
"edit"));
317 $ilCtrl->setParameterByClass(
"ilmediapoolpagegui",
"mepitem_id", $a_set[
"child"]);
318 $this->tpl->setVariable(
"EDIT_LINK",
319 $ilCtrl->getLinkTargetByClass(
"ilmediapoolpagegui",
"edit"));
320 $this->tpl->parseCurrentBlock();
323 $this->tpl->setCurrentBlock(
"tbl_content");
325 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
332 $this->tpl->setVariable(
"TXT_NO_LINK_TITLE", $a_set[
"title"]);
336 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
337 $this->tpl->touchBlock(
"nf");
338 $ilCtrl->setParameterByClass(
"ilobjmediaobjectgui",
"mepitem_id", $a_set[
"child"]);
339 $ilCtrl->setParameter($this->parent_obj,
"mob_id", $a_set[
"foreign_id"]);
340 $this->tpl->setVariable(
"LINK_VIEW",
341 $ilCtrl->getLinkTarget($this->parent_obj,
"showMedia"));
345 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
348 $this->tpl->setCurrentBlock(
"edit");
349 $this->tpl->setVariable(
"TXT_EDIT", $lng->txt(
"edit"));
350 $this->tpl->setVariable(
"EDIT_LINK",
351 $ilCtrl->getLinkTargetByClass(
"ilobjmediaobjectgui",
"edit"));
352 $this->tpl->parseCurrentBlock();
355 $this->tpl->setCurrentBlock(
"link");
356 $this->tpl->setCurrentBlock(
"tbl_content");
362 $med = $mob->getMediaItem(
"Standard");
363 $target = $med->getThumbnailTarget();
366 $this->tpl->setVariable(
"IMG",
ilUtil::img($target));
370 $this->tpl->setVariable(
"IMG",
374 $med->getLocationType() ==
"Reference")
376 $size = @getimagesize($med->getLocation());
382 $w = (int) (
$size[0]/$r);
383 $h = (int) (
$size[1]/$r);
384 $this->tpl->setVariable(
"IMG",
390 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
391 $this->tpl->setVariable(
"MEDIA_INFO",
393 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
398 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()))
405 $this->tpl->setCurrentBlock(
"chbox");
406 $this->tpl->setVariable(
"CHECKBOX_ID", $a_set[
"child"]);
407 $this->tpl->parseCurrentBlock();
408 $this->tpl->setCurrentBlock(
"tbl_content");
412 $this->tpl->setCurrentBlock(
"radio");
413 $this->tpl->setVariable(
"RADIO_ID", $a_set[
"child"]);
414 $this->tpl->parseCurrentBlock();
415 $this->tpl->setCurrentBlock(
"tbl_content");