From 5a4e83c1e408192f34fe5a7a77a693143801198c Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Thu, 27 Jan 2011 16:49:26 -0500 Subject: [PATCH] Allow specifying an application scope for custom form types. This allows applications to add their own Horde_Form_Type_* classes and have them be properly autoloaded. This is an interim solution only until Horde_Form is refactored after 4.0 is released.. --- framework/Form/Form.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/framework/Form/Form.php b/framework/Form/Form.php index acab2917c..ab7ae6b2e 100644 --- a/framework/Form/Form.php +++ b/framework/Form/Form.php @@ -155,7 +155,12 @@ class Horde_Form { */ function getType($type, $params = array()) { - $type_class = 'Horde_Form_Type_' . $type; + if (strpos($type, ':') !== false) { + list($app, $type) = explode(':', $type); + $type_class = $app . '_Form_Type_' . $type; + } else { + $type_class = 'Horde_Form_Type_' . $type; + } if (!class_exists($type_class)) { throw new Horde_Exception(sprintf('Nonexistant class "%s" for field type "%s"', $type_class, $type)); } -- 2.11.0