use the central class mapping.
authorGunnar Wrobel <p@rdus.de>
Fri, 1 May 2009 14:22:44 +0000 (16:22 +0200)
committerGunnar Wrobel <p@rdus.de>
Fri, 1 May 2009 14:22:44 +0000 (16:22 +0200)
koward/lib/Koward/Form/Object.php

index e81e938..5eb7ddb 100644 (file)
@@ -45,15 +45,7 @@ class Koward_Form_Object extends Horde_Form {
             $type = $vars->get('type');
         } else {
             $title = _("Edit Object");
-            $class_name = get_class($this->object);
-            foreach ($this->koward->objects as $name => $config) {
-                if ($config['class'] == $class_name) {
-                    $type = $name;
-                    if (!empty($config['preferred'])) {
-                        break;
-                    }
-                }
-            }
+            $type = $this->koward->getType($this->object);
             if (empty($type)) {
                 throw new Koward_Exception('Undefined object class!');
             }