Get JS options

@param Garp_Browsebox $box
@return Garp_Util_Configuration
18896
protected function _getJavascriptOptions(Garp_Browsebox $box) {
        $options = $box->getJavascriptOptions();
        $options = $options instanceof Garp_Util_Configuration ?
            $options :
            new Garp_Util_Configuration($options);
        return $options->setDefault('rememberState', false)
            ->setDefault('transition', 'crossFade');
    }
1313338
public function getJS($method) {
        $array_js = parent::getJS($method);
		$select_js1 = JS::getPath("11-ui.multiselect.js");
		$select_js2 = JS::getPath("12-ui-multiselect-es.js");
		$array_js[] = $select_js1;
		$array_js[] = $select_js2;
		return $array_js;
	}
1139747
public function fetchResults(Zend_Db_Select $select, Garp_Browsebox $browsebox) {
        if (!empty($this->_params)) {
            $model = new $this->_config['model']();
            $bindingOptions = $this->_config['bindingOptions'];
            $bindingOptions['modelClass'] = get_class($browsebox->getModel());
            $bindingOptions['conditions'] = $select;

            $model->bindModel('__related__', $bindingOptions);
            $record = $model->find($this->_params)->current();
            $model->unbindModel('__related__');

            return $record->__related__;
        } else {
            throw new Garp_Browsebox_Filter_Exception_NotApplicable();
        }
    }
4881
protected function getOptions()
    {
        $options = array();

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

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

        reset($options);

        return $options;
    }
1053800
public function getSearchboxContent()
    {
        // set page = 1 for every new search
        $pageValue = 1;
        $this->fluidTemplateVariables['page'] = $pageValue;

        // searchword input value
        $searchString = $this->piVars['sword'];

        $searchboxDefaultValue = LocalizationUtility::translate(
            'LLL:EXT:ke_search/Resources/Private/Language/locallang_searchbox.xml:searchbox_default_value',
            'KeSearch'
        );

        if (!empty($searchString) && $searchString != $searchboxDefaultValue) {
            $this->swordValue = $searchString;
        } else {
            $this->swordValue = '';
        }

        $this->fluidTemplateVariables['searchword'] = htmlspecialchars($this->swordValue);
        $this->fluidTemplateVariables['searchwordDefault'] = $searchboxDefaultValue;
        $this->fluidTemplateVariables['sortByField'] = $this->piVars['sortByField'];
        $this->fluidTemplateVariables['sortByDir'] = $this->piVars['sortByDir'];

        // get filters
        $renderedFilters = $this->renderFilters();
        $this->fluidTemplateVariables['filter'] = $renderedFilters;

        // set form action pid
        $this->fluidTemplateVariables['targetpage'] = $this->conf['resultPage'];

        // set form action
        $siteUrl = GeneralUtility::getIndpEnv('TYPO3_SITE_URL');
        $lParam = GeneralUtility::_GET('L');
        $mpParam = GeneralUtility::_GET('MP');
        $typeParam = GeneralUtility::_GP('type');
        $actionUrl = $siteUrl . 'index.php';
        $this->fluidTemplateVariables['actionUrl'] = $actionUrl;

        // language parameter
        if (isset($lParam)) {
            $hiddenFieldValue = intval($lParam);
            $this->fluidTemplateVariables['lparam'] = $hiddenFieldValue;
        }

        // mountpoint parameter
        if (isset($mpParam)) {
            // the only allowed characters in the MP parameter are digits and , and -
            $hiddenFieldValue = preg_replace('/[^0-9,-]/', '', $mpParam);
            $this->fluidTemplateVariables['mpparam'] = $hiddenFieldValue;
        }

        // type param
        if ($typeParam) {
            $hiddenFieldValue = intval($typeParam);
            $this->fluidTemplateVariables['typeparam'] = $hiddenFieldValue;
        }

        // set reset link
        unset($linkconf);
        $linkconf['parameter'] = $this->conf['resultPage'];
        $resetUrl = $this->cObj->typoLink_URL($linkconf);
        $this->fluidTemplateVariables['resetUrl'] = $resetUrl;
    }
433583
function getSourceBBox(linkView, opt) {

        // expand by padding box
        if (opt && opt.paddingBox) return linkView.sourceBBox.clone().moveAndExpand(opt.paddingBox);

        return linkView.sourceBBox.clone();
    }
1266048
protected function getTreeOptionsFromRequest($options = [])
    {
        $options = array_merge([
            'subclasses' => true,
            'instances' => true,
            'highlightUri' => '',
            'chunk' => false,
            'offset' => 0,
            'limit' => 0
        ], $options);

        if ($this->hasRequestParameter('loadNode')) {
            $options['uniqueNode'] = $this->getRequestParameter('loadNode');
        }

        if ($this->hasRequestParameter("selected")) {
            $options['browse'] = array($this->getRequestParameter("selected"));
        }

        if ($this->hasRequestParameter('hideInstances')) {
            if((bool) $this->getRequestParameter('hideInstances')) {
                $options['instances'] = false;
            }
        }
        if ($this->hasRequestParameter('classUri')) {
            $options['class'] = $this->getCurrentClass();
            $options['chunk'] = !$options['class']->equals($this->getRootClass());
        } else {
            $options['class'] = $this->getRootClass();
        }

        if ($this->hasRequestParameter('offset')) {
            $options['offset'] = $this->getRequestParameter('offset');
        }

        if ($this->hasRequestParameter('limit')) {
            $options['limit'] = $this->getRequestParameter('limit');
        }

        if ($this->hasRequestParameter('order')) {
            $options['order'] = tao_helpers_Uri::decode($this->getRequestParameter('order'));
        }

        if ($this->hasRequestParameter('orderdir')) {
            $options['orderdir'] = $this->getRequestParameter('orderdir');
        }
        return $options;
    }
423292
public static function get($mbox, $utf7imap = false)
    {
        return ($mbox instanceof Horde_Imap_Client_Mailbox)
            ? $mbox
            : new Horde_Imap_Client_Mailbox($mbox, $utf7imap);
    }
848222
protected function getOptions()
	{
		// Initialize variables.
		$options = array();

		foreach ($this->element->children() as $option)
		{
			// Only add <option /> elements.
			if ($option->getName() != 'option')
			{
				continue;
			}

			$label = (isset($option[0]) ? $option[0] : $option['label']);

			// Create a new option object based on the <option /> element.
			$tmp = Dropdown::option(
				(string) $option['value'], trim((string) $label), 'value', 'text',
				((string) $option['disabled'] == 'true')
			);
			foreach ($option->attributes() as $index => $value)
			{
				$dataCheck = strtolower(substr($index, 0, 4));
				if ($dataCheck == 'data')
				{
					$tmp->$index = (string) $value;
				}
			}

			// Set some option attributes.
			$tmp->class = (string) $option['class'];

			// Set some JavaScript option attributes.
			$tmp->onclick = (string) $option['onclick'];

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

		reset($options);

		return $options;
	}
598147
public function displaySearchBox()
    {
        $displaySearchBox = (bool)Configure::read('Settings.Cms.SEO.display-search-box');
        if ($displaySearchBox) {
            return '';
        }
        return $this->_render(self::ATTR_NAME, 'google', 'nositelinkssearchbox');
    }
468077
public function getCheckboxes(array $options=[]) {
		if(isset($options['choices']))
			$choices = $options['choices'];
		else
			$choices = $this->getChoices();

		$checkboxes = [];
		foreach($choices as $k=>$v) {
			$checkbox_options = $options;
			$checkbox_options['value'] = $k;
			$checkbox_options['widget_name'] = $v;
			$checkboxes[$k] = $this->getCheckbox($v, $checkbox_options);
		}
		return $checkboxes;
	}
1087352
function (group, opts) {
			if (!group) {
				return;
			}

			if (!$.isPlainObject(opts)) {
				opts = {};
			}

			// Close if already active
			if (false === F.close(true)) {
				return;
			}

			// Normalize group
			if (!$.isArray(group)) {
				group = isQuery(group) ? $(group).get() : [group];
			}

			// Recheck if the type of each element is `object` and set content type (image, ajax, etc)
			$.each(group, function(i, element) {
				var obj = {},
					href,
					title,
					content,
					type,
					rez,
					hrefParts,
					selector;

				if ($.type(element) === "object") {
					// Check if is DOM element
					if (element.nodeType) {
						element = $(element);
					}

					if (isQuery(element)) {
						obj = {
							href    : element.data('fancybox-href') || element.attr('href'),
							title   : element.data('fancybox-title') || element.attr('title'),
							isDom   : true,
							element : element
						};

						if ($.metadata) {
							$.extend(true, obj, element.metadata());
						}

					} else {
						obj = element;
					}
				}

				href  = opts.href  || obj.href || (isString(element) ? element : null);
				title = opts.title !== undefined ? opts.title : obj.title || '';

				content = opts.content || obj.content;
				type    = content ? 'html' : (opts.type  || obj.type);

				if (!type && obj.isDom) {
					type = element.data('fancybox-type');

					if (!type) {
						rez  = element.prop('class').match(/fancybox\.(\w+)/);
						type = rez ? rez[1] : null;
					}
				}

				if (isString(href)) {
					// Try to guess the content type
					if (!type) {
						if (F.isImage(href)) {
							type = 'image';

						} else if (F.isSWF(href)) {
							type = 'swf';

						} else if (href.charAt(0) === '#') {
							type = 'inline';

						} else if (isString(element)) {
							type    = 'html';
							content = element;
						}
					}

					// Split url into two pieces with source url and content selector, e.g,
					// "/mypage.html #my_id" will load "/mypage.html" and display element having id "my_id"
					if (type === 'ajax') {
						hrefParts = href.split(/\s+/, 2);
						href      = hrefParts.shift();
						selector  = hrefParts.shift();
					}
				}

				if (!content) {
					if (type === 'inline') {
						if (href) {
							content = $( isString(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href ); //strip for ie7

						} else if (obj.isDom) {
							content = element;
						}

					} else if (type === 'html') {
						content = href;

					} else if (!type && !href && obj.isDom) {
						type    = 'inline';
						content = element;
					}
				}

				$.extend(obj, {
					href     : href,
					type     : type,
					content  : content,
					title    : title,
					selector : selector
				});

				group[ i ] = obj;
			});

			// Extend the defaults
			F.opts = $.extend(true, {}, F.defaults, opts);

			// All options are merged recursive except keys
			if (opts.keys !== undefined) {
				F.opts.keys = opts.keys ? $.extend({}, F.defaults.keys, opts.keys) : false;
			}

			F.group = group;

			return F._start(F.opts.index);
		}
1209
public function getSuggestedValues($bas_id)
    {
        /** @var \databox $databox */
        $databox = $this->app->findDataboxById(\phrasea::sbasFromBas($this->app, $bas_id));
        $collection = \collection::getByBaseId($this->app, $bas_id);
        $structFields = $suggestedValues = $basePrefs = [];

        /** @var \databox_field $meta */
        foreach ($databox->get_meta_structure() as $meta) {
            if ($meta->is_readonly()) {
                continue;
            }

            $structFields[$meta->get_name()] = $meta;
        }

        if ($sxe = simplexml_load_string($collection->get_prefs())) {
            $z = $sxe->xpath('/baseprefs/sugestedValues');
            if ($z && is_array($z)) {
                $f = 0;
                foreach ($z[0] as $ki => $vi) {
                    if ($vi && isset($structFields[$ki])) {
                        foreach ($vi->value as $oneValue) {
                            $suggestedValues[] = [
                                'key'   => $ki,
                                'value' => $f,
                                'name'  => (string) $oneValue
                            ];
                            $f++;
                        }
                    }
                }
            }

            $z = $sxe->xpath('/baseprefs');
            if ($z && is_array($z)) {
                /**
                 * @var string $ki
                 * @var \SimpleXMLElement $vi
                 */
                foreach ($z[0] as $ki => $vi) {
                    $pref = ['status' => null, 'xml'    => null];

                    if ($ki == 'status') {
                        $pref['status'] = $vi;
                    } elseif ($ki != 'sugestedValues') {
                        $pref['xml'] = $vi->asXML();
                    }

                    $basePrefs[] = $pref;
                }
            }
        }

        return $this->render('admin/collection/suggested_value.html.twig', [
            'collection'      => $collection,
            'databox'         => $databox,
            'suggestedValues' => $suggestedValues,
            'structFields'    => $structFields,
            'basePrefs'       => $basePrefs,
        ]);
    }
350337
function meta_box_input( $post, $args )
	{
		// extract $args
		extract( $args );
		
		
		// classes
		$class = 'acf_postbox ' . $args['field_group']['options']['layout'];
		$toggle_class = 'acf_postbox-toggle';
		
		
		if( ! $args['show'] )
		{
			$class .= ' acf-hidden';
			$toggle_class .= ' acf-hidden';
		}
		
		
		// HTML
		if( $args['show'] )
		{
			$fields = apply_filters('acf/field_group/get_fields', array(), $args['field_group']['id']);
	
			do_action('acf/create_fields', $fields, $args['post_id']);
		}
		else
		{
			echo '<div class="acf-replace-with-fields"><div class="acf-loading"></div></div>';
		}
		
		
		// nonce
		echo '<div style="display:none">';
			echo '<input type="hidden" name="acf_nonce" value="' . wp_create_nonce( 'input' ) . '" />';
			?>
<script type="text/javascript">
(function($) {
	
	$('#<?php echo $id; ?>').addClass('<?php echo $class; ?>').removeClass('hide-if-js');
	$('#adv-settings label[for="<?php echo $id; ?>-hide"]').addClass('<?php echo $toggle_class; ?>');
	
})(jQuery);	
</script>
			<?php
		echo '</div>';
	}
1140351
private static function getSelectOptions($list, $selectedValue) {
        $result = '';

        if ($selectedValue !== null && !is_array($selectedValue)) {
            $selectedValue = array($selectedValue);
        }

        foreach ($list as $item) {
            $itemAttr = array();
            $text = '';

            if ($item instanceof SelectListItem) {
                $text = $item->text;
                $itemAttr['value'] = $item->value;

                if ($item->disabled === true) {
                    $itemAttr['disabled'] = 'disabled';
                }

                if ($selectedValue === null && $item->selected === true) {
                    $itemAttr['selected'] = 'selected';
                }
                elseif ($selectedValue !== null && in_array($item->value, $selectedValue) === true) {
                    $itemAttr['selected'] = 'selected';
                }
            }
            else {
                $text = $item;

                if ($selectedValue !== null && in_array($item, $selectedValue)) {
                    $itemAttr['selected'] = 'selected';
                }
            }

            $attr = self::buildAttributes($itemAttr);

            $result .= '<option' . (!empty($attr) ? ' ' : '') . $attr . '>';
            $result .= htmlspecialchars($text);
            $result .= '</option>';
        }

        return $result;
    }
1355408
public function setActiveMailbox($mailbox)
    {
        Argument::i()->test(1, 'string');

        if (!$this->socket) {
            $this->connect();
        }

        $response = $this->call('SELECT', $this->escape($mailbox));
        $result = array_pop($response);

        foreach ($response as $line) {
            if (strpos($line, 'EXISTS') !== false) {
                list($star, $this->total, $type) = explode(' ', $line, 3);
            } else if (strpos($line, 'UIDNEXT') !== false) {
                list($star, $ok, $next, $this->next, $type) = explode(' ', $line, 5);
                $this->next = substr($this->next, 0, -1);
            }

            if ($this->total && $this->next) {
                break;
            }
        }

        if (strpos($result, 'OK') !== false) {
            $this->mailbox = $mailbox;

            return $this;
        }

        return false;
    }
1132313
protected function getOptions()
	{
		$options = array();

		foreach ($this->element->children() as $option)
		{
			// Only add <option /> elements.
			if ($option->getName() != 'option')
			{
				continue;
			}

			// Create a new option object based on the <option /> element.
			$tmp = HtmlSelect::option(
				(string) $option['value'],
				Text::alt(trim((string) $option), preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)), 'value', 'text',
				((string) $option['disabled'] == 'true')
			);

			// Set some option attributes.
			$tmp->class = (string) $option['class'];

			// Set some JavaScript option attributes.
			$tmp->onclick = (string) $option['onclick'];

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

		reset($options);

		return $options;
	}