ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilMediaPoolTableGUI Class Reference

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

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

Public Member Functions

 __construct (object $a_parent_obj, string $a_parent_cmd, ilObjMediaPool $a_media_pool, string $a_folder_par="obj_id", string $a_mode=ilMediaPoolTableGUI::IL_MEP_EDIT, bool $a_all_objects=false, ?ilGlobalTemplateInterface $a_parent_tpl=null)
 
 setInsertCommand (string $a_val)
 
 getInsertCommand ()
 
 getHTML ()
 Get HTML. More...
 
 initFilter ()
 
 setMode (string $a_mode)
 
 getMode ()
 
 getItems ()
 
 render ()
 
- Public Member Functions inherited from ilTable2GUI
 __construct (?object $a_parent_obj, string $a_parent_cmd="", string $a_template_context="")
 
 setOpenFormTag (bool $a_val)
 
 getOpenFormTag ()
 
 setCloseFormTag (bool $a_val)
 
 getCloseFormTag ()
 
 determineLimit ()
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 determineSelectedColumns ()
 
 isColumnSelected (string $col)
 
 getSelectedColumns ()
 
 resetOffset (bool $a_in_determination=false)
 
 initFilter ()
 
 getParentObject ()
 
 getParentCmd ()
 
 setTopAnchor (string $a_val)
 
 getTopAnchor ()
 
 setNoEntriesText (string $a_text)
 
 getNoEntriesText ()
 
 setIsDataTable (bool $a_val)
 
 getIsDataTable ()
 
 setEnableTitle (bool $a_enabletitle)
 
 getEnableTitle ()
 
 setEnableHeader (bool $a_enableheader)
 
 getEnableHeader ()
 
 setEnableNumInfo (bool $a_val)
 
 getEnableNumInfo ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setDescription (string $a_val)
 
 getDescription ()
 
 setOrderField (string $a_order_field)
 
 getOrderField ()
 
 setData (array $a_data)
 Set table data. More...
 
 getData ()
 
 dataExists ()
 
 setPrefix (string $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) More...
 
 getPrefix ()
 
 addFilterItem (ilTableFilterItem $a_input_item, bool $a_optional=false)
 
 addFilterItemByMetaType (string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
 Add filter by standard type. More...
 
 getFilterItems (bool $a_optionals=false)
 
 getFilterItemByPostVar (string $a_post_var)
 
 setFilterCols (int $a_val)
 
 getFilterCols ()
 
 setDisableFilterHiding (bool $a_val=true)
 
 getDisableFilterHiding ()
 
 isFilterSelected (string $a_col)
 Is given filter selected? More...
 
 getSelectedFilters ()
 
 determineSelectedFilters ()
 
 setCustomPreviousNext (string $a_prev_link, string $a_next_link)
 
 setFormAction (string $a_form_action, bool $a_multipart=false)
 
 getFormAction ()
 
 setFormName (string $a_name="")
 
 getFormName ()
 get the name of the parent form More...
 
 setId (string $a_val)
 
 getId ()
 
 setDisplayAsBlock (bool $a_val)
 
 getDisplayAsBlock ()
 
 setSelectAllCheckbox (string $a_select_all_checkbox, bool $a_select_all_on_top=false)
 
 setExternalSorting (bool $a_val)
 
 getExternalSorting ()
 
 setFilterCommand (string $a_val, string $a_caption="")
 
 getFilterCommand ()
 
 setResetCommand (string $a_val, string $a_caption="")
 
 getResetCommand ()
 
 setExternalSegmentation (bool $a_val)
 
 getExternalSegmentation ()
 
 setRowTemplate (string $a_template, string $a_template_dir="")
 Set row template. More...
 
 setDefaultOrderField (string $a_defaultorderfield)
 
 getDefaultOrderField ()
 
 setDefaultOrderDirection (string $a_defaultorderdirection)
 
 getDefaultOrderDirection ()
 
 setDefaultFilterVisiblity (bool $a_status)
 
 getDefaultFilterVisibility ()
 
 clearCommandButtons ()
 
 addCommandButton (string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
 
 addCommandButtonInstance (ilButtonBase $a_button)
 
 addMultiItemSelectionButton (string $a_sel_var, array $a_options, string $a_cmd, string $a_text, string $a_default_selection='')
 
 setCloseCommand (string $a_link)
 
 addMultiCommand (string $a_cmd, string $a_text)
 
 addHiddenInput (string $a_name, string $a_value)
 
 addHeaderCommand (string $a_href, string $a_text, string $a_target="", string $a_img="")
 
 setTopCommands (bool $a_val)
 
 getTopCommands ()
 
 addColumn (string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
 
 getNavParameter ()
 
 setOrderLink (string $key, string $order_dir)
 
 fillHeader ()
 
 determineOffsetAndOrder (bool $a_omit_offset=false)
 
 storeNavParameter ()
 
 getHTML ()
 Get HTML. More...
 
 numericOrdering (string $a_field)
 Should this field be sorted numeric? More...
 
 render ()
 
 writeFilterToSession ()
 
 resetFilter ()
 
 fillFooter ()
 
 getLinkbar (string $a_num)
 
 fillHiddenRow ()
 
 fillActionRow ()
 
 setHeaderHTML (string $html)
 
 storeProperty (string $type, string $value)
 
 loadProperty (string $type)
 
 getCurrentState ()
 get current settings for order, limit, columns and filter More...
 
 setContext (string $id)
 
 getContext ()
 
 setShowRowsSelector (bool $a_value)
 Toggle rows-per-page selector. More...
 
 getShowRowsSelector ()
 
 getLimit ()
 
 getOffset ()
 
 setExportFormats (array $formats)
 Set available export formats. More...
 
 setPrintMode (bool $a_value=false)
 
 getPrintMode ()
 
 getExportMode ()
 
 exportData (int $format, bool $send=false)
 Export and optionally send current table data. More...
 
 setEnableAllCommand (bool $a_value)
 
 setRowSelectorLabel (string $row_selector_label)
 
 getRowSelectorLabel ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 set max. More...
 
- Public Member Functions inherited from ilTableGUI
 __construct (array $a_data=[], bool $a_global_tpl=true)
 
 setTemplate (ilTemplate $a_tpl)
 
 getTemplateObject ()
 
 setData (array $a_data)
 Set table data. More...
 
 getData ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setHelp (string $a_help_page, string $a_help_icon, string $a_help_icon_alt="")
 
 setHeaderNames (array $a_header_names)
 
 getColumnCount ()
 
 setHeaderVars (array $a_header_vars, array $a_header_params=[])
 
 setColumnWidth (array $a_column_width)
 set table column widths More...
 
 setOneColumnWidth (string $a_column_width, int $a_column_number)
 
 setMaxCount (int $a_max_count)
 set max. More...
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 set max. More...
 
 getLimit ()
 
 setPrefix (string $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) More...
 
 setOffset (int $a_offset)
 set dataset offset More...
 
 getOffset ()
 
 setOrderColumn (string $a_order_column="", string $a_default_column="")
 
 getOrderColumn ()
 
 setOrderDirection (string $a_order_direction)
 
 getOrderDirection ()
 
 setFooter (string $a_style, string $a_previous="", string $a_next="")
 
 enable (string $a_module_name)
 
 disable (string $a_module_name)
 
 sortData ()
 
 render ()
 
 renderHeader ()
 
 setOrderLink (string $key, string $order_dir)
 
 setStyle (string $a_element, string $a_style)
 
 getStyle (string $a_element)
 
 setBase (string $a_base)
 
 getBase ()
 
 getFormName ()
 get the name of the parent form More...
 
 setFormName (string $a_name="cmd")
 
 getSelectAllCheckbox ()
 get the name of the checkbox that should be toggled with a select all button More...
 
 setSelectAllCheckbox (string $a_select_all_checkbox)
 
 clearActionButtons ()
 
 addActionButton (string $btn_name, string $btn_value)
 

Data Fields

const IL_MEP_SELECT = "select"
 
const IL_MEP_EDIT = "edit"
 
const IL_MEP_SELECT_CONTENT = "selectc"
 
const IL_MEP_SELECT_SINGLE = "selectsingle"
 
string $insert_command = "create_mob"
 
- 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
string $title = ""
 
string $icon = ""
 
string $icon_alt = ""
 
string $help_page = ""
 
string $help_icon = ""
 
string $help_icon_alt = ""
 
array $header_names = []
 
array $header_vars = []
 
array $linkbar_vars = []
 
array $data = []
 
int $column_count = 0
 
array $column_width = []
 
int $max_count = 0
 
int $limit = 0
 
bool $max_limit = false
 
int $offset = 0
 
string $order_column = ""
 
string $order_direction = ""
 
string $footer_style = ""
 
string $footer_previous = ""
 
string $footer_next = ""
 
bool $lang_support = true
 
bool $global_tpl = false
 
string $form_name = ""
 
string $select_all_checkbox = ""
 
array $action_buttons = []
 
string $prefix = ""
 
string $base = ""
 
array $enabled
 
array $styles
 

Protected Member Functions

 showAdvMetadata ()
 
 getAdvMDRecordGUI ()
 
 prepareOutput ()
 Anything that must be done before HTML is generated. More...
 
 fillRow (array $a_set)
 Standard Version of Fill Row. More...
 
- Protected Member Functions inherited from ilTable2GUI
 getRequestedValues ()
 
 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, ilTableFilterItem $a_element)
 Check if filter element is based on adv md. More...
 
 fillRow (array $a_set)
 Standard Version of Fill Row. More...
 
 getFilterValue (ilTableFilterItem $a_item)
 Get current filter value. More...
 
 setFilterValue (ilTableFilterItem $a_item, $a_value)
 
 fillMetaExcel (ilExcel $a_excel, int &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel (ilExcel $a_excel, int &$a_row)
 Excel Version of Fill Header. More...
 
 fillRowExcel (ilExcel $a_excel, int &$a_row, array $a_set)
 Excel Version of Fill Row. More...
 
 fillMetaCSV (ilCSVWriter $a_csv)
 Add meta information to csv export. More...
 
 fillHeaderCSV (ilCSVWriter $a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV (ilCSVWriter $a_csv, array $a_set)
 CSV Version of Fill Row. More...
 

Protected Attributes

ILIAS MediaObjects Thumbs ThumbsGUI $thumbs_gui
 
ILIAS DI UIServices $ui
 
string $mode = ""
 
array $filter = []
 
int $current_folder = 0
 
string $folder_par
 
ilTree $tree
 
ilObjMediaPool $media_pool
 
bool $all_objects = false
 
ILIAS MediaPool StandardGUIRequest $request
 
ILIAS MediaPool Clipboard ClipboardManager $clipboard_manager
 
ilAccessHandler $access
 
ilRbacReview $rbacreview
 
ilObjUser $user
 
ilGlobalTemplateInterface $parent_tpl = null
 
ilAdvancedMDRecordGUI $adv_filter_record_gui
 
MediaPoolRepository $pool_repo
 
- Protected Attributes inherited from ilTable2GUI
string $requested_nav_par2 = ""
 
string $requested_nav_par = ""
 
string $requested_nav_par1 = ""
 
ILIAS Table TableGUIRequest $table_request = null
 
array $selected_columns = []
 
ilCtrl $ctrl
 
object $parent_obj = null
 
string $parent_cmd = ""
 
string $close_command = ""
 
string $top_anchor = "il_table_top"
 
array $filters = array()
 
array $optional_filters = array()
 
string $filter_cmd = 'applyFilter'
 
string $reset_cmd = 'resetFilter'
 
int $filter_cols = 5
 
bool $ext_sort = false
 
bool $ext_seg = false
 
string $context = ""
 
array $mi_sel_buttons = []
 
bool $disable_filter_hiding = false
 
bool $top_commands = true
 
array $selectable_columns = array()
 
array $selected_column = array()
 
bool $show_rows_selector = true
 
bool $rows_selector_off = false
 
bool $nav_determined = false
 
bool $limit_determined = false
 
bool $filters_determined = false
 
bool $columns_determined = false
 
bool $open_form_tag = true
 
bool $close_form_tag = true
 
array $export_formats = []
 
int $export_mode = 0
 
bool $print_mode = false
 
bool $enable_command_for_all = false
 
bool $restore_filter = false
 
array $restore_filter_values = []
 
bool $default_filter_visibility = false
 
array $sortable_fields = array()
 
bool $prevent_double_submission = true
 
string $row_selector_label = ""
 
bool $select_all_on_top = false
 
array $sel_buttons = []
 
string $nav_value = ''
 
string $noentriestext = ''
 
string $css_row = ''
 
bool $display_as_block = false
 
string $description = ''
 
string $id = ""
 
bool $custom_prev_next = false
 
string $reset_cmd_txt = ""
 
string $defaultorderfield = ""
 
string $defaultorderdirection = ""
 
array $column = []
 
bool $datatable = false
 
bool $num_info = false
 
bool $form_multipart = false
 
array $row_data = []
 
string $order_field = ""
 
array $selected_filter = []
 
string $form_action = ""
 
string $formname = ""
 
string $sort_order = ""
 
array $buttons = []
 
array $multi = []
 
array $hidden_inputs = []
 
array $header_commands = []
 
string $row_template = ""
 
string $row_template_dir = ""
 
string $filter_cmd_txt = ""
 
string $custom_prev = ""
 
string $custom_next = ""
 
array $raw_post_data = null
 
ilGlobalTemplateInterface $main_tpl
 
- Protected Attributes inherited from ilTableGUI
string $sort_order
 
string $link_params
 
array $header_params
 
 $tpl
 
ilLanguage $lng
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 
- Static Public Member Functions inherited from ilTableGUI
static linkbar (string $AScript, int $AHits, int $ALimit, int $AOffset, array $AParams=array(), array $ALayout=array(), string $prefix='')
 

Detailed Description

TableGUI class for recent changes in wiki.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ilMediaPoolTableGUI::__construct ( object  $a_parent_obj,
string  $a_parent_cmd,
ilObjMediaPool  $a_media_pool,
string  $a_folder_par = "obj_id",
string  $a_mode = ilMediaPoolTableGUI::IL_MEP_EDIT,
bool  $a_all_objects = false,
?ilGlobalTemplateInterface  $a_parent_tpl = null 
)

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

61 {
62 global $DIC;
63
64 $this->ctrl = $DIC->ctrl();
65 $this->lng = $DIC->language();
66 $this->access = $DIC->access();
67 $this->rbacreview = $DIC->rbac()->review();
68 $this->user = $DIC->user();
69
70 $ilCtrl = $DIC->ctrl();
71 $ilAccess = $DIC->access();
72 $lng = $DIC->language();
73 $this->ui = $DIC->ui();
74
75 $this->clipboard_manager = $DIC->mediaPool()
76 ->internal()
77 ->domain()
78 ->clipboard();
79
80 $this->request = $DIC->mediaPool()
81 ->internal()
82 ->gui()
83 ->standardRequest();
84
85 if ($a_parent_tpl === null) {
86 $a_parent_tpl = $DIC->ui()->mainTemplate();
87 }
88 $this->parent_tpl = $a_parent_tpl;
89 if ($a_all_objects) {
90 $this->setId("mepall");
91 if (method_exists($a_parent_obj, "getObject") &&
92 is_object($a_parent_obj->getObject())) {
93 $this->setId("mepall" . $a_parent_obj->getObject()->getId());
94 }
95 } else {
96 $this->setId("mepfold");
97 if (method_exists($a_parent_obj, "getObject") &&
98 is_object($a_parent_obj->getObject())) {
99 $this->setId("mepfold" . $a_parent_obj->getObject()->getId());
100 }
101 }
102
103 parent::__construct($a_parent_obj, $a_parent_cmd);
104 $this->setMode($a_mode);
105 $this->all_objects = $a_all_objects;
106 $lng->loadLanguageModule("mep");
107
108 $this->media_pool = $a_media_pool;
109 $this->tree = ilObjMediaPool::_getPoolTree($this->media_pool->getId());
110 $this->folder_par = $a_folder_par;
111 $this->pool_repo = new MediaPoolRepository();
112
113 if ($this->all_objects) {
114 $this->setExternalSorting(true);
115 $this->initFilter();
116 }
117
118 $current_folder = $this->clipboard_manager->getFolder();
119
120 // folder determination
121 $requested_folder_id = $this->request->getFolderId($this->folder_par);
122 if ($requested_folder_id > 0) {
123 $this->current_folder = $requested_folder_id;
124 } elseif ($current_folder > 0 && $this->tree->isInTree($current_folder)) {
125 $this->current_folder = $current_folder;
126 } else {
127 $this->current_folder = $this->tree->getRootId();
128 }
129 $this->clipboard_manager->setFolder($this->current_folder);
130
131 // standard columns
132 $this->addColumn("", "", "1"); // checkbox
133 $this->addColumn($lng->txt("mep_thumbnail"), "", "100px");
134 $this->addColumn($lng->txt("mep_title_and_description"));
135 $this->setEnableHeader(true);
136 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
137 $this->setRowTemplate("tpl.mep_list_row.html", "components/ILIAS/MediaPool");
138
139 if ($this->showAdvMetadata()) {
140 // adv metadata init (adds filter)
141 $this->adv_filter_record_gui = new ilAdvancedMDRecordGUI(
143 'mep',
144 $this->media_pool->getId(),
145 'mob'
146 );
147 $this->adv_filter_record_gui->setTableGUI($this);
148 $this->adv_filter_record_gui->parse();
149
150 // adv metadata columns
151 $adv_th_record_gui = new ilAdvancedMDRecordGUI(
153 'mep',
154 $this->media_pool->getId(),
155 'mob'
156 );
157 $adv_th_record_gui->setTableGUI($this);
158 $adv_th_record_gui->parse();
159 if ($a_mode === self::IL_MEP_SELECT) {
160 $this->setFilterCommand("insert_applyFilter");
161 $this->setResetCommand("insert_resetFilter");
162 }
163 }
164
165 // actions column
166 $this->addColumn($lng->txt("actions"));
167
168 // get items
169 $this->getItems();
170
171 // title
172 if ($a_mode !== self::IL_MEP_EDIT) {
173 if ($this->current_folder !== $this->tree->getRootId() && !$this->all_objects) {
174 $node = $this->tree->getNodeData($this->current_folder);
175 $this->setTitle(
176 $lng->txt("mep_choose_from_folder") . ": " . $node["title"],
177 "standard/icon_fold.svg",
178 $node["title"]
179 );
180 } else {
181 $this->setTitle(
182 $lng->txt("mep_choose_from_mep") . ": " .
183 ilObject::_lookupTitle($this->media_pool->getId()),
184 "standard/icon_mep.svg",
185 ilObject::_lookupTitle($this->media_pool->getId())
186 );
187 }
188 }
189
190 // action commands
191 if ($ilAccess->checkAccess("write", "", $this->media_pool->getRefId()) &&
192 $this->getMode() === self::IL_MEP_EDIT) {
193 $this->addMultiCommand("copyToClipboard", $lng->txt("cont_copy_to_clipboard"));
194 $this->addMultiCommand("move", $lng->txt("move"));
195 $this->addMultiCommand("confirmRemove", $lng->txt("remove"));
196 }
197
198 if ($this->getMode() === self::IL_MEP_SELECT_SINGLE) {
199 // ... even more coupling with ilpcmediaobjectgui
200 $this->addMultiCommand("selectObjectReference", $lng->txt("cont_select"));
201 }
202
203 if ($this->getMode() === self::IL_MEP_EDIT &&
204 $ilAccess->checkAccess("write", "", $this->media_pool->getRefId())) {
205 $this->setSelectAllCheckbox("id");
206 }
207 $this->thumbs_gui = $DIC->mediaObjects()->internal()->gui()->thumbs();
208 }
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _getPoolTree(int $a_obj_id)
static _lookupTitle(int $obj_id)
setFilterCommand(string $a_val, string $a_caption="")
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
addMultiCommand(string $a_cmd, string $a_text)
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setEnableHeader(bool $a_enableheader)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setExternalSorting(bool $a_val)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
setResetCommand(string $a_val, string $a_caption="")
ilLanguage $lng
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $current_folder, $DIC, ilTableGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), ilObjMediaPool\_getPoolTree(), ilObject\_lookupTitle(), ILIAS\Repository\access(), ilTable2GUI\addColumn(), ilTable2GUI\addMultiCommand(), ILIAS\Repository\ctrl(), getItems(), getMode(), initFilter(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ilAdvancedMDRecordGUI\MODE_FILTER, ilAdvancedMDRecordGUI\MODE_TABLE_HEAD, ilTable2GUI\setEnableHeader(), ilTable2GUI\setExternalSorting(), ilTable2GUI\setFilterCommand(), ilTable2GUI\setFormAction(), ilTable2GUI\setId(), setMode(), ilTable2GUI\setResetCommand(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), ilTable2GUI\setTitle(), showAdvMetadata(), ilLanguage\txt(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ fillRow()

ilMediaPoolTableGUI::fillRow ( array  $a_set)
protected

Standard Version of Fill Row.

Most likely to be overwritten by derived class.

Parameters
array<string,mixed>$a_set data array

Reimplemented from ilTable2GUI.

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

402 : void
403 {
405 $ilCtrl = $this->ctrl;
406 $ilAccess = $this->access;
407 $actions = [];
408
409 $this->tpl->setCurrentBlock("link");
410
411 // adv metadata columns
412 if ($this->showAdvMetadata()) {
413 $adv_cell_record_gui = new ilAdvancedMDRecordGUI(
415 'mep',
416 $this->media_pool->getId(),
417 'mob'
418 );
419 $adv_cell_record_gui->setTableGUI($this);
420 $adv_cell_record_gui->setRowData($a_set);
421 $this->tpl->setVariable("ADV_CELLS", $adv_cell_record_gui->parse());
422 }
423
424
425 switch ($a_set["type"]) {
426 case "fold":
427 $this->tpl->setVariable("TXT_TITLE", htmlentities($a_set["title"]));
428 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $a_set["obj_id"]);
429 $ilCtrl->setParameter($this->parent_obj, "id", $a_set["obj_id"]);
430 $this->tpl->setVariable(
431 "LINK_VIEW",
432 $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd)
433 );
434 $this->tpl->parseCurrentBlock();
435
436 if ($ilAccess->checkAccess("write", "", $this->media_pool->getRefId()) &&
437 $this->getMode() === self::IL_MEP_EDIT) {
438 $actions[$lng->txt("edit")] = $ilCtrl->getLinkTarget($this->parent_obj, "editFolder");
439 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", $this->request->getItemId());
440 $actions[$lng->txt("move")] = $ilCtrl->getLinkTarget($this->parent_obj, "move");
441 $actions[$lng->txt("remove")] = $ilCtrl->getLinkTarget($this->parent_obj, "confirmRemove");
442 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $a_set["obj_id"]);
443 $ilCtrl->setParameter(
444 $this->parent_obj,
445 $this->folder_par,
446 $this->request->getFolderId($this->folder_par)
447 );
448 $this->tpl->parseCurrentBlock();
449 }
450
451 $this->tpl->setCurrentBlock("tbl_content");
452 $this->tpl->setVariable("IMG", ilUtil::img(ilUtil::getImagePath("standard/icon_" . $a_set["type"] . ".svg")));
453 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
454 break;
455
456 case "pg":
457 if ($this->getMode() === self::IL_MEP_SELECT ||
458 $this->getMode() === self::IL_MEP_SELECT_SINGLE) {
459 $this->tpl->setVariable("TXT_NO_LINK_TITLE", htmlentities($a_set["title"]));
460 } else {
461 $this->tpl->setVariable("ONCLICK", "il.MediaPool.preview('" . $a_set["child"] . "'); return false;");
462 $this->tpl->setVariable("TXT_TITLE", htmlentities($a_set["title"]));
463 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", $a_set["child"]);
464 }
465
466 if ($this->getMode() === self::IL_MEP_EDIT &&
467 $ilAccess->checkAccess("write", "", $this->media_pool->getRefId())) {
468 $ilCtrl->setParameterByClass("ilmediapoolpagegui", "mepitem_id", $a_set["child"]);
469 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "id", $a_set["child"]);
470
471 $actions[$lng->txt("edit")] = $ilCtrl->getLinkTargetByClass("ilmediapoolpagegui", "edit");
472
473 $mdgui = new ilObjectMetaDataGUI(
474 $this->media_pool,
475 "mpg",
476 $a_set["child"]
477 );
478 $mdtab = $mdgui->getTab("ilmediapoolpagegui");
479 if ($mdtab) {
480 $actions[$lng->txt("meta_data")] = $mdtab;
481 }
482
483 $actions[$lng->txt("cont_usage")] = $ilCtrl->getLinkTargetByClass("ilmediapoolpagegui", "showMediaPoolPageUsages");
484 $actions[$lng->txt("settings")] = $ilCtrl->getLinkTargetByClass("ilmediapoolpagegui", "editMediaPoolPage");
485 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", $this->request->getItemId());
486 $actions[$lng->txt("move")] = $ilCtrl->getLinkTarget($this->parent_obj, "move");
487 $actions[$lng->txt("remove")] = $ilCtrl->getLinkTarget($this->parent_obj, "confirmRemove");
488 }
489
490 $this->tpl->setCurrentBlock("tbl_content");
491 $this->tpl->setVariable("IMG", ilUtil::img(ilUtil::getImagePath("standard/icon_pg.svg")));
492 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
493 break;
494
495 case "mob":
496 $this->tpl->setVariable("ONCLICK", "il.MediaPool.preview('" . $a_set["child"] . "'); return false;");
497 $this->tpl->setVariable("TXT_TITLE", htmlentities($a_set["title"]));
498 $ilCtrl->setParameterByClass("ilobjmediaobjectgui", "mepitem_id", $a_set["child"]);
499 $ilCtrl->setParameter($this->parent_obj, "mob_id", $a_set["foreign_id"]);
500 $ilCtrl->setParameter($this->parent_obj, "id", $a_set["child"]);
501
502 // edit link
503 if ($ilAccess->checkAccess("write", "", $this->media_pool->getRefId()) &&
504 $this->getMode() === self::IL_MEP_EDIT) {
505 $actions[$lng->txt("edit")] = $ilCtrl->getLinkTargetByClass("ilobjmediaobjectgui", "edit");
506 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", $this->request->getItemId());
507 $actions[$lng->txt("cont_copy_to_clipboard")] = $ilCtrl->getLinkTargetByClass("ilobjmediapoolgui", "copyToClipboard");
508 $actions[$lng->txt("move")] = $ilCtrl->getLinkTargetByClass("ilobjmediapoolgui", "move");
509 $actions[$lng->txt("remove")] = $ilCtrl->getLinkTarget($this->parent_obj, "confirmRemove");
510 }
511
512 $this->tpl->setCurrentBlock("link");
513 $this->tpl->setCurrentBlock("tbl_content");
514
515 // output thumbnail (or mob icon)
516 if (ilObject::_lookupType($a_set["foreign_id"]) === "mob") {
517 $mob_id = (int) $a_set["foreign_id"];
518 $this->tpl->setVariable(
519 "IMG",
520 $this->thumbs_gui->getThumbHtml($mob_id)
521 );
522
523 // output media info
524 $mob = new ilObjMediaObject($mob_id);
525 $this->tpl->setVariable(
526 "MEDIA_INFO",
528 );
529 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $this->current_folder);
530 }
531 break;
532 }
533
534 if ($ilAccess->checkAccess("write", "", $this->media_pool->getRefId())) {
535 if ((
536 $this->getMode() === self::IL_MEP_EDIT ||
537 ($this->getMode() === self::IL_MEP_SELECT && $a_set["type"] === "mob") ||
538 ($this->getMode() === self::IL_MEP_SELECT_CONTENT && $a_set["type"] === "pg")
539 )) {
540 $this->tpl->setCurrentBlock("chbox");
541 $this->tpl->setVariable("CHECKBOX_ID", $a_set["child"]);
542 $this->tpl->parseCurrentBlock();
543 $this->tpl->setCurrentBlock("tbl_content");
544 } elseif ($this->getMode() === self::IL_MEP_SELECT_SINGLE && $a_set["type"] === "mob") {
545 $this->tpl->setCurrentBlock("radio");
546 $this->tpl->setVariable("RADIO_ID", $a_set["child"]);
547 $this->tpl->parseCurrentBlock();
548 $this->tpl->setCurrentBlock("tbl_content");
549 }
550 }
551
552 if (count($actions) > 0) {
553 $items = [];
554 foreach ($actions as $txt => $act) {
555 $items[] = $this->ui->factory()->link()->standard($txt, $act);
556 }
557 $dd = $this->ui->factory()->dropdown()->standard($items);
558 $this->tpl->setVariable("DROPDOWN", $this->ui->renderer()->render($dd));
559 }
560 }
static _getMediaInfoHTML(ilObjMediaObject $a_mob)
get media info as html
Class ilObjectMetaDataGUI.
static _lookupType(int $id, bool $reference=false)
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static img(string $a_src, ?string $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
$txt
Definition: error.php:31

References $access, ilTable2GUI\$ctrl, ilTableGUI\$lng, $txt, ilObjMediaObjectGUI\_getMediaInfoHTML(), ilObject\_lookupType(), ilUtil\getImagePath(), getMode(), ilUtil\img(), ILIAS\Repository\int(), ilAdvancedMDRecordGUI\MODE_TABLE_CELLS, showAdvMetadata(), ilLanguage\txt(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ getAdvMDRecordGUI()

ilMediaPoolTableGUI::getAdvMDRecordGUI ( )
protected

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

216 {
218 }
ilAdvancedMDRecordGUI $adv_filter_record_gui

References $adv_filter_record_gui.

◆ getHTML()

ilMediaPoolTableGUI::getHTML ( )

Get HTML.

Reimplemented from ilTable2GUI.

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

252 : string
253 {
254 $html = parent::getHTML();
255 $html .= ilObjMediaPoolGUI::getPreviewModalHTML($this->media_pool->getRefId(), $this->parent_tpl);
256 return $html;
257 }
static getPreviewModalHTML(int $a_mpool_ref_id, ilGlobalTemplateInterface $a_tpl)
Get preview modal html.

References ilObjMediaPoolGUI\getPreviewModalHTML().

+ Here is the call graph for this function:

◆ getInsertCommand()

ilMediaPoolTableGUI::getInsertCommand ( )

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

225 : string
226 {
228 }

References $insert_command.

Referenced by prepareOutput().

+ Here is the caller graph for this function:

◆ getItems()

ilMediaPoolTableGUI::getItems ( )

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

316 : void
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
327 if ($this->getMode() === self::IL_MEP_SELECT) {
328 $mobjs = $this->media_pool->getChilds($this->current_folder, "mob");
329 } elseif ($this->getMode() === self::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->pool_repo->getItems(
344 $this->media_pool->getId(),
345 $this->filter["title"],
346 $this->filter["format"],
347 $this->filter['keyword'],
348 $this->filter['caption']
349 );
350 }
351
352 // add advanced metadata
353 if ($this->showAdvMetadata()) {
354 $mobs = array_filter($objs, function ($m) {
355 return ($m["type"] === "mob");
356 });
357
359 $this->media_pool->getRefId(),
360 "mep",
361 "mob",
362 [0],
363 "mob",
364 $mobs,
365 "",
366 "foreign_id",
367 $this->adv_filter_record_gui->getFilterElements()
368 );
369
370 $snippets = array_filter($objs, function ($m) {
371 return ($m["type"] === "pg");
372 });
373
375 $this->media_pool->getRefId(),
376 "mep",
377 "mpg",
378 [$this->media_pool->getId()],
379 "mpg",
380 $snippets,
381 "mep_id",
382 "obj_id",
383 $this->adv_filter_record_gui->getFilterElements()
384 );
385
386 $objs = array_merge($mobs, $snippets);
387 }
388 $this->setData($objs);
389 }
static queryForRecords(int $adv_rec_obj_ref_id, string $adv_rec_obj_type, string $adv_rec_obj_subtype, array $a_obj_id, string $a_subtype, array $a_records, string $a_obj_id_key, string $a_obj_subid_key, ?array $a_amet_filter=null)
setData(array $a_data)
Set table data.

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

Referenced by __construct().

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

◆ getMode()

ilMediaPoolTableGUI::getMode ( )

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

311 : string
312 {
313 return $this->mode;
314 }

References $mode.

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

+ Here is the caller graph for this function:

◆ initFilter()

ilMediaPoolTableGUI::initFilter ( )

Reimplemented from ilTable2GUI.

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

259 : void
260 {
261 $mset = new ilSetting("mobs");
263
264 // title/description
265 $ti = new ilTextInputGUI($lng->txt("title"), "title");
266 $ti->setMaxLength(64);
267 $ti->setSize(20);
268 $this->addFilterItem($ti);
269 $ti->readFromSession();
270 $this->filter["title"] = $ti->getValue();
271
272 // keyword
273 $GLOBALS['lng']->loadLanguageModule('meta');
274 $ke = new ilTextInputGUI($lng->txt('meta_keyword'), 'keyword');
275 $ke->setMaxLength(64);
276 $ke->setSize(20);
277 $this->addFilterItem($ke);
278 $ke->readFromSession();
279 $this->filter['keyword'] = $ke->getValue();
280
281 // Caption
282 $ca = new ilTextInputGUI($lng->txt('cont_caption'), 'caption');
283 $ca->setMaxLength(64);
284 $ca->setSize(20);
285 $this->addFilterItem($ca);
286 $ca->readFromSession();
287 $this->filter['caption'] = $ca->getValue();
288
289 // format
290 $options = array(
291 "" => $lng->txt("mep_all"),
292 );
293 if ($mset->get("mep_activate_pages")) {
294 $options["mob"] = $lng->txt("mep_mob");
295 $options["pg"] = $lng->txt("mep_mpg");
296 }
297 $formats = $this->media_pool->getUsedFormats();
298 $options = array_merge($options, $formats);
299 $si = new ilSelectInputGUI($this->lng->txt("mep_format"), "format");
300 $si->setOptions($options);
301 $this->addFilterItem($si);
302 $si->readFromSession();
303 $this->filter["format"] = $si->getValue();
304 }
This class represents a selection list property in a property form.
ILIAS Setting Class.
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
This class represents a text property in a property form.
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
$GLOBALS["DIC"]
Definition: wac.php:54

References $GLOBALS, ilTableGUI\$lng, ilTable2GUI\addFilterItem(), ILIAS\Repository\filter(), ILIAS\Repository\lng(), and ilLanguage\txt().

Referenced by __construct().

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

◆ prepareOutput()

ilMediaPoolTableGUI::prepareOutput ( )
protected

Anything that must be done before HTML is generated.

Reimplemented from ilTable2GUI.

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

391 : void
392 {
394
395 if ($this->getMode() === self::IL_MEP_SELECT ||
396 $this->getMode() === self::IL_MEP_SELECT_CONTENT) {
397 $this->addMultiCommand($this->getInsertCommand(), $lng->txt("insert"));
398 $this->addCommandButton("cancelCreate", $lng->txt("cancel"));
399 }
400 }
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")

References ilTableGUI\$lng, ilTable2GUI\addCommandButton(), ilTable2GUI\addMultiCommand(), getInsertCommand(), getMode(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ render()

ilMediaPoolTableGUI::render ( )

Reimplemented from ilTable2GUI.

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

562 : string
563 {
564 $ilCtrl = $this->ctrl;
565
566 $mtpl = new ilTemplate("tpl.media_sel_table.html", true, true, "components/ILIAS/MediaPool");
567
568 $pre = "";
569 if ($this->current_folder !== $this->tree->getRootId() && !$this->all_objects) {
570 $path = $this->tree->getPathFull($this->current_folder);
571
572 $loc = new ilLocatorGUI();
573 foreach ($path as $p) {
574 $ilCtrl->setParameter($this->parent_obj, $this->folder_par, $p["child"]);
575 $title = htmlentities($p["title"]);
576 if ($this->tree->getRootId() == $p["child"]) {
577 $title = ilObject::_lookupTitle($this->media_pool->getId());
578 }
579 $loc->addItem(
580 $title,
581 $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd)
582 );
583 }
584 $ilCtrl->setParameter(
585 $this->parent_obj,
586 $this->folder_par,
587 $this->current_folder
588 );
589
590 $mtpl->setCurrentBlock("loc");
591 $mtpl->setVariable("LOC", $loc->getHTML());
592 $mtpl->parseCurrentBlock();
593 }
594
595 $mtpl->setVariable("TABLE", parent::render());
596
597 return $mtpl->get();
598 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
$path
Definition: ltiservices.php:30

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

+ Here is the call graph for this function:

◆ setInsertCommand()

ilMediaPoolTableGUI::setInsertCommand ( string  $a_val)

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

220 : void
221 {
222 $this->insert_command = $a_val;
223 }

◆ setMode()

ilMediaPoolTableGUI::setMode ( string  $a_mode)

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

306 : void
307 {
308 $this->mode = $a_mode;
309 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ showAdvMetadata()

ilMediaPoolTableGUI::showAdvMetadata ( )
protected

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

210 : bool
211 {
212 return ($this->all_objects);
213 }

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

+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilMediaPoolTableGUI::$access
protected

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

Referenced by fillRow().

◆ $adv_filter_record_gui

ilAdvancedMDRecordGUI ilMediaPoolTableGUI::$adv_filter_record_gui
protected

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

Referenced by getAdvMDRecordGUI().

◆ $all_objects

bool ilMediaPoolTableGUI::$all_objects = false
protected

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

◆ $clipboard_manager

ILIAS MediaPool Clipboard ClipboardManager ilMediaPoolTableGUI::$clipboard_manager
protected

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

◆ $current_folder

int ilMediaPoolTableGUI::$current_folder = 0
protected

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

Referenced by __construct().

◆ $filter

array ilMediaPoolTableGUI::$filter = []
protected

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

◆ $folder_par

string ilMediaPoolTableGUI::$folder_par
protected

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

◆ $insert_command

string ilMediaPoolTableGUI::$insert_command = "create_mob"

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

Referenced by getInsertCommand().

◆ $media_pool

ilObjMediaPool ilMediaPoolTableGUI::$media_pool
protected

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

◆ $mode

string ilMediaPoolTableGUI::$mode = ""
protected

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

Referenced by getMode().

◆ $parent_tpl

ilGlobalTemplateInterface ilMediaPoolTableGUI::$parent_tpl = null
protected

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

◆ $pool_repo

MediaPoolRepository ilMediaPoolTableGUI::$pool_repo
protected

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

◆ $rbacreview

ilRbacReview ilMediaPoolTableGUI::$rbacreview
protected

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

◆ $request

ILIAS MediaPool StandardGUIRequest ilMediaPoolTableGUI::$request
protected

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

◆ $thumbs_gui

ILIAS MediaObjects Thumbs ThumbsGUI ilMediaPoolTableGUI::$thumbs_gui
protected

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

◆ $tree

ilTree ilMediaPoolTableGUI::$tree
protected

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

◆ $ui

ILIAS DI UIServices ilMediaPoolTableGUI::$ui
protected

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

◆ $user

ilObjUser ilMediaPoolTableGUI::$user
protected

Definition at line 47 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"

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

Referenced by ilPCContentIncludeGUI\insertFromPool().

◆ IL_MEP_SELECT_SINGLE

const ilMediaPoolTableGUI::IL_MEP_SELECT_SINGLE = "selectsingle"

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

Referenced by ilPCMediaObjectGUI\insertFromPool().


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