From 097c21ffdf1e777ddb9042e8df8da2571b4525a6 Mon Sep 17 00:00:00 2001 From: Gunnar Wrobel
Date: Mon, 6 Apr 2009 20:40:20 +0200 Subject: [PATCH] Allow hiding objects in a different way. --- koward/lib/Form/Object.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/koward/lib/Form/Object.php b/koward/lib/Form/Object.php index 93eccaf4a..2924335fa 100644 --- a/koward/lib/Form/Object.php +++ b/koward/lib/Form/Object.php @@ -86,7 +86,9 @@ class Koward_Form_Object extends Horde_Form { } else { list($attributes, $attribute_map) = $this->koward->server->getAttributes($config['class']); - if (isset($config['attributes']['show'])) { + if (isset($this->koward->visible['show'])) { + $akeys = $this->koward->visible['show']; + } else if (isset($config['attributes']['show'])) { $akeys = $config['attributes']['show']; } else { $akeys = array_keys($attributes); @@ -98,8 +100,10 @@ class Koward_Form_Object extends Horde_Form { $form_attributes = array(); foreach ($akeys as $key) { - if (isset($config['attributes']['hide']) - && in_array($key, $config['attributes']['hide'])) { + if ((isset($this->koward->visible['hide']) + && in_array($key, $this->koward->visible['hide'])) + || (isset($config['attributes']['hide']) + && in_array($key, $config['attributes']['hide']))) { continue; } @@ -108,9 +112,13 @@ class Koward_Form_Object extends Horde_Form { } else if (isset($attributes[$key]['syntax'])) { list($syntax, $length) = explode('{', $attributes[$key]['syntax'], 2); switch ($syntax) { + case '1.3.6.1.4.1.1466.115.121.1.22': case '1.3.6.1.4.1.1466.115.121.1.50': $type = 'phone'; break; + case '1.3.6.1.4.1.1466.115.121.1.28': + $type = 'image'; + break; default: $type = 'text'; break; @@ -127,6 +135,8 @@ class Koward_Form_Object extends Horde_Form { ); if (isset($config['attributes']['order'][$key])) { $form_attributes[$key]['order'] = $config['attributes']['order'][$key]; + } else if (isset($this->koward->order[$key])) { + $form_attributes[$key]['order'] = $this->koward->order[$key]; } else { $form_attributes[$key]['order'] = -1; } -- 2.11.0