24 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
43 $a_media_pool, $a_folder_par =
"obj_id",
50 $lng->loadLanguageModule(
"mep");
52 $this->media_pool = $a_media_pool;
54 $this->folder_par = $a_folder_par;
57 if (
$_GET[$this->folder_par] > 0)
59 $this->current_folder =
$_GET[$this->folder_par];
61 else if (
$_SESSION[
"mep_pool_folder"] > 0 && $this->tree->isInTree(
$_SESSION[
"mep_pool_folder"]))
63 $this->current_folder =
$_SESSION[
"mep_pool_folder"];
67 $this->current_folder = $this->tree->getRootId();
69 $_SESSION[
"mep_pool_folder"] = $this->current_folder;
72 $this->
addColumn($lng->txt(
"mep_thumbnail"),
"",
"1");
73 $this->
addColumn($lng->txt(
"mep_title_and_description"),
"",
"100%");
76 $this->
setRowTemplate(
"tpl.mep_list_row.html",
"Modules/MediaPool");
80 if ($this->current_folder != $this->tree->getRootId())
82 $node = $this->tree->getNodeData($this->current_folder);
83 $this->
setTitle($node[
"title"],
"icon_fold.gif",
94 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
97 $this->
addMultiCommand(
"copyToClipboard", $lng->txt(
"cont_copy_to_clipboard"));
100 $this->
addCommandButton(
"createFolderForm", $lng->txt(
"mep_create_folder"));
116 if ($this->current_folder != $this->tree->getRootId())
118 $ilCtrl->setParameter($this->parent_obj, $this->folder_par,
119 $this->tree->getParentId($this->current_folder));
120 $this->
addHeaderCommand($ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd),
121 $lng->txt(
"mep_parent_folder"));
133 $this->mode = $a_mode;
151 $fobjs = $this->media_pool->getChilds($this->current_folder,
"fold");
153 foreach ($fobjs as $obj)
155 $f2objs[$obj[
"title"].
":".$obj[
"id"]] = $obj;
160 $mobjs = $this->media_pool->getChilds($this->current_folder,
"mob");
162 foreach ($mobjs as $obj)
164 $m2objs[$obj[
"title"].
":".$obj[
"id"]] = $obj;
169 $objs = array_merge($f2objs, $m2objs);
182 $this->tpl->setCurrentBlock(
"link");
184 switch($a_set[
"type"])
187 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
188 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $a_set[
"obj_id"]);
189 $this->tpl->setVariable(
"LINK_VIEW",
190 $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd));
191 $this->tpl->parseCurrentBlock();
193 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
196 $this->tpl->setCurrentBlock(
"edit");
197 $this->tpl->setVariable(
"TXT_EDIT", $lng->txt(
"edit"));
198 $ilCtrl->setParameterByClass(
"ilobjfoldergui", $this->folder_par, $a_set[
"obj_id"]);
199 $this->tpl->setVariable(
"EDIT_LINK",
200 $ilCtrl->getLinkTargetByClass(
"ilobjfoldergui",
"edit"));
201 $this->tpl->parseCurrentBlock();
204 $this->tpl->setCurrentBlock(
"tbl_content");
206 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
212 $this->tpl->setVariable(
"TXT_NO_LINK_TITLE", $a_set[
"title"]);
216 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
217 $this->tpl->touchBlock(
"nf");
218 $ilCtrl->setParameterByClass(
"ilobjmediaobjectgui",
"obj_id", $a_set[
"obj_id"]);
219 $ilCtrl->setParameter($this->parent_obj,
"mob_id", $a_set[
"obj_id"]);
220 $this->tpl->setVariable(
"LINK_VIEW",
221 $ilCtrl->getLinkTarget($this->parent_obj,
"showMedia"));
225 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
228 $this->tpl->setCurrentBlock(
"edit");
229 $this->tpl->setVariable(
"TXT_EDIT", $lng->txt(
"edit"));
230 $this->tpl->setVariable(
"EDIT_LINK",
231 $ilCtrl->getLinkTargetByClass(
"ilobjmediaobjectgui",
"edit"));
232 $this->tpl->parseCurrentBlock();
235 $this->tpl->setCurrentBlock(
"link");
236 $this->tpl->setCurrentBlock(
"tbl_content");
240 $med = $mob->getMediaItem(
"Standard");
241 $target = $med->getThumbnailTarget();
244 $this->tpl->setVariable(
"IMG_OBJ", $target);
252 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
253 $this->tpl->setVariable(
"MEDIA_INFO",
255 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
259 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
262 $this->tpl->setCurrentBlock(
"chbox");
263 $this->tpl->setVariable(
"CHECKBOX_ID", $a_set[
"obj_id"]);
264 $this->tpl->parseCurrentBlock();
265 $this->tpl->setCurrentBlock(
"tbl_content");