2007-07-19 12:40:28 +02:00
|
|
|
<?php
|
2008-01-09 05:18:36 +01:00
|
|
|
/**
|
|
|
|
* Action that clears all fields on a form.
|
|
|
|
* Inserts an input tag with type=reset.
|
|
|
|
* @package forms
|
|
|
|
* @subpackage actions
|
2007-07-19 12:40:28 +02:00
|
|
|
*/
|
|
|
|
class ResetFormAction extends FormAction {
|
|
|
|
|
|
|
|
function Field() {
|
2009-04-29 01:55:53 +02:00
|
|
|
$attributes = array(
|
|
|
|
'class' => 'action' . ($this->extraClass() ? $this->extraClass() : ''),
|
|
|
|
'id' => $this->id(),
|
|
|
|
'type' => 'reset',
|
|
|
|
'name' => $this->action,
|
|
|
|
);
|
2009-02-02 00:49:53 +01:00
|
|
|
|
2009-04-29 01:55:53 +02:00
|
|
|
if($this->isReadonly()) {
|
|
|
|
$attributes['disabled'] = 'disabled';
|
|
|
|
$attributes['class'] = $attributes['class'] . ' disabled';
|
|
|
|
}
|
2009-02-02 00:49:53 +01:00
|
|
|
|
2009-04-29 01:55:53 +02:00
|
|
|
$attributes['title'] = ($this->description) ? $this->description : ($this->dontEscape) ? $this->Title() : $this->attrTitle();
|
|
|
|
|
|
|
|
if($this->useButtonTag) {
|
2009-02-02 00:49:53 +01:00
|
|
|
return $this->createTag('button', $attributes, $this->attrTitle());
|
2008-08-11 02:21:44 +02:00
|
|
|
}
|
2009-04-29 01:55:53 +02:00
|
|
|
|
|
|
|
return $this->createTag('input', $attributes);
|
2007-07-19 12:40:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
?>
|