End a buffered section of dropdown menu capturing.

Arguments and options regarding the list of the dropdown menu.
@param array $divOptions HTML attributes and options for the wrapper
element
@return string|void
@uses $_start
332045
public function end(array $divOptions = [])
    {
        $buffer = ob_get_contents();

        if (empty($buffer)) {
            return;
        }

        ob_end_clean();

        //Split all links
        if (preg_match_all('/(<a[^>]*>.*?<\/a[^>]*>)/', $buffer, $matches) === 0) {
            return;
        }

        $divOptions = optionsParser($divOptions)->append('class', 'dropdown-menu');

        return $this->_start . PHP_EOL . $this->Html->div($divOptions->get('class'), $matches[0], $divOptions->toArray());
    }
302386
private function SaveOptions(array $options)
    {
        $prev = null;
        foreach ($options as $value=>$text)
        {
            $option = new RadioOption();
            $option->SetRadioField($this->radio);
            $option->SetPrevious($prev);
            $option->SetText($text);
            $option->SetValue($value);
            $option->Save();
            $prev = $option;
        }
    }
417460
public function close($options = array())
    {
        $default = array('reply_code' => 0, 'reply_text' => '', 'method_signature' => array(0,0));
        $options = array_merge($default, $options);
        $args = $this->frameBuilder->channelClose($options);

        $this->sendMethodFrame(array(20, 40), $args);
        return $this->wait(
            array(
                 "20,41" // Channel.close_ok
            )
        );
    }
208642
private function _handleDOption($z)
    {
        if ($a = strstr($z, '=')) {
            $z = substr($a, 1); // strip first =
        }
        $this->azDefine[] = $z;
    }
440881
public function outputOptions(array $options)
    {
        /* @var $output \PG\MSF\Base\Output */
        $output = $this->getContext()->getOutput();
        $status = 200;
        if ($this->verb !== 'OPTIONS') {
            $status = 405;
        }
        $output->setHeader('Allow', implode(', ', $options));
        if (!empty($output->response)) {
            $output->setContentType('application/json; charset=UTF-8');
            $output->end('', $status);
        }
    }
1092970
public function setChoices($choices)
    {
        $this->reset();

        $flatten = $this->flatten($choices);
        if ($this->config['sort']) {
            ksort($flatten);
        }

        /*
         * $path = Db.Lang.php
         * $name = PHP
         */
        foreach ($flatten as $path => $name) {
            $ns = substr($path, 0, strrpos($path, '.'));
            $this->choices[$ns] = $ns;
            if (isset($flatten["{$ns}._"])) {
                $this->groups[$ns] = $flatten["{$ns}._"] + ['max' => PHP_INT_MAX];
                unset($flatten["{$ns}._"]);
            }

            $key = substr($path, strrpos($path, '.') + 1); // php
            if ($key == '_') {
                continue;
            }

            $isSelected = in_array($key, (array)($this->groups[$ns]['selected'] ?? []));
            $this->choices[] = [
                'key'      => $key,
                'ns'       => $ns,
                'name'     => $name,
                'selected' => $isSelected,
                'readonly' => in_array($key, $this->groups[$ns]['readonly'] ?? []),
                'depends'  => (array)($this->groups[$ns]['depends'][$key] ?? []),
            ];

            if ($isSelected) {
                $this->selections[$key] = $ns;
            }

            if (!isset($this->groups[$ns])) {
                $this->groups[$ns] = ['max' => PHP_INT_MAX];
            }
        }

        $this->choices = array_values($this->choices);
        $this->lines   = count($this->choices);
        $this->line    = $this->lines - 1;
    }
54976
public function save_user_preview_options($newoptions) {
        foreach ($this->get_user_pref_fields() as $field) {
            if (isset($newoptions->$field)) {
                set_user_preference(self::OPTIONPREFIX . $field, $newoptions->$field);
            }
        }
    }
967591
public function setOptions(array $options): Control
    {
        if (array_key_exists('type', $options)) {
            $this->setType($options['type']);
        }

        if (array_key_exists('icon', $options)) {
            $this->setIcon($options['icon']);
        }

        if (array_key_exists('position', $options)) {
            $this->setPosition($options['position']);
        }

        return parent::setOptions($options);
    }
1360266
public static function formActions($actions, $htmlOptions = array())
    {
        self::addCssClass('form-actions', $htmlOptions);
        if (is_array($actions)) {
            $actions = implode(' ', $actions);
        }
        return self::tag('div', $htmlOptions, $actions);
    }
530146
public function set_option($options = array()) {
        $options['issuerid'] = clean_param($options['issuerid'], PARAM_INT);
        $options['controlledlinkfoldername'] = clean_param($options['controlledlinkfoldername'], PARAM_TEXT);

        $ret = parent::set_option($options);
        return $ret;
    }
675850
protected function endWrapper($filters = true)
    {
        $wrapperEnd = explode('%3$s', $this->args['wrapper'])[1];

        if ($filters) {
            $wrapperEnd = apply_filters('Municipio/main_menu/wrapper_end', $wrapperEnd, $this->args);
        }

        $this->addOutput(sprintf(
            $wrapperEnd,
            $this->args['id'],
            $this->args['classes']
        ));
    }
785053
public function endMenu() {
        $template = 'outerMenuEnd';
        $options = [];
        if ($this->_level == 2) {
            $template = 'innerMenuEnd';
            $options['dropdownMenuEnd'] = $this->formatTemplate('dropdownMenuEnd', []);
        }
        $this->_level -= 1;
        return $this->formatTemplate($template, $options);
    }
8359
public static function parseDefaultOptions($options = [], $defaults = [])
    {
        array_walk($defaults, function ($value, $key) use (&$options) {
            if (!isset($options[$key])) {
                $options[$key] = $value;
            }
        });

        return $options;
    }
485460
protected static function _setupOptions(&$options)
    {
        $options = self::_merge(self::$_defaults, $options);
        foreach ($options['children'] as &$child) {
            self::_setupOptions($child);
        }
    }
801488
protected function choice($title, array $choices, $default = false)
    {
        $this->line('Available choices:');

        return cli\menu($choices, $default, $title);
    }
986717
public static function startsWith($stringOrStrings, $optionOrOptions)
    {
        return self::startsWithInternal($stringOrStrings, $optionOrOptions, false, false, false);
    }
25390
public function set_option($options = array()) {
        if (!empty($options['apikey'])) {
            set_config('apikey', trim($options['apikey']), 'youtube');
        }
        unset($options['apikey']);
        return parent::set_option($options);
    }