mirror of
https://github.com/silverstripe/silverstripe-widgets
synced 2024-10-22 15:05:54 +00:00
Merge pull request #69 from ryanwachtl/onlyavailablein-config
Use Config to get Widget::$only_available_in
This commit is contained in:
commit
e3c2dec7df
@ -50,8 +50,10 @@ class WidgetAreaEditor extends FormField {
|
|||||||
|
|
||||||
foreach($classes as $class) {
|
foreach($classes as $class) {
|
||||||
|
|
||||||
if (!empty($class::$only_available_in) && is_array($class::$only_available_in)){
|
$available = Config::inst()->get($class, 'only_available_in');
|
||||||
if(in_array($this->Name, $class::$only_available_in)) {
|
|
||||||
|
if (!empty($available) && is_array($available)) {
|
||||||
|
if(in_array($this->Name, $available)) {
|
||||||
$widgets->push(singleton($class));
|
$widgets->push(singleton($class));
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user