Merge branch 'MDL-32137-master-1' of git://git.luns.net.uk/moodle

This commit is contained in:
Sam Hemelryk 2012-04-04 08:22:16 +12:00
commit cad96a8a36
2 changed files with 16 additions and 24 deletions

View File

@ -91,7 +91,6 @@ $string['nomessages'] = 'No messages waiting';
$string['nomessagesfound'] = 'No messages were found';
$string['noreply'] = 'Do not reply to this message';
$string['nosearchresults'] = 'There were no results from your search';
$string['notpermitted'] = 'Not permitted';
$string['offline'] = 'Offline';
$string['offlinecontacts'] = 'Offline contacts ({$a})';
$string['online'] = 'Online';

View File

@ -262,26 +262,20 @@ class core_message_renderer extends plugin_renderer_base {
if (isset($defaultpreferences->{$defaultpreference})) {
$permitted = $defaultpreferences->{$defaultpreference};
}
// If settings are disallowed, just display the message that
// the setting is not permitted, if not use user settings or
// force them.
if ($permitted == 'disallowed') {
// If settings are disallowed or forced, just display the
// corresponding message, if not use user settings.
if (in_array($permitted, array('disallowed', 'forced'))) {
if ($state == 'loggedoff') {
// skip if we are rendering the second line
continue;
}
$cellcontent = html_writer::nonempty_tag('div', get_string('notpermitted', 'message'), array('class' => 'dimmed_text'));
$cellcontent = html_writer::nonempty_tag('div', get_string($permitted, 'message'), array('class' => 'dimmed_text'));
$optioncell = new html_table_cell($cellcontent);
$optioncell->rowspan = 2;
$optioncell->attributes['class'] = 'disallowed';
} else {
// determine user preferences and use then unless we force
// the preferences.
// determine user preferences and use them.
$disabled = array();
if ($permitted == 'forced') {
$checked = true;
$disabled['disabled'] = 1;
} else {
$checked = false;
if ($notificationsdisabled) {
$disabled['disabled'] = 1;
@ -297,7 +291,6 @@ class core_message_renderer extends plugin_renderer_base {
$checked = (int)in_array($processor->name, explode(',', $defaultpreferences->{$defaultpreference}));
}
}
}
$elementname = $preferencebase.'_'.$state.'['.$processor->name.']';
// prepare language bits
$processorname = get_string('pluginname', 'message_'.$processor->name);