summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a2b7fca)
raw | patch | inline | side by side (parent: a2b7fca)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 11 Aug 2006 07:25:43 +0000 (07:25 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 11 Aug 2006 07:25:43 +0000 (07:25 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4483 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_servRepositorySetup.inc | patch | blob | history | |
plugins/admin/systems/servRepositorySetup.tpl | patch | blob | history |
diff --git a/plugins/admin/systems/class_servRepositorySetup.inc b/plugins/admin/systems/class_servRepositorySetup.inc
index 8fec23baad07671634fe52e988f494a63209d1a5..a1c62e7baad9a62b52d3681d66f81a5dc41eb0ad 100644 (file)
$smarty= get_smarty();
if((isset($_POST['AddSection']))&&(isset($_POST['SectionName']))&&(!empty($_POST['SectionName']))){
- $this->Sections[$_POST['SectionName']]=$_POST['SectionName'];
+
+ /* Replace multiple spaces with a single, and cut of white spaces (trim)*/
+ $val = preg_replace("/\ \ * /" , " ", trim($_POST['SectionName']));
+
+ /* check if there are more than one entry given ( "section1 section2 )*/
+ if(preg_match("/ /",$val)){
+
+ /* Generate list of new section names */
+ $vals = split(" ",$val);
+
+ /* Add new entries */
+ foreach($vals as $entry){
+ $entry = trim($entry);
+ $this->Sections[$entry]=$entry;
+ }
+ }else{
+ $this->Sections[$val]=$val;
+ }
}
foreach($_POST as $name => $value){
diff --git a/plugins/admin/systems/servRepositorySetup.tpl b/plugins/admin/systems/servRepositorySetup.tpl
index bdc8b7bdc568176b258396c9d895b61c8f858872..a87c7b151f335ecb113c2b9ad1452bafc96ebe9b 100644 (file)
<td>
{t}Sections{/t}<br>
{$Sections}
- <input type="text" name="SectionName" value="">
+ <input type="text" name="SectionName" value="" style='width:100%;'>
<input type="submit" name="AddSection" value="{t}Add{/t}">
</td>
</tr>