示例#1
0
 public function AvailableList($show_options = true)
 {
     global $langmessage, $config;
     //search settings
     $this->searchPerPage = 10;
     $this->searchOrderOptions = array();
     $this->searchOrderOptions['modified'] = $langmessage['Recently Updated'];
     $this->searchOrderOptions['rating_score'] = $langmessage['Highest Rated'];
     $this->searchOrderOptions['downloads'] = $langmessage['Most Downloaded'];
     $this->SearchOrder();
     $this->SortAvailable();
     // pagination
     $this->searchMax = count($this->avail_addons);
     $this->searchPage = \gp\special\Search::ReqPage('page', $this->searchMax);
     $start = $this->searchPage * $this->searchPerPage;
     $possible = array_slice($this->avail_addons, $start, $this->searchPerPage, true);
     if ($show_options) {
         $this->SearchOptions();
         echo '<hr/>';
     }
     // show themes
     echo '<div id="gp_avail_themes">';
     foreach ($possible as $theme_id => $info) {
         $this->AvailableTheme($theme_id, $info, $show_options);
     }
     echo '</div>';
     if ($show_options) {
         $this->SearchNavLinks();
     }
 }
示例#2
0
 public function SearchNavLinks()
 {
     $pages = ceil($this->searchMax / $this->searchPerPage);
     echo '<div class="search_pages">';
     \gp\special\Search::PaginationLinks($this->searchPage, $pages, $this->searchUrl, $this->searchQuery, 'page');
     echo '</div>';
 }