Ftp-DeleteButton is shown dynamically now.
Dieser Commit ist enthalten in:
Ursprung
99555f092d
Commit
a144084c6d
1 geänderte Dateien mit 26 neuen und 26 gelöschten Zeilen
|
@ -42,6 +42,7 @@ class Application_Form_Config_Ftp extends Zend_Form_SubForm
|
||||||
|
|
||||||
$ftpConfig = $config->get('config.ftp');
|
$ftpConfig = $config->get('config.ftp');
|
||||||
$ftpKeys = array_keys($ftpConfig);
|
$ftpKeys = array_keys($ftpConfig);
|
||||||
|
$ftpKeysComplete = count($ftpKeys, 1);
|
||||||
foreach ($ftpKeys as $ftpConnectionId) {
|
foreach ($ftpKeys as $ftpConnectionId) {
|
||||||
$this->_addRadioActivated($ftpConnectionId);
|
$this->_addRadioActivated($ftpConnectionId);
|
||||||
$this->_addInputTimeout($ftpConnectionId);
|
$this->_addInputTimeout($ftpConnectionId);
|
||||||
|
@ -54,6 +55,13 @@ class Application_Form_Config_Ftp extends Zend_Form_SubForm
|
||||||
|
|
||||||
$legend = $this->_lang->getTranslator()->_('L_FTP_CONNECTION')
|
$legend = $this->_lang->getTranslator()->_('L_FTP_CONNECTION')
|
||||||
. ' ' . ($ftpConnectionId + 1);
|
. ' ' . ($ftpConnectionId + 1);
|
||||||
|
|
||||||
|
if ($ftpKeysComplete > 1) {
|
||||||
|
$buttonDelete = 'ftpDelete' . $ftpConnectionId;
|
||||||
|
} else {
|
||||||
|
$buttonDelete = '';
|
||||||
|
}
|
||||||
|
|
||||||
$this->addDisplayGroup(
|
$this->addDisplayGroup(
|
||||||
array(
|
array(
|
||||||
'ftp_' . $ftpConnectionId . '_use',
|
'ftp_' . $ftpConnectionId . '_use',
|
||||||
|
@ -66,7 +74,7 @@ class Application_Form_Config_Ftp extends Zend_Form_SubForm
|
||||||
'ftp_' . $ftpConnectionId . '_pass',
|
'ftp_' . $ftpConnectionId . '_pass',
|
||||||
'ftp_' . $ftpConnectionId . '_dir',
|
'ftp_' . $ftpConnectionId . '_dir',
|
||||||
'ftpCheck' . $ftpConnectionId,
|
'ftpCheck' . $ftpConnectionId,
|
||||||
'ftpDelete' . $ftpConnectionId,
|
$buttonDelete,
|
||||||
),
|
),
|
||||||
'ftp' . $ftpConnectionId,
|
'ftp' . $ftpConnectionId,
|
||||||
array(
|
array(
|
||||||
|
@ -302,12 +310,6 @@ class Application_Form_Config_Ftp extends Zend_Form_SubForm
|
||||||
*/
|
*/
|
||||||
private function _addButtonsTestAndDelete($index)
|
private function _addButtonsTestAndDelete($index)
|
||||||
{
|
{
|
||||||
if ($index == 0) {
|
|
||||||
// don't show delete button for first ftp profile
|
|
||||||
$buttonDecorator = 'default';
|
|
||||||
} else {
|
|
||||||
$buttonDecorator = 'LineStart';
|
|
||||||
}
|
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
'button',
|
'button',
|
||||||
'ftpCheck' . $index,
|
'ftpCheck' . $index,
|
||||||
|
@ -316,7 +318,7 @@ class Application_Form_Config_Ftp extends Zend_Form_SubForm
|
||||||
'content' =>
|
'content' =>
|
||||||
$this->getView()->getIcon('Connect', '', 16) . ' ' .
|
$this->getView()->getIcon('Connect', '', 16) . ' ' .
|
||||||
$this->_lang->getTranslator()->_('L_TESTCONNECTION'),
|
$this->_lang->getTranslator()->_('L_TESTCONNECTION'),
|
||||||
'decorators' => array($buttonDecorator),
|
'decorators' => array('LineStart'),
|
||||||
'escape' => false,
|
'escape' => false,
|
||||||
'label' => '',
|
'label' => '',
|
||||||
'class' => 'Formbutton ftpToggle' . $index,
|
'class' => 'Formbutton ftpToggle' . $index,
|
||||||
|
@ -325,7 +327,6 @@ class Application_Form_Config_Ftp extends Zend_Form_SubForm
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($index > 0) {
|
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
'button',
|
'button',
|
||||||
'ftpDelete' . $index,
|
'ftpDelete' . $index,
|
||||||
|
@ -343,7 +344,6 @@ class Application_Form_Config_Ftp extends Zend_Form_SubForm
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get valid values
|
* Get valid values
|
||||||
|
|
Laden …
In neuem Issue referenzieren