MDL-68341 core_table: add component parameter to fetch WS

This commit is contained in:
Simey Lameze
2020-04-21 10:28:01 +08:00
parent bc6f5f23ea
commit 4cf97b7f42
9 changed files with 63 additions and 20 deletions
+22 -1
View File
@@ -1499,6 +1499,26 @@ class flexible_table {
];
}
/**
* Get dynamic class component.
*
* @return string
*/
protected function get_component() {
$tableclass = explode("\\", get_class($this));
return reset($tableclass);
}
/**
* Get dynamic class handler.
*
* @return string
*/
protected function get_handler() {
$tableclass = explode("\\", get_class($this));
return end($tableclass);
}
/**
* Get the dynamic table start wrapper.
* If this is not a dynamic table, then an empty string is returned making this safe to blindly call.
@@ -1510,7 +1530,8 @@ class flexible_table {
$sortdata = $this->get_sort_order();
return html_writer::start_tag('div', [
'data-region' => 'core_table/dynamic',
'data-table-handler' => get_class($this),
'data-table-handler' => $this->get_handler(),
'data-table-component' => $this->get_component(),
'data-table-uniqueid' => $this->uniqueid,
'data-table-filters' => json_encode($this->get_filterset()),
'data-table-sort-by' => $sortdata['sortby'],