summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9374e81)
raw | patch | inline | side by side (parent: 9374e81)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 24 Nov 2005 09:55:55 +0000 (09:55 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 24 Nov 2005 09:55:55 +0000 (09:55 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2039 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_debconfTemplate.inc | patch | blob | history |
index 7438df7ca349b0e2c79fc068bb8012a2a15f2a3f..7b586b28c6d4b994c4fb7845b79b1c212b7c2bcc 100644 (file)
{
/* Walk through all template variables */
foreach($this->template as $post_name => $entry){
-
+
/* Check if this var is set*/
if(isset($_POST[$entry['post_name']])){
-
+
/* special handling for arrays */
if(is_array($_POST[$entry['post_name']])){
$str = "";
}
}
}
-
+
+ foreach($this->template as $post_name => $entry){
+ if(isset($_POST["multi-".$entry['post_name']])){
+ $this->template[$post_name]['Default']= "";
+ foreach($_POST as $name => $value){
+ if(preg_match("/".$entry['post_name']."-multi-/",$name)){
+ $this->template[$post_name]['Default'] .= $value.", ";
+ }
+ }
+ $this->template[$post_name]['Default'] = preg_replace("/, $/","",$this->template[$post_name]['Default']);
+ }
+ }
+
+
}
function get_dialog()
{
if ($this->has_template){
- $result= "";
+ $result= "<table><tr><td width='50%'> </td><td> </td></tr>";
foreach ($this->template as $post_name => $entry){
/* Produce type specific output */
$fn= "render_".$entry['Type'];
- $result.= $this->$fn($entry);
+ $str = $this->$fn($entry);
+ if(!empty($str)){
+ $result.=$str."<tr><td colspan='2'><p class='seperator'> </p></td></tr>";
+ }
} else {
//php_error(E_WARNING, "An unknown type has been specified in the debconf template. Please fix.");
}
}
- $result .= "<input type='hidden' post_name='check_post' value='1'>";
+
+ $result .= "<input type='hidden' post_name='check_post' value='1'></table>";
return ($result);
} else {
return _("This package has no debconf options.");
$post_name= $data['post_name'];
$result="
- <table width='100%' border=0>
<tr>
<td valign='top'>
- <b>".$data['Topic']."</b>
+ <b>".$data['Topic']."</b><br>".$data['Description']."
</td>
- <td width='10%' valign='top'>";
+ <td valign='top' style=\"border-left: 1px solid rgb(160, 160, 160);\">";
foreach(array("true","false") as $value){
if($data['Default'] == $value){
$result.= "
</td>
</tr>
- <tr>
- <td colspan=2>".$data['Description']."
- </td>
- </tr>
- </table>";
+ ";
- $result.= "<p class='seperator'> </p>";
return ($result);
}
}
}
-
$result="
- <table width='100%' border=0>
<tr>
<td valign='top'>
- <b>".$data['Topic']."</b>
+ <b>".$data['Topic']."</b><br>".$data['Description']."
</td>
- <td width='10%' valign='top'>
- <select name='".$post_name."[]' multiple size=5>";
-
+ <td valign='top' style=\"border-left: 1px solid rgb(160, 160, 160);\">
+ <input type='hidden' name='multi-".$post_name."' value='1'>
+ ";
+
$defs = split(", ",$data['Default']);
-
foreach($choices as $value){
if(in_array($value,$defs)){
- $result.="\n<option value='".htmlentities($value)."' selected>".htmlentities($value)."</option>";
+ $result.="\n<input name='".$post_name."-multi-".$value."' type='checkbox' value='".htmlentities($value)."' checked>".$value."<br>";
}else{
- $result.="\n<option value='".htmlentities($value)."'>".htmlentities($value)."</option>";
+ $result.="\n<input name='".$post_name."-multi-".$value."' type='checkbox' value='".htmlentities($value)."'>".$value."<br>";
}
}
- $result.= "
- </select>
- </td>
+ $result .= "</td>
</tr>
- <tr>
- <td colspan=2>".$data['Description']."
- </td>
- </tr>
- </table>";
- $result.= "<p class='seperator'> </p>";
+ ";
return ($result);
}
function render_password($data)
{
- $result= "<table width='100%' border=0>";
+ $result= "";
$result.= "<tr><td valign='top'>";
- $result.= "<b>".$data['Topic']." <input type='text' name='".$data['post_name']."' value='".$data['Default']."'></b><br><br>";
+ $result.= "<b>".$data['Topic']."<br>".$data['Description']."</td><td style=\"border-left: 1px solid rgb(160, 160, 160);\"> <input type='text' name='".$data['post_name']."' value='".$data['Default']."'></b><br><br>";
$result.= $data['Description'];
- $result.= "</td></table>";
- $result.= "<p class='seperator'> </p>";
+ $result.= "</td>";
return ($result);
}
$result="
- <table width='100%' border=0>
+
<tr>
<td valign='top'>
- <b>".$data['Topic']."</b>
+ <b>".$data['Topic']."</b><br>".$data['Description']."
</td>
- <td width='10%' valign='top'>
- <select name='".$post_name."'>";
+ <td valign='top' style=\"border-left: 1px solid rgb(160, 160, 160);\">
+ ";
foreach($choices as $value){
if($data['Default'] == $value){
- $result.="\n<option value='".htmlentities($value)."' selected>".htmlentities($value)."</option>";
+ $result.="\n<input type='radio' name='".$post_name."' value='".htmlentities($value)."' checked >".htmlentities($value)."<br>";
}else{
- $result.="\n<option value='".htmlentities($value)."'>".htmlentities($value)."</option>";
+ $result.="\n<input type='radio' name='".$post_name."' value='".htmlentities($value)."'>".htmlentities($value)."<br>";
}
}
$result.= "
- </select>
- </td>
- </tr>
- <tr>
- <td colspan=2>".$data['Description']."
+
</td>
</tr>
- </table>";
- $result.= "<p class='seperator'> </p>";
+ ";
return ($result);
}
function render_string($data)
{
- $result= "<table width='100%' border=0>
+ $result= "
<tr>
<td valign='top'>
- <b>".$data['Topic']."</b>
+ <b>".$data['Topic']."</b> <br>".$data['Description']."
</td>
- <td width='10%'>
+ <td style=\"border-left: 1px solid rgb(160, 160, 160);\">
<input type='text' name='".$data['post_name']."' value='".$data['Default']."'>
</td>
</tr>
- <tr>
- <td colspan='2'>
- ".$data['Description']."
- </td>
- </tr>
- </td></table>";
- $result.= "<p class='seperator'> </p>";
+ ";
return ($result);
}