1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4/**
5 * Class ilForumStatisticsTableGUI
6 *
7 * @author	Michael Jansen <mjansen@databay.de>
8 * @version	$Id$
9 *
10 * @ingroup ModulesForum
11 */
12class ilForumStatisticsTableGUI extends ilTable2GUI
13{
14    /**
15     * Constructor
16     *
17     * @access	public
18     *
19     */
20    public function __construct($a_parent_obj, $a_parent_cmd = "")
21    {
22        parent::__construct($a_parent_obj, $a_parent_cmd);
23
24        $this->setRowTemplate('tpl.statistics_table_row.html', 'Modules/Forum');
25        $this->addColumn($this->lng->txt('frm_statistics_ranking'), 'ranking', '25%');
26        $this->addColumn($this->lng->txt('login'), 'login', '25%');
27        $this->addColumn($this->lng->txt('lastname'), 'lastname', '25%');
28        $this->addColumn($this->lng->txt('firstname'), 'firstname', '25%');
29
30        $this->setDefaultOrderField('ranking');
31        $this->setDefaultOrderDirection('desc');
32
33        $this->enable('hits');
34        $this->enable('sort');
35    }
36
37    /**
38     * Should this field be sorted numeric?
39     *
40     * @access	public
41     * @param	string
42     * @return	boolean	numeric ordering
43     */
44    public function numericOrdering($a_field)
45    {
46        switch ($a_field) {
47            case 'ranking':
48                return true;
49
50            default:
51                return false;
52        }
53    }
54}
55