Merge branch 'MDL-74272-master' of https://github.com/sarjona/moodle
This commit is contained in:
@@ -106,12 +106,15 @@ class cmname implements named_templatable, renderable {
|
||||
'url' => $mod->url,
|
||||
'icon' => $mod->get_icon_url(),
|
||||
'modname' => $mod->modname,
|
||||
'pluginname' => get_string('pluginname', 'mod_' . $mod->modname),
|
||||
'textclasses' => $displayoptions['textclasses'] ?? '',
|
||||
'purpose' => plugin_supports('mod', $mod->modname, FEATURE_MOD_PURPOSE, MOD_PURPOSE_OTHER),
|
||||
'activityname' => $this->get_title_data($output),
|
||||
];
|
||||
|
||||
if ($this->format->show_editor()) {
|
||||
$data['pluginname'] = get_string('pluginname', 'mod_' . $mod->modname);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
{{/ core_courseformat/local/content/cm/cmname }}
|
||||
{{/cmname}}
|
||||
{{#afterlink}}
|
||||
<div class="afterlink">
|
||||
<div class="afterlink d-flex align-items-center ml-3">
|
||||
{{{afterlink}}}
|
||||
</div>
|
||||
{{/afterlink}}
|
||||
|
||||
@@ -50,9 +50,11 @@
|
||||
<img src="{{{icon}}}" class="activityicon " alt="{{{modname}}} icon">
|
||||
</div>
|
||||
<div class="media-body align-self-center">
|
||||
{{#pluginname}}
|
||||
<div class="text-uppercase small">
|
||||
{{{pluginname}}}
|
||||
</div>
|
||||
{{/pluginname}}
|
||||
<div class="activityname">
|
||||
{{#activityname}}
|
||||
{{$ core/inplace_editable }}
|
||||
|
||||
@@ -72,12 +72,11 @@ class core_renderer extends \core_renderer {
|
||||
* @return string A rendered context header.
|
||||
*/
|
||||
public function context_header($headerinfo = null, $headinglevel = 1): string {
|
||||
global $DB, $USER, $CFG, $SITE;
|
||||
global $DB, $USER, $CFG;
|
||||
require_once($CFG->dirroot . '/user/lib.php');
|
||||
$context = $this->page->context;
|
||||
$heading = null;
|
||||
$imagedata = null;
|
||||
$subheader = null;
|
||||
$userbuttons = null;
|
||||
|
||||
// Make sure to use the heading if it has been set.
|
||||
@@ -167,11 +166,12 @@ class core_renderer extends \core_renderer {
|
||||
$purposeclass .= ' activityiconcontainer';
|
||||
$purposeclass .= ' modicon_' . $this->page->activityname;
|
||||
$imagedata = html_writer::tag('div', $imagedata, ['class' => $purposeclass]);
|
||||
$prefix = get_string('modulename', $this->page->activityname);
|
||||
if (!empty($USER->editing)) {
|
||||
$prefix = get_string('modulename', $this->page->activityname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$contextheader = new \context_header($heading, $headinglevel, $imagedata, $userbuttons, $prefix);
|
||||
return $this->render_context_header($contextheader);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user