]> dev.renevier.net Git - syj.git/blob - application/forms/Pending.php
version 0.1
[syj.git] / application / forms / Pending.php
1 <?php
2 /*  This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
3     and is published under the AGPL license. */
4
5 abstract class Syj_Form_Pending extends Zend_Form
6 {
7     protected $_pending = null;
8
9     protected $_elementDecorators = array(
10                           array('Description', array('tag' => '', 'escape' => false)),
11                           array(array('br' => 'HtmlTag'), array('tag' => 'br', 'placement' => 'APPEND', 'openOnly' => true)),
12                           'ViewHelper',
13                           array(array('p' => 'HtmlTag'), array('tag' => 'p', 'class' => 'desc')),
14                           );
15
16     protected $_decorators = array(
17                             'FormElements' => array('decorator' => 'FormElements', 'options' => null),
18                             'Form' => array('decorator' => 'Form', 'options' => array('class' => 'center'))
19                             );
20
21     public function __construct(Syj_Model_Pending $pending, $options = null) {
22         $this->_pending = $pending;
23         parent::__construct($options);
24     }
25
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));
30     }
31
32     abstract protected function getActivateOptions();
33
34     abstract protected function getCancelOptions();
35
36 }