refactoring

This commit is contained in:
Roland Gruber 2016-01-20 20:48:30 +00:00
parent 3715bb4377
commit f8e7adf82d
2 changed files with 7 additions and 5 deletions

View File

@ -156,7 +156,7 @@ echo $_SESSION['header'];
$group = new htmlTable();
$profiles = array();
$selectedProfile = array();
$fieldsEnabled = false;
$profilesExisting = false;
if (sizeof($files) > 0) {
$profiles = $files;
if (!empty($_COOKIE["lam_default_profile"]) && in_array($_COOKIE["lam_default_profile"], $files)) {
@ -165,18 +165,18 @@ echo $_SESSION['header'];
else {
$selectedProfile[] = $conf->default;
}
$fieldsEnabled = true;
$profilesExisting = true;
}
$select = new htmlSelect('filename', $profiles, $selectedProfile);
$select->setIsEnabled($fieldsEnabled);
$select->setIsEnabled($profilesExisting);
$group->addElement($select);
$passwordField = new htmlInputField('passwd');
$passwordField->setIsPassword(true);
$passwordField->setIsEnabled($fieldsEnabled);
$passwordField->setIsEnabled($profilesExisting);
$passwordField->setFieldSize(20);
$group->addElement($passwordField);
$button = new htmlButton('submit', _("Ok"));
$button->setIsEnabled($fieldsEnabled);
$button->setIsEnabled($profilesExisting);
$group->addElement($button);
$group->addElement(new htmlHelpLink('200'));
$tabindex = 1;

View File

@ -25,6 +25,8 @@ include_once (dirname ( __FILE__ ) . '/../utils/configuration.inc');
/**
* LAMConfig test case.
*
* @author Roland Gruber
*/
class LAMConfigTest extends PHPUnit_Framework_TestCase {