MDL-75337 core: Single button - core changes
* Change all core calls toward single_button to use single_button::BUTTON_PRIMARY
when needed
This commit is contained in:
@@ -58,7 +58,7 @@ class add_entries_action implements templatable, renderable {
|
||||
|
||||
if (data_user_can_add_entry($database, $currentgroup, $groupmode, $PAGE->context)) {
|
||||
$addentrylink = new moodle_url('/mod/data/edit.php', ['d' => $this->id, 'backto' => $PAGE->url->out(false)]);
|
||||
$button = new \single_button($addentrylink, get_string('add', 'mod_data'), 'get', true);
|
||||
$button = new \single_button($addentrylink, get_string('add', 'mod_data'), 'get', \single_button::BUTTON_PRIMARY);
|
||||
return $button->export_for_template($output);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ class empty_database_action_bar implements templatable, renderable {
|
||||
|
||||
$importentrieslink = new moodle_url('/mod/data/import.php', $params);
|
||||
$importentriesbutton = new \single_button($importentrieslink,
|
||||
get_string('importentries', 'mod_data'), 'get', false);
|
||||
get_string('importentries', 'mod_data'), 'get');
|
||||
$data['importentriesbutton'] = $importentriesbutton->export_for_template($output);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ class zero_state_action_bar implements templatable, renderable {
|
||||
|
||||
$usepresetlink = new moodle_url('/mod/data/preset.php', $params);
|
||||
$usepresetbutton = new \single_button($usepresetlink,
|
||||
get_string('usestandard', 'mod_data'), 'get', true);
|
||||
get_string('usestandard', 'mod_data'), 'get', \single_button::BUTTON_PRIMARY);
|
||||
$data['usepresetbutton'] = $usepresetbutton->export_for_template($output);
|
||||
|
||||
$actionbar = new \mod_data\output\action_bar($instance->id, $PAGE->url);
|
||||
@@ -68,7 +68,7 @@ class zero_state_action_bar implements templatable, renderable {
|
||||
|
||||
$importpresetlink = new moodle_url('/mod/data/preset.php', $params);
|
||||
$importpresetbutton = new \single_button($importpresetlink,
|
||||
get_string('importapreset', 'mod_data'), 'get', false, [
|
||||
get_string('importapreset', 'mod_data'), 'get', \single_button::BUTTON_SECONDARY, [
|
||||
'data-action' => 'importpresets',
|
||||
'data-dataid' => $cm->id,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user