Merge branch 'MDL-66999-master' of git://github.com/bmbrands/moodle

This commit is contained in:
Adrian Greeve 2019-12-23 14:26:39 +08:00
commit f00542c485
69 changed files with 1487 additions and 2168 deletions

View file

@ -156,7 +156,7 @@ class mnet_review_host_form extends moodleform {
if ($mnet_peer && !empty($mnet_peer->deleted)) {
$radioarray = array();
$radioarray[] = $mform->createElement('static', 'deletedinfo', '',
$OUTPUT->container(get_string('deletedhostinfo', 'mnet'), 'deletedhostinfo'));
$OUTPUT->container(get_string('deletedhostinfo', 'mnet'), 'alert alert-warning'));
$radioarray[] = $mform->createElement('radio', 'deleted', '', get_string('yes'), 1);
$radioarray[] = $mform->createElement('radio', 'deleted', '', get_string('no'), 0);
$mform->addGroup($radioarray, 'radioar', get_string('deleted'), array(' ', ' '), false);

View file

@ -170,7 +170,7 @@ foreach ($sortedbehaviours as $behaviour => $behaviourname) {
if ($version) {
$row[] = $version;
} else {
$row[] = html_writer::tag('span', get_string('nodatabase', 'admin'), array('class' => 'disabled'));
$row[] = html_writer::tag('span', get_string('nodatabase', 'admin'), array('class' => 'text-muted'));
}
// Other question types required by this one.

View file

@ -172,7 +172,7 @@ foreach ($sortedqtypes as $qtypename => $localname) {
if ($version) {
$row[] = $version;
} else {
$row[] = html_writer::tag('span', get_string('nodatabase', 'admin'), array('class' => 'disabled'));
$row[] = html_writer::tag('span', get_string('nodatabase', 'admin'), array('class' => 'text-muted'));
}
// Other question types required by this one.

View file

@ -253,7 +253,7 @@ class core_admin_renderer extends plugin_renderer_base {
$out .= $this->output->container(get_string('cancelinstallinfodir', 'core_plugin', $pluginfo->rootdir));
if ($repotype = $pluginman->plugin_external_source($pluginfo->component)) {
$out .= $this->output->container(get_string('uninstalldeleteconfirmexternal', 'core_plugin', $repotype),
'uninstalldeleteconfirmexternal');
'alert alert-warning mt-2');
}
}
@ -432,7 +432,7 @@ class core_admin_renderer extends plugin_renderer_base {
if ($repotype = $pluginman->plugin_external_source($pluginfo->component)) {
$confirm .= $this->output->container(get_string('uninstalldeleteconfirmexternal', 'core_plugin', $repotype),
'uninstalldeleteconfirmexternal');
'alert alert-warning mt-2');
}
// After any uninstall we must execute full upgrade to finish the cleanup!
@ -511,7 +511,7 @@ class core_admin_renderer extends plugin_renderer_base {
* @return string HTML to output.
*/
protected function warning($message, $type = 'warning') {
return $this->box($message, 'generalbox admin' . $type);
return $this->box($message, 'generalbox alert alert-' . $type);
}
/**
@ -526,7 +526,7 @@ class core_admin_renderer extends plugin_renderer_base {
return $this->warning(get_string('datarootsecuritywarning', 'admin', $CFG->dataroot));
} else if ($insecuredataroot == INSECURE_DATAROOT_ERROR) {
return $this->warning(get_string('datarootsecurityerror', 'admin', $CFG->dataroot), 'error');
return $this->warning(get_string('datarootsecurityerror', 'admin', $CFG->dataroot), 'danger');
} else {
return '';
@ -544,7 +544,7 @@ class core_admin_renderer extends plugin_renderer_base {
if ($devlibdir) {
$moreinfo = new moodle_url('/report/security/index.php');
$warning = get_string('devlibdirpresent', 'core_admin', ['moreinfourl' => $moreinfo->out()]);
return $this->warning($warning, 'error');
return $this->warning($warning, 'danger');
} else {
return '';
@ -721,7 +721,7 @@ class core_admin_renderer extends plugin_renderer_base {
return $this->warning(
$this->container(get_string('maturitycorewarning', 'admin', $maturitylevel)) .
$this->container($this->doc_link('admin/versions', get_string('morehelp'))),
'error');
'danger');
}
/*
@ -737,7 +737,7 @@ class core_admin_renderer extends plugin_renderer_base {
}
$warning = (get_string('testsiteupgradewarning', 'admin', $testsite));
return $this->warning($warning, 'error');
return $this->warning($warning, 'danger');
}
/**
@ -772,7 +772,7 @@ class core_admin_renderer extends plugin_renderer_base {
$level = 'warning';
if ($maturity == MATURITY_ALPHA) {
$level = 'error';
$level = 'danger';
}
$maturitylevel = get_string('maturity' . $maturity, 'admin');
@ -954,7 +954,7 @@ class core_admin_renderer extends plugin_renderer_base {
protected function release_notes_link() {
$releasenoteslink = get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/dev/Releases');
$releasenoteslink = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $releasenoteslink); // extremely ugly validation hack
return $this->box($releasenoteslink, 'generalbox releasenoteslink');
return $this->box($releasenoteslink, 'generalbox alert alert-info');
}
/**
@ -1902,7 +1902,7 @@ class core_admin_renderer extends plugin_renderer_base {
get_string('status'),
);
$servertable->colclasses = array('centeralign name', 'centeralign info', 'leftalign report', 'leftalign plugin', 'centeralign status');
$servertable->attributes['class'] = 'admintable environmenttable generaltable';
$servertable->attributes['class'] = 'admintable environmenttable generaltable table-sm';
$servertable->id = 'serverstatus';
$serverdata = array('ok'=>array(), 'warn'=>array(), 'error'=>array());
@ -1915,7 +1915,7 @@ class core_admin_renderer extends plugin_renderer_base {
get_string('status'),
);
$othertable->colclasses = array('aligncenter info', 'alignleft report', 'alignleft plugin', 'aligncenter status');
$othertable->attributes['class'] = 'admintable environmenttable generaltable';
$othertable->attributes['class'] = 'admintable environmenttable generaltable table-sm';
$othertable->id = 'otherserverstatus';
$otherdata = array('ok'=>array(), 'warn'=>array(), 'error'=>array());

View file

@ -43,7 +43,7 @@ abstract class core_role_capability_table_base {
protected $id;
/** Added to the class="" attribute on output. */
protected $classes = array('rolecap');
protected $classes = array('rolecap table-hover');
/** Default number of capabilities in the table for the search UI to be shown. */
const NUM_CAPS_FOR_SEARCH = 12;

View file

@ -50,6 +50,7 @@ class core_role_check_capability_table extends core_role_capability_table_base {
$this->contextname = $contextname;
$this->stryes = get_string('yes');
$this->strno = get_string('no');
$this->add_classes(['table-striped']);
}
protected function add_header_cells() {

View file

@ -55,6 +55,7 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
foreach ($levels as $level => $classname) {
$this->allcontextlevels[$level] = context_helper::get_level_name($level);
}
$this->add_classes(['table-striped']);
}
protected function load_current_permissions() {

View file

@ -66,9 +66,9 @@ class core_role_override_permissions_table_advanced extends core_role_capability
$rowattributes = parent::get_row_attributes($capability);
if ($this->permissions[$capability->name] !== 0) {
if (empty($rowattributes['class'])) {
$rowattributes['class'] = "overriddenpermission";
$rowattributes['class'] = "overriddenpermission table-warning";
} else {
$rowattributes['class'] .= " overriddenpermission";
$rowattributes['class'] .= " overriddenpermission table-warning";
}
}
return $rowattributes;

View file

@ -52,10 +52,10 @@
<label {{#labelfor}}for="{{labelfor}}"{{/labelfor}}>
{{{title}}}
{{#override}}
<div class="form-overridden">{{override}}</div>
<div class="alert alert-info">{{override}}</div>
{{/override}}
{{#warning}}
<div class="form-warning">{{warning}}</div>
<div class="alert alert-warning">{{warning}}</div>
{{/warning}}
</label>
<span class="form-shortname d-block small text-muted">{{{name}}}</span>

View file

@ -47,7 +47,7 @@
<h3 class="adminpagetitle"><a href="{{url}}">{{{title}}}</a></h3>
<ul class="adminpagepath" aria-label="{{#str}} pagepath, core {{/str}}">
{{#path}}
<li>{{.}}</li>
<li class="small text-muted">{{.}}</li>
{{/path}}
</ul>
<fieldset class="adminsettings">

View file

@ -143,7 +143,7 @@ function print_report_tree($contextid, $contexts, $allroles) {
// If there are any role overrides here, print them.
if (!empty($contexts[$contextid]->rolecapabilities)) {
$rowcounter = 0;
echo '<table class="generaltable rolecaps"><tbody>';
echo '<table class="generaltable table-striped"><tbody>';
foreach ($allroles as $role) {
if (isset($contexts[$contextid]->rolecapabilities[$role->id])) {
$permission = $contexts[$contextid]->rolecapabilities[$role->id];

View file

@ -75,7 +75,7 @@
<hr />
<div class="p-l-3">
<dl class="row">
<dt class="col-xs-3">
<dt class="col-3">
{{#link}}
<a href="#{{name}}"><strong style="word-wrap:break-word">{{name}}</strong></a>
{{/link}}
@ -84,13 +84,13 @@
{{/link}}
<div class="small text-muted" style="word-wrap:break-word">{{type}}</div>
</dt>
<dd class="col-xs-9">{{summary}}</dd>
<dd class="col-9">{{summary}}</dd>
</dl>
<dl>
{{#fields}}
<div class="row">
<dt class="col-xs-3 font-weight-normal" style="word-wrap:break-word">{{field_name}}</dt>
<dd class="col-xs-9">{{field_summary}}</dd>
<dt class="col-3 font-weight-normal" style="word-wrap:break-word">{{field_name}}</dt>
<dd class="col-9">{{field_summary}}</dd>
</div>
{{/fields}}
</dl>
@ -100,7 +100,7 @@
<hr />
<div class="p-l-3">
<div class="row">
<div class="col-xs-12">
<div class="col-12">
{{nullprovider}}
</div>
</div>

View file

@ -52,7 +52,7 @@ class tool_filetypes_renderer extends plugin_renderer_base {
$out = $this->heading(get_string('pluginname', 'tool_filetypes'));
if ($restricted) {
$out .= html_writer::div(
html_writer::div(get_string('configoverride', 'admin'), 'form-overridden'),
html_writer::div(get_string('configoverride', 'admin'), 'alert alert-info'),
'', array('id' => 'adminsettings'));
}
if (count($combined) > 1) {

View file

@ -23,10 +23,3 @@
.path-admin-tool-filetypes .generaltable .nonstandard {
font-weight: bold;
}
/* Spacing around the 'Defined in config.php' stripe */
.path-admin-tool-filetypes .form-overridden {
display: inline-block;
margin-bottom: 1em;
padding: 4px 6px;
}

View file

@ -120,7 +120,8 @@ class main_view extends XMLDBAction {
$result = $this->launch('get_db_directories');
// Display list of DB directories if everything is ok
if ($result && !empty($XMLDB->dbdirs)) {
$o .= '<table id="listdirectories" border="0" cellpadding="5" cellspacing="1" class="admintable generaltable">';
$o .= '<table id="listdirectories" border="0" cellpadding="5" cellspacing="1"' .
' class="table-striped table-sm admintable generaltable">';
$row = 0;
foreach ($XMLDB->dbdirs as $key => $dbdir) {
// Detect if this is the lastused dir

View file

@ -300,7 +300,7 @@
$table->head = array ();
$table->colclasses = array();
$table->head[] = $fullnamedisplay;
$table->attributes['class'] = 'admintable generaltable';
$table->attributes['class'] = 'admintable generaltable table-sm';
foreach ($extracolumns as $field) {
$table->head[] = ${$field};
}