4 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
45 $a_folder_par =
"obj_id",
47 $a_all_objects =
false,
52 $this->ctrl = $DIC->ctrl();
53 $this->lng = $DIC->language();
54 $this->access = $DIC->access();
55 $this->rbacreview = $DIC->rbac()->review();
56 $this->
user = $DIC->user();
59 $ilAccess = $DIC->access();
60 $lng = $DIC->language();
62 if ($a_parent_tpl == null) {
65 $this->parent_tpl = $a_parent_tpl;
67 $this->
setId(
"mepall" . $a_parent_obj->object->getId());
69 if (is_object($a_parent_obj->object)) {
70 $this->
setId(
"mepfold" . $a_parent_obj->object->getId());
74 parent::__construct($a_parent_obj, $a_parent_cmd);
76 $this->all_objects = $a_all_objects;
77 $lng->loadLanguageModule(
"mep");
79 $this->media_pool = $a_media_pool;
81 $this->folder_par = $a_folder_par;
83 if ($this->all_objects) {
88 if (
$_GET[$this->folder_par] > 0) {
89 $this->current_folder =
$_GET[$this->folder_par];
90 } elseif (
$_SESSION[
"mep_pool_folder"] > 0 && $this->tree->isInTree(
$_SESSION[
"mep_pool_folder"])) {
91 $this->current_folder =
$_SESSION[
"mep_pool_folder"];
93 $this->current_folder = $this->tree->getRootId();
95 $_SESSION[
"mep_pool_folder"] = $this->current_folder;
99 $this->
addColumn(
$lng->txt(
"mep_title_and_description"),
"",
"100%");
102 $this->
setRowTemplate(
"tpl.mep_list_row.html",
"Modules/MediaPool");
106 if ($this->current_folder != $this->tree->getRootId() && !$this->all_objects) {
107 $node = $this->tree->getNodeData($this->current_folder);
109 $lng->txt(
"mep_choose_from_folder") .
": " . $node[
"title"],
115 $lng->txt(
"mep_choose_from_mep") .
": " .
123 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
128 if (!$this->all_objects) {
146 $ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId())) {
158 $this->insert_command = $a_val;
179 $html = parent::getHTML();
180 include_once(
"./Modules/MediaPool/classes/class.ilObjMediaPoolGUI.php");
196 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
201 $ti->readFromSession();
202 $this->filter[
"title"] = $ti->getValue();
205 $GLOBALS[
'lng']->loadLanguageModule(
'meta');
210 $ke->readFromSession();
211 $this->filter[
'keyword'] = $ke->getValue();
218 $ca->readFromSession();
219 $this->filter[
'caption'] = $ca->getValue();
222 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
224 "" =>
$lng->txt(
"mep_all"),
226 $formats = $this->media_pool->getUsedFormats();
231 $si->readFromSession();
232 $this->filter[
"format"] =
$si->getValue();
242 $this->mode = $a_mode;
260 if (!$this->all_objects) {
261 $fobjs = $this->media_pool->getChilds($this->current_folder,
"fold");
263 foreach ($fobjs as $obj) {
264 $f2objs[$obj[
"title"] .
":" . $obj[
"child"]] = $obj;
270 $mobjs = $this->media_pool->getChilds($this->current_folder,
"mob");
272 $mobjs = $this->media_pool->getChilds($this->current_folder,
"pg");
274 $mobjs = $this->media_pool->getChildsExceptFolders($this->current_folder);
277 foreach ($mobjs as $obj) {
278 $m2objs[$obj[
"title"] .
":" . $obj[
"child"]] = $obj;
283 $objs = array_merge($f2objs, $m2objs);
285 $objs = $this->media_pool->getMediaObjects(
286 $this->filter[
"title"],
287 $this->filter[
"format"],
288 $this->filter[
'keyword'],
289 $this->filter[
'caption']
323 $this->tpl->setCurrentBlock(
"link");
325 switch ($a_set[
"type"]) {
327 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
328 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $a_set[
"obj_id"]);
329 $this->tpl->setVariable(
331 $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd)
333 $this->tpl->parseCurrentBlock();
335 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
337 $this->tpl->setCurrentBlock(
"edit");
338 $this->tpl->setVariable(
"TXT_EDIT",
$lng->txt(
"edit"));
339 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $a_set[
"obj_id"]);
340 $this->tpl->setVariable(
342 $ilCtrl->getLinkTarget($this->parent_obj,
"editFolder")
344 $ilCtrl->setParameter($this->parent_obj, $this->folder_par,
$_GET[$this->folder_par]);
345 $this->tpl->parseCurrentBlock();
348 $this->tpl->setCurrentBlock(
"tbl_content");
350 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
356 $this->tpl->setVariable(
"TXT_NO_LINK_TITLE", $a_set[
"title"]);
358 $this->tpl->setVariable(
"ONCLICK",
"il.MediaPool.preview('" . $a_set[
"child"] .
"'); return false;");
359 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
360 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"mepitem_id", $a_set[
"child"]);
363 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
365 $this->tpl->setCurrentBlock(
"edit");
366 $this->tpl->setVariable(
"TXT_EDIT",
$lng->txt(
"edit"));
367 $ilCtrl->setParameterByClass(
"ilmediapoolpagegui",
"mepitem_id", $a_set[
"child"]);
368 $this->tpl->setVariable(
370 $ilCtrl->getLinkTargetByClass(
"ilmediapoolpagegui",
"edit")
372 $this->tpl->parseCurrentBlock();
375 $this->tpl->setCurrentBlock(
"tbl_content");
377 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
381 $this->tpl->setVariable(
"ONCLICK",
"il.MediaPool.preview('" . $a_set[
"child"] .
"'); return false;");
382 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
383 $ilCtrl->setParameterByClass(
"ilobjmediaobjectgui",
"mepitem_id", $a_set[
"child"]);
384 $ilCtrl->setParameter($this->parent_obj,
"mob_id", $a_set[
"foreign_id"]);
387 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
389 $this->tpl->setCurrentBlock(
"edit");
390 $this->tpl->setVariable(
"TXT_EDIT",
$lng->txt(
"edit"));
391 $this->tpl->setVariable(
393 $ilCtrl->getLinkTargetByClass(
"ilobjmediaobjectgui",
"edit")
395 $this->tpl->parseCurrentBlock();
398 $this->tpl->setCurrentBlock(
"link");
399 $this->tpl->setCurrentBlock(
"tbl_content");
404 $med = $mob->getMediaItem(
"Standard");
407 $target = $med->getThumbnailTarget();
412 $this->tpl->setVariable(
418 $med->getLocationType() ==
"Reference") {
419 $size = @getimagesize($med->getLocation());
426 $this->tpl->setVariable(
434 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
435 $this->tpl->setVariable(
439 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
444 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId())) {
450 $this->tpl->setCurrentBlock(
"chbox");
451 $this->tpl->setVariable(
"CHECKBOX_ID", $a_set[
"child"]);
452 $this->tpl->parseCurrentBlock();
453 $this->tpl->setCurrentBlock(
"tbl_content");
455 $this->tpl->setCurrentBlock(
"radio");
456 $this->tpl->setVariable(
"RADIO_ID", $a_set[
"child"]);
457 $this->tpl->parseCurrentBlock();
458 $this->tpl->setCurrentBlock(
"tbl_content");
474 $mtpl =
new ilTemplate(
"tpl.media_sel_table.html",
true,
true,
"Modules/MediaPool");
477 if ($this->current_folder != $this->tree->getRootId() && !$this->all_objects) {
478 $path = $this->tree->getPathFull($this->current_folder);
480 include_once(
"./Services/Locator/classes/class.ilLocatorGUI.php");
482 foreach (
$path as $p) {
483 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $p[
"child"]);
485 if ($this->tree->getRootId() == $p[
"child"]) {
490 $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd)
496 $this->current_folder
499 $mtpl->setCurrentBlock(
"loc");
500 $mtpl->setVariable(
"LOC", $loc->getHTML());
501 $mtpl->parseCurrentBlock();
504 $mtpl->setVariable(
"TABLE", parent::render());
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
setExternalSorting($a_val)
Set external sorting.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
static _lookupTitle($a_id)
lookup object title
static deducibleSize($a_mime)
checks if mime type is provided by getimagesize()
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
addMultiCommand($a_cmd, $a_text)
Add Command button.
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setEnableHeader($a_enableheader)
Set Enable Header.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options