#2285 - Fixed widget editor

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2.2@50805 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-03-10 21:34:32 +00:00
parent f369a2bb4d
commit d765a8e3cf

View File

@ -97,4 +97,17 @@ class Widget extends DataObject {
} }
class Widget_Controller extends Controller {
function editablesegment() {
$className = $this->urlParams['ID'];
if(class_exists($className) && is_subclass_of($className, 'Widget')) {
$obj = new $className();
return $obj->EditableSegment();
} else {
user_error("Bad widget class: $className", E_USER_WARNING);
return "Bad widget class name given";
}
}
}
?> ?>