MDL-68861 core_contentbank: Fix translation in add button

This commit is contained in:
cescobedo 2020-05-28 19:59:06 +02:00 committed by Victor Deniz Falcon
parent 0641366181
commit 7e5a395854
2 changed files with 13 additions and 3 deletions

View File

@ -101,7 +101,7 @@ class bankcontent implements renderable, templatable {
// The tools are displayed in the action bar on the index page.
foreach ($this->toolbar as $tool) {
// Customize the output of a tool, like dropdowns.
$method = 'export_tool_'.$tool['name'];
$method = 'export_tool_'.$tool['action'];
if (method_exists($this, $method)) {
$this->$method($tool);
}

View File

@ -70,7 +70,12 @@ if (has_capability('moodle/contentbank:useeditor', $context)) {
if (!empty($editabletypes)) {
// Editor base URL.
$editbaseurl = new moodle_url('/contentbank/edit.php', ['contextid' => $contextid]);
$toolbar[] = ['name' => get_string('add'), 'link' => $editbaseurl, 'dropdown' => true, 'contenttypes' => $editabletypes];
$toolbar[] = [
'name' => get_string('add'),
'link' => $editbaseurl, 'dropdown' => true,
'contenttypes' => $editabletypes,
'action' => 'add'
];
}
}
@ -80,7 +85,12 @@ if (has_capability('moodle/contentbank:upload', $context)) {
$accepted = $cb->get_supported_extensions_as_string($context);
if (!empty($accepted)) {
$importurl = new moodle_url('/contentbank/upload.php', ['contextid' => $contextid]);
$toolbar[] = array('name' => get_string('upload', 'contentbank'), 'link' => $importurl, 'icon' => 'i/upload');
$toolbar[] = [
'name' => get_string('upload', 'contentbank'),
'link' => $importurl,
'icon' => 'i/upload',
'action' => 'upload'
];
}
}