/**
  * @Response("extension://system/views/admin/widgets/index.razr")
  */
 public function indexAction()
 {
     $this->positions[''] = ['name' => __('Unassigned Widgets')];
     $widgets = [];
     foreach ($this->widgets->query()->orderBy('priority', 'ASC')->get() as $widget) {
         $position = $widget->getPosition();
         $widgets[isset($this->positions[$position]) ? $position : ''][] = $widget;
     }
     return ['head.title' => __('Widgets'), 'widgets' => $widgets, 'positions' => $this->positions, 'types' => TypesTrait::getWidgetTypes()];
 }
 /**
  * Registers widget types.
  */
 public function onSystemLoaded()
 {
     TypesTrait::setWidgetTypes($this['events']->dispatch('system.widget', new RegisterWidgetEvent())->getTypes());
 }