From aeeac6536bd2bf78fe6f148592a19e3a2d26fdf2 Mon Sep 17 00:00:00 2001 From: cajus Date: Thu, 20 Aug 2009 13:49:23 +0000 Subject: [PATCH] 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 --- gosa-core/include/class_filter.inc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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"; -- 2.30.2