From: cajus Date: Thu, 20 Aug 2009 13:49:23 +0000 (+0000) Subject: Fixed attribute replacement when attributes share part of names X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=aeeac6536bd2bf78fe6f148592a19e3a2d26fdf2;p=gosa.git Fixed attribute replacement when attributes share part of names git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14095 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_filter.inc b/gosa-core/include/class_filter.inc index 1247ad781..0bea6c4a6 100644 --- a/gosa-core/include/class_filter.inc +++ b/gosa-core/include/class_filter.inc @@ -123,6 +123,17 @@ class filter { $this->alphabetElements[]= $tag; } } + + // Sort elements for element length to allow proper replacing later on + function strlenSort($a, $b) { + if (strlen($a['tag']) == strlen($b['tag'])) { + return 0; + } + return (strlen($a['tag']) < strlen($b['tag']) ? -1 : 1); + } + uasort($this->elements, 'strlenSort'); + $this->elements= array_reverse($this->elements); + } return true; @@ -132,7 +143,15 @@ class filter { function getTextfield($element) { $tag= $element['tag']; - $result= ""; + $size= 30; + if (isset($element['size'])){ + $size= $element['size']; + } + $maxlength= 30; + if (isset($element['maxlength'])){ + $maxlength= $element['maxlength']; + } + $result= ""; if (isset($element['autocomplete'])) { $frequency= "0.5"; $characters= "1";