diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2013-03-06 08:26:33 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2013-03-06 08:26:33 +0100 |
commit | bce0c3c372c2916e53c1991a11d9f541cb8f96fb (patch) | |
tree | 91a4512c1971218bb968c18e17472103adc56992 /apps/user_ldap | |
parent | 1e5f8b0e205d01bee32b5db5b9cd20c69c8f467a (diff) | |
download | nextcloud-server-bce0c3c372c2916e53c1991a11d9f541cb8f96fb.tar.gz nextcloud-server-bce0c3c372c2916e53c1991a11d9f541cb8f96fb.zip |
LDAP: move more settings stuff to template file
Diffstat (limited to 'apps/user_ldap')
-rw-r--r-- | apps/user_ldap/settings.php | 12 | ||||
-rw-r--r-- | apps/user_ldap/templates/settings.php | 15 |
2 files changed, 15 insertions, 12 deletions
diff --git a/apps/user_ldap/settings.php b/apps/user_ldap/settings.php index c55a718a82a..05497ae8a33 100644 --- a/apps/user_ldap/settings.php +++ b/apps/user_ldap/settings.php @@ -42,17 +42,7 @@ OCP\Util::addstyle('user_ldap', 'settings'); $tmpl = new OCP\Template('user_ldap', 'settings'); $prefixes = \OCA\user_ldap\lib\Helper::getServerConfigurationPrefixes(); -$scoHtml = ''; -$i = 1; -$sel = ' selected'; -foreach($prefixes as $prefix) { - $scoHtml .= '<option value="'.$prefix.'"'.$sel.'>'.$i++.'. Server</option>'; - $sel = ''; -} -if(count($prefixes) == 0) { - $scoHtml .= '<option value="" selected>1. Server</option>'; -} -$tmpl->assign('serverConfigurationOptions', $scoHtml); +$tmpl->assign('serverConfigurationPrefixes', $prefixes); // assign default values if(!isset($ldap)) { diff --git a/apps/user_ldap/templates/settings.php b/apps/user_ldap/templates/settings.php index f44127594c7..d3c2c298904 100644 --- a/apps/user_ldap/templates/settings.php +++ b/apps/user_ldap/templates/settings.php @@ -14,7 +14,20 @@ <fieldset id="ldapSettings-1"> <p><label for="ldap_serverconfig_chooser"><?php p($l->t('Server configuration'));?></label> <select id="ldap_serverconfig_chooser" name="ldap_serverconfig_chooser"> - <?php print_unescaped($_['serverConfigurationOptions']); ?> + <?php if(count($_['serverConfigurationPrefixes']) == 0 ) { + ?> + <option value="" selected>1. Server</option>'); + <?php + } else { + $i = 1; + $sel = ' selected'; + foreach($_['serverConfigurationPrefixes'] as $prefix) { + ?> + <option value="<?php p($prefix); ?>"<?php p($sel); ?>><?php p($i++); ?>. Server</option> + <?php + } + } + ?> <option value="NEW"><?php p($l->t('Add Server Configuration'));?></option> </select> <button id="ldap_action_delete_configuration" |