refactoring
This commit is contained in:
parent
3715bb4377
commit
f8e7adf82d
|
@ -156,7 +156,7 @@ echo $_SESSION['header'];
|
||||||
$group = new htmlTable();
|
$group = new htmlTable();
|
||||||
$profiles = array();
|
$profiles = array();
|
||||||
$selectedProfile = array();
|
$selectedProfile = array();
|
||||||
$fieldsEnabled = false;
|
$profilesExisting = false;
|
||||||
if (sizeof($files) > 0) {
|
if (sizeof($files) > 0) {
|
||||||
$profiles = $files;
|
$profiles = $files;
|
||||||
if (!empty($_COOKIE["lam_default_profile"]) && in_array($_COOKIE["lam_default_profile"], $files)) {
|
if (!empty($_COOKIE["lam_default_profile"]) && in_array($_COOKIE["lam_default_profile"], $files)) {
|
||||||
|
@ -165,18 +165,18 @@ echo $_SESSION['header'];
|
||||||
else {
|
else {
|
||||||
$selectedProfile[] = $conf->default;
|
$selectedProfile[] = $conf->default;
|
||||||
}
|
}
|
||||||
$fieldsEnabled = true;
|
$profilesExisting = true;
|
||||||
}
|
}
|
||||||
$select = new htmlSelect('filename', $profiles, $selectedProfile);
|
$select = new htmlSelect('filename', $profiles, $selectedProfile);
|
||||||
$select->setIsEnabled($fieldsEnabled);
|
$select->setIsEnabled($profilesExisting);
|
||||||
$group->addElement($select);
|
$group->addElement($select);
|
||||||
$passwordField = new htmlInputField('passwd');
|
$passwordField = new htmlInputField('passwd');
|
||||||
$passwordField->setIsPassword(true);
|
$passwordField->setIsPassword(true);
|
||||||
$passwordField->setIsEnabled($fieldsEnabled);
|
$passwordField->setIsEnabled($profilesExisting);
|
||||||
$passwordField->setFieldSize(20);
|
$passwordField->setFieldSize(20);
|
||||||
$group->addElement($passwordField);
|
$group->addElement($passwordField);
|
||||||
$button = new htmlButton('submit', _("Ok"));
|
$button = new htmlButton('submit', _("Ok"));
|
||||||
$button->setIsEnabled($fieldsEnabled);
|
$button->setIsEnabled($profilesExisting);
|
||||||
$group->addElement($button);
|
$group->addElement($button);
|
||||||
$group->addElement(new htmlHelpLink('200'));
|
$group->addElement(new htmlHelpLink('200'));
|
||||||
$tabindex = 1;
|
$tabindex = 1;
|
||||||
|
|
|
@ -25,6 +25,8 @@ include_once (dirname ( __FILE__ ) . '/../utils/configuration.inc');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LAMConfig test case.
|
* LAMConfig test case.
|
||||||
|
*
|
||||||
|
* @author Roland Gruber
|
||||||
*/
|
*/
|
||||||
class LAMConfigTest extends PHPUnit_Framework_TestCase {
|
class LAMConfigTest extends PHPUnit_Framework_TestCase {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue