Handle the original widget options.

@param GetOptionsEvent $event The event.

@return void
778237
public function handleOriginalOptions(GetOptionsEvent $event)
    {
        $environment = $event->getEnvironment();

        if (!$this->scopeDeterminator->currentScopeIsBackend()
            || ('select' !== $environment->getInputProvider()->getParameter('act'))
            || ('edit' !== $environment->getInputProvider()->getParameter('select'))
        ) {
            return;
        }

        $model = $event->getModel();

        if (!($propertyName = $this->getOriginalPropertyName($event->getPropertyName(), ModelId::fromModel($model)))
            || !$model->getProperty($propertyName)
        ) {
            return;
        }

        $originalWidget       = clone $event->getWidget();
        $originalWidget->id   = $propertyName;
        $originalWidget->name = $propertyName;

        $originalOptionsEvent =
            new GetOptionsEvent(
                $propertyName,
                $event->getSubPropertyName(),
                $event->getEnvironment(),
                $model,
                $originalWidget,
                $event->getOptions()
            );

        $environment->getEventDispatcher()->dispatch(GetOptionsEvent::NAME, $originalOptionsEvent);

        $event->setOptions($originalOptionsEvent->getOptions());

        $event->stopPropagation();
    }
602870
protected function _setOptions()
    {
        if (!is_null($this->getHeader())) {
            $this->_setOpt(CURLOPT_HTTPHEADER, $this->getHeader());
        }
        $this->_setOpt(CURLOPT_URL, $this->getUrl());

        if ($this->getMethod() == "POST") {
            $this->_setOpt(CURLOPT_POST, 1);
            $this->_setOpt(CURLOPT_POSTFIELDS, $this->getQuery());
        }

        $options = $this->getOptions();
        if (count($options)) {
            foreach ($options as $name => $mValue) {
                $this->_setOpt(constant($name), $mValue);
            }
        }
    }
29743
public function handleGetTheme(GetThemeEvent $event)
    {
        /** @var Backend $backendAdapter */
        $backendAdapter = $this->framework->getAdapter(Backend::class);

        $event->setTheme($backendAdapter->getTheme());
    }
1292700
protected function handleOptions($xml, $options = [])
    {
        if ($xml instanceof \SimpleXMLElement) {
            foreach ($xml->children() as $name => $option) {
                if ($option->getName() === 'optgroup') {
                    foreach ($option->children() as $opt) {
                        $attributes = XmlHelper::getAttributes($opt);

                        $opt = new Option((string) $opt, XmlHelper::getAttribute($opt, 'value'), $attributes);

                        $this->options[XmlHelper::getAttribute($option, 'label')][] = $opt;
                    }
                } else {
                    $attributes = XmlHelper::getAttributes($option);

                    $option = new Option((string) $option, XmlHelper::getAttribute($option, 'value'), $attributes);

                    $this->options[] = $option;
                }
            }
        } else {
            foreach ($options as $name => $option) {
                // If is array, means it is group
                if (is_array($option)) {
                    foreach ($option as $opt) {
                        if (!($opt instanceof Option)) {
                            throw new \InvalidArgumentException(
                                sprintf(
                                    'Please give me %s class as option, %s given.',
                                    'Windwalker\\Html\\Option',
                                    get_class($opt)
                                )
                            );
                        }
                    }
                } else {
                    // If not array, means it is option
                    if (!($option instanceof Option)) {
                        throw new \InvalidArgumentException(
                            sprintf(
                                'Please give me %s class as option, %s given.',
                                'Windwalker\\Html\\Option',
                                get_class($option)
                            )
                        );
                    }
                }

                if (is_numeric($name)) {
                    $this->options[] = $option;
                } else {
                    $this->options[$name] = array_merge(
                        $this->options[$name] ?? [],
                        $option
                    );
                }
            }
        }
    }
879924
function onQuickFormEvent($event, $arg, &$caller)
    {
        switch ($event) {
            case 'createElement':
                $choices=array();
                $choices[0] = get_string('no');
                $choices[1] = get_string('yes');
                $this->load($choices);
                break;
        }
        return parent::onQuickFormEvent($event, $arg, $caller);
    }
300358
public function SetOptions( $options ){
		foreach($options as $option => $value){
			$this->SetOption($option,$value);
		}
	}
1305567
public function handle($event)
    {
        $needCrop = $event->dataType->rows()
            ->whereType('image')
            ->where('details', 'like', '%cropper%')
            ->exists();

        if ($needCrop) {
            $event->model->cropPhotos($event);
        }
    }
1042170
final public function handle(Event $event): void
    {
        if (!$this->isEventSupported($event)) {
            throw new InvalidEventException(\sprintf(
                'Event must be a %s, %s given',
                \implode('or ', $this->getSupportedEventTypes()),
                \get_class($event)
            ));
        }

        $this->handleEvent($event);
    }
1113542
public function getColumnNames(GetPropertyOptionsEvent $event)
    {
        if (!$this->isBackendOptionRequestFor($event, ['tag_column', 'tag_alias', 'tag_sorting'])) {
            return;
        }

        $result = $this->getColumnNamesFrom($event->getModel()->getProperty('tag_table'));

        if (!empty($result)) {
            \asort($result);
            $event->setOptions($result);
        }
    }
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);
        }
    }
1286910
public function handleEncodePropertyValueFromWidget(EncodePropertyValueFromWidgetEvent $event)
    {
        $attribute = $this->getSupportedAttribute($event);
        if (!$attribute) {
            return;
        }

        $date = \DateTime::createFromFormat($attribute->getDateTimeFormatString(), $event->getValue());

        if ($date) {
            $event->setValue($date->getTimestamp());
        }
    }
817162
public function handle(GetGroupHeaderEvent $event)
    {
        if ((null !== $event->getValue()) || !$this->scopeDeterminator->currentScopeIsBackend()) {
            return;
        }

        $environment = $event->getEnvironment();
        $property    = $environment
            ->getDataDefinition()
            ->getPropertiesDefinition()
            ->getProperty($event->getGroupField());

        // No property? Get out!
        if (!$property) {
            $event->setValue('-');
            return;
        }

        $value = $this->formatGroupHeader(
            $environment,
            $event->getModel(),
            $property,
            $event->getGroupingMode(),
            $event->getGroupingLength()
        );

        if (null !== $value) {
            $event->setValue($value);
        }
    }
773808
protected function processHtmlOptions()
	{
		if (isset($this->htmlOptions['prepend']))
		{
			$this->prependText = $this->htmlOptions['prepend'];
			unset($this->htmlOptions['prepend']);
		}

		if (isset($this->htmlOptions['append']))
		{
			$this->appendText = $this->htmlOptions['append'];
			unset($this->htmlOptions['append']);
		}

		if (isset($this->htmlOptions['hint']))
		{
			$this->hintText = $this->htmlOptions['hint'];
			unset($this->htmlOptions['hint']);
		}

		if (isset($this->htmlOptions['labelOptions']))
		{
			$this->labelOptions = $this->htmlOptions['labelOptions'];
			unset($this->htmlOptions['labelOptions']);
		}

		if (isset($this->htmlOptions['prependOptions']))
		{
			$this->prependOptions = $this->htmlOptions['prependOptions'];
			unset($this->htmlOptions['prependOptions']);
		}

		if (isset($this->htmlOptions['appendOptions']))
		{
			$this->appendOptions = $this->htmlOptions['appendOptions'];
			unset($this->htmlOptions['appendOptions']);
		}

		if (isset($this->htmlOptions['hintOptions']))
		{
			$this->hintOptions = $this->htmlOptions['hintOptions'];
			unset($this->htmlOptions['hintOptions']);

		}

		if (isset($this->htmlOptions['errorOptions']))
		{
			$this->errorOptions = $this->htmlOptions['errorOptions'];
			unset($this->htmlOptions['errorOptions']);
		}

		if (isset($this->htmlOptions['captchaOptions']))
		{
			$this->captchaOptions = $this->htmlOptions['captchaOptions'];
			unset($this->htmlOptions['captchaOptions']);
		}
	}
808961
public function handle(DomainEvent $event) : void {
        $method = lcfirst($this->getShortName($event));
        if (method_exists($this, $method)) {
            $this->$method($event);
        }
    }
149018
protected function defaultOptions()
    {
        $this->options = ArrayHelper::merge($this->options, $this->module->widgetOptions);
        $this->clientOptions = ArrayHelper::merge($this->clientOptions, $this->module->widgetClientOptions);
        $this->externalPlugins = ArrayHelper::merge($this->externalPlugins, $this->module->widgetExternalPlugins);

        if (!isset($this->options['id']))
        {
            if ($this->hasModel()) {
                $this->options['id'] = Html::getInputId($this->model, $this->attribute);
            } else {
                $this->options['id'] = $this->getId();
            }
        }
    }
818605
public function handle_options($options = null)
    {
        $this->opt = new pakeGetopt(self::$OPTIONS);
        $this->opt->parse($options);
        foreach ($this->opt->get_options() as $opt => $value) {
            $this->do_option($opt, $value);
        }
    }
1069819
public function sendGetCalendarsToApp(Event $event, array $options = []): void
    {
        $eventName = preg_replace('/^(Plugin)/', 'App', $event->getName());
        if (empty($eventName)) {
            return;
        }

        $ev = new Event($eventName, $this, [
            'options' => $options
        ]);

        EventManager::instance()->dispatch($ev);

        $event->result = $ev->result;
    }