ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilMediaPoolTableGUI Class Reference

TableGUI class for recent changes in wiki. More...

+ Inheritance diagram for ilMediaPoolTableGUI:
+ Collaboration diagram for ilMediaPoolTableGUI:

Public Member Functions

 __construct ($a_parent_obj, $a_parent_cmd, $a_media_pool, $a_folder_par="obj_id", $a_mode=ilMediaPoolTableGUI::IL_MEP_EDIT, $a_all_objects=false)
 Constructor. More...
 
 setInsertCommand ($a_val)
 Set inser command. More...
 
 getInsertCommand ()
 Get inser command. More...
 
 initFilter ()
 Init filter. More...
 
 setMode ($a_mode)
 Set Mode. More...
 
 getMode ()
 Get Mode. More...
 
 getItems ()
 Get items of current folder. More...
 
 prepareOutput ()
 Prepare output. More...
 
 render ()
 get HTML More...
 
- Public Member Functions inherited from ilTable2GUI
 __construct ($a_parent_obj, $a_parent_cmd="", $a_template_context="")
 Constructor. More...
 
 setOpenFormTag ($a_val)
 Set open form tag. More...
 
 getOpenFormTag ()
 Get open form tag. More...
 
 setCloseFormTag ($a_val)
 Set close form tag. More...
 
 getCloseFormTag ()
 Get close form tag. More...
 
 determineLimit ()
 Determine the limit. More...
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 determineSelectedColumns ()
 Determine selected columns. More...
 
 isColumnSelected ($a_col)
 Is given column selected? More...
 
 getSelectedColumns ()
 Get selected columns. More...
 
executeCommand ()
 Execute command. More...
 
 resetOffset ($a_in_determination=false)
 Reset offset. More...
 
 initFilter ()
 Init filter. More...
 
 getParentObject ()
 Get parent object. More...
 
 getParentCmd ()
 Get parent command. More...
 
 setTopAnchor ($a_val)
 Set top anchor. More...
 
 getTopAnchor ()
 Get top anchor. More...
 
 setNoEntriesText ($a_text)
 Set text for an empty table. More...
 
 getNoEntriesText ()
 Get text for an empty table. More...
 
 setIsDataTable ($a_val)
 Set is data table. More...
 
 getIsDataTable ()
 Get is data table. More...
 
 setEnableTitle ($a_enabletitle)
 Set Enable Title. More...
 
 getEnableTitle ()
 Get Enable Title. More...
 
 setEnableHeader ($a_enableheader)
 Set Enable Header. More...
 
 getEnableHeader ()
 Get Enable Header. More...
 
 setEnableNumInfo ($a_val)
 Set enable num info. More...
 
 getEnableNumInfo ()
 Get enable num info. More...
 
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 Set title and title icon. More...
 
 setDescription ($a_val)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setOrderField ($a_order_field)
 set order column More...
 
 getOrderField ()
 
 setData ($a_data)
 
 getData ()
 
 dataExists ()
 
 setPrefix ($a_prefix)
 
 getPrefix ()
 
 addFilterItem ($a_input_item, $a_optional=false)
 Add filter item. More...
 
 addFilterItemByMetaType ($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=NULL)
 Add filter by standard type. More...
 
 getFilterItems ($a_optionals=false)
 Get filter items. More...
 
 getFilterItemByPostVar ($a_post_var)
 
 setFilterCols ($a_val)
 Set filter columns. More...
 
 getFilterCols ()
 Get filter columns. More...
 
 setDisableFilterHiding ($a_val=true)
 Set disable filter hiding. More...
 
 getDisableFilterHiding ()
 Get disable filter hiding. More...
 
 isFilterSelected ($a_col)
 Is given filter selected? More...
 
 getSelectedFilters ()
 Get selected filters. More...
 
 determineSelectedFilters ()
 Determine selected filters. More...
 
 setCustomPreviousNext ($a_prev_link, $a_next_link)
 Set custom previous/next links. More...
 
 setFormAction ($a_form_action)
 Set Form action parameter. More...
 
 getFormAction ()
 Get Form action parameter. More...
 
 setFormName ($a_formname)
 Set Form name. More...
 
 getFormName ()
 Get Form name. More...
 
 setId ($a_val)
 Set id. More...
 
 getId ()
 Get element id. More...
 
 setDisplayAsBlock ($a_val)
 Set display as block. More...
 
 getDisplayAsBlock ()
 Get display as block. More...
 
 getSelectAllCheckbox ()
 Get the name of the checkbox that should be toggled with a select all button. More...
 
 setSelectAllCheckbox ($a_select_all_checkbox)
 Set the name of the checkbox that should be toggled with a select all button. More...
 
 setExternalSorting ($a_val)
 Set external sorting. More...
 
 getExternalSorting ()
 Get external sorting. More...
 
 setFilterCommand ($a_val)
 Set filter command. More...
 
 getFilterCommand ()
 Get filter command. More...
 
 setResetCommand ($a_val)
 Set reset filter command. More...
 
 getResetCommand ()
 Get reset filter command. More...
 
 setExternalSegmentation ($a_val)
 Set external segmentation. More...
 
 getExternalSegmentation ()
 Get external segmentation. More...
 
 setRowTemplate ($a_template, $a_template_dir="")
 Set row template. More...
 
 setDefaultOrderField ($a_defaultorderfield)
 Set Default order field. More...
 
 getDefaultOrderField ()
 Get Default order field. More...
 
 setDefaultOrderDirection ($a_defaultorderdirection)
 Set Default order direction. More...
 
 getDefaultOrderDirection ()
 Get Default order direction. More...
 
 clearCommandButtons ()
 
 addCommandButton ($a_cmd, $a_text, $a_onclick='', $a_id="")
 Add Command button. More...
 
 addSelectionButton ($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection='')
 Add Selection List + Command button. More...
 
 addMultiItemSelectionButton ($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection='')
 Add Selection List + Command button for selected items. More...
 
 setCloseCommand ($a_link)
 Add command for closing table. More...
 
 addMultiCommand ($a_cmd, $a_text)
 Add Command button. More...
 
 addHiddenInput ($a_name, $a_value)
 Add Hidden Input field. More...
 
 addHeaderCommand ($a_href, $a_text, $a_target="", $a_img="")
 Add Header Command (Link) (Image needed for now) More...
 
 setTopCommands ($a_val)
 Set top commands (display command buttons on top of table, too) More...
 
 getTopCommands ()
 Get top commands (display command buttons on top of table, too) More...
 
 addColumn ($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
 Add a column to the header. More...
 
 getNavParameter ()
 
 setOrderLink ($sort_field, $order_dir)
 
 fillHeader ()
 
 determineOffsetAndOrder ($a_omit_offset=false)
 Determine offset and order. More...
 
 storeNavParameter ()
 
 getHTML ()
 Get HTML. More...
 
 numericOrdering ($a_field)
 Should this field be sorted numeric? More...
 
 render ()
 render table public More...
 
 writeFilterToSession ()
 Write filter values to session. More...
 
 resetFilter ()
 Reset filter. More...
 
 fillFooter ()
 Fill footer row. More...
 
 getLinkbar ($a_num)
 Get previous/next linkbar. More...
 
 fillHiddenRow ()
 
 fillActionRow ()
 Fill Action Row. More...
 
 setHeaderHTML ($html)
 set header html More...
 
 storeProperty ($type, $value)
 Store table property. More...
 
 loadProperty ($type)
 Load table property. More...
 
 getCurrentState ()
 get current settings for order, limit, columns and filter More...
 
 setContext ($id)
 Set context. More...
 
 getContext ()
 Get context. More...
 
 setShowRowsSelector ($a_value)
 Toggle rows-per-page selector. More...
 
 getShowRowsSelector ()
 Get rows-per-page selector state. More...
 
 setShowTemplates ($a_value)
 Toggle templates. More...
 
 getShowTemplates ()
 Get template state. More...
 
 restoreTemplate ($a_name)
 Restore state from template. More...
 
 saveTemplate ($a_name)
 Save current state as template. More...
 
 deleteTemplate ($a_name)
 Delete template. More...
 
 getLimit ()
 Get limit. More...
 
 getOffset ()
 Get offset. More...
 
 setExportFormats (array $formats)
 Set available export formats. More...
 
 setPrintMode ($a_value=false)
 Toogle print mode. More...
 
 getPrintMode ()
 Get print mode. More...
 
 getExportMode ()
 Was export activated? More...
 
 exportData ($format, $send=false)
 Export and optionally send current table data. More...
 
 setEnableAllCommand ($a_value)
 Enable actions for all entries in current result. More...
 
 setRowSelectorLabel ($row_selector_label)
 
 getRowSelectorLabel ()
 
- Public Member Functions inherited from ilTableGUI
 ilTableGUI ($a_data=0, $a_global_tpl=true)
 Constructor. More...
 
 setTemplate (&$a_tpl)
 set template public More...
 
getTemplateObject ()
 
 setData ($a_data)
 set table data public More...
 
 getData ()
 
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 set table title public More...
 
 setHelp ($a_help_page, $a_help_icon, $a_help_icon_alt=0)
 set table help page public More...
 
 setHeaderNames ($a_header_names)
 set table header names public More...
 
 getColumnCount ()
 Returns the column count based on the number of the header row columns public. More...
 
 setHeaderVars ($a_header_vars, $a_header_params=0)
 set table header vars public More...
 
 setColumnWidth ($a_column_width)
 set table column widths public More...
 
 setOneColumnWidth ($a_column_width, $a_column_number)
 set one table column width public More...
 
 setMaxCount ($a_max_count)
 set max. More...
 
 setLimit ($a_limit=0, $a_default_limit=0)
 set max. More...
 
 getLimit ()
 Get limit. More...
 
 setPrefix ($a_prefix)
 set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort separately) public More...
 
 setOffset ($a_offset)
 set dataset offset public More...
 
 getOffset ()
 Get offset. More...
 
 setOrderColumn ($a_order_column=0, $a_default_column=0)
 set order column public More...
 
 getOrderColumn ()
 Get order column. More...
 
 setOrderDirection ($a_order_direction)
 set order direction public More...
 
 getOrderDirection ()
 Get order direction. More...
 
 setFooter ($a_style, $a_previous=0, $a_next=0)
 set order direction public More...
 
 enable ($a_module_name)
 enables particular modules of table More...
 
 disable ($a_module_name)
 diesables particular modules of table More...
 
 sortData ()
 
 render ()
 render table public More...
 
 renderHeader ()
 
 setOrderLink ($key, $order_dir)
 
 setStyle ($a_element, $a_style)
 
 getStyle ($a_element)
 
 setBase ($a_base)
 Set Base script name (deprecated, only use this for workarounds). More...
 
 getBase ()
 Get Base script name (deprecated, only use this for workarounds). More...
 
 getFormName ()
 
 setFormName ($a_name="cmd")
 
 getSelectAllCheckbox ()
 
 setSelectAllCheckbox ($a_select_all_checkbox)
 
 clearActionButtons ()
 
 addActionButton ($btn_name, $btn_value)
 

Data Fields

const IL_MEP_SELECT = "select"
 
const IL_MEP_EDIT = "edit"
 
const IL_MEP_SELECT_CONTENT = "selectc"
 
 $insert_command = "create_mob"
 
const IL_MEP_SELECT_SINGLE = "selectsingle"
 
- Data Fields inherited from ilTable2GUI
const FILTER_TEXT = 1
 
const FILTER_SELECT = 2
 
const FILTER_DATE = 3
 
const FILTER_LANGUAGE = 4
 
const FILTER_NUMBER_RANGE = 5
 
const FILTER_DATE_RANGE = 6
 
const FILTER_DURATION_RANGE = 7
 
const FILTER_DATETIME_RANGE = 8
 
const EXPORT_EXCEL = 1
 
const EXPORT_CSV = 2
 
const ACTION_ALL_LIMIT = 1000
 
- Data Fields inherited from ilTableGUI
 $title
 
 $icon
 
 $icon_alt
 
 $help_page
 
 $help_icon
 
 $help_icon_alt
 
 $header_names
 
 $header_vars
 
 $linkbar_vars
 
 $data
 
 $column_count
 
 $column_width
 
 $max_count
 
 $limit
 
 $max_limit = false
 
 $offset
 
 $order_column
 
 $order_direction
 
 $footer_style
 
 $footer_previous
 
 $footer_next
 
 $lang_support = true
 
 $global_tpl
 
 $form_name
 
 $select_all_checkbox
 
 $action_buttons
 
 $prefix
 
 $base = ""
 
 $enabled
 
 $styles
 

Protected Member Functions

 fillRow ($a_set)
 Standard Version of Fill Row. More...
 
- Protected Member Functions inherited from ilTable2GUI
 prepareOutput ()
 Anything that must be done before HTML is generated. More...
 
 fillRow ($a_set)
 Standard Version of Fill Row. More...
 
 getFilterValue (ilFormPropertyGUI $a_item)
 Get current filter value. More...
 
 SetFilterValue (ilFormPropertyGUI $a_item, $a_value)
 Set current filter value. More...
 
 fillMetaExcel ($worksheet, &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel ($worksheet, &$a_row)
 Excel Version of Fill Row. More...
 
 fillRowExcel ($a_worksheet, &$a_row, $a_set)
 Excel Version of Fill Row. More...
 
 fillMetaCSV ($a_csv)
 Add meta information to csv export. More...
 
 fillHeaderCSV ($a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV ($a_csv, $a_set)
 CSV Version of Fill Row. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 Get maximum number of entries to enable actions for all. More...
 
- Protected Attributes inherited from ilTable2GUI
 $close_command = ""
 
 $top_anchor = "il_table_top"
 
 $filters = array()
 
 $optional_filters = array()
 
 $filter_cmd = 'applyFilter'
 
 $reset_cmd = 'resetFilter'
 
 $filter_cols = 5
 
 $ext_sort = false
 
 $ext_seg = false
 
 $context = ""
 
 $mi_sel_buttons = null
 
 $disable_filter_hiding = false
 
 $selected_filter = false
 
 $top_commands = true
 
 $selectable_columns = array()
 
 $selected_column = array()
 
 $show_templates = false
 
 $show_rows_selector = false
 
 $nav_determined = false
 
 $limit_determined = false
 
 $filters_determined = false
 
 $columns_determined = false
 
 $open_form_tag = true
 
 $close_form_tag = true
 
 $export_formats
 
 $export_mode
 
 $print_mode
 
 $enable_command_for_all
 
 $row_selector_label
 

Detailed Description

TableGUI class for recent changes in wiki.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 14 of file class.ilMediaPoolTableGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMediaPoolTableGUI::__construct (   $a_parent_obj,
  $a_parent_cmd,
  $a_media_pool,
  $a_folder_par = "obj_id",
  $a_mode = ilMediaPoolTableGUI::IL_MEP_EDIT,
  $a_all_objects = false 
)

Constructor.

Definition at line 25 of file class.ilMediaPoolTableGUI.php.

References $_GET, $_SESSION, $ilCtrl, $lng, ilObject\_lookupTitle(), ilTable2GUI\addColumn(), ilTable2GUI\addMultiCommand(), getItems(), getMode(), ilObjMediaPool\getPoolTree(), IL_MEP_EDIT, IL_MEP_SELECT_SINGLE, initFilter(), ilTable2GUI\setEnableHeader(), ilTable2GUI\setExternalSorting(), ilTable2GUI\setFormAction(), ilTable2GUI\setId(), setMode(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), and ilTable2GUI\setTitle().

28  {
29  global $ilCtrl, $lng, $ilAccess, $lng;
30 
31  if ($a_all_objects)
32  {
33  $this->setId("mepall".$a_parent_obj->object->getId());
34  }
35  else
36  {
37  if (is_object($a_parent_obj->object))
38  {
39  $this->setId("mepfold".$a_parent_obj->object->getId());
40  }
41  }
42 
43  parent::__construct($a_parent_obj, $a_parent_cmd);
44  $this->setMode($a_mode);
45  $this->all_objects = $a_all_objects;
46  $lng->loadLanguageModule("mep");
47 
48  $this->media_pool = $a_media_pool;
49  $this->tree = ilObjMediaPool::getPoolTree($this->media_pool->getId());
50  $this->folder_par = $a_folder_par;
51 
52  if ($this->all_objects)
53  {
54  $this->setExternalSorting(true);
55  $this->initFilter();
56  }
57  // folder determination
58  if ($_GET[$this->folder_par] > 0)
59  {
60  $this->current_folder = $_GET[$this->folder_par];
61  }
62  else if ($_SESSION["mep_pool_folder"] > 0 && $this->tree->isInTree($_SESSION["mep_pool_folder"]))
63  {
64  $this->current_folder = $_SESSION["mep_pool_folder"];
65  }
66  else
67  {
68  $this->current_folder = $this->tree->getRootId();
69  }
70  $_SESSION["mep_pool_folder"] = $this->current_folder;
71 
72  $this->addColumn("", "", "1"); // checkbox
73  $this->addColumn($lng->txt("mep_thumbnail"), "", "1");
74  $this->addColumn($lng->txt("mep_title_and_description"), "", "100%");
75  $this->setEnableHeader(true);
76  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
77  $this->setRowTemplate("tpl.mep_list_row.html", "Modules/MediaPool");
78  $this->getItems();
79 
80  // title
81  if ($this->current_folder != $this->tree->getRootId() && !$this->all_objects)
82  {
83  $node = $this->tree->getNodeData($this->current_folder);
84  $this->setTitle(
85  $lng->txt("mep_choose_from_folder").": ".$node["title"], "icon_fold.png",
86  $node["title"]);
87  }
88  else
89  {
90  $this->setTitle(
91  $lng->txt("mep_choose_from_mep").": ".
92  ilObject::_lookupTitle($this->media_pool->getId()),
93  "icon_mep.png",
94  ilObject::_lookupTitle($this->media_pool->getId()));
95  }
96 
97  // action commands
98  if ($ilAccess->checkAccess("write", "", $this->media_pool->getRefId()) &&
100  {
101  $this->addMultiCommand("copyToClipboard", $lng->txt("cont_copy_to_clipboard"));
102  $this->addMultiCommand("confirmRemove", $lng->txt("remove"));
103 
104  if (!$this->all_objects)
105  {
106 /* $this->addCommandButton("createFolderForm", $lng->txt("mep_create_folder"));
107  $this->addCommandButton("createMediaObject", $lng->txt("mep_create_mob"));
108 
109  $mset = new ilSetting("mobs");
110  if ($mset->get("mep_activate_pages"))
111  {
112  $this->addCommandButton("createMediaPoolPage", $lng->txt("mep_create_content_snippet"));
113  }*/
114  }
115  }
116 
118  {
119  // ... even more coupling with ilpcmediaobjectgui
120  $this->addMultiCommand("selectObjectReference", $lng->txt("cont_select"));
121  }
122 
123  if ($this->getMode() == ilMediaPoolTableGUI::IL_MEP_EDIT &&
124  $ilAccess->checkAccess("write", "", $this->media_pool->getRefId()))
125  {
126  $this->setSelectAllCheckbox("id");
127  }
128  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
setExternalSorting($a_val)
Set external sorting.
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
setId($a_val)
Set id.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
getItems()
Get items of current folder.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
static getPoolTree($a_obj_id)
Get Pool Tree.
global $lng
Definition: privfeed.php:40
setFormAction($a_form_action)
Set Form action parameter.
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.
+ Here is the call graph for this function:

Member Function Documentation

◆ fillRow()

ilMediaPoolTableGUI::fillRow (   $a_set)
protected

Standard Version of Fill Row.

Most likely to be overwritten by derived class.

Definition at line 291 of file class.ilMediaPoolTableGUI.php.

References $_GET, $ilCtrl, $lng, $r, $size, ilObjMediaObjectGUI\_getMediaInfoHTML(), ilObject\_lookupType(), ilUtil\deducibleSize(), ilUtil\getImagePath(), getMode(), IL_MEP_EDIT, IL_MEP_SELECT, IL_MEP_SELECT_CONTENT, IL_MEP_SELECT_SINGLE, ilUtil\img(), and ilMDKeyword\lookupKeywords().

292  {
293  global $lng, $ilCtrl, $ilAccess;
294 
295  $this->tpl->setCurrentBlock("link");
296 
297  switch($a_set["type"])
298  {
299  case "fold":
300  $this->tpl->setVariable("TXT_TITLE", $a_set["title"]);
301  $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $a_set["obj_id"]);
302  $this->tpl->setVariable("LINK_VIEW",
303  $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd));
304  $this->tpl->parseCurrentBlock();
305 
306  if ($ilAccess->checkAccess("write", "", $this->media_pool->getRefId()) &&
308  {
309  $this->tpl->setCurrentBlock("edit");
310  $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit"));
311  $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $a_set["obj_id"]);
312  $this->tpl->setVariable("EDIT_LINK",
313  $ilCtrl->getLinkTarget($this->parent_obj, "editFolder"));
314  $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $_GET[$this->folder_par]);
315  $this->tpl->parseCurrentBlock();
316  }
317 
318  $this->tpl->setCurrentBlock("tbl_content");
319  $this->tpl->setVariable("IMG", ilUtil::img(ilUtil::getImagePath("icon_".$a_set["type"].".png")));
320  $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
321  break;
322 
323  case "pg":
324  $this->tpl->setVariable("TXT_NO_LINK_TITLE", $a_set["title"]);
325 
326  if ($ilAccess->checkAccess("write", "", $this->media_pool->getRefId()) &&
328  {
329  $this->tpl->setCurrentBlock("edit");
330  $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit"));
331  $ilCtrl->setParameterByClass("ilmediapoolpagegui", "mepitem_id", $a_set["child"]);
332  $this->tpl->setVariable("EDIT_LINK",
333  $ilCtrl->getLinkTargetByClass("ilmediapoolpagegui", "edit"));
334  $this->tpl->parseCurrentBlock();
335  }
336 
337  $this->tpl->setCurrentBlock("tbl_content");
338  $this->tpl->setVariable("IMG", ilUtil::img(ilUtil::getImagePath("icon_pg.png")));
339  $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
340  break;
341 
342  case "mob":
345  {
346  $this->tpl->setVariable("TXT_NO_LINK_TITLE", $a_set["title"]);
347  }
348  else
349  {
350  $this->tpl->setVariable("TXT_TITLE", $a_set["title"]);
351  $this->tpl->touchBlock("nf");
352  $ilCtrl->setParameterByClass("ilobjmediaobjectgui", "mepitem_id", $a_set["child"]);
353  $ilCtrl->setParameter($this->parent_obj, "mob_id", $a_set["foreign_id"]);
354  $this->tpl->setVariable("LINK_VIEW",
355  $ilCtrl->getLinkTarget($this->parent_obj, "showMedia"));
356  }
357 
358  // edit link
359  if ($ilAccess->checkAccess("write", "", $this->media_pool->getRefId()) &&
361  {
362  $this->tpl->setCurrentBlock("edit");
363  $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit"));
364  $this->tpl->setVariable("EDIT_LINK",
365  $ilCtrl->getLinkTargetByClass("ilobjmediaobjectgui", "edit"));
366  $this->tpl->parseCurrentBlock();
367  }
368 
369  $this->tpl->setCurrentBlock("link");
370  $this->tpl->setCurrentBlock("tbl_content");
371 
372  // output thumbnail (or mob icon)
373  if (ilObject::_lookupType($a_set["foreign_id"]) == "mob")
374  {
375  $mob = new ilObjMediaObject($a_set["foreign_id"]);
376  $med = $mob->getMediaItem("Standard");
377  $target = "";
378  if ($med)
379  {
380  $target = $med->getThumbnailTarget();
381  }
382  if ($target != "")
383  {
384  $this->tpl->setVariable("IMG", ilUtil::img($target));
385  }
386  else
387  {
388  $this->tpl->setVariable("IMG",
389  ilUtil::img(ilUtil::getImagePath("icon_".$a_set["type"].".png")));
390  }
391  if ($med && ilUtil::deducibleSize($med->getFormat()) &&
392  $med->getLocationType() == "Reference")
393  {
394  $size = @getimagesize($med->getLocation());
395  if ($size[0] > 0 && $size[1] > 0)
396  {
397  $wr = $size[0] / 80;
398  $hr = $size[1] / 80;
399  $r = max($wr, hr);
400  $w = (int) ($size[0]/$r);
401  $h = (int) ($size[1]/$r);
402  $this->tpl->setVariable("IMG",
403  ilUtil::img($med->getLocation(), "", $w, $h));
404  }
405  }
406 
407  // output media info
408  include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
409  $this->tpl->setVariable("MEDIA_INFO",
411  $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
412 
413  // output keywords
414  include_once './Services/MetaData/classes/class.ilMDKeyword.php';
415  if(count($kws = ilMDKeyword::lookupKeywords(0, $a_set['foreign_id'])))
416  {
417  $this->tpl->setCurrentBlock('additional_info');
418  $this->tpl->setVariable('ADD_INFO',$lng->txt('keywords').': '.implode(' ',$kws));
419  $this->tpl->parseCurrentBlock();
420  }
421  // output caption
422  if($med && strlen($med->getCaption()))
423  {
424  $this->tpl->setCurrentBlock('additional_info');
425  $this->tpl->setVariable('ADD_INFO',$lng->txt('cont_caption').': '.$med->getCaption());
426  $this->tpl->parseCurrentBlock();
427  }
428  }
429  break;
430  }
431 
432  if ($ilAccess->checkAccess("write", "", $this->media_pool->getRefId()))
433  {
434  if (($this->getMode() == ilMediaPoolTableGUI::IL_MEP_EDIT ||
435  ($this->getMode() == ilMediaPoolTableGUI::IL_MEP_SELECT && $a_set["type"] == "mob") ||
436  ($this->getMode() == ilMediaPoolTableGUI::IL_MEP_SELECT_CONTENT && $a_set["type"] == "pg")
437  ))
438  {
439  $this->tpl->setCurrentBlock("chbox");
440  $this->tpl->setVariable("CHECKBOX_ID", $a_set["child"]);
441  $this->tpl->parseCurrentBlock();
442  $this->tpl->setCurrentBlock("tbl_content");
443  }
444  else if ($this->getMode() == ilMediaPoolTableGUI::IL_MEP_SELECT_SINGLE && $a_set["type"] == "mob")
445  {
446  $this->tpl->setCurrentBlock("radio");
447  $this->tpl->setVariable("RADIO_ID", $a_set["child"]);
448  $this->tpl->parseCurrentBlock();
449  $this->tpl->setCurrentBlock("tbl_content");
450  }
451  }
452  }
$size
Definition: RandomTest.php:79
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="")
Build img tag.
$_GET["client_id"]
static deducibleSize($a_mime)
checks if mime type is provided by getimagesize()
_getMediaInfoHTML(&$a_mob)
get media info as html
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Class ilObjMediaObject.
static _lookupType($a_id, $a_reference=false)
lookup object type
global $lng
Definition: privfeed.php:40
static lookupKeywords($a_rbac_id, $a_obj_id, $a_return_ids=false)
Lookup Keywords.
$r
+ Here is the call graph for this function:

◆ getInsertCommand()

ilMediaPoolTableGUI::getInsertCommand ( )

Get inser command.

Returns
string inser command

Definition at line 145 of file class.ilMediaPoolTableGUI.php.

References $insert_command.

Referenced by prepareOutput().

146  {
147  return $this->insert_command;
148  }
+ Here is the caller graph for this function:

◆ getItems()

ilMediaPoolTableGUI::getItems ( )

Get items of current folder.

Definition at line 221 of file class.ilMediaPoolTableGUI.php.

References getMode(), IL_MEP_SELECT, IL_MEP_SELECT_CONTENT, and ilTable2GUI\setData().

Referenced by __construct().

222  {
223  if (!$this->all_objects)
224  {
225  $fobjs = $this->media_pool->getChilds($this->current_folder, "fold");
226  $f2objs = array();
227  foreach ($fobjs as $obj)
228  {
229  $f2objs[$obj["title"].":".$obj["child"]] = $obj;
230  }
231  ksort($f2objs);
232 
233  // get current media objects / pages
235  {
236  $mobjs = $this->media_pool->getChilds($this->current_folder, "mob");
237  }
239  {
240  $mobjs = $this->media_pool->getChilds($this->current_folder, "pg");
241  }
242  else
243  {
244  $mobjs = $this->media_pool->getChildsExceptFolders($this->current_folder);
245  }
246  $m2objs = array();
247  foreach ($mobjs as $obj)
248  {
249  $m2objs[$obj["title"].":".$obj["child"]] = $obj;
250  }
251  ksort($m2objs);
252 
253  // merge everything together
254  $objs = array_merge($f2objs, $m2objs);
255  }
256  else
257  {
258  $objs = $this->media_pool->getMediaObjects(
259  $this->filter["title"],
260  $this->filter["format"],
261  $this->filter['keyword'],
262  $this->filter['caption']
263  );
264  }
265 //var_dump($objs);
266  $this->setData($objs);
267  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMode()

ilMediaPoolTableGUI::getMode ( )

Get Mode.

Returns
string Mode

Definition at line 213 of file class.ilMediaPoolTableGUI.php.

Referenced by __construct(), fillRow(), getItems(), and prepareOutput().

214  {
215  return $this->mode;
216  }
+ Here is the caller graph for this function:

◆ initFilter()

ilMediaPoolTableGUI::initFilter ( )

Init filter.

Definition at line 153 of file class.ilMediaPoolTableGUI.php.

References $GLOBALS, $ilUser, $lng, $options, $si, ilTable2GUI\addFilterItem(), and ilTextInputGUI\setMaxLength().

Referenced by __construct().

154  {
155  global $lng, $rbacreview, $ilUser;
156 
157  // title/description
158  include_once("./Services/Form/classes/class.ilTextInputGUI.php");
159  $ti = new ilTextInputGUI($lng->txt("title"), "title");
160  $ti->setMaxLength(64);
161  $ti->setSize(20);
162  $this->addFilterItem($ti);
163  $ti->readFromSession();
164  $this->filter["title"] = $ti->getValue();
165 
166  // keyword
167  $GLOBALS['lng']->loadLanguageModule('meta');
168  $ke = new ilTextInputGUI($lng->txt('meta_keyword'),'keyword');
169  $ke->setMaxLength(64);
170  $ke->setSize(20);
171  $this->addFilterItem($ke);
172  $ke->readFromSession();
173  $this->filter['keyword'] = $ke->getValue();
174 
175  // Caption
176  $ca = new ilTextInputGUI($lng->txt('cont_caption'),'caption');
177  $ca->setMaxLength(64);
178  $ca->setSize(20);
179  $this->addFilterItem($ca);
180  $ca->readFromSession();
181  $this->filter['caption'] = $ca->getValue();
182 
183  // format
184  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
185  $options = array(
186  "" => $lng->txt("mep_all"),
187  );
188  $formats = $this->media_pool->getUsedFormats();
189  $options = array_merge($options, $formats);
190  $si = new ilSelectInputGUI($this->lng->txt("mep_format"), "format");
191  $si->setOptions($options);
192  $this->addFilterItem($si);
193  $si->readFromSession();
194  $this->filter["format"] = $si->getValue();
195 
196  }
This class represents a selection list property in a property form.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
if(!is_array($argv)) $options
$GLOBALS['ct_recipient']
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

ilMediaPoolTableGUI::prepareOutput ( )

Prepare output.

Parameters

Definition at line 275 of file class.ilMediaPoolTableGUI.php.

References $lng, ilTable2GUI\addCommandButton(), ilTable2GUI\addMultiCommand(), getInsertCommand(), getMode(), IL_MEP_SELECT, and IL_MEP_SELECT_CONTENT.

276  {
277  global $lng;
278 
281  {
282  $this->addMultiCommand($this->getInsertCommand(), $lng->txt("insert"));
283  $this->addCommandButton("cancelCreate", $lng->txt("cancel"));
284  }
285  }
addMultiCommand($a_cmd, $a_text)
Add Command button.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="")
Add Command button.
global $lng
Definition: privfeed.php:40
getInsertCommand()
Get inser command.
+ Here is the call graph for this function:

◆ render()

ilMediaPoolTableGUI::render ( )

get HTML

Parameters

Definition at line 460 of file class.ilMediaPoolTableGUI.php.

References $ilCtrl, $lng, $path, ilTableGUI\$title, and ilObject\_lookupTitle().

461  {
462  global $ilCtrl, $lng;
463 
464  $mtpl = new ilTemplate("tpl.media_sel_table.html", true, true, "Modules/MediaPool");
465 
466  $pre = "";
467  if ($this->current_folder != $this->tree->getRootId() && !$this->all_objects)
468  {
469  $path = $this->tree->getPathFull($this->current_folder);
470 
471  include_once("./Services/Locator/classes/class.ilLocatorGUI.php");
472  $loc = new ilLocatorGUI();
473  foreach ($path as $p)
474  {
475  $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $p["child"]);
476  $title = $p["title"];
477  if ($this->tree->getRootId() == $p["child"])
478  {
479  $title = ilObject::_lookupTitle($this->media_pool->getId());
480  }
481  $loc->addItem(
482  $title,
483  $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd)
484  );
485  }
486  $ilCtrl->setParameter($this->parent_obj, $this->folder_par,
487  $this->current_folder);
488 
489  $mtpl->setCurrentBlock("loc");
490  $mtpl->setVariable("LOC", $loc->getHTML());
491  $mtpl->parseCurrentBlock();
492  }
493 
494  $mtpl->setVariable("TABLE", parent::render());
495 
496  return $mtpl->get();
497  }
static _lookupTitle($a_id)
lookup object title
locator handling class
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
global $lng
Definition: privfeed.php:40
$path
Definition: index.php:22
+ Here is the call graph for this function:

◆ setInsertCommand()

ilMediaPoolTableGUI::setInsertCommand (   $a_val)

Set inser command.

Parameters
stringinser command

Definition at line 135 of file class.ilMediaPoolTableGUI.php.

136  {
137  $this->insert_command = $a_val;
138  }

◆ setMode()

ilMediaPoolTableGUI::setMode (   $a_mode)

Set Mode.

Parameters
string$a_modeMode

Definition at line 203 of file class.ilMediaPoolTableGUI.php.

Referenced by __construct().

204  {
205  $this->mode = $a_mode;
206  }
+ Here is the caller graph for this function:

Field Documentation

◆ $insert_command

ilMediaPoolTableGUI::$insert_command = "create_mob"

Definition at line 19 of file class.ilMediaPoolTableGUI.php.

Referenced by getInsertCommand().

◆ IL_MEP_EDIT

const ilMediaPoolTableGUI::IL_MEP_EDIT = "edit"

◆ IL_MEP_SELECT

const ilMediaPoolTableGUI::IL_MEP_SELECT = "select"

◆ IL_MEP_SELECT_CONTENT

const ilMediaPoolTableGUI::IL_MEP_SELECT_CONTENT = "selectc"

◆ IL_MEP_SELECT_SINGLE

const ilMediaPoolTableGUI::IL_MEP_SELECT_SINGLE = "selectsingle"

The documentation for this class was generated from the following file: