Sets Site Search keyword/category parameter names, to be used on websites which have not specified these values
Expects Comma separated list of query params names

@param string
@param string
@return bool
339766
public function setGlobalSearchParameters($searchKeywordParameters, $searchCategoryParameters)
    {
        Piwik::checkUserHasSuperUserAccess();
        Option::set(self::OPTION_SEARCH_KEYWORD_QUERY_PARAMETERS_GLOBAL, $searchKeywordParameters);
        Option::set(self::OPTION_SEARCH_CATEGORY_QUERY_PARAMETERS_GLOBAL, $searchCategoryParameters);
        Cache::deleteTrackerCache();
        return true;
    }
158437
private CmsGallerySearchParameters prepareSearchParams(CmsGallerySearchBean searchData) {

        // create a new search parameter object
        CmsGallerySearchParameters params = new CmsGallerySearchParameters();
        CmsObject cms = getCmsObject();

        // set the selected types to the parameters
        if (searchData.getServerSearchTypes() != null) {
            params.setResourceTypes(searchData.getServerSearchTypes());
        }

        // set the selected galleries to the parameters
        if (searchData.getGalleries() != null) {
            List<String> paramGalleries = new ArrayList<String>();
            for (String gallerySitePath : searchData.getGalleries()) {
                paramGalleries.add(cms.getRequestContext().addSiteRoot(gallerySitePath));
            }
            params.setGalleries(paramGalleries);
        }

        // set the sort order for the galleries to the parameters
        CmsGallerySearchParameters.CmsGallerySortParam sortOrder;
        String temp = searchData.getSortOrder();
        try {
            sortOrder = CmsGallerySearchParameters.CmsGallerySortParam.valueOf(temp);
        } catch (Exception e) {
            sortOrder = CmsGallerySearchParameters.CmsGallerySortParam.DEFAULT;
        }
        params.setSortOrder(sortOrder);
        if (searchData.getScope() == null) {
            params.setScope(OpenCms.getWorkplaceManager().getGalleryDefaultScope());
        } else {
            params.setScope(searchData.getScope());
        }
        params.setReferencePath(searchData.getReferencePath());

        // set the selected folders to the parameters
        params.setFolders(new ArrayList<String>(searchData.getFolders()));

        // set the categories to the parameters
        if (searchData.getCategories() != null) {
            params.setCategories(searchData.getCategories());
        }

        // set the search query to the parameters
        if (!CmsStringUtil.isEmptyOrWhitespaceOnly(searchData.getQuery())) {
            params.setSearchWords(searchData.getQuery());
        }

        // set the result page to the parameters
        int page = searchData.getPage();
        params.setResultPage(page);

        // set the locale to the parameters
        String locale = searchData.getLocale();
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(locale)) {
            locale = getCmsObject().getRequestContext().getLocale().toString();
        }
        params.setSearchLocale(locale);

        // set the matches per page to the parameters
        params.setMatchesPerPage(searchData.getMatchesPerPage());

        // get the date range input
        long dateCreatedStart = searchData.getDateCreatedStart();
        long dateCreatedEnd = searchData.getDateCreatedEnd();
        long dateModifiedStart = searchData.getDateModifiedStart();
        long dateModifiedEnd = searchData.getDateModifiedEnd();

        // set the date created range to the parameters
        if ((dateCreatedStart != -1L) && (dateCreatedEnd != -1L)) {
            params.setDateCreatedTimeRange(dateCreatedStart, dateCreatedEnd);
        } else if (dateCreatedStart != -1L) {
            params.setDateCreatedTimeRange(dateCreatedStart, Long.MAX_VALUE);
        } else if (dateCreatedEnd != -1L) {
            params.setDateCreatedTimeRange(Long.MIN_VALUE, dateCreatedEnd);
        }

        // set the date modified range to the parameters
        if ((dateModifiedStart != -1L) && (dateModifiedEnd != -1L)) {
            params.setDateLastModifiedTimeRange(dateModifiedStart, dateModifiedEnd);
        } else if (dateModifiedStart != -1L) {
            params.setDateLastModifiedTimeRange(dateModifiedStart, Long.MAX_VALUE);
        } else if (dateModifiedEnd != -1L) {
            params.setDateLastModifiedTimeRange(Long.MIN_VALUE, dateModifiedEnd);
        }
        params.setIgnoreSearchExclude(searchData.isIgnoreSearchExclude());
        if (GalleryMode.ade.equals(searchData.getGalleryMode())) {
            if (searchData.getTypes().isEmpty() || !Collections.disjoint(FUNCTION_TYPES, searchData.getTypes())) {
                CmsADEConfigData config = OpenCms.getADEManager().lookupConfiguration(
                    cms,
                    cms.getRequestContext().addSiteRoot(searchData.getReferencePath()));
                // in case a restricted set of functions is configured, remove all other functions
                params.setAllowedFunctions(config.getDynamicFunctions());
            }
        }
        return params;
    }
430866
public function setMetaTags($keywords = null, $description = null)
    {
        if (empty($keywords)) {
            $keywords = $this->module->podiumConfig->get('meta_keywords');
        }
        if ($keywords) {
            $this->getView()->registerMetaTag([
                'name' => 'keywords',
                'content' => $keywords
            ]);
        }
        if (empty($description)) {
            $description = $this->module->podiumConfig->get('meta_description');
        }
        if ($description) {
            $this->getView()->registerMetaTag([
                'name' => 'description',
                'content' => $description
            ]);
        }
    }
843685
function setSearch(uri) {
  if (typeof uri.search === 'string' || uri.query === undefined) return;

  if (typeof uri.query === 'string') {
    uri.search = '?' + uri.query;
    return;
  }

  var name, filled = false;
  uri.search = '?';

  for (name in uri.query) {
    filled = true;
    uri.search += name + '=' + uri.query[name] + '&';
  }

  uri.search = uri.search.substr(0, uri.search.length - 1);
}
668154
public function setWebsite($website)
	{
		$pattern = '#^([a-z]+://)?[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)+(:[0-9]+)?(/.*)?$#';

		if( $website !== '' && preg_match( $pattern, $website ) !== 1 ) {
			throw new \Exception( sprintf( 'Invalid web site URL "%1$s"', $website ) );
		}

		$this->website = (string) $website;
	}
1185777
public function recommendedFor($query)
    {
        $requestOptions = [
            'scope' => 'pins',
            'query' => $query,
        ];

        $result = $this->get(UrlBuilder::RESOURCE_SEARCH, $requestOptions);

        return empty($result) ? [] : $this->getKeywordsFromRequest($result);
    }
700521
private function _setParams()
	{
		foreach ($_GET as $key => $value) {
			$this->_params[$key] = $this->_sanitize($value);
		}

		foreach ($_POST as $key => $value) {
			$_POST[$key] = $this->_sanitize($value);
		}

		$nbElements = count($this->_requestVars);
		if ($nbElements > 3) {
			$i = 2;
			while ($i < $nbElements and $i + 1 < $nbElements) {
				if (ctype_digit($this->_requestVars[$i])) {
					$i += 2;
					continue;
				}

				$this->_params[$this->_requestVars[$i]] = $this->_sanitize($this->_requestVars[$i + 1]);
				$i += 2;
			}
		}

		if ($nbElements > 2) {
			$i = 2;
			while ($i < $nbElements) {
				$this->_params[$i - 2] = $this->_sanitize($this->_requestVars[$i]);
				$i++;
			}
		}

		return $this;
	}
434621
function buildHTTPGetQuery( $request, $queryParams )
    {
        foreach ( $queryParams as $name => $value )
        {
            if ( is_array( $value ) )
            {
                foreach ( $value as $valueKey => $valuePart )
                {
                    $encodedQueryParams[] = urlencode( $name ) . '=' . urlencode( $valuePart );
                }
            }
            else
            {
                $encodedQueryParams[] = urlencode( $name ) . '=' . urlencode( $value );
            }
        }

        return $this->SearchServerURI . $request . '?' . implode( '&', $encodedQueryParams );
    }
1304723
public void setQuery( String query )
    {
        _parameters = null;

        if ( query == null || query.length() == 0 ) { return; }

        for ( StringTokenizer tok = new StringTokenizer( query, "&" ); tok.hasMoreElements(); )
        {
            String queryItem = tok.nextToken();

            if ( queryItem.startsWith( "amp;" ) )
            {
                queryItem = queryItem.substring( 4 );
            }

            int eq = queryItem.indexOf( '=' );
            if ( eq != -1 )
            {
                addParameter( queryItem.substring( 0, eq ) , queryItem.substring( eq + 1 ), true );
            }
            else
            {
                addParameter( queryItem, null, true );
            }
        }
    }
1336004
public function setKeywords($keywords)
    {
        if (!empty($keywords)) {
            Yii::$app->view->registerMetaTag(['name' => 'keywords', 'content' => $keywords], 'keywords');
        }
        return $this;
    }
710461
protected function setSeoTags()
    {
        global $APPLICATION;

        if ($this->arParams['SET_SEO_TAGS'] !== 'Y')
        {
            return false;
        }

        if ($this->arResult['SEO_TAGS']['TITLE'])
        {
            $APPLICATION->SetPageProperty('title', $this->arResult['SEO_TAGS']['TITLE']);
        }

        if ($this->arResult['SEO_TAGS']['DESCRIPTION'])
        {
            $APPLICATION->SetPageProperty('description', $this->arResult['SEO_TAGS']['DESCRIPTION']);
        }

        if ($this->arResult['SEO_TAGS']['KEYWORDS'])
        {
            $APPLICATION->SetPageProperty('keywords', $this->arResult['SEO_TAGS']['KEYWORDS']);
        }
    }
754700
public function setCustomParam($key, $value) {
        if ($this->searchParams->customParam == null) {
            $this->searchParams->customParam = array();
        }

        $this->searchParams->customParam[$key] = $value;
    }
153015
private function _setParams($value, $params)
    {
        $strFinal = $value;
        $key = '';
        for ($i = 0; $i < strlen($strFinal); $i++) {
            if ($strFinal[$i] == ':') { // 1º
                $_a = $i + 1;
                for ($j = $_a; $j < strlen($strFinal); $j++) {
                    $isLastOne = ($j == strlen($strFinal) - 1);
                    if (in_array($strFinal[$j],
                            [
                                ' ',
                                ',',
                                '\\',
                                '\'',
                                '"'
                            ]) || $isLastOne
                    ) { // 2º
                        $_b = $j;
                        $_b = ($isLastOne) ? $_b + 1 : $_b;
                        $key = substr($strFinal, $_a, $_b - $_a);
                        $i = $_b;
                        break;
                    }
                }

                // We found the key
                if (isset($params[$key])) {
                    $langKey = $params[$key];
                    $strFinalA = substr($strFinal, 0, $_a - 1);
                    $strFinalB = substr($strFinal, $_b);
                    $strFinal = $strFinalA . $langKey . $strFinalB;
                }
            }
        }
        return $strFinal;
    }
1225225
public void setSearchCategory(String searchCategory){
        if (searchCategory != null && getSearchQuery() == null){
            throw new IllegalStateException("SearchQuery must be set before SearchCategory can be set.");
        }
        setParameter(SEARCH_CATEGORY, searchCategory);
    }
1257682
protected function prepareQueryString($queryParameters)
    {
        unset($queryParameters[self::PARAMETER_PAGE]);
        $queryParameters[self::PARAMETER_PAGE] = '';

        return '?' . http_build_query($queryParameters);
    }
241499
public function setQueryString($query_string = [])
    {
        if (!is_array($query_string) && is_string($query_string)) {
            $query_string = parse_str($query_string);
        }
        if (count($query_string) == 0) {
            $this->query_string = [];
        } else {
            $this->query_string = $query_string;
        }
    }
1373667
private function processParameters()
    {
        $parameters = $this->parameters;
        $string = $this->query;

        $string = str_replace('[:', '[;;', $string);

        $parameters = array_filter($parameters, function ($value) use (& $parameters, & $string)
        {
            $key = key($parameters);
            next($parameters);

            if (is_numeric($value))
            {
                $string = str_replace(":$key", $value, $string);
                return false;
            }

            else
            {
                $string = str_replace(":$key", '{' . $key . '}', $string);
                return true;
            }
        });

        $string = str_replace('[;;', '[:', $string);

        $this->query = $string;
        return $parameters;
    }