From: Vincent Vanwaelscappel Date: Mon, 6 Feb 2023 15:52:37 +0000 (+0100) Subject: wip #5700 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=ee5956d73752ae1a315a321144284bc630decceb;p=cubist_cms-back.git wip #5700 @1 --- diff --git a/src/app/Magic/Models/ExternalServer.php b/src/app/Magic/Models/ExternalServer.php index d123bfe..7ef094d 100644 --- a/src/app/Magic/Models/ExternalServer.php +++ b/src/app/Magic/Models/ExternalServer.php @@ -25,7 +25,6 @@ class ExternalServer extends CubistMagicAbstractModel implements IServer { 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,]); @@ -140,4 +139,13 @@ class ExternalServer extends CubistMagicAbstractModel implements IServer { return ['ftp_port' => $this->ftp_port]; } + + public function makeURL($path) + { + $base = $this->getBaseURL(); + if (!$base) { + return null; + } + return rtrim($base, '/') . '/' . trim($path, '/'); + } }