ok, where i should put this code ?
ImageWidget.php
class ImageWidget extends Widget {
[...]
return new FieldSet(
new DropdownField('File_name','Image file: ',$this->getHierarchy)
)
[...]
}
class SimpleTreeDropdownField extends DropdownField {
}
doesn't work
class ImageWidget extends Widget {
[...]
return new FieldSet(
new DropdownField('File_name','Image file: ',$this->getHierarchy)
)
[...]
}
class SimpleTreeDropdownField extends ImageWidget {
}
i get:
Fatal error: Declaration of SimpleTreeDropdownField::__construct() must be compatible with that of DataObjectInterface::__construct() in /home/wilgocki/domains/wilgocki.net/public_html/silverstripe/widgets_ImageWidget/ImageWidget.php on line 94
my previous code works but i need to wrap words after 50 chars (http://www.silverstripe.org/customising-the-cms/show/253177?showPost=253177)
new DropdownField('File_name','Select image:',DataObject::get("File")->toDropdownMap('Filename',wordwrap('Filename', 50, "\n", 1)))