/**
     * Provides the values for the markers in the simple form template
     *
     * @return array	an array containing values for markers in the simple form template
     */
    public function execute()
    {
        $searchWord = '';
        $testSearchWord = t3lib_div::_GPmerged('tx_solr');
        if (trim($testSearchWord['q'])) {
            $searchWord = trim($this->parentPlugin->piVars['q']);
            $searchWord = t3lib_div::removeXSS($searchWord);
            $searchWord = htmlentities($searchWord, ENT_QUOTES, $GLOBALS['TSFE']->metaCharset);
        }
        $marker = array('action' => $this->cObj->getTypoLink_URL($this->parentPlugin->conf['search.']['targetPage']), 'action_id' => intval($this->parentPlugin->conf['search.']['targetPage']), 'action_language' => intval($GLOBALS['TSFE']->sys_page->sys_language_uid), 'action_language_parameter' => 'L', 'accept-charset' => $GLOBALS['TSFE']->metaCharset, 'q' => $searchWord);
        // TODO maybe move into a form modifier
        if ($this->parentPlugin->conf['suggest']) {
            $this->addSuggestStylesheets();
            $this->addSuggestJavascript();
            $marker['suggest_url'] = '<script type="text/javascript">
				/*<![CDATA[*/
				var tx_solr_suggestUrl = \'' . $this->getSuggestUrl() . '\';
				/*]]>*/
				</script>
			';
        }
        // hook to modify the search form
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['modifySearchForm'])) {
            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['modifySearchForm'] as $classReference) {
                $formModifier = t3lib_div::getUserObj($classReference);
                if ($formModifier instanceof tx_solr_FormModifier) {
                    $marker = $formModifier->modifyForm($marker, $this->parentPlugin->getTemplate());
                } else {
                    throw new InvalidArgumentException('Form modifier "' . $classReference . '" must implement the tx_solr_FormModifier interface.', 1262864703);
                }
            }
        }
        return $marker;
    }
 /**
  * Builds a web request object from the raw HTTP information and the configuration
  *
  * @return Tx_Extbase_MVC_Web_Request The web request as an object
  */
 public function build()
 {
     $parameters = t3lib_div::_GPmerged('tx_' . strtolower($this->extensionName) . '_' . strtolower($this->pluginName));
     if (is_string($parameters['controller']) && array_key_exists($parameters['controller'], $this->allowedControllerActions)) {
         $controllerName = filter_var($parameters['controller'], FILTER_SANITIZE_STRING);
         $allowedActions = $this->allowedControllerActions[$controllerName];
         if (is_string($parameters['action']) && is_array($allowedActions) && in_array($parameters['action'], $allowedActions)) {
             $actionName = filter_var($parameters['action'], FILTER_SANITIZE_STRING);
         } else {
             $actionName = $this->defaultActionName;
         }
     } else {
         $controllerName = $this->defaultControllerName;
         $actionName = $this->defaultActionName;
     }
     $request = t3lib_div::makeInstance('Tx_Extbase_MVC_Web_Request');
     $request->setPluginName($this->pluginName);
     $request->setControllerExtensionName($this->extensionName);
     $request->setControllerName($controllerName);
     $request->setControllerActionName($actionName);
     $request->setRequestURI(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'));
     $request->setBaseURI(t3lib_div::getIndpEnv('TYPO3_SITE_URL'));
     $request->setMethod(isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : NULL);
     if (is_string($parameters['format']) && strlen($parameters['format'])) {
         $request->setFormat(filter_var($parameters['format'], FILTER_SANITIZE_STRING));
     }
     foreach ($parameters as $argumentName => $argumentValue) {
         $request->setArgument($argumentName, $argumentValue);
     }
     return $request;
 }
 /**
  * Get the users last stored selection or processes an undo command
  *
  * @return	void
  */
 function initSelection_getStored_mergeSubmitted()
 {
     if (t3lib_div::_GP($this->paramPrefix . '_undo')) {
         $this->undoSelection();
         $this->hasChanged = true;
     } else {
         $this->setCurrentSelectionFromStored();
         if ($sel = t3lib_div::_GPmerged($this->paramStr)) {
             $oldSel = serialize($this->sel);
             $this->mergeSelection($sel);
             $this->storeCurrentSelectionAsUndo();
             $this->storeSelection();
             if ($oldSel != serialize($this->sel)) {
                 $this->hasChanged = true;
             }
         }
     }
 }
Exemplo n.º 4
0
 /**
  * Builds a web request object from the raw HTTP information and the configuration
  *
  * @return Tx_Extbase_MVC_Web_Request The web request as an object
  */
 public function build()
 {
     $this->loadDefaultValues();
     $pluginNamespace = Tx_Extbase_Utility_Extension::getPluginNamespace($this->extensionName, $this->pluginName);
     $parameters = t3lib_div::_GPmerged($pluginNamespace);
     if (is_string($parameters['controller']) && array_key_exists($parameters['controller'], $this->allowedControllerActions)) {
         $controllerName = filter_var($parameters['controller'], FILTER_SANITIZE_STRING);
     } elseif (!empty($this->defaultControllerName)) {
         $controllerName = $this->defaultControllerName;
     } else {
         throw new Tx_Extbase_MVC_Exception('The default controller can not be determined.<br />' . 'Please check for Tx_Extbase_Utility_Extension::configurePlugin() in your ext_localconf.php.', 1295479650);
     }
     $allowedActions = $this->allowedControllerActions[$controllerName];
     if (is_string($parameters['action']) && is_array($allowedActions) && in_array($parameters['action'], $allowedActions)) {
         $actionName = filter_var($parameters['action'], FILTER_SANITIZE_STRING);
     } elseif (!empty($this->defaultActionName)) {
         $actionName = $this->defaultActionName;
     } else {
         throw new Tx_Extbase_MVC_Exception('The default action can not be determined for controller "' . $controllerName . '".<br />' . 'Please check Tx_Extbase_Utility_Extension::configurePlugin() in your ext_localconf.php.', 1295479651);
     }
     $request = $this->objectManager->create('Tx_Extbase_MVC_Web_Request');
     $request->setPluginName($this->pluginName);
     $request->setControllerExtensionName($this->extensionName);
     $request->setControllerName($controllerName);
     $request->setControllerActionName($actionName);
     $request->setRequestURI(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'));
     $request->setBaseURI(t3lib_div::getIndpEnv('TYPO3_SITE_URL'));
     $request->setMethod(isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : NULL);
     if (is_string($parameters['format']) && strlen($parameters['format'])) {
         $request->setFormat(filter_var($parameters['format'], FILTER_SANITIZE_STRING));
     }
     foreach ($parameters as $argumentName => $argumentValue) {
         $request->setArgument($argumentName, $argumentValue);
     }
     return $request;
 }
 /**
  * Initializes the backend module by setting internal variables
  *
  * @return	void
  */
 function init()
 {
     global $TYPO3_CONF_VARS, $FILEMOUNTS;
     // name might be set from outside
     if (!$this->MCONF['name']) {
         $this->MCONF = $GLOBALS['MCONF'];
     }
     tx_dam::config_init();
     # tx_dam::config_setValue('setup.devel', '1');
     $this->defaultPid = tx_dam_db::getPid();
     $this->id = $this->defaultPid;
     // from parent::init();
     $this->CMD = t3lib_div::_GP('CMD');
     $this->perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
     $this->menuConfig();
     $this->handleExternalFunctionValue();
     // include the default language file
     $GLOBALS['LANG']->includeLLFile('EXT:dam/lib/locallang.xml');
     //
     // Get current folder
     //
     // tx_dam_folder could be set by GP or stored in module conf
     $SET = t3lib_div::_GP('SET');
     $this->path = $this->MOD_SETTINGS['tx_dam_folder'];
     // check if tx_dam_folder was set by GP which takes precedence, if not use command sent by navframe
     // order: GP (script), SLCMD (navframe), MOD_SETTINGS (stored)
     $SLCMD = t3lib_div::_GPmerged('SLCMD');
     if (!$SET['tx_dam_folder'] and is_array($SLCMD['SELECT']) and is_array($SLCMD['SELECT']['txdamFolder'])) {
         $this->path = tx_dam::path_makeRelative(key($SLCMD['SELECT']['txdamFolder']));
     }
     $this->checkOrSetPath();
     $this->pageinfo = t3lib_BEfunc::readPageAccess($this->defaultPid, $this->perms_clause);
     $this->calcPerms = $GLOBALS['BE_USER']->calcPerms($this->pageinfo);
     //
     // Detect and set forced single function and set params
     //
     // remove selection command from any params
     $this->addParams['SLCMD'] = '';
     $this->addParams['SET'] = '';
     // forced a module function?
     $forcedFunction = t3lib_div::_GP('forcedFunction');
     if ($this->MOD_MENU['function'][$forcedFunction]) {
         $this->forcedFunction = $forcedFunction;
         $this->addParams['forcedFunction'] = $this->forcedFunction;
         $this->handleExternalFunctionValue('function', $this->forcedFunction);
     }
     //
     // Init selection
     //
     $this->selection = t3lib_div::makeInstance('tx_dam_selectionQuery');
     $maxPages = $this->config_checkValueEnabled('browserMaxPages', 20);
     $this->MOD_SETTINGS['tx_dam_resultPointer'] = $this->selection->initPointer($this->MOD_SETTINGS['tx_dam_resultPointer'], $this->MOD_SETTINGS['tx_dam_resultsPerPage'], $maxPages);
     $this->selection->initSelection($this, $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dam']['selectionClasses'], 'tx_dam', 'tx_dam_select');
     $this->selection->initQueryGen();
     $this->selection->qg->initBESelect('tx_dam', tx_dam_db::getPidList());
     $this->selection->addFilemountsToQuerygen();
     // debug output
     if (tx_dam::config_getValue('setup.devel')) {
         $this->debugContent['MOD_SETTINGS'] = '<h4>MOD_SETTINGS</h4>' . t3lib_div::view_array($this->MOD_SETTINGS);
     }
     // BE Info output
     if (tx_dam::config_getValue('setup.devel') and t3lib_extMgm::isLoaded('cc_beinfo')) {
         require_once t3lib_extMgm::extPath('cc_beinfo') . 'class.tx_ccbeinfo.php';
         $beinfo = t3lib_div::makeInstance('tx_ccbeinfo');
         $beinfoContent = $beinfo->makeInfo($this);
         $this->debugContent['beinfo'] = '<h4>BE Info</h4>' . $beinfoContent;
     }
 }
 /**
  * Class Constructor (true constructor)
  * Initializes $this->piVars if $this->prefixId is set to any value
  * Will also set $this->LLkey based on the config.language setting.
  *
  * @return	void
  */
 function tslib_pibase()
 {
     // Setting piVars:
     if ($this->prefixId) {
         $this->piVars = t3lib_div::_GPmerged($this->prefixId);
         // cHash mode check
         // IMPORTANT FOR CACHED PLUGINS (USER cObject): As soon as you generate cached plugin output which depends on parameters (eg. seeing the details of a news item) you MUST check if a cHash value is set.
         // Background: The function call will check if a cHash parameter was sent with the URL because only if it was the page may be cached. If no cHash was found the function will simply disable caching to avoid unpredictable caching behaviour. In any case your plugin can generate the expected output and the only risk is that the content may not be cached. A missing cHash value is considered a mistake in the URL resulting from either URL manipulation, "realurl" "grayzones" etc. The problem is rare (more frequent with "realurl") but when it occurs it is very puzzling!
         if ($this->pi_checkCHash && count($this->piVars)) {
             $GLOBALS['TSFE']->reqCHash();
         }
     }
     if (!empty($GLOBALS['TSFE']->config['config']['language'])) {
         $this->LLkey = $GLOBALS['TSFE']->config['config']['language'];
         if (!empty($GLOBALS['TSFE']->config['config']['language_alt'])) {
             $this->altLLkey = $GLOBALS['TSFE']->config['config']['language_alt'];
         }
     }
 }
Exemplo n.º 7
0
 /**
  * Resolves the controller and action to use for current call.
  * This takes into account any function menu that has being called.
  *
  * @param string $module The name of the module
  * @return array The controller/action pair to use for current call
  */
 protected function resolveControllerAction($module)
 {
     $configuration = $GLOBALS['TBE_MODULES']['_configuration'][$module];
     $fallbackControllerAction = $this->getFallbackControllerAction($configuration);
     // Extract dispatcher settings from request
     $argumentPrefix = strtolower('tx_' . $configuration['extensionName'] . '_' . $configuration['name']);
     $dispatcherParameters = t3lib_div::_GPmerged($argumentPrefix);
     $dispatcherControllerAction = $this->getDispatcherControllerAction($configuration, $dispatcherParameters);
     // Extract module function settings from request
     $moduleFunctionControllerAction = $this->getModuleFunctionControllerAction($module, $fallbackControllerAction['controllerName']);
     // Dispatcher controller/action has precedence over default controller/action
     $controllerAction = t3lib_div::array_merge_recursive_overrule($fallbackControllerAction, $dispatcherControllerAction, FALSE, FALSE);
     // Module function controller/action has precedence
     $controllerAction = t3lib_div::array_merge_recursive_overrule($controllerAction, $moduleFunctionControllerAction, FALSE, FALSE);
     return $controllerAction;
 }
 /**
  * Initializes the backend module by setting internal variables, initializing the menu.
  *
  * @access public
  *
  * @return	void
  */
 public function __construct()
 {
     $GLOBALS['BE_USER']->modAccess($GLOBALS['MCONF'], 1);
     $GLOBALS['LANG']->includeLLFile('EXT:' . $this->extKey . '/modules/' . $this->modPath . 'locallang.xml');
     $this->setMOD_MENU();
     parent::init();
     $this->conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]);
     $this->pageInfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);
     $this->doc = t3lib_div::makeInstance('template');
     $this->doc->setModuleTemplate('EXT:' . $this->extKey . '/modules/' . $this->modPath . 'template.tmpl');
     $this->doc->getPageRenderer()->addCssFile(t3lib_extMgm::extRelPath($this->extKey) . 'res/backend.css');
     $this->doc->backPath = $GLOBALS['BACK_PATH'];
     $this->doc->bodyTagAdditions = 'class="ext-' . $this->extKey . '-modules"';
     $this->doc->form = '<form action="" method="post" enctype="multipart/form-data">';
     $this->data = t3lib_div::_GPmerged($this->prefixId);
 }
 /**
  * Clear cart after submit
  *
  * @param	string			$content: html content from powermail
  * @param	array			$conf: TypoScript from powermail
  * @param	array			$session: Values in session
  * @param	boolean			$ok: if captcha not failed
  * @param	object			$pObj: Parent object
  * @return	void
  */
 public function PM_SubmitLastOneHook($content, $conf, $session, $ok, $pObj)
 {
     $piVars = t3lib_div::_GPmerged('tx_powermail_pi1');
     $conf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_wtcart_pi1.'];
     if ($piVars['mailID'] == $conf['powermailContent.']['uid']) {
         // current content uid fits to given uid in constants
         $div = t3lib_div::makeInstance('tx_wtcart_div');
         // Create new instance for div functions
         $products = $div->removeAllProductsFromSession();
         // clear complete cart
     }
 }
Exemplo n.º 10
0
 /**
  * Gets the button to add a new category.
  *
  * @return	string		HTML representiation of the add category button
  */
 protected function getAddCategoryButton($table = 'tx_dam_cat')
 {
     global $BE_USER, $LANG, $BACK_PATH, $TCA, $TYPO3_CONF_VARS;
     $cmd = t3lib_div::_GPmerged('SLCMD');
     if (is_array($cmd['SELECT']['txdamCat'])) {
         $uid = intval(key($cmd['SELECT']['txdamCat']));
     }
     $sysfolder = t3lib_div::makeInstance('tx_dam_sysfolder');
     $sysfolderUid = $sysfolder->getPidList();
     $result = '<a href="' . $BACK_PATH . t3lib_extMgm::extRelPath('dam_catedit') . 'mod_cmd/index.php?CMD=tx_damcatedit_cmd_new&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . '&vC=' . $GLOBALS['BE_USER']->veriCode() . '&edit[' . $table . '][-' . $uid . ']=new&defVals[' . $table . '][parent_id]=' . $uid . '&defVals[' . $table . '][pid]=' . $this->backRef->id . '">';
     if (t3lib_div::int_from_ver(TYPO3_version) < 4004000) {
         $result .= '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/new_el.gif', 'width="11" height="12"') . ' alt="" />';
     } else {
         $result .= t3lib_iconWorks::getSpriteIcon('actions-document-new', array('title' => $LANG->sL('LLL:EXT:lang/locallang_core.xml:cm.createnew', 1)));
     }
     $result .= '</a>';
     return $result;
 }
 /**
  * Replaces a facet in a filter query.
  *
  * @param	string	$facetToReplace Facet filter to replace in the filter parameters
  * @return	array	Array of filter parameters
  */
 protected function replaceFacetAndEncodeFilterParameters($facetToReplace)
 {
     $resultParameters = t3lib_div::_GPmerged('tx_solr');
     // urlencode the array to get the original representation
     $filterParameters = array_values((array) array_map('urldecode', $resultParameters['filter']));
     $filterParameters = array_unique($filterParameters);
     // find the currently used option for this facet
     $indexToReplace = FALSE;
     foreach ($filterParameters as $key => $filter) {
         list($filterName, $filterValue) = explode(':', $filter);
         if ($filterName == $this->facetName) {
             $indexToReplace = $key;
             break;
         }
     }
     if ($indexToReplace !== FALSE) {
         // facet found, replace facet
         $filterParameters[$indexToReplace] = $facetToReplace;
     } else {
         // facet not found, add facet
         $filterParameters[] = $facetToReplace;
     }
     $filterParameters = array_map('urlencode', $filterParameters);
     return $filterParameters;
 }
Exemplo n.º 12
0
 /**
  * Generate the module's content
  *
  * @return	string	HTML of the module's main content
  */
 protected function getModuleContent()
 {
     $content = '';
     $sectionTitle = '';
     // Get submitted data
     $this->submittedData = t3lib_div::_GPmerged('tx_scheduler');
     // If a save command was submitted, handle saving now
     if ($this->CMD == 'save') {
         $previousCMD = t3lib_div::_GP('previousCMD');
         // First check the submitted data
         $result = $this->preprocessData();
         // If result is ok, proceed with saving
         if ($result) {
             $this->saveTask();
             // Unset command, so that default screen gets displayed
             unset($this->CMD);
             // Errors occurred
             // Go back to previous step
         } else {
             $this->CMD = $previousCMD;
         }
     }
     // Handle chosen action
     switch ((string) $this->MOD_SETTINGS['function']) {
         case 'scheduler':
             // Scheduler's main screen
             $content .= $this->executeTasks();
             // Execute chosen action
             switch ($this->CMD) {
                 case 'add':
                 case 'edit':
                     try {
                         // Try adding or editing
                         $content .= $this->editTask();
                         $sectionTitle = $GLOBALS['LANG']->getLL('action.' . $this->CMD);
                     } catch (Exception $e) {
                         // An exception may happen when the task to
                         // edit could not be found. In this case revert
                         // to displaying the list of tasks
                         // It can also happend when attempting to edit a running task
                         $content .= $this->listTasks();
                     }
                     break;
                 case 'delete':
                     $this->deleteTask();
                     $content .= $this->listTasks();
                     break;
                 case 'stop':
                     $this->stopTask();
                     $content .= $this->listTasks();
                     break;
                 case 'list':
                 default:
                     $content .= $this->listTasks();
                     break;
             }
             break;
         case 'check':
             // Setup check screen
             // TODO: move check to the report module
             $content .= $this->displayCheckScreen();
             break;
         case 'info':
             // Information screen
             $content .= $this->displayInfoScreen();
             break;
     }
     // Wrap the content in a section
     return $this->doc->section($sectionTitle, '<div class="tx_scheduler_mod1">' . $content . '</div>', 0, 1);
 }
 /**
  * Builds the URL to reset all options of a facet - removing all its applied
  * filters from a result set.
  *
  * @return string  Url to remove a facet
  */
 protected function buildResetFacetUrl()
 {
     $resetFacetUrl = '';
     $resultParameters = t3lib_div::_GPmerged('tx_solr');
     if (is_array($resultParameters['filter'])) {
         // urldecode the array to get the original representation
         $filterParameters = array_values((array) array_map('urldecode', $resultParameters['filter']));
         $filterParameters = array_unique($filterParameters);
         // find and remove all options for this facet
         foreach ($filterParameters as $key => $filter) {
             list($filterName, $filterValue) = explode(':', $filter);
             if ($filterName == $this->facetName) {
                 unset($filterParameters[$key]);
             }
         }
         $filterParameters = array_map('urlencode', $filterParameters);
         $resetFacetUrl = $this->queryLinkBuilder->getQueryUrl(array('filter' => $filterParameters));
     } else {
         $resetFacetUrl = $this->queryLinkBuilder->getQueryUrl();
     }
     return $resetFacetUrl;
 }
 /**
  * Liefert den aktuell angeforderten ExportTyp (string) oder false (boolean)
  *
  * @return string|boolean
  */
 public function getCurrentExportType()
 {
     $parameters = t3lib_div::_GPmerged('mklib');
     if (empty($parameters['export'])) {
         return FALSE;
     }
     // den Typ des Exports auslesen;
     $type = reset(array_keys($parameters['export']));
     $types = $this->getExportTypes();
     if (!in_array($type, $types)) {
         return FALSE;
     }
     return $type;
 }
 /**
  * Rendering
  * Called in SC_browse_links::main() when isValid() returns true;
  *
  * @param	string		$type Type: "file", ...
  * @param	object		$pObj Parent object.
  * @return	string		Rendered content
  * @see SC_browse_links::main()
  */
 function render($type, &$pObj)
 {
     global $LANG, $BE_USER;
     $this->pObj =& $pObj;
     $pObj->browser =& $this;
     $this->renderInit();
     $content = '';
     $debug = false;
     switch ((string) $type) {
         case 'rte':
             $content = $this->main_rte();
             break;
         case 'db':
         case 'file':
             $content = $this->main();
             break;
         default:
             $content .= '<h3>ERROR</h3>';
             $content .= '<h3>Unknown or missing mode!</h3>';
             $debug = true;
             break;
     }
     // debug output
     if ($debug or tx_dam::config_getValue('setup.devel')) {
         $bparams = explode('|', $this->bparams);
         $debugArr = array('act' => $this->act, 'mode' => $this->mode, 'thisScript' => $this->thisScript, 'bparams' => $bparams, 'allowedTables' => $this->allowedTables, 'allowedFileTypes' => $this->allowedFileTypes, 'disallowedFileTypes' => $this->disallowedFileTypes, 'addParams' => $this->addParams, 'pointer' => $this->damSC->selection->pointer->page, 'SLCMD' => t3lib_div::_GPmerged('SLCMD'), 'Selection' => $this->damSC->selection->sl->sel, 'Query' => $this->damSC->selection->qg->query, 'QueryArray' => $this->damSC->selection->qg->getQueryParts(), 'PM' => t3lib_div::_GPmerged('PM'));
         $this->damSC->debugContent['browse_links'] = '<h4>EB SETTINGS</h4>' . t3lib_div::view_array($debugArr);
         $dbgContent = '<div class="debugContent">' . implode('', $this->damSC->debugContent) . '</div>';
         $content .= $this->damSC->buttonToggleDisplay('debug', 'Debug output', $dbgContent);
     }
     return $content;
 }
Exemplo n.º 16
0
 /**
  * Replaces a facet option in a filter query.
  *
  * @return array Array of filter parameters
  */
 protected function replaceFacetAndEncodeFilterParameters()
 {
     $resultParameters = t3lib_div::_GPmerged('tx_solr');
     $filterParameters = array();
     $indexToReplace = FALSE;
     if (isset($resultParameters['filter'])) {
         // urlencode the array to get the original representation
         $filterParameters = array_values((array) array_map('urldecode', $resultParameters['filter']));
         $filterParameters = array_unique($filterParameters);
         // find the currently used option for this facet
         foreach ($filterParameters as $key => $filter) {
             list($filterName, $filterValue) = explode(':', $filter);
             if ($filterName == $this->facetName) {
                 $indexToReplace = $key;
                 break;
             }
         }
     }
     if ($indexToReplace !== FALSE) {
         // facet found, replace facet
         // move facet to the end of the uri so it may be manipulated using JavaScript
         unset($filterParameters[$indexToReplace]);
         $filterParameters[$indexToReplace] = $this->facetName . ':' . $this->facetOption->getUrlValue();
     } else {
         // facet not found, add facet
         $filterParameters[] = $this->facetName . ':' . $this->facetOption->getUrlValue();
     }
     $filterParameters = array_map('urlencode', $filterParameters);
     return $filterParameters;
 }