Example #1
0
 public function initialize()
 {
     $bandwidthValidator = $this->createValidator()->orValidator($this->createValidator()->integer()->greatThan(0), $this->createValidator(Validate::EMPTYSTRING));
     $WeightAdapter = $this->getPlatform()->getMapAdapter(array($this, 'readWeight'), array($this, 'writeWeight'), array());
     $ProviderNameAdapter = $this->getPlatform()->getMapAdapter(array($this, 'readProviderName'), array($this, 'writeProviderName'), array());
     $this->setSchema(array(array('device', Validate::ANYTHING, \Nethgui\Controller\Table\RowAbstractAction::KEY), array('role', $this->createValidator()->memberOf($this->getParent()->getInterfaceRoles()), \Nethgui\Controller\Table\RowAbstractAction::FIELD), array('bootproto', $this->createValidator()->memberOf('dhcp', 'none'), \Nethgui\Controller\Table\RowAbstractAction::FIELD), array('ipaddr', Validate::IPv4, \Nethgui\Controller\Table\RowAbstractAction::FIELD), array('netmask', Validate::IPv4_NETMASK, \Nethgui\Controller\Table\RowAbstractAction::FIELD), array('gateway', Validate::IP_OR_EMPTY, \Nethgui\Controller\Table\RowAbstractAction::FIELD), array('ProviderName', $this->createValidator()->maxLength(5)->minLength(1)->regexp('/^(?:(?!main).)*$/')->regexp('/^(?:(?!local).)*$/')->regexp('/^(?:(?!\\s).)*$/'), $ProviderNameAdapter), array('Weight', $this->createValidator()->integer()->greatThan(0)->lessThan(256), $WeightAdapter), array('FwInBandwidth', $bandwidthValidator, \Nethgui\Controller\Table\RowAbstractAction::FIELD), array('FwOutBandwidth', $bandwidthValidator, \Nethgui\Controller\Table\RowAbstractAction::FIELD)));
     parent::initialize();
 }
 public function initialize()
 {
     parent::initialize();
     $this->setSchema(array(array('alias', FALSE, \Nethgui\Controller\Table\RowAbstractAction::KEY), array('role', FALSE, \Nethgui\Controller\Table\RowAbstractAction::FIELD), array('type', FALSE, \Nethgui\Controller\Table\RowAbstractAction::FIELD), array('ipaddr', $this->createValidator(Validate::IPv4), \Nethgui\Controller\Table\RowAbstractAction::FIELD), array('netmask', $this->createValidator(Validate::NETMASK), \Nethgui\Controller\Table\RowAbstractAction::FIELD)));
 }
 public function initialize()
 {
     parent::initialize();
     $parameterSchema = array(array('name', FALSE, \Nethgui\Controller\Table\Modify::KEY));
     $this->setSchema($parameterSchema);
 }
Example #4
0
 public function initialize()
 {
     $this->setSchema(array(array('device', Validate::ANYTHING, \Nethgui\Controller\Table\RowAbstractAction::KEY), array('role', $this->createValidator()->memberOf($this->getParent()->getInterfaceRoles()), \Nethgui\Controller\Table\RowAbstractAction::FIELD), array('bootproto', $this->createValidator()->memberOf('dhcp', 'none'), \Nethgui\Controller\Table\RowAbstractAction::FIELD), array('ipaddr', Validate::IPv4, \Nethgui\Controller\Table\RowAbstractAction::FIELD), array('netmask', Validate::IPv4_NETMASK, \Nethgui\Controller\Table\RowAbstractAction::FIELD), array('gateway', Validate::IP_OR_EMPTY, \Nethgui\Controller\Table\RowAbstractAction::FIELD)));
     parent::initialize();
 }