From: Chuck Hagenbuch Date: Tue, 13 Oct 2009 03:05:28 +0000 (-0400) Subject: One take on a simple module implementation. Not sure I'm sticking with this yet. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=68faa3427c05de5c5127b13a58dcbbcbf6f54a37;p=horde.git One take on a simple module implementation. Not sure I'm sticking with this yet. --- diff --git a/framework/Controller/lib/Horde/Controller/Dispatcher.php b/framework/Controller/lib/Horde/Controller/Dispatcher.php index 991f7e78b..f58da88b7 100644 --- a/framework/Controller/lib/Horde/Controller/Dispatcher.php +++ b/framework/Controller/lib/Horde/Controller/Dispatcher.php @@ -156,7 +156,7 @@ class Horde_Controller_Dispatcher // try to load the class $controllerName = $hash[':controller']; if (!class_exists($controllerName, false)) { - $path = $this->_controllerDir . $controllerName . '.php'; + $path = $this->_controllerDir . str_replace('_', '/', $controllerName) . '.php'; if (file_exists($path)) { require $path; } else { @@ -189,10 +189,17 @@ class Horde_Controller_Dispatcher $ret[':controller'] = $this->_inflector->camelize($val) . 'Controller'; } elseif ($key == 'action') { $ret[':action'] = $this->_inflector->camelize($val, 'lower'); + } elseif ($key == 'module') { + $ret[':module'] = $this->_inflector->camelize($val); } $ret[$key] = $val; } + + if (!empty($ret[':module'])) { + $ret[':controller'] = $ret[':module'] . '_' . $ret[':controller']; + } + return !empty($ret) && isset($ret['controller']) ? $ret : false; }