{
parent::setFields();
-
$this->addField('name', Text::class, __('Nom'), ['column' => true]);
$this->addField('protocol', SelectFromArray::class, __('Protocole'), ['options' => $this->getProtocols(), 'default' => 'FTP', 'column' => true, 'allows_null' => false]);
$this->addField('ftp_mode', SelectFromArray::class, __('Mode de transfert'), ['options' => ['0' => __('Mode passif'), '1' => __('Mode actif')], 'default' => '1', 'when' => ['protocol' => $this->getPasswordProtocols()], 'allows_null' => false,]);
{
return ['ftp_port' => $this->ftp_port];
}
+
+ public function makeURL($path)
+ {
+ $base = $this->getBaseURL();
+ if (!$base) {
+ return null;
+ }
+ return rtrim($base, '/') . '/' . trim($path, '/');
+ }
}