/** * Load Search Panels * @param array $panels * @return void */ public function loadPanels($panels = array()) { // Panel List $this->list = array(); // Build Panels $this->panels = array(); // Default Panels $defaults = IDX_Panel::defaults(); // Search Panels $panels = is_array($panels) && !empty($panels) ? $panels : $defaults; foreach ($panels as $id => $panel) { if (is_array($panel)) { $panel = $this->loadPanel($id, $panel); } if ($panel instanceof IDX_Panel && $panel->isAvailable()) { $this->panels[$panel->getId()] = $panel; } } // Default Panels foreach ($defaults as $id => $panel) { $panel = $this->loadPanel($id, array_merge($panel, array('display' => false))); if ($panel instanceof IDX_Panel && $panel->isAvailable()) { // Add to List $this->list[$panel->getId()] = array('title' => $panel->getTitle()); // Add to Panels if (!isset($this->panels[$panel->getId()])) { $this->panels[$panel->getId()] = $panel; } } } // Remove Map Panels if (empty($this->map) || empty(Settings::getInstance()->MODULES['REW_IDX_MAPPING'])) { unset($this->panels['bounds']); unset($this->panels['radius']); unset($this->panels['polygon']); } }
if (empty($search)) { $search = $db->fetch("SELECT *, `search_panels` AS `panels` FROM `rewidx_quicksearch` WHERE `agent` = " . $db->quote(Settings::getInstance()->SETTINGS['agent']) . " AND `idx` = '';"); } } else { // Load idx defaults for current feed $search = $db->fetch("SELECT * FROM `rewidx_defaults` WHERE `idx` IN (" . $db->quote(Settings::getInstance()->IDX_FEED) . ", '') ORDER BY `idx` DESC LIMIT 1;"); } } // Search Panels if (!empty($search['panels'])) { $panels = unserialize($search['panels']); } // Search Panels if (empty($panels)) { // Default Panels $panels = IDX_Panel::defaults(); } // Search Split if (!empty($search['split'])) { $before = $panels; } // Append Missing Panels IDX_Panel::displayMissing($panels, $_REQUEST); // Force Map Panels on Map Search if ($_GET['load_page'] == 'search_map') { $panels = array_merge_recursive(array('polygon' => array('display' => true), 'radius' => array('display' => true), 'bounds' => array('display' => true)), $panels); } else { // Set Panels as Hidden if (!empty($panels['polygon'])) { $panels['polygon']['hidden'] = true; }