mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
#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:
parent
f369a2bb4d
commit
d765a8e3cf
@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user