Version 5.0.0 beta 8
This commit is contained in:
1 parent
54d5dcd0a0
commit
214f649f1d
483 files changed
+35354
-33568
No files matched your search
@@ -43,6 +43,7 @@ use IPS\Theme\CustomTemplate;
|
||||
use IPS\Theme\Editor\Category;
|
||||
use IPS\Theme\Editor\Setting;
|
||||
use IPS\Widget\Area;
|
||||
use IPS\Widget\Polymorphic;
|
||||
use IPS\Xml\SimpleXML;
|
||||
use OutOfRangeException;
|
||||
use OverflowException;
|
||||
@@ -5287,6 +5288,27 @@ EOF;
|
||||
return $blocks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a list of all valid widget keys for this application
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getValidWidgetKeys() : array
|
||||
{
|
||||
$keys = [];
|
||||
foreach( Db::i()->select( '*', 'core_widgets', [ 'app=?', $this->directory ] ) as $widget )
|
||||
{
|
||||
$class = 'IPS\\' . $this->directory . '\\widgets\\' . $widget['key'];
|
||||
$keys[] = $widget['key'];
|
||||
if( in_array( Polymorphic::class, class_implements( $class ) ) )
|
||||
{
|
||||
/* @var Polymorphic $class */
|
||||
$keys = array_merge( $keys, $class::getWidgetKeys() );
|
||||
}
|
||||
}
|
||||
return $keys;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup after saving
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user