2 /* This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
3 and is published under the AGPL license. */
5 abstract class Syj_Form_Pending extends Zend_Form
7 protected $_pending = null;
9 protected $_elementDecorators = array(
10 array('Description', array('tag' => '', 'escape' => false)),
11 array(array('br' => 'HtmlTag'), array('tag' => 'br', 'placement' => 'APPEND', 'openOnly' => true)),
13 array(array('p' => 'HtmlTag'), array('tag' => 'p', 'class' => 'desc')),
16 protected $_decorators = array(
17 'FormElements' => array('decorator' => 'FormElements', 'options' => null),
18 'Form' => array('decorator' => 'Form', 'options' => array('class' => 'center'))
21 public function __construct(Syj_Model_Pending $pending, $options = null) {
22 $this->_pending = $pending;
23 parent::__construct($options);
26 public function init() {
27 $activate = array('Submit', 'pending_validate', $this->getActivateOptions());
28 $cancel = array('Submit', 'pending_cancel', $this->getCancelOptions());
29 $this->addElements(array($activate, $cancel));
32 abstract protected function getActivateOptions();
34 abstract protected function getCancelOptions();