Merge branch 'MDL-81163-main' of https://github.com/sarjona/moodle into main

This commit is contained in:
Paul Holden 2024-03-21 14:41:41 +00:00
commit 97a5b89317
No known key found for this signature in database
GPG Key ID: A81A96D6045F6164
4 changed files with 6 additions and 10 deletions

View File

@ -132,8 +132,7 @@ class content_item_readonly_repository implements content_item_readonly_reposito
$help = $this->get_core_module_help_string($mod->name);
$archetype = plugin_supports('mod', $mod->name, FEATURE_MOD_ARCHETYPE, MOD_ARCHETYPE_OTHER);
$purpose = plugin_supports('mod', $mod->name, FEATURE_MOD_PURPOSE, MOD_PURPOSE_OTHER);
$isbrandedfunction = $mod->name.'_is_branded';
$isbranded = function_exists($isbrandedfunction) ? $isbrandedfunction() : false;
$isbranded = component_callback('mod_' . $mod->name, 'is_branded', [], false);
$contentitem = new content_item(
$mod->id,
@ -197,8 +196,7 @@ class content_item_readonly_repository implements content_item_readonly_reposito
$help = $this->get_core_module_help_string($mod->name);
$archetype = plugin_supports('mod', $mod->name, FEATURE_MOD_ARCHETYPE, MOD_ARCHETYPE_OTHER);
$purpose = plugin_supports('mod', $mod->name, FEATURE_MOD_PURPOSE, MOD_PURPOSE_OTHER);
$isbrandedfunction = $mod->name.'_is_branded';
$isbranded = function_exists($isbrandedfunction) ? $isbrandedfunction() : false;
$isbranded = component_callback('mod_' . $mod->name, 'is_branded', [], false);
$icon = 'monologo';
// Quick check for monologo icons.

View File

@ -258,8 +258,7 @@ class core_course_external extends external_api {
$modcontext = context_module::instance($cm->id);
$isbrandedfunction = $cm->modname.'_is_branded';
$isbranded = function_exists($isbrandedfunction) ? $isbrandedfunction() : false;
$isbranded = component_callback('mod_' . $cm->modname, 'is_branded', [], false);
// Common info (for people being able to see the module or availability dates).
$module['id'] = $cm->id;

View File

@ -78,8 +78,8 @@ class cmicon implements named_templatable, renderable {
$iconurl = $mod->get_icon_url();
$iconclass = $iconurl->get_param('filtericon') ? '' : 'nofilter';
$isbrandedfunction = $mod->modname.'_is_branded';
$isbranded = function_exists($isbrandedfunction) ? $isbrandedfunction() : false;
$isbranded = component_callback('mod_' . $mod->modname, 'is_branded', [], false);
$data = [
'uservisible' => $mod->uservisible,
'url' => $mod->url,

View File

@ -170,8 +170,7 @@ class core_renderer extends \core_renderer {
$purposeclass = plugin_supports('mod', $this->page->activityname, FEATURE_MOD_PURPOSE);
$purposeclass .= ' activityiconcontainer icon-size-6';
$purposeclass .= ' modicon_' . $this->page->activityname;
$isbrandedfunction = $this->page->activityname.'_is_branded';
$isbranded = function_exists($isbrandedfunction) ? $isbrandedfunction() : false;
$isbranded = component_callback('mod_' . $this->page->activityname, 'is_branded', [], false);
$imagedata = html_writer::tag('div', $imagedata, ['class' => $purposeclass . ($isbranded ? ' isbranded' : '')]);
if (!empty($USER->editing)) {
$prefix = get_string('modulename', $this->page->activityname);