FEATURE: add functionality for creating new widget.
This commit adds functionality for creating widget of whatever type. Controller calls widget admin handler, which renders and handles input form.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Enumerations\WidgetTypes;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AdminMenusProvider extends ServiceProvider
|
||||
@@ -38,6 +39,14 @@ class AdminMenusProvider extends ServiceProvider
|
||||
$sub->route('upload.overview', trans('admin/mainMenu.uploadedFiles'), [], 150, ['icon' => 'fa fa-files-o']);
|
||||
}, 25, ['icon' => 'fa fa-film']);
|
||||
$menu->dropdown(trans('admin/mainMenu.widgets'), function ($sub) {
|
||||
// create list of all widget types
|
||||
$sub->dropdown(trans('admin/mainMenu.newWidget'), function ($sub) {
|
||||
$i = 1;
|
||||
foreach (WidgetTypes::getWithTranslations() as $type => $name) {
|
||||
$sub->route('widgets.new', $name, ['type' => $type], $i++);
|
||||
}
|
||||
}, 10, ['icon' => 'fa fa-plus']);
|
||||
|
||||
// menu for widget areas
|
||||
$sub->dropdown(trans('admin/mainMenu.widgetAreas'), function ($sub) {
|
||||
$sub->route('widgetareas.new', trans('admin/mainMenu.newWidgetArea'), [], 1, ['icon' => 'fa fa-plus']);
|
||||
|
||||
Reference in New Issue
Block a user