* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2 * @author Icinga Development Team */ // {{{ICINGA_LICENSE_HEADER}}} namespace Monitoring\Form\Command; use Zend_Form_Element_Hidden; /** * For for command CustomNotification */ class CustomNotificationForm extends CommandForm { /** * Interface method to build the form * @see CommandForm::create */ protected function create() { $this->addElement($this->createAuthorField()); $this->addElement( 'textarea', 'comment', array( 'label' => t('Comment'), 'rows' => 4, 'required' => true ) ); $this->addElement( 'checkbox', 'force', array( 'label' => t('Forced') ) ); $this->addElement( 'checkbox', 'broadcast', array( 'label' => t('Broadcast') ) ); $this->setSubmitLabel(t('Send custom notification')); parent::create(); } public function getComment() { return $this->getValue('comment'); } public function getOptions() { $value = 0; if ($this->getValue('force')) { $value |= 2; } if ($this->getValue('broadcast')) { $value |= 1; } return $value; } }