Retrieve the widget's data options for JavaScript components.

@return array
349806
public function widgetDataForJs()
    {
        $data = array_merge_recursive(
            parent::widgetDataForJs(),
            [
                'card_template' => $this->cardTemplate(),
                'num_columns' => $this->numColumns()
            ]
        );

        return $data;
    }
981884
protected function getElementData()
    {
        $obDefaultCurrency = CurrencyHelper::instance()->getDefault();
        $sCurrencyCode = !empty($obDefaultCurrency) ? $obDefaultCurrency->code : null;

        $arResult = [
            'price_value'     => $this->obElement->setActiveCurrency($sCurrencyCode)->setActivePriceType(null)->price_value,
            'old_price_value' => $this->obElement->setActiveCurrency($sCurrencyCode)->setActivePriceType(null)->old_price_value,
            'trashed'         => $this->obElement->trashed(),
        ];

        return $arResult;
    }
575481
public function getWidgetConfigs()
    {
        $widgetClasses = $this->getAllWidgetClassNames();

        $configs = array();

        /**
         * Triggered to add custom widget configs. To filder widgets have a look at the {@hook Widget.filterWidgets}
         * event.
         *
         * **Example**
         *
         *     public function addWidgetConfigs(&$configs)
         *     {
         *         $config = new WidgetConfig();
         *         $config->setModule('PluginName');
         *         $config->setAction('renderDashboard');
         *         $config->setCategoryId('Dashboard_Dashboard');
         *         $config->setSubcategoryId('dashboardId');
         *         $configs[] = $config;
         *     }
         *
         * @param array &$configs An array containing a list of widget config entries.
         */
        Piwik::postEvent('Widget.addWidgetConfigs', array(&$configs));

        foreach ($widgetClasses as $widgetClass) {
            $configs[] = $this->getWidgetConfigForClassName($widgetClass);
        }

        return $configs;
    }
357231
protected function getOptions()
    {
        $this->options['allowOutsideClick'] = ArrayHelper::getValue($this->options, 'allowOutsideClick', $this->allowOutsideClick);
        $this->options['timer'] = ArrayHelper::getValue($this->options, 'timer', $this->timer);
        $this->options['type'] = ArrayHelper::getValue($this->options, 'type', $this->type);

        return Json::encode($this->options);
    }
261540
protected function getOptions()
    {
        $path = public_path($this->config->get('theme.themeDir'));

        return array(
            array('path', 'p', InputOption::VALUE_OPTIONAL, 'Path to theme directory.', $path),
            array('type', 't', InputOption::VALUE_OPTIONAL, 'Widget view type [php|blade|twig].', null),
            array('global', 'g', InputOption::VALUE_NONE, 'Create global widget.', null)
        );
    }
1230489
public function getRendererOptions()
	{
		$opts = array();
		foreach( $this->allowedRendererOptions as $opt ) {
			if( isset( $this->options[$opt] ) )
				$opts[$opt] = $this->options[$opt];
		}
		return $opts;
	}
681705
public function getEditData()
    {
        $sort = [];
        if ($this->dataProvider->getSort()->attributes) {
            foreach ($this->dataProvider->getSort()->attributes as $key => $value) {
                $sort[$key] = ArrayHelper::getValue($value, 'label');
            }
        }

        return [
            'callAttributes'   => $this->callAttributes,
            'availableColumns' => $this->getColumnsKeyLabels(),
            'sortAttributes'   => $sort,
        ];
    }
520710
public function getDataRows()
    {
        $list = array();
        foreach ($this->components as $child) {
            if ($child instanceof DataRow) {
                $list[] = $child;
            }
        }
        return $list;
    }
947361
public function getJavascriptOptions() {
        $out = $this->_options['javascriptOptions'];
        $out['options'] = base64_encode(serialize(array(
            'pageSize' => $this->_options['pageSize'],
            'viewPath' => $this->_options['viewPath'],
            'filters'  => $this->getFilters()
        )));
        return $out;
    }
1322956
protected function getClientOptions()
    {
        $options = [
            'encodeErrorSummary'  => $this->owner->encodeErrorSummary,
            'errorSummary'        => '.'.implode('.', preg_split('/\s+/', $this->owner->errorSummaryCssClass, -1, PREG_SPLIT_NO_EMPTY)),
            'validateOnSubmit'    => $this->owner->validateOnSubmit,
            'errorCssClass'       => $this->owner->errorCssClass,
            'successCssClass'     => $this->owner->successCssClass,
            'validatingCssClass'  => $this->owner->validatingCssClass,
            'ajaxParam'           => $this->owner->ajaxParam,
            'ajaxDataType'        => $this->owner->ajaxDataType,
            'scrollToError'       => $this->owner->scrollToError,
            'scrollToErrorOffset' => $this->owner->scrollToErrorOffset,
        ];
        if ($this->owner->validationUrl !== null) {
            $options['validationUrl'] = Url::to($this->owner->validationUrl);
        }

        return $options;
    }
28748
private function getDatatableOptions(): array
    {
        list($plugin, $controller) = pluginSplit($this->entity->get('model'));

        $result = [
            'table_id' => '#' . $this->getTableId(),
            'order' => [$this->getOrderField(), $this->getOrderDirection()],
            'ajax' => [
                'url' => Router::url([
                    'plugin' => $plugin,
                    'controller' => $controller,
                    'action' => $this->action,
                    $this->preSaveId
                ]),
                'columns' => $this->getDatatableColumns(),
                'extras' => ['format' => 'pretty']
            ],
        ];

        if (! $this->getGroupByField() && $this->batch) {
            $result['batch'] = ['id' => Configure::read('Search.batch.button_id')];
        }

        return $result;
    }
226338
protected function getOptions()
    {
        $options = array();

        foreach ($this->getRoutes() as $route)
        {
            // Create a new option object based on the <option /> element.
            $tmp = \JHtml::_(
                'select.option', $route,
                \JText::_(trim((string) $route)), 'value', 'text'
            );

            // Add the option object to the result set.
            $options[] = $tmp;
        }

        reset($options);

        return $options;
    }
969151
public function getWidgets()
    {
        if ($this->widgets === null || !array_key_exists('value', $this->widgets)) {
            return;
        }

        //return an array, no matter one or many widget defined
        if (count($this->widgets['value']) > 1) {
            return $this->widgets['value'];
        } else {
            return [$this->widgets['value']];
        }
    }
989424
protected function getData()
    {
        $searchTerm = Str::lower($this->getSearchTerm());
        $searchWords = [];
        if (strlen($searchTerm)) {
            $searchWords = explode(' ', $searchTerm);
        }

        $pluginManager = PluginManager::instance();
        $plugins = $pluginManager->getPlugins();

        $this->prepareComponentList();

        $items = [];
        foreach ($plugins as $plugin) {
            $components = $this->getPluginComponents($plugin);
            if (!is_array($components)) {
                continue;
            }

            $pluginDetails = $plugin->pluginDetails();

            $pluginName = $pluginDetails['name'] ?? Lang::get('system::lang.plugin.unnamed');
            $pluginIcon = $pluginDetails['icon'] ?? 'icon-puzzle-piece';
            $pluginDescription = $pluginDetails['description'] ?? null;

            $pluginClass = get_class($plugin);

            $pluginItems = [];
            foreach ($components as $componentInfo) {
                $className = $componentInfo->className;
                $alias = $componentInfo->alias;
                $component = App::make($className);

                if ($component->isHidden) {
                    continue;
                }

                $componentDetails = $component->componentDetails();
                $component->alias = '--alias--';

                $item = (object)[
                    'title'          => ComponentHelpers::getComponentName($component),
                    'description'    => ComponentHelpers::getComponentDescription($component),
                    'plugin'         => $pluginName,
                    'propertyConfig' => ComponentHelpers::getComponentsPropertyConfig($component),
                    'propertyValues' => ComponentHelpers::getComponentPropertyValues($component, $alias),
                    'className'      => get_class($component),
                    'pluginIcon'     => $pluginIcon,
                    'alias'          => $alias,
                    'name'           => $componentInfo->duplicateAlias
                        ? $componentInfo->className
                        : $componentInfo->alias
                ];

                if ($searchWords && !$this->itemMatchesSearch($searchWords, $item)) {
                    continue;
                }

                if (!array_key_exists($pluginClass, $items)) {
                    $group = (object)[
                        'title'       => $pluginName,
                        'description' => $pluginDescription,
                        'pluginClass' => $pluginClass,
                        'icon'        => $pluginIcon,
                        'items'       => []
                    ];

                    $items[$pluginClass] = $group;
                }

                $pluginItems[] = $item;
            }

            usort($pluginItems, function ($a, $b) {
                return strcmp($a->title, $b->title);
            });

            if (isset($items[$pluginClass])) {
                $items[$pluginClass]->items = $pluginItems;
            }
        }

        uasort($items, function ($a, $b) {
            return strcmp($a->title, $b->title);
        });

        return $items;
    }
705315
public function getWidgetTypes()
    {
        $types = &gplcart_static('field.widget.types');

        if (isset($types)) {
            return $types;
        }

        $types = array(
            'button' => $this->translation->text('Button'),
            'radio' => $this->translation->text('Radio buttons'),
            'select' => $this->translation->text('Dropdown list')
        );

        $this->hook->attach('field.widget.types', $types, $this);
        return $types;
    }
50741
protected function _getListOptionsForElem() {
		$cachePath = 'DefaultOptions_Form_' . $this->_currUIlang;
		$cached = Cache::read($cachePath, CAKE_THEME_CACHE_KEY_HELPERS);
		if (!empty($cached)) {
			return $cached;
		}

		$result = [];
		$result['select'] = [
			'extraOpt' => [
				'actions-box',
				'container',
				'count-selected-text',
				'deselect-all-text',
				'dropdown-align-right',
				'dropup-auto',
				'header',
				'hide-disabled',
				'icon-base',
				'live-search',
				'live-search-normalize',
				'live-search-placeholder',
				'live-search-style',
				'max-options',
				'max-options-text',
				'mobile',
				'multiple-separator',
				'none-selected-text',
				'select-all-text',
				'selected-text-format',
				'select-on-tab',
				'show-content',
				'show-icon',
				'show-subtext',
				'show-tick',
				'size',
				'style',
				'tick-icon',
				'width',
				'window-padding',
			]
		];
		$result['dateTime'] = [
			'defaultOpt' => [
				'label' => false,
				'data-toggle' => 'datetimepicker'
			],
			'extraOpt' => [
				'date-format',
				'date-locale',
				'icon-type',
				'widget-position-horizontal',
				'widget-position-vertical'
			]
		];
		$result['spin'] = [
			'defaultOpt' => [
				'data-toggle' => 'spin',
				'data-spin-verticalbuttons' => 'true',
				'label' => false,
			],
			'extraOpt' => [
				'min',
				'max',
				'step',
				'decimals',
				'maxboostedstep',
				'verticalbuttons',
				'prefix',
				'prefix_extraclass',
				'postfix',
				'postfix_extraclass',
			]
		];
		$result['flag'] = [
			'defaultOpt' => [
				'type' => 'select'
			],
			'extraOpt' => [
				'country-url',
			],
			'divOpt' => [
				'data-toggle' => 'flag-select',
				'data-button-type' => 'btn-default form-control',
			]
		];
		$result['autocomplete'] = [
			'defaultOpt' => [
				'data-toggle' => 'autocomplete',
				'label' => false,
			],
			'extraOpt' => [
				'type',
				'plugin',
				'url',
				'local',
				'min-length'
			]
		];
		$result['createUploadForm'] = [
			'type' => 'file',
			'default' => false,
			'url' => false
		];
		$result['upload'] = [
			'btnTitle' => $this->Html->tag('span', __d('view_extension', 'Select file...')),
			'inputOpt' => [
				'type' => 'file',
				'secure' => false,
				'label' => false,
				'div' => false,
				'data-toggle' => 'fileupload',
				'name' => 'files',
				'data-fileupload-btntext-upload' => __d('view_extension', 'Upload'),
				'data-fileupload-btntext-abort' => __d('view_extension', 'Abort'),
				'data-fileupload-msgtext-processing' => __d('view_extension', 'Processing...'),
				'data-fileupload-msgtext-error' => __d('view_extension', 'File upload failed'),
			]
		];
		$result['createFormTabs'] = [
			'tabListOpt' => [
				'class' => 'nav nav-pills nav-stacked col-xs-4 col-sm-4 col-md-4 col-lg-4'
			],
			'tabContentClass' => 'tab-content col-xs-8 col-lg-8 col-sm-8 col-md-8 col-lg-8',
			'submitBtn' => [
				'title' => __d('view_extension', 'Save'),
				'options' => [
					'class' => 'btn btn-success btn-md',
					'div' => 'form-group text-center'
				]
			]
		];
		Cache::write($cachePath, $result, CAKE_THEME_CACHE_KEY_HELPERS);

		return $result;
	}
1195632
protected function getOptions()
	{
		$options = array();

		// Initialize some field attributes.
		$first = (int) $this->element['first'];
		$last = (int) $this->element['last'];
		$step = (int) $this->element['step'];

		// Sanity checks.
		if ($step == 0)
		{
			// Step of 0 will create an endless loop.
			return $options;
		}
		elseif ($first < $last && $step < 0)
		{
			// A negative step will never reach the last number.
			return $options;
		}
		elseif ($first > $last && $step > 0)
		{
			// A position step will never reach the last number.
			return $options;
		}
		elseif ($step < 0)
		{
			// Build the options array backwards.
			for ($i = $first; $i >= $last; $i += $step)
			{
				$options[] = HtmlSelect::option($i);
			}
		}
		else
		{
			// Build the options array.
			for ($i = $first; $i <= $last; $i += $step)
			{
				$options[] = HtmlSelect::option($i);
			}
		}

		// Merge any additional options in the XML definition.
		$options = array_merge(parent::getOptions(), $options);

		return $options;
	}