(Original Author) * Cameron Roy * Frederic Wenzel * Chris Pollett * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ ?> $key) { $applications[$key] = $app_prettynames[$name]; } if (!isset($appid)) { $appid = APP_ID; } $min_display_version_by_app = array( // eventually this information should be kept in DB APP_FIREFOX => "1.0", APP_THUNDERBIRD => "1.0", APP_SEAMONKEY => "1.0", APP_SUNBIRD => "0.2" ); $new_versions = array(); foreach ($app_shortnames as $n => $k) { // AmoVersions is from controller->beforeRender() if (!empty($AmoVersions[$k])) foreach ($AmoVersions[$k] as $version) { $versions_parts = explode(".", $version); $second_part = (isset($versions_parts[1])) ? ".".intval($versions_parts[1]) : ""; if (!isset($min_display_version_by_app[$k]) || $min_display_version_by_app[$k] <= $versions_parts[0].$second_part ) { if ($k != APP_FIREFOX || !in_array($versions_parts[0].$second_part, array('1.4','3.1'))) { // yuck. Baz didn't like FF 1.4. Nick didn't like FF 3.1. $new_versions[$k][] = $versions_parts[0].$second_part; } } } if (!empty($new_versions[$k])) $new_versions[$k] = array_unique($new_versions[$k]); } $versions = $new_versions; if(!isset($lver)) { $lver = ""; } if(!isset($hver)) { $hver = ""; } // AmoPlatforms is from controller->beforeRender() array_shift($AmoPlatforms); // get rid of PLATFORM_ALL $platforms = array_merge(array(PLATFORM_ANY => ___('Any', 'advanced_search_form_any_type')), $AmoPlatforms); //add semantically happy PLATFORM_ANY $pid = 0; if (isset($this->params['url']['pid']) && in_array($this->params['url']['pid'], array_keys($platforms))) { $pid = $this->params['url']['pid']; } // AmoAddonTypes is from controller->beforeRender() // for now we want to get rid of Plugin and Language packs since the former // goes to a static page and the latter is empty array_pop($AmoAddonTypes); array_pop($AmoAddonTypes); $addon_types = array_merge(array(ADDON_ANY => ___('Any', 'advanced_search_form_any_type')), $AmoAddonTypes); if (!isset($atype)) { $atype = ADDON_ANY; } $page_arr = $this->controller->Pagination->resultsPerPage; $pages = array(); foreach ($page_arr as $page) { $pages[$page] = $page; } if (!isset($pp)) { $pp = $this->controller->Pagination->show; } $updates = array( "" => ___('Any time'), '- INTERVAL 1 DAY' => ___('Past Day'), '- INTERVAL 1 WEEK' => ___('Past week'), '- INTERVAL 1 MONTH' => ___('Past month'), '- INTERVAL 3 MONTH' => ___('Past 3 months'), '- INTERVAL 6 MONTH' => ___('Past 6 months'), '- INTERVAL 1 YEAR' => ___('Past year') ); $lup = ""; if (isset($this->params['url']['lup']) && in_array($this->params['url']['lup'], array_keys($updates))) { $lup = $this->params['url']['lup']; } $sort_orders = array( '' => ___('Keyword Match'), 'newest' => ___('Newest', 'advanced_search_form_newest'), 'name' => ___('Name', 'advanced_search_form_name'), 'averagerating' => ___('Rating', 'advanced_search_form_rating'), 'weeklydownloads' => ___('Popularity', 'advanced_search_form_popularity') ); if (!isset($sort)) { $sort = ""; } // handles toggling advanced search form when JS not enabled $toggle_uri = $_SERVER['REQUEST_URI']; if (isset($this->params['url']['adv']) || isset($this->params['url']['as'])) { $toggle_uri = str_replace("adv=", "nor=", $toggle_uri); $toggle_uri = str_replace("as=", "nor=", $toggle_uri); $two_form = ""; } else { $toggle_uri = str_replace("nor=", "adv=", $toggle_uri); $delim = (stristr($toggle_uri,"?")) ? "&" : "?"; if(!stristr($toggle_uri, "adv=")) { $toggle_uri .= "{$delim}adv=true"; } $two_form = "
"; } $toggle_uri = htmlspecialchars($toggle_uri); // prepare query string if (!isset($query) || !is_string($query)) $query = ___('search for add-ons'); // prepare selected category, "all" if not set if (!isset($category)) $category = array(0, 0); ?>
">