4 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
50 $a_folder_par =
"obj_id",
52 $a_all_objects =
false,
57 $this->ctrl = $DIC->ctrl();
58 $this->lng = $DIC->language();
59 $this->access = $DIC->access();
60 $this->rbacreview = $DIC->rbac()->review();
61 $this->
user = $DIC->user();
64 $ilAccess = $DIC->access();
65 $lng = $DIC->language();
67 if ($a_parent_tpl == null) {
70 $this->parent_tpl = $a_parent_tpl;
72 $this->
setId(
"mepall");
73 if (is_object($a_parent_obj->object)) {
74 $this->
setId(
"mepall" . $a_parent_obj->object->getId());
77 $this->
setId(
"mepfold");
78 if (is_object($a_parent_obj->object)) {
79 $this->
setId(
"mepfold" . $a_parent_obj->object->getId());
83 parent::__construct($a_parent_obj, $a_parent_cmd);
85 $this->all_objects = $a_all_objects;
86 $lng->loadLanguageModule(
"mep");
88 $this->media_pool = $a_media_pool;
90 $this->folder_par = $a_folder_par;
92 if ($this->all_objects) {
97 if (
$_GET[$this->folder_par] > 0) {
98 $this->current_folder =
$_GET[$this->folder_par];
99 } elseif (
$_SESSION[
"mep_pool_folder"] > 0 && $this->tree->isInTree(
$_SESSION[
"mep_pool_folder"])) {
100 $this->current_folder =
$_SESSION[
"mep_pool_folder"];
102 $this->current_folder = $this->tree->getRootId();
104 $_SESSION[
"mep_pool_folder"] = $this->current_folder;
112 $this->
setRowTemplate(
"tpl.mep_list_row.html",
"Modules/MediaPool");
116 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
119 $this->adv_filter_record_gui->parse();
124 $adv_th_record_gui->parse();
125 if ($a_mode == self::IL_MEP_SELECT) {
139 if ($this->current_folder != $this->tree->getRootId() && !$this->all_objects) {
140 $node = $this->tree->getNodeData($this->current_folder);
142 $lng->txt(
"mep_choose_from_folder") .
": " . $node[
"title"],
148 $lng->txt(
"mep_choose_from_mep") .
": " .
157 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
162 if (!$this->all_objects) {
180 $ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId())) {
191 if ($this->all_objects) {
216 $this->insert_command = $a_val;
237 $html = parent::getHTML();
238 include_once(
"./Modules/MediaPool/classes/class.ilObjMediaPoolGUI.php");
254 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
259 $ti->readFromSession();
260 $this->filter[
"title"] = $ti->getValue();
263 $GLOBALS[
'lng']->loadLanguageModule(
'meta');
268 $ke->readFromSession();
269 $this->filter[
'keyword'] = $ke->getValue();
276 $ca->readFromSession();
277 $this->filter[
'caption'] = $ca->getValue();
280 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
282 "" =>
$lng->txt(
"mep_all"),
284 $formats = $this->media_pool->getUsedFormats();
289 $si->readFromSession();
290 $this->filter[
"format"] =
$si->getValue();
300 $this->mode = $a_mode;
318 if (!$this->all_objects) {
319 $fobjs = $this->media_pool->getChilds($this->current_folder,
"fold");
321 foreach ($fobjs as $obj) {
322 $f2objs[$obj[
"title"] .
":" . $obj[
"child"]] = $obj;
328 $mobjs = $this->media_pool->getChilds($this->current_folder,
"mob");
330 $mobjs = $this->media_pool->getChilds($this->current_folder,
"pg");
332 $mobjs = $this->media_pool->getChildsExceptFolders($this->current_folder);
335 foreach ($mobjs as $obj) {
336 $m2objs[$obj[
"title"] .
":" . $obj[
"child"]] = $obj;
341 $objs = array_merge($f2objs, $m2objs);
343 $objs = $this->media_pool->getMediaObjects(
344 $this->filter[
"title"],
345 $this->filter[
"format"],
346 $this->filter[
'keyword'],
347 $this->filter[
'caption']
353 include_once(
"./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php");
355 $this->media_pool->getRefId(),
363 $this->adv_filter_record_gui->getFilterElements()
398 $this->tpl->setCurrentBlock(
"link");
404 $adv_cell_record_gui->setRowData($a_set);
405 $this->tpl->setVariable(
"ADV_CELLS", $adv_cell_record_gui->parse());
409 switch ($a_set[
"type"]) {
411 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
412 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $a_set[
"obj_id"]);
413 $this->tpl->setVariable(
415 $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd)
417 $this->tpl->parseCurrentBlock();
419 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
421 $this->tpl->setCurrentBlock(
"edit");
422 $this->tpl->setVariable(
"TXT_EDIT",
$lng->txt(
"edit"));
423 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $a_set[
"obj_id"]);
424 $this->tpl->setVariable(
426 $ilCtrl->getLinkTarget($this->parent_obj,
"editFolder")
428 $ilCtrl->setParameter($this->parent_obj, $this->folder_par,
$_GET[$this->folder_par]);
429 $this->tpl->parseCurrentBlock();
432 $this->tpl->setCurrentBlock(
"tbl_content");
434 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
440 $this->tpl->setVariable(
"TXT_NO_LINK_TITLE", $a_set[
"title"]);
442 $this->tpl->setVariable(
"ONCLICK",
"il.MediaPool.preview('" . $a_set[
"child"] .
"'); return false;");
443 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
444 $ilCtrl->setParameterByClass(
"ilobjmediapoolgui",
"mepitem_id", $a_set[
"child"]);
447 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
449 $this->tpl->setCurrentBlock(
"edit");
450 $this->tpl->setVariable(
"TXT_EDIT",
$lng->txt(
"edit"));
451 $ilCtrl->setParameterByClass(
"ilmediapoolpagegui",
"mepitem_id", $a_set[
"child"]);
452 $this->tpl->setVariable(
454 $ilCtrl->getLinkTargetByClass(
"ilmediapoolpagegui",
"edit")
456 $this->tpl->parseCurrentBlock();
459 $this->tpl->setCurrentBlock(
"tbl_content");
461 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
465 $this->tpl->setVariable(
"ONCLICK",
"il.MediaPool.preview('" . $a_set[
"child"] .
"'); return false;");
466 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
467 $ilCtrl->setParameterByClass(
"ilobjmediaobjectgui",
"mepitem_id", $a_set[
"child"]);
468 $ilCtrl->setParameter($this->parent_obj,
"mob_id", $a_set[
"foreign_id"]);
471 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId()) &&
473 $this->tpl->setCurrentBlock(
"edit");
474 $this->tpl->setVariable(
"TXT_EDIT",
$lng->txt(
"edit"));
475 $this->tpl->setVariable(
477 $ilCtrl->getLinkTargetByClass(
"ilobjmediaobjectgui",
"edit")
479 $this->tpl->parseCurrentBlock();
482 $this->tpl->setCurrentBlock(
"link");
483 $this->tpl->setCurrentBlock(
"tbl_content");
488 $med = $mob->getMediaItem(
"Standard");
491 $target = $med->getThumbnailTarget();
496 $this->tpl->setVariable(
502 $med->getLocationType() ==
"Reference") {
503 $size = @getimagesize($med->getLocation());
510 $this->tpl->setVariable(
518 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
519 $this->tpl->setVariable(
523 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
528 if ($ilAccess->checkAccess(
"write",
"", $this->media_pool->getRefId())) {
534 $this->tpl->setCurrentBlock(
"chbox");
535 $this->tpl->setVariable(
"CHECKBOX_ID", $a_set[
"child"]);
536 $this->tpl->parseCurrentBlock();
537 $this->tpl->setCurrentBlock(
"tbl_content");
539 $this->tpl->setCurrentBlock(
"radio");
540 $this->tpl->setVariable(
"RADIO_ID", $a_set[
"child"]);
541 $this->tpl->parseCurrentBlock();
542 $this->tpl->setCurrentBlock(
"tbl_content");
558 $mtpl =
new ilTemplate(
"tpl.media_sel_table.html",
true,
true,
"Modules/MediaPool");
561 if ($this->current_folder != $this->tree->getRootId() && !$this->all_objects) {
562 $path = $this->tree->getPathFull($this->current_folder);
564 include_once(
"./Services/Locator/classes/class.ilLocatorGUI.php");
566 foreach (
$path as $p) {
567 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $p[
"child"]);
569 if ($this->tree->getRootId() == $p[
"child"]) {
574 $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd)
580 $this->current_folder
583 $mtpl->setCurrentBlock(
"loc");
584 $mtpl->setVariable(
"LOC", $loc->getHTML());
585 $mtpl->parseCurrentBlock();
588 $mtpl->setVariable(
"TABLE", parent::render());
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
setTableGUI($a_val)
Set table.
setExternalSorting($a_val)
Set external sorting.
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.
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
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.
static img($a_src, $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
static _lookupType($a_id, $a_reference=false)
lookup object type
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
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.
static queryForRecords($adv_rec_obj_ref_id, $adv_rec_obj_type, $adv_rec_obj_subtype, $a_obj_id, $a_subtype, $a_records, $a_obj_id_key, $a_obj_subid_key, array $a_amet_filter=null)
Query data for given object records.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
setFilterCommand($a_val, $a_caption=null)
Set filter command.