Example #1
0
File: Index.php Project: acp3/cms
 /**
  * @param array $formData
  * @return array
  */
 protected function prepareFormData(array $formData)
 {
     if (isset($formData['search_term']) === true) {
         if (isset($formData['mods']) === false) {
             $modules = $this->searchHelpers->getModules();
             $formData['mods'] = [];
             foreach ($modules as $row) {
                 $formData['mods'][] = $row['dir'];
             }
         }
         if (isset($formData['area']) === false) {
             $formData['area'] = 'title_content';
         }
         if (isset($formData['sort']) === false) {
             $formData['sort'] = 'asc';
         }
     }
     return $formData;
 }
Example #2
0
File: Index.php Project: acp3/cms
 /**
  * @return array
  */
 public function execute()
 {
     $this->setCacheResponseCacheable($this->config->getSettings(Schema::MODULE_NAME)['cache_lifetime']);
     return ['search_mods' => $this->searchHelpers->getModules()];
 }