summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a057b06)
raw | patch | inline | side by side (parent: a057b06)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 5 May 2010 14:55:05 +0000 (14:55 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 5 May 2010 14:55:05 +0000 (14:55 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18149 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-core/include/class_configRegistry.inc b/gosa-core/include/class_configRegistry.inc
index 0f623ee08366720af8f7c422d76a23d7750183fa..a3f46e8356f2beaa7bd5629728e354fdc5cdb052 100644 (file)
protected $value = "";
protected $type = "string";
protected $default = "";
+ protected $defaults = "";
protected $description = "";
protected $check = "";
protected $migrate = "";
protected $status = 'undefined';
protected $attributes = array('name','type','default','description','check',
- 'migrate','mandatory','group');
+ 'migrate','mandatory','group','defaults');
function __construct($parent,$classname,$data)
{
function getType() { return($this->type); }
function getDescription() { return($this->description); }
function getDefault() { return($this->default); }
+ function getDefaults() { return($this->defaults); }
function getStatus() { return($this->status); }
function isMandatory() { return($this->mandatory); }
index efe2203d901300e87546ec0772d6ee1fce5346ed..421df114a024c7bf7576cb3723b9b71c76a6dfd8 100644 (file)
}
class core extends plugin {
+
+ static function getPropertyValues()
+ {
+ return(array(1,2,3));
+ }
+
static function plInfo()
{
return (array(
diff --git a/gosa-core/plugins/addons/configViewer/class_configViewer.inc b/gosa-core/plugins/addons/configViewer/class_configViewer.inc
index c52f32aa89bea4413a8b427767c8fbc49e853696..edddd802f29cf8b119f2ee2fa3e40d1001aa07a2 100644 (file)
$tooltip = "<div id='tooltip_{$id}' class='tooltip'>".$title."</div>";
return($tooltip."<span title='tooltip_{$id}'>{$cn[0]}</span>");
}
- static function propertyValue($class,$cn, $value,$type,$default,$description)
+ static function propertyValue($class,$cn,$value,$type,$default,$defaults)
{
$name = "{$class[0]}:{$cn[0]}";
$value = htmlentities($value[0], ENT_COMPAT , 'UTF-8');
switch($type[0]){
+ case 'switch':
+
+ if(!empty($defaults[0])){
+ $data = call_user_func(preg_split("/::/", $defaults[0]));
+ if(is_array($data)){
+ $res = "<select size=1 name=\"{$name}\" style='width:100%'>";
+ foreach($data as $oValue => $oDesc){
+ if($oValue == $value){
+ $res.="<option selected value=\"{$oValue}\">{$oDesc}</option>\n";
+ }else{
+ $res.="<option value=\"{$oValue}\">{$oDesc}</option>\n";
+ }
+ }
+ $res.= "</select>";
+ }
+ }
+ break;
case 'string':
case 'integer':
- $res = "<input style='width:97%' type='text' value=\"{$value}\" name={$name}>";
+ $res = "<input style='width:97%' type='text' value=\"{$value}\" name=\"{$name}\">";
break;
default: $res = "";
}
diff --git a/gosa-core/plugins/addons/configViewer/class_filterProperties.inc b/gosa-core/plugins/addons/configViewer/class_filterProperties.inc
index d475c37531a98963e31f76b5e704b66661323632..136eb07a420d043586db2bba5a700dd7f8e8b817 100644 (file)
$entry = filterCONFIGPROPERTIES::fakeLdapResult($entry, 'description', $property->getDescription());
$entry = filterCONFIGPROPERTIES::fakeLdapResult($entry, 'value', $property->getValue());
$entry = filterCONFIGPROPERTIES::fakeLdapResult($entry, 'default', $property->getDefault());
+ $entry = filterCONFIGPROPERTIES::fakeLdapResult($entry, 'defaults', $property->getDefaults());
$entry = filterCONFIGPROPERTIES::fakeLdapResult($entry, 'check', $property->getCheck());
$entry = filterCONFIGPROPERTIES::fakeLdapResult($entry, 'class', $property->getClass());
$entry = filterCONFIGPROPERTIES::fakeLdapResult($entry, 'type', $property->getType());
diff --git a/gosa-core/plugins/addons/configViewer/property-list.xml b/gosa-core/plugins/addons/configViewer/property-list.xml
index db88d6a99305c975c2b622b2911d30901e083d0e..54794a1405fb80a2672916b791c7b4d85790b0be 100644 (file)
<label>Value</label>
<sortAttribute>value</sortAttribute>
<sortType>string</sortType>
- <value>%{filter:propertyValue(class,cn,value,type,default,description)}</value>
+ <value>%{filter:propertyValue(class,cn,value,type,default,defaults)}</value>
<export>true</export>
</column>