$this->element('title', null, _m('TITLE','Notice'));
$this->elementEnd('head');
$this->elementStart('body');
- $this->showContent();
+ if ($this->getError()) {
+ $this->element('p', array('id'=>'error'), $msg);
+ } else {
+ $this->showContent();
+ }
$this->elementEnd('body');
$this->endHTML();
}
class FormAction extends ManagedAction
{
protected $form = null;
+ protected $formOpts = array();
protected $type = null;
protected $needLogin = true;
protected $canPost = true;
protected function getForm()
{
$class = $this->form.'Form';
- $form = new $class($this);
+ $form = new $class($this, $this->formOpts);
return $form;
}
class ManagedAction extends Action
{
+ protected function prepare(array $args=array())
+ {
+ if (!parent::prepare($args)) {
+ return false;
+ }
+ $this->doPreparation();
+ return true;
+ }
+
+ protected function doPreparation()
+ {
+ // pass by default
+ }
+
/**
* Handler method
*/
protected function handlePost()
{
// This will only be run if the Action has the property canPost==true
+ assert($this->canPost);
}
}