| 1 |
<?php |
| 2 |
abstract class PFBCError extends Base { |
| 3 |
protected $form; |
| 4 |
|
| 5 |
public function __construct(array $properties = null) { |
| 6 |
$this->configure($properties); |
| 7 |
} |
| 8 |
|
| 9 |
public abstract function applyAjaxErrorResponse(); |
| 10 |
|
| 11 |
public function clear() { |
| 12 |
echo 'jQuery("#', $this->form->getId(), ' .pfbc-error").remove();'; |
| 13 |
} |
| 14 |
|
| 15 |
public abstract function render(); |
| 16 |
public abstract function renderAjaxErrorResponse(); |
| 17 |
|
| 18 |
public function renderCSS() { |
| 19 |
$id = $this->form->getId(); |
| 20 |
echo <<<CSS |
| 21 |
#$id .pfbc-error { padding: .5em; margin-bottom: 1em; } |
| 22 |
#$id .pfbc-error ul { padding-left: 1.75em; margin: 0; margin-top: .25em; } |
| 23 |
#$id .pfbc-error li { padding-top: .25em; } |
| 24 |
CSS; |
| 25 |
} |
| 26 |
|
| 27 |
public function setForm(Form $form) { |
| 28 |
$this->form = $form; |
| 29 |
} |
| 30 |
} |
| 31 |
|