From d765a8e3cf9bb86fcb427baf9c187deba841465f Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Mon, 10 Mar 2008 21:34:32 +0000 Subject: [PATCH] #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 --- widgets/Widget.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/widgets/Widget.php b/widgets/Widget.php index 80568d9c1..3d78bbc34 100644 --- a/widgets/Widget.php +++ b/widgets/Widget.php @@ -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"; + } + } +} + ?> \ No newline at end of file