getTag(); $model = $this -> getModel(self :: MODEL); $this -> statistics = $model -> getPeopleStatistics($locale); $input = JFactory :: getApplication() -> input; $this -> itemId = JRequest :: getUInt('Itemid', 0); $this -> keywords = $this -> getParameter('keyword'); $this -> fields = $this -> getParameter('field'); $this -> constraints = $this -> getParameter('constraint'); $this -> countries = $this -> getParameter('country'); $this -> filters = array(); $country = JRequest :: getString('countryFilter'); if ($country != NULL) { $this -> filters['countryFilter'] = new JObject(); $this -> filters['countryFilter'] -> name = 'countryFilter'; $this -> filters['countryFilter'] -> value = $country; } $this -> page = JRequest :: getUInt('page', self :: DEFAULT_PAGE); $this -> size = JRequest :: getUInt('size', self :: MIN_SIZE); if ((($this -> keywords != NULL) && ($this -> fields != NULL) && ($this -> constraints != NULL)) || ($this -> countries != NULL)) { JView :: loadHelper('PiwikHelper'); PiwikHelper :: logPageView('advancedSearchPeople', 'keywords=' . urlencode(implode(',', $this -> keywords)) . '&fields=' . urlencode(implode(',', $this -> fields)) . '&constraints=' . urlencode(implode(',', $this -> constraints)) . '&countries=' . urlencode(implode(',', $this -> countries)) . '&country=' . urlencode($country) . '&page=' . urlencode($this -> page) . '&size=' . urlencode($this -> size) . '&locale=' . urlencode($locale)); $this -> result = $model -> advancedSearchPeople($this -> keywords, $this -> fields, $this -> constraints, $this -> countries, $country, $this -> page, $this -> size, $locale); $this -> totalPages = ($this -> result == NULL) ? NULL : ceil($this -> result -> totalPeople / $this -> size); if ($this -> totalPages == NULL) $this -> totalPages = 1; $this -> pagingStart = $this -> page; $this -> pagingEnd = $this -> page; while (($this -> pagingEnd - $this -> pagingStart < self :: MAX_PAGES - 1) && (($this -> pagingStart != 1) || ($this -> pagingEnd != $this -> totalPages))) { if ($this -> pagingStart > 1) $this -> pagingStart --; if ($this -> pagingEnd < $this -> totalPages) $this -> pagingEnd++; } } else $this -> result = NULL; if (count($errors = $this -> get('Errors')) > 0) { JLog :: add('Error viewing advancedsearchpeople: ' . implode("\n", $errors), JLog :: ERROR, self :: LOG); return FALSE; } parent :: display($template); } private function getParameter($name) { $values = JFactory :: getApplication() -> input -> get($name, NULL, NULL); if ($values == NULL) $values = array(); else if (!is_array($values)) { $value = $values; $values = array(); $values[] = $value; } return $values; } }