MDL-44139 admin: standardise warning renderer use
Take three handcoded warnings and convert them to calling the 'warning' renderer like rest of the file. Then remove redundant CSS and/or move specific CSS to generic places so it's shared.
This commit is contained in:
+15
-14
@@ -610,10 +610,10 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
}
|
||||
|
||||
$maturitylevel = get_string('maturity' . $maturity, 'admin');
|
||||
return $this->box(
|
||||
return $this->warning(
|
||||
$this->container(get_string('maturitycorewarning', 'admin', $maturitylevel)) .
|
||||
$this->container($this->doc_link('admin/versions', get_string('morehelp'))),
|
||||
'generalbox maturitywarning');
|
||||
'error');
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -628,10 +628,8 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $this->box(
|
||||
$this->container(get_string('testsiteupgradewarning', 'admin', $testsite)),
|
||||
'generalbox testsitewarning'
|
||||
);
|
||||
$warning = (get_string('testsiteupgradewarning', 'admin', $testsite));
|
||||
return $this->warning($warning, 'error');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -663,11 +661,16 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
return ''; // No worries.
|
||||
}
|
||||
|
||||
$level = 'warning';
|
||||
|
||||
if ($maturity == MATURITY_ALPHA) {
|
||||
$level = 'error';
|
||||
}
|
||||
|
||||
$maturitylevel = get_string('maturity' . $maturity, 'admin');
|
||||
return $this->box(
|
||||
get_string('maturitycoreinfo', 'admin', $maturitylevel) . ' ' .
|
||||
$this->doc_link('admin/versions', get_string('morehelp')),
|
||||
'generalbox adminwarning maturityinfo maturity'.$maturity);
|
||||
$warningtext = get_string('maturitycoreinfo', 'admin', $maturitylevel);
|
||||
$warningtext .= ' ' . $this->doc_link('admin/versions', get_string('morehelp'));
|
||||
return $this->warning($warningtext, $level);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -682,7 +685,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
*/
|
||||
protected function available_updates($updates, $fetch) {
|
||||
|
||||
$updateinfo = $this->box_start('generalbox adminwarning availableupdatesinfo');
|
||||
$updateinfo = '';
|
||||
$someupdateavailable = false;
|
||||
if (is_array($updates)) {
|
||||
if (is_array($updates['core'])) {
|
||||
@@ -719,9 +722,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
}
|
||||
$updateinfo .= $this->container_end();
|
||||
|
||||
$updateinfo .= $this->box_end();
|
||||
|
||||
return $updateinfo;
|
||||
return $this->warning($updateinfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user