MDL-64506 templates: Move BS2 labels to BS4 badges
[moodle.git] / admin / renderer.php
index 57eaa0e..257f825 100644 (file)
@@ -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('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);
                 }
 
                 $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 = '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:
                         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:
                         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:
                         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);
                         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 = 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');
                 }
                 } 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 = '';
                 } 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').
                 }
                 $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) {
 
                 } 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)),
                         $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 {
                         );
 
                     } 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 .= ' '.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) {
                         $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 {
                         $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 .= ' '.html_writer::span(get_string('dependencyunavailable', 'core_plugin'),
-                            'label label-important');
+                            'badge badge-danger');
                         $class = 'requires-failed requires-outdated requires-unavailable';
                     }
                     $displayuploadlink = true;
                         $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 = '';
                 } 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) {
                 }
 
                 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) {
                 } 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 = '';
                 }
                 } else {
                     $msg = '';
                 }
@@ -2018,13 +2018,13 @@ class core_admin_renderer extends plugin_renderer_base {
                 // Format error or warning line
                 if ($errorline) {
                     $messagetype = 'error';
                 // Format error or warning line
                 if ($errorline) {
                     $messagetype = 'error';
-                    $statusclass = 'label-important';
+                    $statusclass = 'badge-danger';
                 } else if ($warningline) {
                     $messagetype = 'warn';
                 } else if ($warningline) {
                     $messagetype = 'warn';
-                    $statusclass = 'label-warning';
+                    $statusclass = 'badge-warning';
                 } else {
                     $messagetype = 'ok';
                 } else {
                     $messagetype = 'ok';
-                    $statusclass = 'label-success';
+                    $statusclass = 'badge-success';
                 }
                 $status = html_writer::span($status, 'label ' . $statusclass);
                 // Here we'll store all the feedback found
                 }
                 $status = html_writer::span($status, 'label ' . $statusclass);
                 // Here we'll store all the feedback found