initIds('dnsSection'); $this->initFields(); } public function initFields() { if($this->configuration()->isPermissionSearchdomain()){ $domain = new Text('searchdomain'); $domain->addValidator(new SearchdomainValidator(false)); $domain->setDescription('description'); $this->addField($domain); } if($this->configuration()->isPermissionNameservers()){ $server = Server::select('id', 'nameserver1ip', 'nameserver2ip')->findOrFail($this->getWhmcsParamByKey('serverid')); //ns1 $ns1 = new Text('nameserver[0]'); $ns1->addValidator(new NameserverValidator()); $ns1->setDefaultValue(trim($server->nameserver1ip)); $ns1->setDescription('description'); $this->addField($ns1); //ns2 $ns2 = new Text('nameserver[1]'); $ns2->addValidator(new NameserverValidator()); $ns2->setDefaultValue(trim($server->nameserver2ip)); $ns2->setDescription('description'); $this->addField($ns2); } } }