/**
  * Add all fields to the form and set form specific attributes.
  */
 public function initialize()
 {
     $this->_action = 'dashboard';
     $devicestateTimeouts = new Text('check-devicestate-interval');
     $devicestateTimeouts->setLabel('Check device state interval');
     $devicestateTimeouts->setFilters(array('striptags', 'int'));
     $devicestateTimeouts->setAttributes(array('class' => 'form-control'));
     $devicestateTimeouts->setDefault($this->_config->dashboard->checkDeviceStatesInterval);
     $devicestateTimeouts->addValidator(new Regex(array('pattern' => '/^[0-9]+$/', 'message' => 'Not a number')));
     $alertTimeout = new Text('alert-timeout');
     $alertTimeout->setLabel('Alert timeout');
     $alertTimeout->setFilters(array('striptags', 'int'));
     $alertTimeout->setAttributes(array('class' => 'form-control'));
     $alertTimeout->setDefault($this->_config->dashboard->alertTimeout);
     $alertTimeout->addValidator(new Regex(array('pattern' => '/^[0-9]+$/', 'message' => 'Not a number')));
     $phpSysInfoURL = new Text('phpsysinfo-url');
     $phpSysInfoURL->setLabel('PHPSysInfo URL');
     $phpSysInfoURL->setFilters(array('striptags', 'string'));
     $phpSysInfoURL->setAttributes(array('class' => 'form-control'));
     $phpSysInfoURL->setDefault($this->_config->dashboard->phpSysInfoURL);
     $phpSysInfoVCore = new Text('phpsysinfo-vcore');
     $phpSysInfoVCore->setLabel('PHPSysInfo vcore label');
     $phpSysInfoVCore->setFilters(array('striptags', 'string'));
     $phpSysInfoVCore->setAttributes(array('class' => 'form-control'));
     $phpSysInfoVCore->setDefault($this->_config->dashboard->phpSysInfoVCore);
     $transmissionURL = new Text('transmission-url');
     $transmissionURL->setLabel('Transmission URL');
     $transmissionURL->setFilters(array('striptags', 'string'));
     $transmissionURL->setAttributes(array('class' => 'form-control'));
     $transmissionURL->setDefault($this->_config->dashboard->transmissionURL);
     $transmissionUsername = new Text('transmission-username');
     $transmissionUsername->setLabel('Transmission username');
     $transmissionUsername->setFilters(array('striptags', 'string'));
     $transmissionUsername->setAttributes(array('class' => 'form-control'));
     $transmissionUsername->setDefault($this->_config->dashboard->transmissionUsername);
     $transmissionPassword = new Password('transmission-password');
     $transmissionPassword->setLabel('Transmission password');
     $transmissionPassword->setFilters(array('striptags', 'string'));
     $transmissionPassword->setAttributes(array('class' => 'form-control'));
     $transmissionPassword->setDefault($this->_config->dashboard->transmissionPassword);
     $transmissionInterval = new Text('transmission-update-interval');
     $transmissionInterval->setLabel('Transmission update inteval');
     $transmissionInterval->setFilters(array('striptags', 'int'));
     $transmissionInterval->setAttributes(array('class' => 'form-control'));
     $transmissionInterval->setDefault($this->_config->dashboard->transmissionUpdateInterval);
     $transmissionInterval->addValidator(new Regex(array('pattern' => '/^[0-9]+$/', 'message' => 'Not a number')));
     $rotateMoviesInterval = new Text('rotate-movies-interval');
     $rotateMoviesInterval->setLabel('Rotate movies inteval');
     $rotateMoviesInterval->setFilters(array('striptags', 'int'));
     $rotateMoviesInterval->setAttributes(array('class' => 'form-control'));
     $rotateMoviesInterval->setDefault($this->_config->dashboard->rotateMoviesInterval);
     $rotateMoviesInterval->addValidator(new Regex(array('pattern' => '/^[0-9]+$/', 'message' => 'Not a number')));
     $rotateEpisodesInterval = new Text('rotate-episodes-interval');
     $rotateEpisodesInterval->setLabel('Rotate episode inteval');
     $rotateEpisodesInterval->setFilters(array('striptags', 'int'));
     $rotateEpisodesInterval->setAttributes(array('class' => 'form-control'));
     $rotateEpisodesInterval->setDefault($this->_config->dashboard->rotateEpisodesInterval);
     $rotateEpisodesInterval->addValidator(new Regex(array('pattern' => '/^[0-9]+$/', 'message' => 'Not a number')));
     $rotateAlbumsInterval = new Text('rotate-albums-interval');
     $rotateAlbumsInterval->setLabel('Rotate albums inteval');
     $rotateAlbumsInterval->setFilters(array('striptags', 'int'));
     $rotateAlbumsInterval->setAttributes(array('class' => 'form-control'));
     $rotateAlbumsInterval->setDefault($this->_config->dashboard->rotateAlbumsInterval);
     $rotateAlbumsInterval->addValidator(new Regex(array('pattern' => '/^[0-9]+$/', 'message' => 'Not a number')));
     $this->add($devicestateTimeouts);
     $this->add($alertTimeout);
     $this->add($phpSysInfoURL);
     $this->add($phpSysInfoVCore);
     $this->add($transmissionURL);
     $this->add($transmissionUsername);
     $this->add($transmissionPassword);
     $this->add($transmissionInterval);
     $this->add($rotateMoviesInterval);
     $this->add($rotateEpisodesInterval);
     $this->add($rotateAlbumsInterval);
 }