getModel(self :: MODEL); $locale = JFactory :: getLanguage() -> getTag(); $this -> itemId = JRequest :: getUInt('Itemid', 0); $this -> keyword = JRequest :: getString('keyword'); $this -> filters = array(); $country = JRequest :: getString('country'); if ($country != NULL) { $this -> filters['country'] = new JObject(); $this -> filters['country'] -> name = 'country'; $this -> filters['country'] -> value = $country; } $this -> page = JRequest :: getUInt('page', self :: DEFAULT_PAGE); $this -> size = JRequest :: getUInt('size', self :: DEFAULT_SIZE); if ($this -> keyword == NULL) $this -> statistics = $model -> getPeopleStatistics($locale); else { JView :: loadHelper('PiwikHelper'); PiwikHelper :: logPageView('searchPeople', 'keyword=' . urlencode($this -> keyword) . '&country=' . urlencode($country) . '&page=' . urlencode($this -> page) . '&size=' . urlencode($this -> size) . '&locale=' . urlencode($locale)); $this -> result = $model -> searchPeople($this -> keyword, $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++; } } if (count($errors = $this -> get('Errors')) > 0) { JLog :: add('Error viewing searchpeople: ' . implode("\n", $errors), JLog :: ERROR, self :: LOG); return FALSE; } parent :: display($template); } }