Ejemplo n.º 1
0
 /**
  * Gets the search form controller response for this type.
  *
  * @see XenForo_Search_DataHandler_Abstract::getSearchFormControllerResponse()
  */
 public function getSearchFormControllerResponse(XenForo_ControllerPublic_Abstract $controller, XenForo_Input $input, array $viewParams)
 {
     $controller->getRouteMatch()->setSections('xengallery');
     $options = XenForo_Application::getOptions();
     if ($options->xengalleryOverrideStyle) {
         $controller->setViewStateChange('styleId', $options->xengalleryOverrideStyle);
     }
     $params = $input->filterSingle('c', XenForo_Input::ARRAY_SIMPLE);
     if (!empty($params['mediacat'])) {
         $viewParams['search']['categories'] = array_fill_keys(explode(' ', $params['mediacat']), true);
     } else {
         $viewParams['search']['categories'] = array();
     }
     $viewParams['categories'] = XenForo_Model::create('XenGallery_Model_Category')->getCategoryStructure();
     return $controller->responseView('XenGallery_ViewPublic_Search_Form_Media', 'xengallery_search_form_media', $viewParams);
 }