ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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, $a_parent_tpl=null)
 Constructor. More...
 
 setInsertCommand ($a_val)
 Set inser command. More...
 
 getInsertCommand ()
 Get inser command. More...
 
 getHTML ()
 Get HTML. 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="")
 ilTable2GUI 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, $a_multipart=false)
 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, $a_select_all_on_top=false)
 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, $a_caption=null)
 Set filter command. More...
 
 getFilterCommand ()
 Get filter command. More...
 
 setResetCommand ($a_val, $a_caption=null)
 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...
 
 setDefaultFilterVisiblity ($a_status)
 Set default filter visiblity. More...
 
 getDefaultFilterVisibility ()
 Get default filter visibility. More...
 
 clearCommandButtons ()
 
 addCommandButton ($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
 Add Command button. More...
 
 addCommandButtonInstance (ilButtonBase $a_button)
 Add Command button instance. 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="", $a_tooltip_with_html=false)
 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 ()
 
 setPreventDoubleSubmission ($a_val)
 Set prevent double submission. More...
 
 getPreventDoubleSubmission ()
 Get prevent double submission. More...
 
 setLimit ($a_limit=0, $a_default_limit=0)
 
- Public Member Functions inherited from ilTableGUI
 __construct ($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 FILTER_CHECKBOX = 9
 
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

 showAdvMetadata ()
 Show adv metadata. More...
 
 getAdvMDRecordGUI ()
 needed for advmd filter handling More...
 
 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...
 
 isFilterVisible ()
 Check if filter is visible: manually shown (session, db) or default value set. More...
 
 isAdvMDFilter (ilAdvancedMDRecordGUI $a_gui, $a_element)
 Check if filter element is based on adv md. 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 (ilExcel $a_excel, &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel (ilExcel $a_excel, &$a_row)
 Excel Version of Fill Header. More...
 
 fillRowExcel (ilExcel $a_excel, &$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...
 

Protected Attributes

 $access
 
 $rbacreview
 
 $user
 
 $parent_tpl = null
 
 $adv_filter_record_gui
 
- Protected Attributes inherited from ilTable2GUI
 $ctrl
 
 $tpl
 
 $parent_obj
 
 $parent_cmd
 
 $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 = []
 
 $disable_filter_hiding = false
 
 $selected_filter = false
 
 $top_commands = true
 
 $selectable_columns = array()
 
 $selected_column = array()
 
 $show_templates = false
 
 $show_rows_selector = true
 
 $rows_selector_off = 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
 
 $restore_filter
 
 $restore_filter_values
 
 $default_filter_visibility = false
 
 $sortable_fields = array()
 
 $prevent_double_submission = true
 
 $row_selector_label
 
 $select_all_on_top = false
 
 $sel_buttons = []
 
- Protected Attributes inherited from ilTableGUI
 $tpl
 
 $lng
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 Get maximum number of entries to enable actions for all. More...
 

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,
  $a_parent_tpl = null 
)

Constructor.

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

References $_GET, $_SESSION, $DIC, $GLOBALS, $ilCtrl, ilTableGUI\$lng, ilObjMediaPool\_getPoolTree(), ilObject\_lookupTitle(), ilTable2GUI\addColumn(), ilTable2GUI\addMultiCommand(), getItems(), getMode(), IL_MEP_EDIT, IL_MEP_SELECT_SINGLE, initFilter(), ilAdvancedMDRecordGUI\MODE_FILTER, ilAdvancedMDRecordGUI\MODE_TABLE_HEAD, ilTable2GUI\setEnableHeader(), ilTable2GUI\setExternalSorting(), ilTable2GUI\setFilterCommand(), ilTable2GUI\setFormAction(), ilTable2GUI\setId(), setMode(), ilTable2GUI\setResetCommand(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), ilAdvancedMDRecordGUI\setTableGUI(), ilTable2GUI\setTitle(), showAdvMetadata(), and user().

54  {
55  global $DIC;
56 
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();
62 
63  $ilCtrl = $DIC->ctrl();
64  $ilAccess = $DIC->access();
65  $lng = $DIC->language();
66 
67  if ($a_parent_tpl == null) {
68  $a_parent_tpl = $GLOBALS["tpl"];
69  }
70  $this->parent_tpl = $a_parent_tpl;
71  if ($a_all_objects) {
72  $this->setId("mepall");
73  if (is_object($a_parent_obj->object)) {
74  $this->setId("mepall" . $a_parent_obj->object->getId());
75  }
76  } else {
77  $this->setId("mepfold");
78  if (is_object($a_parent_obj->object)) {
79  $this->setId("mepfold" . $a_parent_obj->object->getId());
80  }
81  }
82 
83  parent::__construct($a_parent_obj, $a_parent_cmd);
84  $this->setMode($a_mode);
85  $this->all_objects = $a_all_objects;
86  $lng->loadLanguageModule("mep");
87 
88  $this->media_pool = $a_media_pool;
89  $this->tree = ilObjMediaPool::_getPoolTree($this->media_pool->getId());
90  $this->folder_par = $a_folder_par;
91 
92  if ($this->all_objects) {
93  $this->setExternalSorting(true);
94  $this->initFilter();
95  }
96  // folder determination
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"];
101  } else {
102  $this->current_folder = $this->tree->getRootId();
103  }
104  $_SESSION["mep_pool_folder"] = $this->current_folder;
105 
106  // standard columns
107  $this->addColumn("", "", "1"); // checkbox
108  $this->addColumn($lng->txt("mep_thumbnail"), "", "1");
109  $this->addColumn($lng->txt("mep_title_and_description"));
110  $this->setEnableHeader(true);
111  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
112  $this->setRowTemplate("tpl.mep_list_row.html", "Modules/MediaPool");
113 
114  if ($this->showAdvMetadata()) {
115  // adv metadata init (adds filter)
116  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
117  $this->adv_filter_record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_FILTER, 'mep', $this->media_pool->getId(), 'mob');
118  $this->adv_filter_record_gui->setTableGUI($this);
119  $this->adv_filter_record_gui->parse();
120 
121  // adv metadata columns
122  $adv_th_record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_TABLE_HEAD, 'mep', $this->media_pool->getId(), 'mob');
123  $adv_th_record_gui->setTableGUI($this);
124  $adv_th_record_gui->parse();
125  if ($a_mode == self::IL_MEP_SELECT) {
126  $this->setFilterCommand("insert_applyFilter");
127  $this->setResetCommand("insert_resetFilter");
128  }
129  }
130 
131  // actions column
132  $this->addColumn($lng->txt("actions"));
133 
134  // get items
135  $this->getItems();
136 
137  // title
138  if ($a_mode != ilMediaPoolTableGUI::IL_MEP_EDIT) {
139  if ($this->current_folder != $this->tree->getRootId() && !$this->all_objects) {
140  $node = $this->tree->getNodeData($this->current_folder);
141  $this->setTitle(
142  $lng->txt("mep_choose_from_folder") . ": " . $node["title"],
143  "icon_fold.svg",
144  $node["title"]
145  );
146  } else {
147  $this->setTitle(
148  $lng->txt("mep_choose_from_mep") . ": " .
149  ilObject::_lookupTitle($this->media_pool->getId()),
150  "icon_mep.svg",
151  ilObject::_lookupTitle($this->media_pool->getId())
152  );
153  }
154  }
155 
156  // action commands
157  if ($ilAccess->checkAccess("write", "", $this->media_pool->getRefId()) &&
159  $this->addMultiCommand("copyToClipboard", $lng->txt("cont_copy_to_clipboard"));
160  $this->addMultiCommand("confirmRemove", $lng->txt("remove"));
161 
162  if (!$this->all_objects) {
163  /* $this->addCommandButton("createFolderForm", $lng->txt("mep_create_folder"));
164  $this->addCommandButton("createMediaObject", $lng->txt("mep_create_mob"));
165 
166  $mset = new ilSetting("mobs");
167  if ($mset->get("mep_activate_pages"))
168  {
169  $this->addCommandButton("createMediaPoolPage", $lng->txt("mep_create_content_snippet"));
170  }*/
171  }
172  }
173 
175  // ... even more coupling with ilpcmediaobjectgui
176  $this->addMultiCommand("selectObjectReference", $lng->txt("cont_select"));
177  }
178 
179  if ($this->getMode() == ilMediaPoolTableGUI::IL_MEP_EDIT &&
180  $ilAccess->checkAccess("write", "", $this->media_pool->getRefId())) {
181  $this->setSelectAllCheckbox("id");
182  }
183  }
setExternalSorting($a_val)
Set external sorting.
showAdvMetadata()
Show adv metadata.
$_SESSION["AccountId"]
global $DIC
Definition: saml.php:7
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
setId($a_val)
Set id.
user()
Definition: user.php:4
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.
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.
addMultiCommand($a_cmd, $a_text)
Add Command button.
static _getPoolTree($a_obj_id)
Get Pool Tree.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
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.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
setFilterCommand($a_val, $a_caption=null)
Set filter command.
+ 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 392 of file class.ilMediaPoolTableGUI.php.

References $_GET, $access, ilTable2GUI\$ctrl, $h, $ilCtrl, ilTableGUI\$lng, $r, $size, $target, $w, 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(), ilAdvancedMDRecordGUI\MODE_TABLE_CELLS, ilAdvancedMDRecordGUI\setTableGUI(), and showAdvMetadata().

393  {
394  $lng = $this->lng;
396  $ilAccess = $this->access;
397 
398  $this->tpl->setCurrentBlock("link");
399 
400  // adv metadata columns
401  if ($this->showAdvMetadata()) {
402  $adv_cell_record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_TABLE_CELLS, 'mep', $this->media_pool->getId(), 'mob');
403  $adv_cell_record_gui->setTableGUI($this);
404  $adv_cell_record_gui->setRowData($a_set);
405  $this->tpl->setVariable("ADV_CELLS", $adv_cell_record_gui->parse());
406  }
407 
408 
409  switch ($a_set["type"]) {
410  case "fold":
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(
414  "LINK_VIEW",
415  $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd)
416  );
417  $this->tpl->parseCurrentBlock();
418 
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(
425  "EDIT_LINK",
426  $ilCtrl->getLinkTarget($this->parent_obj, "editFolder")
427  );
428  $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $_GET[$this->folder_par]);
429  $this->tpl->parseCurrentBlock();
430  }
431 
432  $this->tpl->setCurrentBlock("tbl_content");
433  $this->tpl->setVariable("IMG", ilUtil::img(ilUtil::getImagePath("icon_" . $a_set["type"] . ".svg")));
434  $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
435  break;
436 
437  case "pg":
440  $this->tpl->setVariable("TXT_NO_LINK_TITLE", $a_set["title"]);
441  } else {
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"]);
445  }
446 
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(
453  "EDIT_LINK",
454  $ilCtrl->getLinkTargetByClass("ilmediapoolpagegui", "edit")
455  );
456  $this->tpl->parseCurrentBlock();
457  }
458 
459  $this->tpl->setCurrentBlock("tbl_content");
460  $this->tpl->setVariable("IMG", ilUtil::img(ilUtil::getImagePath("icon_pg.svg")));
461  $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
462  break;
463 
464  case "mob":
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"]);
469 
470  // edit link
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(
476  "EDIT_LINK",
477  $ilCtrl->getLinkTargetByClass("ilobjmediaobjectgui", "edit")
478  );
479  $this->tpl->parseCurrentBlock();
480  }
481 
482  $this->tpl->setCurrentBlock("link");
483  $this->tpl->setCurrentBlock("tbl_content");
484 
485  // output thumbnail (or mob icon)
486  if (ilObject::_lookupType($a_set["foreign_id"]) == "mob") {
487  $mob = new ilObjMediaObject($a_set["foreign_id"]);
488  $med = $mob->getMediaItem("Standard");
489  $target = "";
490  if ($med) {
491  $target = $med->getThumbnailTarget();
492  }
493  if ($target != "") {
494  $this->tpl->setVariable("IMG", ilUtil::img($target));
495  } else {
496  $this->tpl->setVariable(
497  "IMG",
498  ilUtil::img(ilUtil::getImagePath("icon_" . $a_set["type"] . ".svg"))
499  );
500  }
501  if ($med && ilUtil::deducibleSize($med->getFormat()) &&
502  $med->getLocationType() == "Reference") {
503  $size = @getimagesize($med->getLocation());
504  if ($size[0] > 0 && $size[1] > 0) {
505  $wr = $size[0] / 80;
506  $hr = $size[1] / 80;
507  $r = max($wr, $hr);
508  $w = (int) ($size[0] / $r);
509  $h = (int) ($size[1] / $r);
510  $this->tpl->setVariable(
511  "IMG",
512  ilUtil::img($med->getLocation(), "", $w, $h)
513  );
514  }
515  }
516 
517  // output media info
518  include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
519  $this->tpl->setVariable(
520  "MEDIA_INFO",
522  );
523  $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
524  }
525  break;
526  }
527 
528  if ($ilAccess->checkAccess("write", "", $this->media_pool->getRefId())) {
529  if ((
531  ($this->getMode() == ilMediaPoolTableGUI::IL_MEP_SELECT && $a_set["type"] == "mob") ||
532  ($this->getMode() == ilMediaPoolTableGUI::IL_MEP_SELECT_CONTENT && $a_set["type"] == "pg")
533  )) {
534  $this->tpl->setCurrentBlock("chbox");
535  $this->tpl->setVariable("CHECKBOX_ID", $a_set["child"]);
536  $this->tpl->parseCurrentBlock();
537  $this->tpl->setCurrentBlock("tbl_content");
538  } elseif ($this->getMode() == ilMediaPoolTableGUI::IL_MEP_SELECT_SINGLE && $a_set["type"] == "mob") {
539  $this->tpl->setCurrentBlock("radio");
540  $this->tpl->setVariable("RADIO_ID", $a_set["child"]);
541  $this->tpl->parseCurrentBlock();
542  $this->tpl->setCurrentBlock("tbl_content");
543  }
544  }
545  }
$size
Definition: RandomTest.php:84
showAdvMetadata()
Show adv metadata.
$_GET["client_id"]
$h
static deducibleSize($a_mime)
checks if mime type is provided by getimagesize()
$w
global $ilCtrl
Definition: ilias.php:18
$r
Definition: example_031.php:79
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Class ilObjMediaObject.
static img($a_src, $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static _lookupType($a_id, $a_reference=false)
lookup object type
static _getMediaInfoHTML(&$a_mob)
get media info as html
$target
Definition: test.php:19
+ Here is the call graph for this function:

◆ getAdvMDRecordGUI()

ilMediaPoolTableGUI::getAdvMDRecordGUI ( )
protected

needed for advmd filter handling

Returns
ilAdvancedMDRecordGUI

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

References $adv_filter_record_gui.

◆ getHTML()

ilMediaPoolTableGUI::getHTML ( )

Get HTML.

Parameters

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

References $html, $parent_tpl, and ilObjMediaPoolGUI\getPreviewModalHTML().

236  {
237  $html = parent::getHTML();
238  include_once("./Modules/MediaPool/classes/class.ilObjMediaPoolGUI.php");
239  $html .= ilObjMediaPoolGUI::getPreviewModalHTML($this->media_pool->getRefId(), $this->parent_tpl);
240  return $html;
241  }
static getPreviewModalHTML($a_mpool_ref_id, $a_tpl)
Get preview modal html.
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ getInsertCommand()

ilMediaPoolTableGUI::getInsertCommand ( )

Get inser command.

Returns
string inser command

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

References $insert_command.

Referenced by prepareOutput().

225  {
226  return $this->insert_command;
227  }
+ Here is the caller graph for this function:

◆ getItems()

ilMediaPoolTableGUI::getItems ( )

Get items of current folder.

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

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

Referenced by __construct().

317  {
318  if (!$this->all_objects) {
319  $fobjs = $this->media_pool->getChilds($this->current_folder, "fold");
320  $f2objs = array();
321  foreach ($fobjs as $obj) {
322  $f2objs[$obj["title"] . ":" . $obj["child"]] = $obj;
323  }
324  ksort($f2objs);
325 
326  // get current media objects / pages
328  $mobjs = $this->media_pool->getChilds($this->current_folder, "mob");
329  } elseif ($this->getMode() == ilMediaPoolTableGUI::IL_MEP_SELECT_CONTENT) {
330  $mobjs = $this->media_pool->getChilds($this->current_folder, "pg");
331  } else {
332  $mobjs = $this->media_pool->getChildsExceptFolders($this->current_folder);
333  }
334  $m2objs = array();
335  foreach ($mobjs as $obj) {
336  $m2objs[$obj["title"] . ":" . $obj["child"]] = $obj;
337  }
338  ksort($m2objs);
339 
340  // merge everything together
341  $objs = array_merge($f2objs, $m2objs);
342  } else {
343  $objs = $this->media_pool->getMediaObjects(
344  $this->filter["title"],
345  $this->filter["format"],
346  $this->filter['keyword'],
347  $this->filter['caption']
348  );
349  }
350 
351  // add advanced metadata
352  if ($this->showAdvMetadata()) {
353  include_once("./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php");
355  $this->media_pool->getRefId(),
356  "mep",
357  "mob",
358  0,
359  "mob",
360  $objs,
361  "",
362  "foreign_id",
363  $this->adv_filter_record_gui->getFilterElements()
364  );
365  }
366  //echo ("<br>".$this->media_pool->getRefId());
367  //var_dump($objs); exit;
368  $this->setData($objs);
369  }
showAdvMetadata()
Show adv metadata.
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.
+ 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 308 of file class.ilMediaPoolTableGUI.php.

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

309  {
310  return $this->mode;
311  }
+ Here is the caller graph for this function:

◆ initFilter()

ilMediaPoolTableGUI::initFilter ( )

Init filter.

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

References $formats, $GLOBALS, $ilUser, ilTableGUI\$lng, PHPMailer\PHPMailer\$options, $rbacreview, $si, $user, ilTable2GUI\addFilterItem(), and ilTextInputGUI\setMaxLength().

Referenced by __construct().

248  {
249  $lng = $this->lng;
252 
253  // title/description
254  include_once("./Services/Form/classes/class.ilTextInputGUI.php");
255  $ti = new ilTextInputGUI($lng->txt("title"), "title");
256  $ti->setMaxLength(64);
257  $ti->setSize(20);
258  $this->addFilterItem($ti);
259  $ti->readFromSession();
260  $this->filter["title"] = $ti->getValue();
261 
262  // keyword
263  $GLOBALS['lng']->loadLanguageModule('meta');
264  $ke = new ilTextInputGUI($lng->txt('meta_keyword'), 'keyword');
265  $ke->setMaxLength(64);
266  $ke->setSize(20);
267  $this->addFilterItem($ke);
268  $ke->readFromSession();
269  $this->filter['keyword'] = $ke->getValue();
270 
271  // Caption
272  $ca = new ilTextInputGUI($lng->txt('cont_caption'), 'caption');
273  $ca->setMaxLength(64);
274  $ca->setSize(20);
275  $this->addFilterItem($ca);
276  $ca->readFromSession();
277  $this->filter['caption'] = $ca->getValue();
278 
279  // format
280  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
281  $options = array(
282  "" => $lng->txt("mep_all"),
283  );
284  $formats = $this->media_pool->getUsedFormats();
285  $options = array_merge($options, $formats);
286  $si = new ilSelectInputGUI($this->lng->txt("mep_format"), "format");
287  $si->setOptions($options);
288  $this->addFilterItem($si);
289  $si->readFromSession();
290  $this->filter["format"] = $si->getValue();
291  }
This class represents a selection list property in a property form.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
This class represents a text property in a property form.
$ilUser
Definition: imgupload.php:18
setMaxLength($a_maxlength)
Set Max Length.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
$formats
Definition: date.php:77
+ 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 377 of file class.ilMediaPoolTableGUI.php.

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

378  {
379  $lng = $this->lng;
380 
383  $this->addMultiCommand($this->getInsertCommand(), $lng->txt("insert"));
384  $this->addCommandButton("cancelCreate", $lng->txt("cancel"));
385  }
386  }
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
addMultiCommand($a_cmd, $a_text)
Add Command button.
getInsertCommand()
Get inser command.
+ Here is the call graph for this function:

◆ render()

ilMediaPoolTableGUI::render ( )

get HTML

Parameters

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

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

554  {
556  $lng = $this->lng;
557 
558  $mtpl = new ilTemplate("tpl.media_sel_table.html", true, true, "Modules/MediaPool");
559 
560  $pre = "";
561  if ($this->current_folder != $this->tree->getRootId() && !$this->all_objects) {
562  $path = $this->tree->getPathFull($this->current_folder);
563 
564  include_once("./Services/Locator/classes/class.ilLocatorGUI.php");
565  $loc = new ilLocatorGUI();
566  foreach ($path as $p) {
567  $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $p["child"]);
568  $title = $p["title"];
569  if ($this->tree->getRootId() == $p["child"]) {
570  $title = ilObject::_lookupTitle($this->media_pool->getId());
571  }
572  $loc->addItem(
573  $title,
574  $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd)
575  );
576  }
577  $ilCtrl->setParameter(
578  $this->parent_obj,
579  $this->folder_par,
580  $this->current_folder
581  );
582 
583  $mtpl->setCurrentBlock("loc");
584  $mtpl->setVariable("LOC", $loc->getHTML());
585  $mtpl->parseCurrentBlock();
586  }
587 
588  $mtpl->setVariable("TABLE", parent::render());
589 
590  return $mtpl->get();
591  }
$path
Definition: aliased.php:25
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
+ Here is the call graph for this function:

◆ setInsertCommand()

ilMediaPoolTableGUI::setInsertCommand (   $a_val)

Set inser command.

Parameters
stringinser command

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

215  {
216  $this->insert_command = $a_val;
217  }

◆ setMode()

ilMediaPoolTableGUI::setMode (   $a_mode)

Set Mode.

Parameters
string$a_modeMode

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

Referenced by __construct().

299  {
300  $this->mode = $a_mode;
301  }
+ Here is the caller graph for this function:

◆ showAdvMetadata()

ilMediaPoolTableGUI::showAdvMetadata ( )
protected

Show adv metadata.

Returns
bool

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

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

190  {
191  if ($this->all_objects) {
192  return true;
193  }
194 
195  return false;
196  }
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilMediaPoolTableGUI::$access
protected

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

Referenced by fillRow().

◆ $adv_filter_record_gui

ilMediaPoolTableGUI::$adv_filter_record_gui
protected

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

Referenced by getAdvMDRecordGUI().

◆ $insert_command

ilMediaPoolTableGUI::$insert_command = "create_mob"

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

Referenced by getInsertCommand().

◆ $parent_tpl

ilMediaPoolTableGUI::$parent_tpl = null
protected

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

Referenced by getHTML().

◆ $rbacreview

ilMediaPoolTableGUI::$rbacreview
protected

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

Referenced by initFilter().

◆ $user

ilMediaPoolTableGUI::$user
protected

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

Referenced by initFilter().

◆ 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: