From 569f47b38c9cc275dfab924d5f50877ccd0c859a Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 6 May 2010 08:11:39 +0000 Subject: [PATCH] Filled dropdown boxes with valid values. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18155 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_core.inc | 56 ++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/gosa-core/include/class_core.inc b/gosa-core/include/class_core.inc index 421df114a..cae46d74f 100644 --- a/gosa-core/include/class_core.inc +++ b/gosa-core/include/class_core.inc @@ -19,9 +19,61 @@ class all extends plugin { class core extends plugin { - static function getPropertyValues() + static function getPropertyValues($class,$name,$value,$type) { - return(array(1,2,3)); + $list = array(); + switch($name){ + case 'passwordDefaultHash': + $tmp = passwordMethod::get_available_methods(); + foreach($tmp['name'] as $id => $method){ + $desc = $tmp[$id]['name']; + $list[$method] = $desc; + } + break; + case 'accountPrimaryAttribute': + $list = array('uid' => 'uid', 'cn' => 'cn'); + break; + case 'loginAttribute': + $list = array( + 'uid' => 'uid', + 'mail' => 'mail', + 'both' => 'uid & mail'); + break; + case 'timezone': + $tmp = timezone::_get_tz_zones(); + foreach($tmp['TIMEZONES'] as $name => $offset){ + if($offset >= 0){ + $list[$name] = $name." ( + ".sprintf("%0.2f",$offset/(60*60))." "._("hours").")"; + }else{ + $offset = $offset * -1; + $list[$name] = $name." ( - ".sprintf("%0.2f",($offset/(60*60)))." "._("hours").")"; + } + } + break; + case 'mailAttribute': + $list = array('mail' => 'mail','uid' => 'uid'); + break; + case 'mailMethod': + $list = mailMethod::get_methods(); + break; + case 'language': + $tmp = get_languages(TRUE); + $list[""] = _("Automatic"); + foreach($tmp as $key => $desc){ + $list[$key] = $desc; + } + break; + case 'modificationDetectionAttribute': + $list = array('entryCSN' => 'entryCSN (OpenLdap)','textCSN'=>'textCSN (Sun DS)'); + break; + default: echo $name." ";$list = array(); + } + + if(!isset($list[$value])){ + $list[$value] = $value." ("._("User value").")"; + } + + return($list); } static function plInfo() -- 2.30.2