public function init() { parent::init(); $this->addElement('simpleText', 'path', array('label' => $this->lmsg('pathLabel'), 'value' => $this->_slave->getConfigPath())); $this->addElement('textarea', 'config', array('value' => $this->_slave->content(), 'decorators' => [['Callback', ['callback' => [$this, 'decorateConfig']]]])); $this->addControlButtons(array('hideLegend' => true, 'sendHidden' => true, 'cancelLink' => pm_Context::getBaseUrl())); }
public function init() { parent::init(); $this->addElement('text', 'ip', array('label' => $this->lmsg('ipLabel'), 'value' => '', 'class' => 'f-large-size', 'required' => true, 'validators' => array(array('NotEmpty', true), array('Ip', true)))); $this->addElement('text', 'port', array('label' => $this->lmsg('portLabel'), 'value' => '953', 'required' => true, 'validators' => array(array('NotEmpty', true), array('Int', true)))); $this->addElement('select', 'algorithm', array('label' => $this->lmsg('algorithmLabel'), 'multiOptions' => array('hmac-md5' => 'hmac-md5'), 'value' => 'hmac-md5', 'required' => true)); $this->addElement('text', 'secret', array('label' => $this->lmsg('secretLabel'), 'value' => $this->_getRandomSecret(), 'class' => 'f-large-size', 'required' => true, 'validators' => array(array('NotEmpty', true), array('Callback', true, array(array($this, 'isValidSecret')))))); $this->addControlButtons(array('cancelLink' => pm_Context::getBaseUrl())); }