mirror of
https://github.com/silverstripe/silverstripe-widgets
synced 2024-10-22 15:05:54 +00:00
Update WidgetAreaEditor.php
This commit is contained in:
parent
b7b8b80c18
commit
22b7790307
@ -36,7 +36,6 @@ class WidgetAreaEditor extends FormField {
|
||||
* @return ArrayList
|
||||
*/
|
||||
public function AvailableWidgets() {
|
||||
|
||||
$widgets= new ArrayList();
|
||||
|
||||
foreach($this->widgetClasses as $widgetClass) {
|
||||
@ -50,8 +49,15 @@ class WidgetAreaEditor extends FormField {
|
||||
}
|
||||
|
||||
foreach($classes as $class) {
|
||||
|
||||
if (!empty($class::$only_available_in) && is_array($class::$only_available_in)){
|
||||
if(in_array($this->Name, $class::$only_available_in)) {
|
||||
$widgets->push(singleton($class));
|
||||
}
|
||||
}else {
|
||||
$widgets->push(singleton($class));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $widgets;
|
||||
|
Loading…
x
Reference in New Issue
Block a user