summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e3df88f)
raw | patch | inline | side by side (parent: e3df88f)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 4 Apr 2008 06:36:01 +0000 (06:36 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 4 Apr 2008 06:36:01 +0000 (06:36 +0000) |
-Updated option handling
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10185 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10185 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/admin/sudo/class_sudoOptions.inc | patch | blob | history | |
gosa-core/plugins/admin/sudo/options.tpl | patch | blob | history |
diff --git a/gosa-core/plugins/admin/sudo/class_sudoOptions.inc b/gosa-core/plugins/admin/sudo/class_sudoOptions.inc
index 7cb9fbebbae6d26933b347760961e0977c6167a9..95bb1386857fd4204248cc2f2f4bc34f90e78b18 100644 (file)
/* Create internal sudoOption object */
$option = array();
$option['NAME'] = $opt;
- $option['VALUE'] = array($value);
+ $option['VALUE'] = $value;
$option['NEGATE'] = $negation;
/* Special handling for mixed flag types.
if(empty($value)){
$option['NEGATE'] = FALSE;
if($negation){
- $option['VALUE'] = array(0 => "FALSE");
+ $option['VALUE'] = "FALSE";
}else{
- $option['VALUE'] = array(0 => "TRUE");
+ $option['VALUE'] = "TRUE";
}
}
}
if(in_array($this->options[$opt]['TYPE'],array("BOOLEAN"))){
$option['NEGATE'] = FALSE;
if($negation){
- $option['VALUE'] = array(0 => "FALSE");
+ $option['VALUE'] = "FALSE";
}else{
- $option['VALUE'] = array(0 => "TRUE");
+ $option['VALUE'] = "TRUE";
}
}
$opt = preg_replace("/^negOption_/","",$name);
$opt = preg_replace("/_[^_]*$/","",$opt);
if(isset($this->sudoOption[$opt])){
- $val = $this->sudoOption[$opt]['VALUE'][0];
+ $val = $this->sudoOption[$opt]["VALUE"];
/*****
Negate STRING_BOOL && BOOL_INTEGER
if(in_array($this->options[$opt]['TYPE'],array('STRING_BOOL','BOOL_INTEGER'))){
if(in_array($val, array("TRUE","FALSE"))){
if($val == "TRUE"){
- $this->sudoOption[$opt]['VALUE'][0] = "FALSE";
+ $this->sudoOption[$opt]["VALUE"] = "FALSE";
}else{
- $this->sudoOption[$opt]['VALUE'][0] = "TRUE";
+ $this->sudoOption[$opt]["VALUE"] = "TRUE";
}
}else{
$this->sudoOption[$opt]['NEGATE'] = !$this->sudoOption[$opt]['NEGATE'];
*****/
if(in_array($this->options[$opt]['TYPE'],array('BOOLEAN'))){
if($val == "TRUE"){
- $this->sudoOption[$opt]['VALUE'][0] = "FALSE";
+ $this->sudoOption[$opt]["VALUE"] = "FALSE";
}else{
- $this->sudoOption[$opt]['VALUE'][0] = "TRUE";
+ $this->sudoOption[$opt]["VALUE"] = "TRUE";
}
}
}
/* Append attribute only once, lists are handled below */
if(isset($this->options[$opt]) && !isset($this->sudoOption[$opt])){
$type = $this->options[$opt]['TYPE'];
- $val = array($this->options[$opt]['DEFAULT']);
+ $val = $this->options[$opt]['DEFAULT'];
$option = array("NAME" => $opt, "VALUE" => $val , "NEGATE" => FALSE);
if($type == "LISTS"){
}
}elseif(isset($this->options[$opt]) && isset($this->sudoOption[$opt]) && $this->options[$opt]['TYPE'] == "LISTS"){
$type = $this->options[$opt]['TYPE'];
- $val = array($this->options[$opt]['DEFAULT']);
+ $val = $this->options[$opt]['DEFAULT'];
$option = array("NAME" => $opt, "VALUE" => $val , "NEGATE" => FALSE);
$this->sudoOption[$opt][] = $option;
}
****/
if(in_array($this->options[$name]['TYPE'],array("BOOLEAN"))){
if(isset($_POST['option_value__'.$name])){
- $this->sudoOption[$name]['VALUE'][0] = get_post('option_value__'.$name);
+ $this->sudoOption[$name]["VALUE"] = get_post('option_value__'.$name);
}
}
****/
if(in_array($this->options[$name]['TYPE'],array("STRING","INTEGER"))){
if(isset($_POST['option_value__'.$name])){
- $this->sudoOption[$name]['VALUE'][0] = get_post('option_value__'.$name);
+ $this->sudoOption[$name]["VALUE"] = get_post('option_value__'.$name);
}
}
}
if($sel == "FALSE" || $sel == "TRUE"){
- $this->sudoOption[$name]['VALUE'] = array($sel);
+ $this->sudoOption[$name]['VALUE'] = $sel;
$this->sudoOption[$name]['NEGATE'] = FALSE;
}else{
- $this->sudoOption[$name]['VALUE'] = array($val);
+ $this->sudoOption[$name]['VALUE'] = $val;
}
}
}
foreach($this->sudoOption[$name] as $entry_key => $entry){
if(isset($_POST['list_value__'.$name.'_'.$entry_key])){
$val = get_post('list_value__'.$name.'_'.$entry_key);
- $this->sudoOption[$name][$entry_key]['VALUE'][0] = $val;
+ $this->sudoOption[$name][$entry_key]["VALUE"] = $val;
}
}
}
if($type=="LISTS"){
foreach($this->sudoOption[$name] as $entry_key => $entry){
- $val = $entry['VALUE'][0];
+ $val = $entry["VALUE"];
if(empty($val)){
$option = $name;
}else{
}
$neg = $opt['NEGATE'];
- $value = $opt['VALUE'][0];
+ $value = $opt["VALUE"];
$option = "";
/****
index 832e8b69212faed480d0b0a63e0e33d5235b30b7..d339ef78ce5cf37b1a53b5ff8a67d0b9da96633f 100644 (file)
<img src='images/negate.png' alt="!">
{/if}
</td>
- <td><input type='text' value="{$entry.VALUE.0}" name="list_value__{$key}_{$entry_key}"></td>
+ <td><input type='text' value="{$entry.VALUE}" name="list_value__{$key}_{$entry_key}"></td>
<td>
<input type='image' src='images/negate.png' name='negListOption_{$key}_{$entry_key}' class='center'>
<input type='image' src='images/edittrash.png' name='delListOption_{$key}_{$entry_key}' class='center'>
{if $options[$item.NAME].TYPE == "STRING"}
<!-- STRING
-->
- <input type='text' name='option_value__{$key}' value="{$item.VALUE.0}" style='width:280px;'>
+ <input type='text' name='option_value__{$key}' value="{$item.VALUE}" style='width:280px;'>
{elseif $options[$item.NAME].TYPE == "INTEGER"}
<!-- INTEGER
-->
- <input type='text' name='option_value__{$key}' value="{$item.VALUE.0}" style='width:280px;'>
+ <input type='text' name='option_value__{$key}' value="{$item.VALUE}" style='width:280px;'>
{elseif $options[$item.NAME].TYPE == "BOOLEAN"}
<!-- BOOLEAN
-->
<select name="option_value__{$key}">
- <option {if $item.VALUE.0 == "FALSE"} selected {/if}value="FALSE">FALSE</option>
- <option {if $item.VALUE.0 == "TRUE"} selected {/if}value="TRUE">TRUE</option>
+ <option {if $item.VALUE == "FALSE"} selected {/if}value="FALSE">FALSE</option>
+ <option {if $item.VALUE == "TRUE"} selected {/if}value="TRUE">TRUE</option>
</select>
{elseif $options[$item.NAME].TYPE == "BOOL_INTEGER"}
<!-- BOOLEAN_INTEGER
-->
<select name="option_selection__{$key}" id="option_selection__{$key}"
onChange="toggle_bool_fields('option_selection__{$key}','option_value__{$key}');">
- <option {if $item.VALUE.0 == "FALSE"} selected {/if}value="FALSE">FALSE</option>
- <option {if $item.VALUE.0 == "TRUE"} selected {/if}value="TRUE">TRUE</option>
- <option {if $item.VALUE.0 != "TRUE" && $item.VALUE.0 != "FALSE"} selected {/if}
+ <option {if $item.VALUE == "FALSE"} selected {/if}value="FALSE">FALSE</option>
+ <option {if $item.VALUE == "TRUE"} selected {/if}value="TRUE">TRUE</option>
+ <option {if $item.VALUE != "TRUE" && $item.VALUE != "FALSE"} selected {/if}
value="STRING">STRING</option>
- <input type='text' value="{$item.VALUE.0}" style='width:280px;' name='option_value__{$key}'
+ <input type='text' value="{$item.VALUE}" style='width:280px;' name='option_value__{$key}'
id="option_value__{$key}"
- {if $item.VALUE.0 == "FALSE" || $item.VALUE.0 == "TRUE"} disabled {/if}>
+ {if $item.VALUE == "FALSE" || $item.VALUE == "TRUE"} disabled {/if}>
</select>
{elseif $options[$item.NAME].TYPE == "STRING_BOOL"}
<!-- STRING_BOOLEAN
-->
<select name="option_selection__{$key}" id="option_selection__{$key}"
onChange="toggle_bool_fields('option_selection__{$key}','option_value__{$key}');">
- <option {if $item.VALUE.0 == "FALSE"} selected {/if}value="FALSE">FALSE</option>
- <option {if $item.VALUE.0 == "TRUE"} selected {/if}value="TRUE">TRUE</option>
- <option {if $item.VALUE.0 != "TRUE" && $item.VALUE.0 != "FALSE"} selected {/if}
+ <option {if $item.VALUE == "FALSE"} selected {/if}value="FALSE">FALSE</option>
+ <option {if $item.VALUE == "TRUE"} selected {/if}value="TRUE">TRUE</option>
+ <option {if $item.VALUE != "TRUE" && $item.VALUE != "FALSE"} selected {/if}
value="STRING">STRING</option>
- <input type='text' value="{$item.VALUE.0}" style='width:280px;' name='option_value__{$key}'
+ <input type='text' value="{$item.VALUE}" style='width:280px;' name='option_value__{$key}'
id="option_value__{$key}"
- {if $item.VALUE.0 == "FALSE" || $item.VALUE.0 == "TRUE"} disabled {/if}>
+ {if $item.VALUE == "FALSE" || $item.VALUE == "TRUE"} disabled {/if}>
</select>
{/if}
</td>