Merged revisions 50812 via svnmerge from

http://svn.silverstripe.com/open/modules/sapphire/branches/2.2.2

........
  r50812 | sminnee | 2008-03-11 10:34:32 +1300 (Tue, 11 Mar 2008) | 1 line
  
  #2285 - Fixed widget editor
........


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@50884 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-03-11 03:29:36 +00:00
parent b8262b6d48
commit bfc51aa63f

View File

@ -104,4 +104,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";
}
}
}
?>