summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9294ed0)
raw | patch | inline | side by side (parent: 9294ed0)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 11 Aug 2006 07:23:42 +0000 (07:23 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 11 Aug 2006 07:23:42 +0000 (07:23 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4482 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..6bbfb43483c57af16ed7b8474d89d583fb634d95 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>