MINOR: fixed deprecated code in MathSpamProtectorField

Fixed some deprecated code following instructions in the deprecation
notices.
This commit is contained in:
martimiz 2012-07-10 14:23:18 +02:00
parent 57fd743202
commit d016d32dcc

View File

@ -18,20 +18,19 @@ class MathSpamProtectorField extends SpamProtectorField {
* *
* @return HTML * @return HTML
*/ */
function Field() { function Field($properties = array()) {
if(self::is_enabled()) { if(self::is_enabled($properties = array())) {
$attributes = array( $attributes = array(
'type' => 'text', 'type' => 'text',
'class' => 'text ' . ($this->extraClass() ? $this->extraClass() : ''), 'class' => 'text ' . ($this->extraClass() ? $this->extraClass() : ''),
'id' => $this->id(), 'id' => $this->id(),
'name' => $this->Name(), 'name' => $this->getName(),
'value' => $this->Value(), 'value' => $this->Value(),
'title' => $this->Title(), 'title' => $this->Title(),
'tabindex' => $this->getTabIndex(), 'tabindex' => $this->getAttribute('tabindex'),
'maxlength' => ($this->maxLength) ? $this->maxLength : null, 'maxlength' => ($this->maxLength) ? $this->maxLength : null,
'size' => ($this->maxLength) ? min( $this->maxLength, 30 ) : null 'size' => ($this->maxLength) ? min( $this->maxLength, 30 ) : null
); );
return $this->createTag('input', $attributes); return $this->createTag('input', $attributes);
} }
} }
@ -60,8 +59,7 @@ class MathSpamProtectorField extends SpamProtectorField {
$this->name, $this->name,
_t( _t(
'MathSpamProtectionField.INCORRECTSOLUTION', 'MathSpamProtectionField.INCORRECTSOLUTION',
"Incorrect solution to the spam protection question, please try again.", "Incorrect solution to the spam protection question, please try again."
PR_MEDIUM
), ),
"error" "error"
); );