Handle event for add the default buttons for the select mode.

@param GetSelectModeButtonsEvent $event The event.

@return void
438287
public function handleEvent(GetSelectModeButtonsEvent $event)
    {
        $environment     = $event->getEnvironment();
        $translator      = $environment->getTranslator();
        $basicDefinition = $environment->getDataDefinition()->getBasicDefinition();
        $buttons         = [];

        $confirmMessage = \htmlentities(
            \sprintf(
                '<h2 class="tl_error">%s</h2>' .
                '<p></p>' .
                '<div class="tl_submit_container">' .
                '<input type="submit" name="close" class="%s" value="%s" onclick="%s">' .
                '</div>',
                StringUtil::specialchars($translator->translate('MSC.nothingSelect', 'contao_default')),
                'tl_submit',
                StringUtil::specialchars($translator->translate('MSC.close', 'contao_default')),
                'this.blur(); BackendGeneral.hideMessage(); return false;'
            )
        );
        $onClick        = 'BackendGeneral.confirmSelectOverrideEditAll(this, \'models[]\', \''
                          . $confirmMessage . '\'); return false;';

        $input = '<input type="submit" name="%s" id="%s" class="tl_submit" accesskey="%s" value="%s" onclick="%s">';

        if ($basicDefinition->isDeletable()) {
            $onClickDelete = \sprintf(
                'BackendGeneral.confirmSelectDeleteAll(this, \'%s\', \'%s\', \'%s\', \'%s\', \'%s\'); return false;',
                'models[]',
                $confirmMessage,
                StringUtil::specialchars($translator->translate('MSC.delAllConfirm', 'contao_default')),
                StringUtil::specialchars($translator->translate('MSC.confirmOk', 'contao_default')),
                StringUtil::specialchars($translator->translate('MSC.confirmAbort', 'contao_default'))
            );

            $buttons['delete'] = \sprintf(
                $input,
                'delete',
                'delete',
                'd',
                StringUtil::specialchars($translator->translate('MSC.deleteSelected', 'contao_default')),
                $onClickDelete
            );
        }

        $sortingProperty = ViewHelpers::getManualSortingProperty($event->getEnvironment());
        if ($sortingProperty && $basicDefinition->isEditable()) {
            $buttons['cut'] = \sprintf(
                $input,
                'cut',
                'cut',
                's',
                StringUtil::specialchars($translator->translate('MSC.moveSelected', 'contao_default')),
                $onClick
            );
        }

        if ($basicDefinition->isCreatable()) {
            $buttons['copy'] = \sprintf(
                $input,
                'copy',
                'copy',
                'c',
                StringUtil::specialchars($translator->translate('MSC.copySelected', 'contao_default')),
                $onClick
            );
        }

        if ($basicDefinition->isEditable()) {
            $buttons['override'] = \sprintf(
                $input,
                'override',
                'override',
                'v',
                StringUtil::specialchars($translator->translate('MSC.overrideSelected', 'contao_default')),
                $onClick
            );

            $buttons['edit'] = \sprintf(
                $input,
                'edit',
                'edit',
                's',
                StringUtil::specialchars($translator->translate('MSC.editSelected', 'contao_default')),
                $onClick
            );
        }

        $event->setButtons($buttons);
    }
621279
public function on(string $event, $handler)
    {
        if (self::isSupportedEvent($event)) {
            $this->options[$event] = $handler;
        }
    }
57444
protected function config(MvcEvent $event)
    {
        $appConfig = $event->getApplication()->getServiceManager()->get('config');
        $config = array_key_exists(self::CONFIG_KEY, $appConfig) ? $appConfig[self::CONFIG_KEY] : array();
        
        if (array_key_exists('template', $config)) {
            $this->setTemplate($config['template']);
        }
        
        if (array_key_exists('renderLayout', $config)) {
            $this->setRenderLayout($config['renderLayout']);
        }
    }
215453
public function handleXmlHttpRequest(MvcEvent $event)
	{
		$request = $event->getRequest();
		if ($request->isXMLHttpRequest()) {
			$dispatchResult = $event->getResult();
			if ($dispatchResult instanceof ViewModel) {
				$dispatchResult->setTerminal(true);
			}
		}
	}
892764
public function handleGetAttributesFromDca(GetAttributesFromDcaEvent $event)
    {
        /** @var Widget $widgetAdapter */
        $widgetAdapter = $this->framework->getAdapter(Widget::class);

        $event->setResult(
            $widgetAdapter->getAttributesFromDca(
                $event->getFieldConfiguration(),
                $event->getWidgetName(),
                $event->getValue(),
                $event->getWidgetId(),
                $event->getTable(),
                $event->getDataContainer()
            )
        );
    }
569677
public function addEvent(EventMessage $event)
    {
        $this->events[] = $event;
        if (stristr($event->getEventList(), 'complete') !== false
            || stristr($event->getName(), 'complete') !== false
            || stristr($event->getName(), 'DBGetResponse') !== false
        ) {
            $this->completed = true;
        }
    }
1355965
public function init(MvcEvent $event): void
    {
        if (true === $this->tracyOptions->getEnabled()) {
            Debugger::enable($this->tracyOptions->getMode());

            if (null !== $this->tracyOptions->getEmail()) {
                Debugger::$email = $this->tracyOptions->getEmail();
            }

            if (null !== $this->tracyOptions->getLogDirectory()) {
                Debugger::$logDirectory = $this->tracyOptions->getLogDirectory();
            }

            if (null !== $this->tracyOptions->getLogSeverity()) {
                Debugger::$logSeverity = $this->tracyOptions->getLogSeverity();
            }

            if (null !== $this->tracyOptions->getMaxDepth()) {
                Debugger::$maxDepth = $this->tracyOptions->getMaxDepth();
            }

            if (null !== $this->tracyOptions->getMaxLength()) {
                Debugger::$maxLength = $this->tracyOptions->getMaxLength();
            }

            if (null !== $this->tracyOptions->getShowBar()) {
                Debugger::$showBar = $this->tracyOptions->getShowBar();
            }

            if (null !== $this->tracyOptions->getShowLocation()) {
                Debugger::$showLocation = $this->tracyOptions->getShowLocation();
            }

            if (null !== $this->tracyOptions->getStrict()) {
                Debugger::$strictMode = $this->tracyOptions->getStrict();
            }
        }
    }
669446
public function onIndexEngineDriverFormJavascript(HookRenderEvent $event)
    {
        $driverCode = $event->getArgument("driver");
        $driver = $this->registry->getDriver($driverCode, DriverRegistryInterface::MODE_RETURN_NULL);

        if (null !== $driver) {
            $event->add($this->render("form-field/render-string-vector-js.html", [
                "driver_code" => $driverCode,
            ]));
        }
    }
369797
public function addContextual($event)
    {
        $page = $event->getPage();
        $currentArticle = $event->getPage()->getBusinessEntity();

        $bottomRightNavbar = $this->menuBuilder->getBottomRightNavbar();

        $bottomRightNavbar->addChild('menu.page.settings',
            [
                'route'           => 'victoire_blog_article_settings',
                'routeParameters' => [
                    'id'      => $currentArticle->getId(),
                    'page_id' => $page->getId(),
                ],
                'linkAttributes' => [
                    'class' => 'v-btn v-btn--sm v-btn--transparent',
                    'id'    => 'v-settings-link',
                ],
            ]
        )->setLinkAttribute('data-toggle', 'vic-modal');
    }
1016924
public void cmsEvent(CmsEvent event) {

        switch (event.getType()) {
            case I_CmsEventListener.EVENT_CLEAR_CACHES:
                flushMessageCache();
                m_editorDisplayOptions.clearCache();
                if (LOG.isDebugEnabled()) {
                    LOG.debug(Messages.get().getBundle().key(Messages.LOG_EVENT_CLEAR_CACHES_0));
                }
                break;
            default: // no operation
        }
    }
137392
public function onPreSetData(FormEvent $event)
    {
        $form = $event->getForm();
        $item = $event->getData();

        foreach ($this->fields as $field) {
            list ($name, $type, $options) = $field;
            if (null !== $item) {
                $options = array_replace($options, $this->itemHelper->getFormOptions($item, $name));
            }
            $form->add($name, $type, $options);
        }
    }
1215958
public function bindPluginEvents(Event $event)
    {
        foreach ($this->plugins as $field => $plugin) {
            $plugin = self::findPluginInstance($field, $plugin, $event->sender->tableName());
            foreach ($plugin->events() as $on => $handler) {
                $event->sender->on($on, is_string($handler) ? [$plugin, $handler] : $handler);
            }
        }
    }
564525
protected function handle(Event $event): void
    {
        $method = 'apply'.ClassName::short($event);

        if (!method_exists($this, $method)) {
            return;
        }

        $this->$method($event);
    }
49109
protected function handle($event): void
    {
        $method = $this->getApplyMethod($event);

        if (!method_exists($this, $method)) {
            return;
        }

        $this->$method($event);
    }
772178
public void onClick(MenuItemClickEvent event) {
		if (editController.getEditMode() == EditMode.DRAG_MODE) {
			editController.setEditMode(EditMode.INSERT_MODE);
		} else {
			editController.setEditMode(EditMode.DRAG_MODE);
		}
	}
289209
public void setSelectMode(final SelectMode selectMode) {
		getOrCreateComponentModel().selectMode = selectMode == null ? SelectMode.NONE : selectMode;
	}
190132
public function add_listener($event) {
		if (strpos('::', $event) === false) {
			$classname = get_called_class();
			$method = $event;
		} else {
			list($classname, $method) = explode('::', $event);
		}
		$event_name = strtolower(str_replace('\\', '_', $classname . '_' . $method));

		$dispatcher = \Skeleton\Event\Dispatcher::get();
		$dispatcher->add_listener($event_name, [ '\\Event\\' . $classname, $method ]);
	}