XOOPS Cube Legacy base repository
Revision | bb3d66e85314d07cf97667cf96b7e45d6a1ad177 (tree) |
---|---|
Zeit | 2012-08-12 21:04:26 |
Autor | Nobuhiro YASUTOMI <nobuhiro.yasutomi@nift...> |
Commiter | Nobuhiro YASUTOMI |
fix gethandler for internal class (issues #10)
@@ -579,10 +579,15 @@ function &xoops_gethandler($name, $optional = false ) | ||
579 | 579 | XCube_DelegateUtils::call('Legacy.Event.GetHandler', new XCube_Ref($handler), $name, $optional); |
580 | 580 | if ($handler) return $handlers[$name] =& $handler; |
581 | 581 | |
582 | - require_once XOOPS_ROOT_PATH.'/kernel/'.$name.'.php'; | |
582 | + // internal Class handler exist | |
583 | 583 | if (XC_CLASS_EXISTS($class = 'Xoops'.ucfirst($name).'Handler')) { |
584 | 584 | $handlers[$name] = $handler = new $class($GLOBALS['xoopsDB']); |
585 | 585 | return $handler; |
586 | + } | |
587 | + include_once XOOPS_ROOT_PATH.'/kernel/'.$name.'.php'; | |
588 | + if (XC_CLASS_EXISTS($class)) { | |
589 | + $handlers[$name] = $handler = new $class($GLOBALS['xoopsDB']); | |
590 | + return $handler; | |
586 | 591 | } |
587 | 592 | |
588 | 593 | if (!$optional) { |