Beispiel #1
0
 /**
  * Provides the values for the markers in the simple form template
  *
  * @return array An array containing values for markers in the simple form template
  * @throws InvalidArgumentException if an registered form modifier fails to implement the required interface Tx_Solr_FormModifier
  */
 public function execute()
 {
     $url = $this->cObj->getTypoLink_URL($this->parentPlugin->conf['search.']['targetPage']);
     $marker = array('action' => htmlspecialchars($url), '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' => $this->parentPlugin->getCleanUserQuery());
     // 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 = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($classReference);
             if ($formModifier instanceof Tx_Solr_FormModifier) {
                 if ($formModifier instanceof Tx_Solr_CommandPluginAware) {
                     $formModifier->setParentPlugin($this->parentPlugin);
                 }
                 $marker = $formModifier->modifyForm($marker, $this->parentPlugin->getTemplate());
             } else {
                 throw new InvalidArgumentException('Form modifier "' . $classReference . '" must implement the Tx_Solr_FormModifier interface.', 1262864703);
             }
         }
     }
     return $marker;
 }