MDL-64506 templates: Move BS2 labels to BS4 badges
This commit is contained in:
+21
-21
@@ -1066,7 +1066,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
$sourcelabel = html_writer::span(get_string('sourcestd', 'core_plugin'), 'sourcetext label');
|
||||
} else {
|
||||
$row->attributes['class'] .= ' extension';
|
||||
$sourcelabel = html_writer::span(get_string('sourceext', 'core_plugin'), 'sourcetext label label-info');
|
||||
$sourcelabel = html_writer::span(get_string('sourceext', 'core_plugin'), 'sourcetext badge badge-info');
|
||||
}
|
||||
|
||||
$coredependency = $plugin->is_core_dependency_satisfied($version);
|
||||
@@ -1078,19 +1078,19 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
$statusclass = 'statustext label ';
|
||||
switch ($statuscode) {
|
||||
case core_plugin_manager::PLUGIN_STATUS_NEW:
|
||||
$statusclass .= $dependenciesok ? 'label-success' : 'label-warning';
|
||||
$statusclass .= $dependenciesok ? 'badge-success' : 'badge-warning';
|
||||
break;
|
||||
case core_plugin_manager::PLUGIN_STATUS_UPGRADE:
|
||||
$statusclass .= $dependenciesok ? 'label-info' : 'label-warning';
|
||||
$statusclass .= $dependenciesok ? 'badge-info' : 'badge-warning';
|
||||
break;
|
||||
case core_plugin_manager::PLUGIN_STATUS_MISSING:
|
||||
case core_plugin_manager::PLUGIN_STATUS_DOWNGRADE:
|
||||
case core_plugin_manager::PLUGIN_STATUS_DELETE:
|
||||
$statusclass .= 'label-important';
|
||||
$statusclass .= 'badge-danger';
|
||||
break;
|
||||
case core_plugin_manager::PLUGIN_STATUS_NODB:
|
||||
case core_plugin_manager::PLUGIN_STATUS_UPTODATE:
|
||||
$statusclass .= $dependenciesok ? '' : 'label-warning';
|
||||
$statusclass .= $dependenciesok ? '' : 'badge-warning';
|
||||
break;
|
||||
}
|
||||
$status = html_writer::span(get_string('status_' . $statuscode, 'core_plugin'), $statusclass);
|
||||
@@ -1363,7 +1363,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
$supportedmoodles = array();
|
||||
foreach ($plugin->version->supportedmoodles as $moodle) {
|
||||
if ($CFG->branch == str_replace('.', '', $moodle->release)) {
|
||||
$supportedmoodles[] = html_writer::span($moodle->release, 'label label-success');
|
||||
$supportedmoodles[] = html_writer::span($moodle->release, 'badge badge-success');
|
||||
} else {
|
||||
$supportedmoodles[] = html_writer::span($moodle->release, 'label');
|
||||
}
|
||||
@@ -1468,7 +1468,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
$label = '';
|
||||
} else {
|
||||
$class = 'requires-failed';
|
||||
$label = html_writer::span(get_string('dependencyfails', 'core_plugin'), 'label label-important');
|
||||
$label = html_writer::span(get_string('dependencyfails', 'core_plugin'), 'badge badge-danger');
|
||||
}
|
||||
$requires[] = html_writer::tag('li',
|
||||
html_writer::span(get_string('moodleversion', 'core_plugin', $plugin->versionrequires), 'dep dep-core').
|
||||
@@ -1483,8 +1483,8 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
|
||||
} else if ($reqinfo->status == $pluginman::REQUIREMENT_STATUS_MISSING) {
|
||||
if ($reqinfo->availability == $pluginman::REQUIREMENT_AVAILABLE) {
|
||||
$label = html_writer::span(get_string('dependencymissing', 'core_plugin'), 'label label-warning');
|
||||
$label .= ' '.html_writer::span(get_string('dependencyavailable', 'core_plugin'), 'label label-warning');
|
||||
$label = html_writer::span(get_string('dependencymissing', 'core_plugin'), 'badge badge-warning');
|
||||
$label .= ' '.html_writer::span(get_string('dependencyavailable', 'core_plugin'), 'badge badge-warning');
|
||||
$class = 'requires-failed requires-missing requires-available';
|
||||
$actions[] = html_writer::link(
|
||||
new moodle_url('https://moodle.org/plugins/view.php', array('plugin' => $reqname)),
|
||||
@@ -1492,24 +1492,24 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
);
|
||||
|
||||
} else {
|
||||
$label = html_writer::span(get_string('dependencymissing', 'core_plugin'), 'label label-important');
|
||||
$label = html_writer::span(get_string('dependencymissing', 'core_plugin'), 'badge badge-danger');
|
||||
$label .= ' '.html_writer::span(get_string('dependencyunavailable', 'core_plugin'),
|
||||
'label label-important');
|
||||
'badge badge-danger');
|
||||
$class = 'requires-failed requires-missing requires-unavailable';
|
||||
}
|
||||
$displayuploadlink = true;
|
||||
|
||||
} else if ($reqinfo->status == $pluginman::REQUIREMENT_STATUS_OUTDATED) {
|
||||
if ($reqinfo->availability == $pluginman::REQUIREMENT_AVAILABLE) {
|
||||
$label = html_writer::span(get_string('dependencyfails', 'core_plugin'), 'label label-warning');
|
||||
$label .= ' '.html_writer::span(get_string('dependencyavailable', 'core_plugin'), 'label label-warning');
|
||||
$label = html_writer::span(get_string('dependencyfails', 'core_plugin'), 'badge badge-warning');
|
||||
$label .= ' '.html_writer::span(get_string('dependencyavailable', 'core_plugin'), 'badge badge-warning');
|
||||
$class = 'requires-failed requires-outdated requires-available';
|
||||
$displayupdateslink = true;
|
||||
|
||||
} else {
|
||||
$label = html_writer::span(get_string('dependencyfails', 'core_plugin'), 'label label-important');
|
||||
$label = html_writer::span(get_string('dependencyfails', 'core_plugin'), 'badge badge-danger');
|
||||
$label .= ' '.html_writer::span(get_string('dependencyunavailable', 'core_plugin'),
|
||||
'label label-important');
|
||||
'badge badge-danger');
|
||||
$class = 'requires-failed requires-outdated requires-unavailable';
|
||||
}
|
||||
$displayuploadlink = true;
|
||||
@@ -1773,13 +1773,13 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
$source = '';
|
||||
} else {
|
||||
$row->attributes['class'] .= ' extension';
|
||||
$source = html_writer::div(get_string('sourceext', 'core_plugin'), 'source label label-info');
|
||||
$source = html_writer::div(get_string('sourceext', 'core_plugin'), 'source badge badge-info');
|
||||
}
|
||||
|
||||
if ($status === core_plugin_manager::PLUGIN_STATUS_MISSING) {
|
||||
$msg = html_writer::div(get_string('status_missing', 'core_plugin'), 'statusmsg label label-important');
|
||||
$msg = html_writer::div(get_string('status_missing', 'core_plugin'), 'statusmsg badge badge-danger');
|
||||
} else if ($status === core_plugin_manager::PLUGIN_STATUS_NEW) {
|
||||
$msg = html_writer::div(get_string('status_new', 'core_plugin'), 'statusmsg label label-success');
|
||||
$msg = html_writer::div(get_string('status_new', 'core_plugin'), 'statusmsg badge badge-success');
|
||||
} else {
|
||||
$msg = '';
|
||||
}
|
||||
@@ -2018,13 +2018,13 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
// Format error or warning line
|
||||
if ($errorline) {
|
||||
$messagetype = 'error';
|
||||
$statusclass = 'label-important';
|
||||
$statusclass = 'badge-danger';
|
||||
} else if ($warningline) {
|
||||
$messagetype = 'warn';
|
||||
$statusclass = 'label-warning';
|
||||
$statusclass = 'badge-warning';
|
||||
} else {
|
||||
$messagetype = 'ok';
|
||||
$statusclass = 'label-success';
|
||||
$statusclass = 'badge-success';
|
||||
}
|
||||
$status = html_writer::span($status, 'label ' . $statusclass);
|
||||
// Here we'll store all the feedback found
|
||||
|
||||
Reference in New Issue
Block a user