1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
5include_once('./Services/Table/classes/class.ilTable2GUI.php');
6
7/**
8*
9* @author Helmut Schottmüller <ilias@aurealis.de>
10* @version $Id$
11*
12* @ingroup ModulesTest
13*/
14
15class ilAssessmentFolderLogAdministrationTableGUI extends ilTable2GUI
16{
17    /**
18     * Constructor
19     *
20     * @access public
21     * @param
22     * @return
23     */
24    public function __construct($a_parent_obj, $a_parent_cmd, $a_write_access = false)
25    {
26        parent::__construct($a_parent_obj, $a_parent_cmd);
27
28        global $DIC;
29        $lng = $DIC['lng'];
30        $ilCtrl = $DIC['ilCtrl'];
31
32        $this->lng = $lng;
33        $this->ctrl = $ilCtrl;
34        $this->counter = 1;
35
36        $this->setFormName('showlog');
37        $this->setStyle('table', 'fullwidth');
38
39        $this->addColumn('', '', '1%', true);
40        $this->addColumn($this->lng->txt("title"), 'title', '50%');
41        $this->addColumn($this->lng->txt("ass_log_count_datasets"), 'nr', '15%');
42        $this->addColumn($this->lng->txt("ass_location"), '', '30%');
43
44        $this->setRowTemplate("tpl.il_as_tst_assessment_log_administration_row.html", "Modules/Test");
45
46        $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
47
48        if ($a_write_access) {
49            $this->addMultiCommand('deleteLog', $this->lng->txt('ass_log_delete_entries'));
50            $this->setSelectAllCheckbox('chb_test');
51            $this->enable('select_all');
52        }
53
54        $this->numericOrdering('nr');
55        $this->setDefaultOrderField("title");
56        $this->setDefaultOrderDirection("asc");
57
58        $this->setPrefix('chb_test');
59
60        $this->enable('header');
61        $this->enable('sort');
62    }
63
64    /**
65     * fill row
66     *
67     * @access public
68     * @param
69     * @return
70     */
71    public function fillRow($data)
72    {
73        $this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($data['title']));
74        $this->tpl->setVariable("NR", $data['nr']);
75        $this->tpl->setVariable("TEST_ID", $data['id']);
76        $this->tpl->setVariable("LOCATION_HREF", $data['location_href']);
77        $this->tpl->setVariable("LOCATION_TXT", $data['location_txt']);
78    }
79
80    /**
81     * {@inheritdoc}
82     */
83    public function numericOrdering($a_field)
84    {
85        return 'nr' == $a_field;
86    }
87}
88