コード例 #1
0
ファイル: passwordunmask.php プロジェクト: elie89/moodle
 /**
  * constructor
  *
  * @param string $elementName (optional) name of the password element
  * @param string $elementLabel (optional) label for password element
  * @param mixed $attributes (optional) Either a typical HTML attribute string
  *              or an associative array
  */
 public function __construct($elementName = null, $elementLabel = null, $attributes = null)
 {
     global $CFG;
     // no standard mform in moodle should allow autocomplete of passwords
     if (empty($attributes)) {
         $attributes = array('autocomplete' => 'off');
     } else {
         if (is_array($attributes)) {
             $attributes['autocomplete'] = 'off';
         } else {
             if (strpos($attributes, 'autocomplete') === false) {
                 $attributes .= ' autocomplete="off" ';
             }
         }
     }
     parent::__construct($elementName, $elementLabel, $attributes);
 }
コード例 #2
0
ファイル: passwordunmask.php プロジェクト: ncsu-delta/moodle
 /**
  * constructor
  *
  * @param string $elementName (optional) name of the password element
  * @param string $elementLabel (optional) label for password element
  * @param mixed $attributes (optional) Either a typical HTML attribute string
  *              or an associative array
  */
 function MoodleQuickForm_passwordunmask($elementName=null, $elementLabel=null, $attributes=null) {
     global $CFG;
     if (empty($CFG->xmlstrictheaders)) {
         // no standard mform in moodle should allow autocomplete of passwords
         // this is valid attribute in html5, sorry, we have to ignore validation errors in legacy xhtml 1.0
         if (empty($attributes)) {
             $attributes = array('autocomplete'=>'off');
         } else if (is_array($attributes)) {
             $attributes['autocomplete'] = 'off';
         } else {
             if (strpos($attributes, 'autocomplete') === false) {
                 $attributes .= ' autocomplete="off" ';
             }
         }
     }
     parent::MoodleQuickForm_password($elementName, $elementLabel, $attributes);
 }
コード例 #3
0
 function MoodleQuickForm_passwordunmask($elementName = null, $elementLabel = null, $attributes = null)
 {
     parent::MoodleQuickForm_password($elementName, $elementLabel, $attributes);
 }
コード例 #4
0
ファイル: passwordunmask.php プロジェクト: dg711/moodle
 /**
  * Function to export the renderer data in a format that is suitable for a mustache template.
  *
  * @param renderer_base $output Used to do a final render of any components that need to be rendered for export.
  * @return stdClass|array
  */
 public function export_for_template(renderer_base $output)
 {
     $context = parent::export_for_template($output);
     $context['valuechars'] = array_fill(0, strlen($context['value']), 'x');
     return $context;
 }