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:
nicolasconnault 2008-02-28 15:43:09 +00:00
parent e2ae84a298
commit 2673c733de
3 changed files with 10 additions and 3 deletions

View File

@ -1033,7 +1033,7 @@ class grade_structure {
} }
/** /**
* Return locking icon for give element * Return locking icon for given element
* @param object $element * @param object $element
* @return string * @return string
*/ */
@ -1043,8 +1043,14 @@ class grade_structure {
$strparams = $this->get_params_for_iconstr($element); $strparams = $this->get_params_for_iconstr($element);
$strunlock = get_string('unlockverbose', 'grades', $strparams); $strunlock = get_string('unlockverbose', 'grades', $strparams);
$strlock = get_string('lockverbose', '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'; $icon = 'unlock';
$tooltip = $strunlock; $tooltip = $strunlock;

View File

@ -340,6 +340,7 @@ $string['noidnumber'] = 'No id number';
$string['nolettergrade'] = 'No letter grade for'; $string['nolettergrade'] = 'No letter grade for';
$string['nomode'] = 'NA'; $string['nomode'] = 'NA';
$string['nonnumericweight'] = 'Received non-numeric value for'; $string['nonnumericweight'] = 'Received non-numeric value for';
$string['nonunlockableverbose'] = 'This grade cannot be unlocked until $a->itemname is unlocked.';
$string['nonweightedpct'] = 'non-weighted %%'; $string['nonweightedpct'] = 'non-weighted %%';
$string['nooutcome'] = 'No outcome'; $string['nooutcome'] = 'No outcome';
$string['nopublish'] = 'Do not publish'; $string['nopublish'] = 'Do not publish';

BIN
pix/t/unlock_gray.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B