-
Notifications
You must be signed in to change notification settings - Fork 174
/
dqt.class.inc
105 lines (100 loc) · 2.79 KB
/
dqt.class.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
/**
* Data Querying Module
*
* PHP Version 7
*
* @category Module
* @package Loris
* @subpackage DQT
* @author Loris Team <loris-dev@bic.mni.mcgill.ca>
* @license http://www.gnu.org/licenses/gpl-3.0.txt GPLv3
* @link https://www.github.com/aces/Loris/
*/
namespace LORIS\dqt;
/**
* Data Querying Module
*
* PHP Version 7
*
* @category Module
* @package Loris
* @subpackage DQT
* @author Loris Team <loris-dev@bic.mni.mcgill.ca>
* @license http://www.gnu.org/licenses/gpl-3.0.txt GPLv3
* @link https://www.github.com/aces/Loris/
*/
class Dqt extends \NDB_Form
{
public $skipTemplate = true;
/**
* Check user access permission
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
function _hasAccess(\User $user) : bool
{
// check user permissions
return $user->hasPermission('dataquery_view');
}
/**
* Include the column formatter required to display the feedback link colours
* in the candidate_list menu
*
* @return array of javascript to be inserted
*/
function getJSDependencies()
{
$factory = \NDB_Factory::singleton();
$baseURL = $factory->settings()->getBaseURL();
$deps = parent::getJSDependencies();
return array_merge(
$deps,
[
$baseURL . '/js/d3.min.js',
$baseURL . '/js/c3.min.js',
$baseURL . '/dqt/js/react.fieldselector.js',
$baseURL . '/dqt/js/react.filterBuilder.js',
$baseURL . '/dqt/js/react.tabs.js',
$baseURL . '/dqt/js/react.sidebar.js',
$baseURL . '/dqt/js/react.app.js',
$baseURL . '/js/flot/jquery.flot.min.js',
$baseURL . '/js/components/PaginationLinks.js',
$baseURL . '/js/jszip/jszip.min.js',
$baseURL . '/js/components/MultiSelectDropdown.js',
]
);
}
/**
* Generate a breadcrumb trail for this page.
*
* @return \LORIS\BreadcrumbTrail
*/
public function getBreadcrumbs(): \LORIS\BreadcrumbTrail
{
return new \LORIS\BreadcrumbTrail(
new \LORIS\Breadcrumb('Data Query Tool', "/$this->name")
);
}
/**
* Include additional CSS files:
* 1. dataquery.css
*
* @return array of javascript to be inserted
*/
function getCSSDependencies()
{
$factory = \NDB_Factory::singleton();
$baseURL = $factory->settings()->getBaseURL();
$deps = parent::getCSSDependencies();
return array_merge(
$deps,
[
$baseURL . '/dqt/css/dataquery.css',
$baseURL . '/css/c3.css',
]
);
}
}