FEATURE #1422: prepare application for registering widgets
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
namespace App\Enumerations;
|
||||
|
||||
use App\Models\WidgetType;
|
||||
|
||||
class WidgetTypes extends BaseEnumeration
|
||||
{
|
||||
/**
|
||||
* Init list of all installed modules
|
||||
*
|
||||
* @throws Exceptions\EnumerationExistsException
|
||||
*/
|
||||
protected static function init()
|
||||
{
|
||||
$widgets = WidgetType::all(['id', 'name']);
|
||||
|
||||
foreach ($widgets as $widget) {
|
||||
self::push($widget->id, $widget->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
namespace App\Enumerations;
|
||||
|
||||
use App\Models\WidgetType;
|
||||
|
||||
class WidgetTypesWithHandlers extends BaseEnumeration
|
||||
{
|
||||
/**
|
||||
* Init list of all installed modules
|
||||
*
|
||||
* @throws Exceptions\EnumerationExistsException
|
||||
*/
|
||||
protected static function init()
|
||||
{
|
||||
$modules = WidgetType::all(['handler', 'name']);
|
||||
|
||||
foreach ($modules as $module) {
|
||||
self::push($module->handler, $module->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user