MDL-75211 mod_data: show batch select only if delcheck is present

This commit is contained in:
Ferran Recio
2022-10-19 17:05:29 +02:00
parent 8305c1c74d
commit ed4dcf6dff
3 changed files with 38 additions and 1 deletions
+1 -1
View File
@@ -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';
+10
View File
@@ -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.
*