ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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="")
 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)
 set table data @access public More...
 
 getData ()
 
 dataExists ()
 
 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) @access public More...
 
 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)
 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...
 
 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 @access 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)
 set max. More...
 
- Public Member Functions inherited from ilTableGUI
 ilTableGUI ($a_data=0, $a_global_tpl=true)
 Constructor. More...
 
 setTemplate (&$a_tpl)
 set template @access public More...
 
getTemplateObject ()
 
 setData ($a_data)
 set table data @access public More...
 
 getData ()
 
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 set table title @access public More...
 
 setHelp ($a_help_page, $a_help_icon, $a_help_icon_alt=0)
 set table help page @access public More...
 
 setHeaderNames ($a_header_names)
 set table header names @access public More...
 
 getColumnCount ()
 Returns the column count based on the number of the header row columns @access public. More...
 
 setHeaderVars ($a_header_vars, $a_header_params=0)
 set table header vars @access public More...
 
 setColumnWidth ($a_column_width)
 set table column widths @access public More...
 
 setOneColumnWidth ($a_column_width, $a_column_number)
 set one table column width @access 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) @access public More...
 
 setOffset ($a_offset)
 set dataset offset @access public More...
 
 getOffset ()
 Get offset. More...
 
 setOrderColumn ($a_order_column=0, $a_default_column=0)
 set order column @access public More...
 
 getOrderColumn ()
 Get order column. More...
 
 setOrderDirection ($a_order_direction)
 set order direction @access public More...
 
 getOrderDirection ()
 Get order direction. More...
 
 setFooter ($a_style, $a_previous=0, $a_next=0)
 set order direction @access 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 @access 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...
 
 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 ($worksheet, &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel ($worksheet, &$a_row)
 Excel Version of Fill Header. 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...
 

Protected Attributes

 $parent_tpl = null
 
- 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 = 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
 
 $sortable_fields = array()
 
 $prevent_double_submission = true
 
 $row_selector_label
 

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 26 of file class.ilMediaPoolTableGUI.php.

29 {
30 global $ilCtrl, $lng, $ilAccess, $lng;
31
32 if ($a_parent_tpl == null)
33 {
34 $a_parent_tpl = $GLOBALS["tpl"];
35 }
36 $this->parent_tpl = $a_parent_tpl;
37 if ($a_all_objects)
38 {
39 $this->setId("mepall".$a_parent_obj->object->getId());
40 }
41 else
42 {
43 if (is_object($a_parent_obj->object))
44 {
45 $this->setId("mepfold".$a_parent_obj->object->getId());
46 }
47 }
48
49 parent::__construct($a_parent_obj, $a_parent_cmd);
50 $this->setMode($a_mode);
51 $this->all_objects = $a_all_objects;
52 $lng->loadLanguageModule("mep");
53
54 $this->media_pool = $a_media_pool;
55 $this->tree = ilObjMediaPool::getPoolTree($this->media_pool->getId());
56 $this->folder_par = $a_folder_par;
57
58 if ($this->all_objects)
59 {
60 $this->setExternalSorting(true);
61 $this->initFilter();
62 }
63 // folder determination
64 if ($_GET[$this->folder_par] > 0)
65 {
66 $this->current_folder = $_GET[$this->folder_par];
67 }
68 else if ($_SESSION["mep_pool_folder"] > 0 && $this->tree->isInTree($_SESSION["mep_pool_folder"]))
69 {
70 $this->current_folder = $_SESSION["mep_pool_folder"];
71 }
72 else
73 {
74 $this->current_folder = $this->tree->getRootId();
75 }
76 $_SESSION["mep_pool_folder"] = $this->current_folder;
77
78 $this->addColumn("", "", "1"); // checkbox
79 $this->addColumn($lng->txt("mep_thumbnail"), "", "1");
80 $this->addColumn($lng->txt("mep_title_and_description"), "", "100%");
81 $this->setEnableHeader(true);
82 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
83 $this->setRowTemplate("tpl.mep_list_row.html", "Modules/MediaPool");
84 $this->getItems();
85
86 // title
87 if ($this->current_folder != $this->tree->getRootId() && !$this->all_objects)
88 {
89 $node = $this->tree->getNodeData($this->current_folder);
90 $this->setTitle(
91 $lng->txt("mep_choose_from_folder").": ".$node["title"], "icon_fold.svg",
92 $node["title"]);
93 }
94 else
95 {
96 $this->setTitle(
97 $lng->txt("mep_choose_from_mep").": ".
98 ilObject::_lookupTitle($this->media_pool->getId()),
99 "icon_mep.svg",
100 ilObject::_lookupTitle($this->media_pool->getId()));
101 }
102
103 // action commands
104 if ($ilAccess->checkAccess("write", "", $this->media_pool->getRefId()) &&
105 $this->getMode() == ilMediaPoolTableGUI::IL_MEP_EDIT)
106 {
107 $this->addMultiCommand("copyToClipboard", $lng->txt("cont_copy_to_clipboard"));
108 $this->addMultiCommand("confirmRemove", $lng->txt("remove"));
109
110 if (!$this->all_objects)
111 {
112/* $this->addCommandButton("createFolderForm", $lng->txt("mep_create_folder"));
113 $this->addCommandButton("createMediaObject", $lng->txt("mep_create_mob"));
114
115 $mset = new ilSetting("mobs");
116 if ($mset->get("mep_activate_pages"))
117 {
118 $this->addCommandButton("createMediaPoolPage", $lng->txt("mep_create_content_snippet"));
119 }*/
120 }
121 }
122
124 {
125 // ... even more coupling with ilpcmediaobjectgui
126 $this->addMultiCommand("selectObjectReference", $lng->txt("cont_select"));
127 }
128
130 $ilAccess->checkAccess("write", "", $this->media_pool->getRefId()))
131 {
132 $this->setSelectAllCheckbox("id");
133 }
134 }
$_GET["client_id"]
$_SESSION["AccountId"]
getItems()
Get items of current folder.
static getPoolTree($a_obj_id)
Get Pool Tree.
static _lookupTitle($a_id)
lookup object title
setEnableHeader($a_enableheader)
Set Enable Header.
setExternalSorting($a_val)
Set external sorting.
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.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40

References $_GET, $_SESSION, $GLOBALS, $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().

+ 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.

Reimplemented from ilTable2GUI.

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

313 {
314 global $lng, $ilCtrl, $ilAccess;
315
316 $this->tpl->setCurrentBlock("link");
317
318 switch($a_set["type"])
319 {
320 case "fold":
321 $this->tpl->setVariable("TXT_TITLE", $a_set["title"]);
322 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $a_set["obj_id"]);
323 $this->tpl->setVariable("LINK_VIEW",
324 $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd));
325 $this->tpl->parseCurrentBlock();
326
327 if ($ilAccess->checkAccess("write", "", $this->media_pool->getRefId()) &&
328 $this->getMode() == ilMediaPoolTableGUI::IL_MEP_EDIT)
329 {
330 $this->tpl->setCurrentBlock("edit");
331 $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit"));
332 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $a_set["obj_id"]);
333 $this->tpl->setVariable("EDIT_LINK",
334 $ilCtrl->getLinkTarget($this->parent_obj, "editFolder"));
335 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $_GET[$this->folder_par]);
336 $this->tpl->parseCurrentBlock();
337 }
338
339 $this->tpl->setCurrentBlock("tbl_content");
340 $this->tpl->setVariable("IMG", ilUtil::img(ilUtil::getImagePath("icon_".$a_set["type"].".svg")));
341 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
342 break;
343
344 case "pg":
347 {
348 $this->tpl->setVariable("TXT_NO_LINK_TITLE", $a_set["title"]);
349 }
350 else
351 {
352 $this->tpl->setVariable("ONCLICK", "il.MediaPool.preview('".$a_set["child"]."'); return false;");
353 $this->tpl->setVariable("TXT_TITLE", $a_set["title"]);
354 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", $a_set["child"]);
355 }
356
357 if ($ilAccess->checkAccess("write", "", $this->media_pool->getRefId()) &&
358 $this->getMode() == ilMediaPoolTableGUI::IL_MEP_EDIT)
359 {
360 $this->tpl->setCurrentBlock("edit");
361 $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit"));
362 $ilCtrl->setParameterByClass("ilmediapoolpagegui", "mepitem_id", $a_set["child"]);
363 $this->tpl->setVariable("EDIT_LINK",
364 $ilCtrl->getLinkTargetByClass("ilmediapoolpagegui", "edit"));
365 $this->tpl->parseCurrentBlock();
366 }
367
368 $this->tpl->setCurrentBlock("tbl_content");
369 $this->tpl->setVariable("IMG", ilUtil::img(ilUtil::getImagePath("icon_pg.svg")));
370 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
371 break;
372
373 case "mob":
374 $this->tpl->setVariable("ONCLICK", "il.MediaPool.preview('".$a_set["child"]."'); return false;");
375 $this->tpl->setVariable("TXT_TITLE", $a_set["title"]);
376 $ilCtrl->setParameterByClass("ilobjmediaobjectgui", "mepitem_id", $a_set["child"]);
377 $ilCtrl->setParameter($this->parent_obj, "mob_id", $a_set["foreign_id"]);
378
379 // edit link
380 if ($ilAccess->checkAccess("write", "", $this->media_pool->getRefId()) &&
381 $this->getMode() == ilMediaPoolTableGUI::IL_MEP_EDIT)
382 {
383 $this->tpl->setCurrentBlock("edit");
384 $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit"));
385 $this->tpl->setVariable("EDIT_LINK",
386 $ilCtrl->getLinkTargetByClass("ilobjmediaobjectgui", "edit"));
387 $this->tpl->parseCurrentBlock();
388 }
389
390 $this->tpl->setCurrentBlock("link");
391 $this->tpl->setCurrentBlock("tbl_content");
392
393 // output thumbnail (or mob icon)
394 if (ilObject::_lookupType($a_set["foreign_id"]) == "mob")
395 {
396 $mob = new ilObjMediaObject($a_set["foreign_id"]);
397 $med = $mob->getMediaItem("Standard");
398 $target = "";
399 if ($med)
400 {
401 $target = $med->getThumbnailTarget();
402 }
403 if ($target != "")
404 {
405 $this->tpl->setVariable("IMG", ilUtil::img($target));
406 }
407 else
408 {
409 $this->tpl->setVariable("IMG",
410 ilUtil::img(ilUtil::getImagePath("icon_".$a_set["type"].".svg")));
411 }
412 if ($med && ilUtil::deducibleSize($med->getFormat()) &&
413 $med->getLocationType() == "Reference")
414 {
415 $size = @getimagesize($med->getLocation());
416 if ($size[0] > 0 && $size[1] > 0)
417 {
418 $wr = $size[0] / 80;
419 $hr = $size[1] / 80;
420 $r = max($wr, hr);
421 $w = (int) ($size[0]/$r);
422 $h = (int) ($size[1]/$r);
423 $this->tpl->setVariable("IMG",
424 ilUtil::img($med->getLocation(), "", $w, $h));
425 }
426 }
427
428 // output media info
429 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
430 $this->tpl->setVariable("MEDIA_INFO",
432 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
433 }
434 break;
435 }
436
437 if ($ilAccess->checkAccess("write", "", $this->media_pool->getRefId()))
438 {
439 if (($this->getMode() == ilMediaPoolTableGUI::IL_MEP_EDIT ||
440 ($this->getMode() == ilMediaPoolTableGUI::IL_MEP_SELECT && $a_set["type"] == "mob") ||
441 ($this->getMode() == ilMediaPoolTableGUI::IL_MEP_SELECT_CONTENT && $a_set["type"] == "pg")
442 ))
443 {
444 $this->tpl->setCurrentBlock("chbox");
445 $this->tpl->setVariable("CHECKBOX_ID", $a_set["child"]);
446 $this->tpl->parseCurrentBlock();
447 $this->tpl->setCurrentBlock("tbl_content");
448 }
449 else if ($this->getMode() == ilMediaPoolTableGUI::IL_MEP_SELECT_SINGLE && $a_set["type"] == "mob")
450 {
451 $this->tpl->setCurrentBlock("radio");
452 $this->tpl->setVariable("RADIO_ID", $a_set["child"]);
453 $this->tpl->parseCurrentBlock();
454 $this->tpl->setCurrentBlock("tbl_content");
455 }
456 }
457 }
$size
Definition: RandomTest.php:79
_getMediaInfoHTML(&$a_mob)
get media info as html
Class ilObjMediaObject.
static _lookupType($a_id, $a_reference=false)
lookup object type
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static deducibleSize($a_mime)
checks if mime type is provided by getimagesize()
$h
$w
$r
Definition: example_031.php:79

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

+ Here is the call graph for this function:

◆ getHTML()

ilMediaPoolTableGUI::getHTML ( )

Get HTML.

Parameters

return

Reimplemented from ilTable2GUI.

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

163 {
164 $html = parent::getHTML();
165 include_once("./Modules/MediaPool/classes/class.ilObjMediaPoolGUI.php");
166 $html.= ilObjMediaPoolGUI::getPreviewModalHTML($this->media_pool->getRefId(), $this->parent_tpl);
167 return $html;
168 }
static getPreviewModalHTML($a_mpool_ref_id, $a_tpl)
Get preview modal html.
$html
Definition: example_001.php:87

References $html, and ilObjMediaPoolGUI\getPreviewModalHTML().

+ Here is the call graph for this function:

◆ getInsertCommand()

ilMediaPoolTableGUI::getInsertCommand ( )

Get inser command.

Returns
string inser command

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

References $insert_command.

Referenced by prepareOutput().

+ Here is the caller graph for this function:

◆ getItems()

ilMediaPoolTableGUI::getItems ( )

Get items of current folder.

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

243 {
244 if (!$this->all_objects)
245 {
246 $fobjs = $this->media_pool->getChilds($this->current_folder, "fold");
247 $f2objs = array();
248 foreach ($fobjs as $obj)
249 {
250 $f2objs[$obj["title"].":".$obj["child"]] = $obj;
251 }
252 ksort($f2objs);
253
254 // get current media objects / pages
256 {
257 $mobjs = $this->media_pool->getChilds($this->current_folder, "mob");
258 }
260 {
261 $mobjs = $this->media_pool->getChilds($this->current_folder, "pg");
262 }
263 else
264 {
265 $mobjs = $this->media_pool->getChildsExceptFolders($this->current_folder);
266 }
267 $m2objs = array();
268 foreach ($mobjs as $obj)
269 {
270 $m2objs[$obj["title"].":".$obj["child"]] = $obj;
271 }
272 ksort($m2objs);
273
274 // merge everything together
275 $objs = array_merge($f2objs, $m2objs);
276 }
277 else
278 {
279 $objs = $this->media_pool->getMediaObjects(
280 $this->filter["title"],
281 $this->filter["format"],
282 $this->filter['keyword'],
283 $this->filter['caption']
284 );
285 }
286//var_dump($objs);
287 $this->setData($objs);
288 }
setData($a_data)
set table data @access public

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

Referenced by __construct().

+ 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 234 of file class.ilMediaPoolTableGUI.php.

235 {
236 return $this->mode;
237 }

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

+ Here is the caller graph for this function:

◆ initFilter()

ilMediaPoolTableGUI::initFilter ( )

Init filter.

Reimplemented from ilTable2GUI.

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

175 {
176 global $lng, $rbacreview, $ilUser;
177
178 // title/description
179 include_once("./Services/Form/classes/class.ilTextInputGUI.php");
180 $ti = new ilTextInputGUI($lng->txt("title"), "title");
181 $ti->setMaxLength(64);
182 $ti->setSize(20);
183 $this->addFilterItem($ti);
184 $ti->readFromSession();
185 $this->filter["title"] = $ti->getValue();
186
187 // keyword
188 $GLOBALS['lng']->loadLanguageModule('meta');
189 $ke = new ilTextInputGUI($lng->txt('meta_keyword'),'keyword');
190 $ke->setMaxLength(64);
191 $ke->setSize(20);
192 $this->addFilterItem($ke);
193 $ke->readFromSession();
194 $this->filter['keyword'] = $ke->getValue();
195
196 // Caption
197 $ca = new ilTextInputGUI($lng->txt('cont_caption'),'caption');
198 $ca->setMaxLength(64);
199 $ca->setSize(20);
200 $this->addFilterItem($ca);
201 $ca->readFromSession();
202 $this->filter['caption'] = $ca->getValue();
203
204 // format
205 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
206 $options = array(
207 "" => $lng->txt("mep_all"),
208 );
209 $formats = $this->media_pool->getUsedFormats();
210 $options = array_merge($options, $formats);
211 $si = new ilSelectInputGUI($this->lng->txt("mep_format"), "format");
212 $si->setOptions($options);
213 $this->addFilterItem($si);
214 $si->readFromSession();
215 $this->filter["format"] = $si->getValue();
216
217 }
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.
if(!is_array($argv)) $options
global $ilUser
Definition: imgupload.php:15

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

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

ilMediaPoolTableGUI::prepareOutput ( )

Prepare output.

Parameters

return

Reimplemented from ilTable2GUI.

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

297 {
298 global $lng;
299
302 {
303 $this->addMultiCommand($this->getInsertCommand(), $lng->txt("insert"));
304 $this->addCommandButton("cancelCreate", $lng->txt("cancel"));
305 }
306 }
getInsertCommand()
Get inser command.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.

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

+ Here is the call graph for this function:

◆ render()

ilMediaPoolTableGUI::render ( )

get HTML

Parameters

return

Reimplemented from ilTable2GUI.

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

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

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

+ Here is the call graph for this function:

◆ setInsertCommand()

ilMediaPoolTableGUI::setInsertCommand (   $a_val)

Set inser command.

Parameters
stringinser command

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

142 {
143 $this->insert_command = $a_val;
144 }

◆ setMode()

ilMediaPoolTableGUI::setMode (   $a_mode)

Set Mode.

Parameters
string$a_modeMode

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

225 {
226 $this->mode = $a_mode;
227 }

Referenced by __construct().

+ 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().

◆ $parent_tpl

ilMediaPoolTableGUI::$parent_tpl = null
protected

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

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