2 /* shortlog.class.php - phpgitweb
3 * Copyright (C) 2011-2012 Philipp Kreil (pk910)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 private $page, $phpgitweb;
22 public function main($phpgitweb, $project) {
23 $this->phpgitweb = $phpgitweb;
24 $this->project = $project;
26 return new ContentProvider('main', 'err400');
27 $project['refs'] = $phpgitweb->get_project_loader()->getProjectRefs($project);
28 $phpgitweb->append_header_nav("shortlog", null, true);
29 $phpgitweb->append_title("shortlog");
30 CommitLoader::parse(true);
32 $this->page = new ContentProvider('shortlog', 'main');
33 if(strtolower(CommitLoader::$commit_base_id) != 'all') {
34 $this->page->set('refname', ' - '.CommitLoader::$commit_base_id);
36 $this->page->set('refname', '');
39 if(array_key_exists('pg', $_GET)) {
43 $skip = $_GET['pg'] * 100;
44 $next_page = $_GET['pg'] + 1;
51 $subnav = new ContentProvider('shortlog', 'shortlog_subnav');
52 $phpgitweb->append_sub_nav($subnav);
55 $subnav->set('first', new ContentProvider('shortlog', 'shortlog_subnav_first_link'));
56 $subnav->set('prev', new ContentProvider('shortlog', 'shortlog_subnav_prev_link', array('page' => ($pg - 1))));
58 $subnav->set('first', new ContentProvider('shortlog', 'shortlog_subnav_first'));
59 $subnav->set('prev', new ContentProvider('shortlog', 'shortlog_subnav_prev'));
62 $shortlog = new shortlog();
63 $this->page->set('shortlog', $shortlog->generate_shortlog($project, CommitLoader::$commit_base_id, 100, $skip, null, true, $next_page));
65 if($shortlog->get_have_more())
66 $subnav->set('next', new ContentProvider('shortlog', 'shortlog_subnav_next_link', array('page' => ($pg + 1))));
68 $subnav->set('next', new ContentProvider('shortlog', 'shortlog_subnav_next'));