~ubuntu-branches/ubuntu/trusty/moodle/trusty-proposed

« back to all changes in this revision

Viewing changes to grade/edit/tree/item_form.php

  • Committer: Package Import Robot
  • Author(s): Tomasz Muras
  • Date: 2012-11-15 21:50:13 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20121115215013-hmzkwz3v5hvm2a0a
Tags: 2.2.6.dfsg-1
New upstream version: 2.2.6 (Build: 20121112)

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
        }
137
137
 
138
138
        /// hiding
139
 
        // advcheckbox is not compatible with disabledIf!
140
 
        $mform->addElement('checkbox', 'hidden', get_string('hidden', 'grades'));
 
139
        if ($item->cancontrolvisibility) {
 
140
            // advcheckbox is not compatible with disabledIf!
 
141
            $mform->addElement('checkbox', 'hidden', get_string('hidden', 'grades'));
 
142
            $mform->addElement('date_time_selector', 'hiddenuntil', get_string('hiddenuntil', 'grades'), array('optional'=>true));
 
143
            $mform->disabledIf('hidden', 'hiddenuntil[off]', 'notchecked');
 
144
        } else {
 
145
            $mform->addElement('static', 'hidden', get_string('hidden', 'grades'),
 
146
                    get_string('componentcontrolsvisibility', 'grades'));
 
147
            // Unset hidden to avoid data override.
 
148
            unset($item->hidden);
 
149
        }
141
150
        $mform->addHelpButton('hidden', 'hidden', 'grades');
142
 
        $mform->addElement('date_time_selector', 'hiddenuntil', get_string('hiddenuntil', 'grades'), array('optional'=>true));
143
 
        $mform->disabledIf('hidden', 'hiddenuntil[off]', 'notchecked');
144
151
 
145
152
        /// locking
146
153
        $mform->addElement('advcheckbox', 'locked', get_string('locked', 'grades'));