MDL-75211 mod_data: show batch select only if delcheck is present
This commit is contained in:
@@ -115,7 +115,7 @@ class view_footer extends sticky_footer {
|
||||
$this->baseurl
|
||||
);
|
||||
|
||||
if ($parser->get_template_name() != 'singletemplate' && $canmanageentries) {
|
||||
if ($parser->get_template_name() != 'singletemplate' && $parser->has_tag('delcheck') && $canmanageentries) {
|
||||
// Build the select/deselect all control.
|
||||
$selectallid = 'selectall-listview-entries';
|
||||
$togglegroup = 'listview-entries';
|
||||
|
||||
@@ -215,6 +215,16 @@ class template {
|
||||
$this->tags = $matches['tags'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a tag is present in the template.
|
||||
*
|
||||
* @param bool $tagname the tag to check (without ##)
|
||||
* @return bool if the tag is present
|
||||
*/
|
||||
public function has_tag(string $tagname): bool {
|
||||
return in_array($tagname, $this->tags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the current template name.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user