mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-13718 New icon for "locked" state icon, for grades whose grade item is locked. Merging from MOODLE_19_STABLE
This commit is contained in:
parent
e2ae84a298
commit
2673c733de
@ -1033,7 +1033,7 @@ class grade_structure {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return locking icon for give element
|
||||
* Return locking icon for given element
|
||||
* @param object $element
|
||||
* @return string
|
||||
*/
|
||||
@ -1044,7 +1044,13 @@ class grade_structure {
|
||||
$strunlock = get_string('unlockverbose', 'grades', $strparams);
|
||||
$strlock = get_string('lockverbose', 'grades', $strparams);
|
||||
|
||||
if ($element['object']->is_locked()) {
|
||||
// Don't allow an unlocking action for a grade whose grade item is locked: just print a state icon
|
||||
if ($element['type'] == 'grade' && $element['object']->grade_item->is_locked()) {
|
||||
$strparamobj = new stdClass();
|
||||
$strparamobj->itemname = $element['object']->grade_item->itemname;
|
||||
$strnonunlockable = get_string('nonunlockableverbose', 'grades', $strparamobj);
|
||||
$action = '<img src="'.$CFG->pixpath.'/t/unlock_gray.gif" alt="'.$strnonunlockable.'" class="iconsmall" title="'.$strnonunlockable.'"/>';
|
||||
} elseif ($element['object']->is_locked()) {
|
||||
$icon = 'unlock';
|
||||
$tooltip = $strunlock;
|
||||
|
||||
|
@ -340,6 +340,7 @@ $string['noidnumber'] = 'No id number';
|
||||
$string['nolettergrade'] = 'No letter grade for';
|
||||
$string['nomode'] = 'NA';
|
||||
$string['nonnumericweight'] = 'Received non-numeric value for';
|
||||
$string['nonunlockableverbose'] = 'This grade cannot be unlocked until $a->itemname is unlocked.';
|
||||
$string['nonweightedpct'] = 'non-weighted %%';
|
||||
$string['nooutcome'] = 'No outcome';
|
||||
$string['nopublish'] = 'Do not publish';
|
||||
|
BIN
pix/t/unlock_gray.gif
Normal file
BIN
pix/t/unlock_gray.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 91 B |
Loading…
x
Reference in New Issue
Block a user