Esempio n. 1
0
 /**
  * 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);
 }
Esempio n. 2
0
 /**
  * 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)
 {
     // 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" ';
             }
         }
     }
     $this->_persistantFreeze = true;
     parent::__construct($elementName, $elementLabel, $attributes);
     $this->setType('passwordunmask');
 }