mirror of
https://github.com/moodle/moodle.git
synced 2025-04-16 14:02:32 +02:00
Merge branch 'MDL-36991-master' of git://github.com/sammarshallou/moodle
This commit is contained in:
commit
27885779bc
@ -98,6 +98,6 @@ $string['showavailabilitysection_show'] = 'Show section greyed-out, with restric
|
||||
$string['startswith'] = 'starts with';
|
||||
$string['userfield'] = 'User field';
|
||||
$string['userfield_help'] = 'You can restrict access based on any field from the users profile.';
|
||||
$string['userrestriction_hidden'] = 'Restricted (completely hidden, no message): ‘{$a}’';
|
||||
$string['userrestriction_visible'] = 'Restricted: ‘{$a}’';
|
||||
$string['userrestriction_hidden'] = 'Restricted (completely hidden, no message): {$a}';
|
||||
$string['userrestriction_visible'] = 'Restricted: {$a}';
|
||||
$string['groupingnoaccess'] = 'You do not currently belong to a group which has access to this section. ';
|
||||
|
@ -761,6 +761,7 @@ abstract class condition_info_base {
|
||||
|
||||
$information = '';
|
||||
|
||||
|
||||
// Completion conditions
|
||||
if (count($this->item->conditionscompletion) > 0) {
|
||||
if ($this->item->course == $COURSE->id) {
|
||||
@ -776,9 +777,11 @@ abstract class condition_info_base {
|
||||
if (empty($modinfo->cms[$cmid])) {
|
||||
continue;
|
||||
}
|
||||
$information .= html_writer::start_tag('li');
|
||||
$information .= get_string(
|
||||
'requires_completion_' . $expectedcompletion,
|
||||
'condition', $modinfo->cms[$cmid]->name) . ' ';
|
||||
$information .= html_writer::end_tag('li');
|
||||
}
|
||||
}
|
||||
|
||||
@ -797,7 +800,9 @@ abstract class condition_info_base {
|
||||
} else {
|
||||
$string = 'range';
|
||||
}
|
||||
$information .= html_writer::start_tag('li');
|
||||
$information .= get_string('requires_grade_'.$string, 'condition', $minmax->name).' ';
|
||||
$information .= html_writer::end_tag('li');
|
||||
}
|
||||
}
|
||||
|
||||
@ -808,7 +813,9 @@ abstract class condition_info_base {
|
||||
$a = new stdclass;
|
||||
$a->field = $details->fieldname;
|
||||
$a->value = $details->value;
|
||||
$information .= html_writer::start_tag('li');
|
||||
$information .= get_string('requires_user_field_'.$details->operator, 'condition', $a) . ' ';
|
||||
$information .= html_writer::end_tag('li');
|
||||
}
|
||||
}
|
||||
|
||||
@ -859,22 +866,41 @@ abstract class condition_info_base {
|
||||
|
||||
if ($this->item->availablefrom && $this->item->availableuntil) {
|
||||
if ($shortfrom && $shortuntil && $daybeforeuntil == $this->item->availablefrom) {
|
||||
$information .= html_writer::start_tag('li');
|
||||
$information .= get_string('requires_date_both_single_day', 'condition',
|
||||
self::show_time($this->item->availablefrom, true));
|
||||
$information .= html_writer::end_tag('li');
|
||||
} else {
|
||||
$information .= html_writer::start_tag('li');
|
||||
$information .= get_string('requires_date_both', 'condition', (object)array(
|
||||
'from' => self::show_time($this->item->availablefrom, $shortfrom),
|
||||
'until' => self::show_time($displayuntil, $shortuntil)));
|
||||
$information .= html_writer::end_tag('li');
|
||||
}
|
||||
} else if ($this->item->availablefrom) {
|
||||
$information .= html_writer::start_tag('li');
|
||||
$information .= get_string('requires_date', 'condition',
|
||||
self::show_time($this->item->availablefrom, $shortfrom));
|
||||
$information .= html_writer::end_tag('li');
|
||||
} else if ($this->item->availableuntil) {
|
||||
$information .= html_writer::start_tag('li');
|
||||
$information .= get_string('requires_date_before', 'condition',
|
||||
self::show_time($displayuntil, $shortuntil));
|
||||
$information .= html_writer::end_tag('li');
|
||||
}
|
||||
|
||||
$information = trim($information);
|
||||
// The information is in <li> tags, but to avoid taking up more space
|
||||
// if there is only a single item, we strip out the list tags so that it
|
||||
// is plain text in that case.
|
||||
if (!empty($information)) {
|
||||
$li = strpos($information, '<li>', 4);
|
||||
if ($li === false) {
|
||||
$information = preg_replace('~^<li>(.*)</li>$~', '$1', $information);
|
||||
} else {
|
||||
$information = html_writer::tag('ul', $information);
|
||||
}
|
||||
$information = trim($information);
|
||||
}
|
||||
return $information;
|
||||
}
|
||||
|
||||
@ -971,9 +997,11 @@ abstract class condition_info_base {
|
||||
}
|
||||
if (!$thisisok) {
|
||||
$available = false;
|
||||
$information .= html_writer::start_tag('li');
|
||||
$information .= get_string(
|
||||
'requires_completion_' . $expectedcompletion,
|
||||
'condition', $modinfo->cms[$cmid]->name) . ' ';
|
||||
$information .= html_writer::end_tag('li');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -999,7 +1027,9 @@ abstract class condition_info_base {
|
||||
} else {
|
||||
$string = 'range';
|
||||
}
|
||||
$information .= html_writer::start_tag('li');
|
||||
$information .= get_string('requires_grade_' . $string, 'condition', $minmax->name) . ' ';
|
||||
$information .= html_writer::end_tag('li');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1014,7 +1044,9 @@ abstract class condition_info_base {
|
||||
$a = new stdClass();
|
||||
$a->field = $details->fieldname;
|
||||
$a->value = $details->value;
|
||||
$information .= html_writer::start_tag('li');
|
||||
$information .= get_string('requires_user_field_'.$details->operator, 'condition', $a) . ' ';
|
||||
$information .= html_writer::end_tag('li');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1024,9 +1056,11 @@ abstract class condition_info_base {
|
||||
if (time() < $this->item->availablefrom) {
|
||||
$available = false;
|
||||
|
||||
$information .= html_writer::start_tag('li');
|
||||
$information .= get_string('requires_date', 'condition',
|
||||
self::show_time($this->item->availablefrom,
|
||||
self::is_midnight($this->item->availablefrom)));
|
||||
$information .= html_writer::end_tag('li');
|
||||
}
|
||||
}
|
||||
|
||||
@ -1055,7 +1089,18 @@ abstract class condition_info_base {
|
||||
$information = '';
|
||||
}
|
||||
|
||||
$information = trim($information);
|
||||
// The information is in <li> tags, but to avoid taking up more space
|
||||
// if there is only a single item, we strip out the list tags so that it
|
||||
// is plain text in that case.
|
||||
if (!empty($information)) {
|
||||
$li = strpos($information, '<li>', 4);
|
||||
if ($li === false) {
|
||||
$information = preg_replace('~^<li>(.*)</li>$~', '$1', $information);
|
||||
} else {
|
||||
$information = html_writer::tag('ul', $information);
|
||||
}
|
||||
$information = trim($information);
|
||||
}
|
||||
return $available;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user