MDL-36704: wrap pending conditions in span tags
This commit is contained in:
Regular → Executable
+31
-22
@@ -303,7 +303,8 @@ class condition_info_section extends condition_info_base {
|
||||
array($this->item->groupingid, $userid));
|
||||
if (!$gotit && !has_capability('moodle/site:accessallgroups', $context, $userid)) {
|
||||
$available = false;
|
||||
$information .= get_string('groupingnoaccess', 'condition');
|
||||
$information .= html_writer::tag('span',
|
||||
get_string('groupingnoaccess', 'condition'), array('class'=>"conditionalrule groupingnoaccess"));
|
||||
}
|
||||
} else {
|
||||
// Request is for current user - use cache
|
||||
@@ -332,7 +333,8 @@ class condition_info_section extends condition_info_base {
|
||||
$usergroupings = $CONDITIONLIB_PRIVATE->groupingscache[$this->item->course];
|
||||
if ($usergroupings !== true && !array_key_exists($this->item->groupingid, $usergroupings)) {
|
||||
$available = false;
|
||||
$information .= get_string('groupingnoaccess', 'condition');
|
||||
$information .= html_writer::tag('span',
|
||||
get_string('groupingnoaccess', 'condition'), array('class'=>"conditionalrule groupingnoaccess"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -776,9 +778,9 @@ abstract class condition_info_base {
|
||||
if (empty($modinfo->cms[$cmid])) {
|
||||
continue;
|
||||
}
|
||||
$information .= get_string(
|
||||
'requires_completion_' . $expectedcompletion,
|
||||
'condition', $modinfo->cms[$cmid]->name) . ' ';
|
||||
$information .= html_writer::tag('span',
|
||||
get_string('requires_completion_' . $expectedcompletion, 'condition', $modinfo->cms[$cmid]->name).' ',
|
||||
array('class'=>"conditionalrule requires_completion"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -797,7 +799,8 @@ abstract class condition_info_base {
|
||||
} else {
|
||||
$string = 'range';
|
||||
}
|
||||
$information .= get_string('requires_grade_'.$string, 'condition', $minmax->name).' ';
|
||||
$information .= html_writer::tag('span', get_string('requires_grade_'.$string, 'condition', $minmax->name).' ',
|
||||
array('class'=>"conditionalrule requires_grade"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -859,19 +862,22 @@ abstract class condition_info_base {
|
||||
|
||||
if ($this->item->availablefrom && $this->item->availableuntil) {
|
||||
if ($shortfrom && $shortuntil && $daybeforeuntil == $this->item->availablefrom) {
|
||||
$information .= get_string('requires_date_both_single_day', 'condition',
|
||||
self::show_time($this->item->availablefrom, true));
|
||||
$information .= html_writer::tag('span',
|
||||
get_string('requires_date_both_single_day', 'condition', self::show_time($this->item->availablefrom, true)),
|
||||
array('class'=>"conditionalrule requires_date_both_single_day"));
|
||||
} else {
|
||||
$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::tag('span',
|
||||
get_string('requires_date_both', 'condition',
|
||||
(object)array('from' => self::show_time($this->item->availablefrom, $shortfrom),
|
||||
'until' => self::show_time($displayuntil, $shortuntil))),
|
||||
array('class'=>"conditionalrule requires_date_both"));
|
||||
}
|
||||
} else if ($this->item->availablefrom) {
|
||||
$information .= get_string('requires_date', 'condition',
|
||||
self::show_time($this->item->availablefrom, $shortfrom));
|
||||
$information .= html_writer::tag('span', get_string('requires_date', 'condition',
|
||||
self::show_time($this->item->availablefrom, $shortfrom)), array('class'=>"conditionalrule requires_date"));
|
||||
} else if ($this->item->availableuntil) {
|
||||
$information .= get_string('requires_date_before', 'condition',
|
||||
self::show_time($displayuntil, $shortuntil));
|
||||
$information .= html_writer::tag('span', get_string('requires_date_before', 'condition',
|
||||
self::show_time($displayuntil, $shortuntil)), array('class'=>"conditionalrule requires_date_before"));
|
||||
}
|
||||
|
||||
$information = trim($information);
|
||||
@@ -971,9 +977,9 @@ abstract class condition_info_base {
|
||||
}
|
||||
if (!$thisisok) {
|
||||
$available = false;
|
||||
$information .= get_string(
|
||||
'requires_completion_' . $expectedcompletion,
|
||||
'condition', $modinfo->cms[$cmid]->name) . ' ';
|
||||
$information .= html_writer::tag('span',
|
||||
get_string('requires_completion_' . $expectedcompletion, 'condition', $modinfo->cms[$cmid]->name).' ',
|
||||
array('class'=>"conditionalrule requires_completion"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -999,7 +1005,9 @@ abstract class condition_info_base {
|
||||
} else {
|
||||
$string = 'range';
|
||||
}
|
||||
$information .= get_string('requires_grade_' . $string, 'condition', $minmax->name) . ' ';
|
||||
$information .= html_writer::tag('span',
|
||||
get_string('requires_grade_' . $string, 'condition', $minmax->name).' ',
|
||||
array('class'=>"conditionalrule requires_grade"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1024,9 +1032,10 @@ abstract class condition_info_base {
|
||||
if (time() < $this->item->availablefrom) {
|
||||
$available = false;
|
||||
|
||||
$information .= get_string('requires_date', 'condition',
|
||||
self::show_time($this->item->availablefrom,
|
||||
self::is_midnight($this->item->availablefrom)));
|
||||
$information .= html_writer::tag('span',
|
||||
get_string('requires_date', 'condition',
|
||||
self::show_time($this->item->availablefrom, self::is_midnight($this->item->availablefrom))),
|
||||
array('class'=>"conditionalrule availablefrom"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user