public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $localFileNames = array_values(FileSystemTools::nodot_files(FileSystemTools::build_path(Director::baseFolder(), Replicant::config()->get('files_path'))));
     $fields->addFieldToTab('Root.Main', new DropdownField('FileName', 'Database dump to restore', array_combine($localFileNames, $localFileNames)));
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $knownHosts = $this->getHostsList(true);
     $fields->addFieldToTab('Root.Main', new DropdownField('RemoteHost', 'Fetch from server', $knownHosts));
     $fields->addFieldToTab('Root.Main', new DropdownField('Protocol', 'Protocol to list files', Replicant::config()->get('protocols')));
     $fields->addFieldToTab('Root.Main', new DropdownField('Proxy', 'Proxy (if required, e.g. within CWP)', $this->getProxyList(true)));
     $fields->addFieldToTab('Root.Main', new TextField('UserName', null, Member::currentUser()->Email));
     $fields->addFieldToTab('Root.Main', new PasswordField('Password'));
     // this is not saved anywhere
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab('Root.Main', new DropdownField('RemoteHost', 'Fetch from server', $this->getHostsList(false)));
     $fields->addFieldToTab('Root.Main', new DropdownField('Protocol', 'Server-to-server file transfer protocol', Replicant::config()->get('protocols')));
     $fields->addFieldToTab('Root.Main', new DropdownField('Proxy', 'Proxy (if required, e.g. within CWP)', $this->getProxyList(true)));
     $fields->addFieldToTab('Root.Main', new TextField('UserName', null, Member::currentUser()->Email));
     $fields->addFieldToTab('Root.Main', new PasswordField('Password'));
     // this is not saved anywhere
     $fields->addFieldToTab('Root.Main', new TextField('FileName', 'Filename (leave blank for all remote files)'));
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // keep track of fields which will be hidden if RemoteHost is localhost
     $hide = array();
     $fields->addFieldToTab('Root.Main', new DropdownField('RemoteHost', 'Remote Host', $this->getHostsList(true)));
     $fields->addFieldToTab('Root.Main', $hide[] = new DropdownField('Protocol', 'Server-to-server request protocol', Replicant::config()->get('protocols')));
     $fields->addFieldToTab('Root.Main', $hide[] = new DropdownField('Proxy', 'Proxy (if required, e.g. within CWP)', $this->getProxyList(true)));
     $fields->addFieldToTab('Root.Main', $hide[] = new TextField('Database', 'Database', DatabaseTools::getDBCredential('Database')));
     $fields->addFieldToTab('Root.Main', $hide[] = new TextField('UserName', 'User name', Member::currentUser()->Email));
     $fields->addFieldToTab('Root.Main', $hide[] = new PasswordField('Password'));
     // this is not saved anywhere
     $fields->addFieldToTab('Root.Main', new CheckboxField('UseGZIP', "Use gzip compression", $this->isInDB() ? $this->UseGZIP : true));
     foreach ($hide as $field) {
         $field->hideIf('RemoteHost')->isEqualTo('localhost');
     }
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab('Root.Main', new DropdownField('Proxy', 'Proxy (if required, e.g. within CWP)', $this->getProxyList(true)));
     return $fields;
 }