-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathindex.php
218 lines (198 loc) · 9.48 KB
/
index.php
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<?php
/**
* ELIS(TM): Enterprise Learning Intelligence Suite
* Copyright (C) 2008-2011 Remote-Learner.net Inc (http://www.remote-learner.net)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package elis
* @subpackage programmanagement
* @author Remote-Learner.net Inc
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2008-2012 Remote Learner.net Inc http://www.remote-learner.net
*
*/
require_once dirname(__FILE__) . '/lib/setup.php';
/// This is the main entry point for the program management system. It can be called from anywhere.
/// By using this, we can manage all application-specific handling easier.
$PAGE->set_context(context_system::instance());
$pages = array(
// Learning Plan
'crscat' => array('class' => 'coursecatalogpage',
'file' => 'coursecatalogpage.class.php'),
'certlist' => array('class' => 'certificatelistpage',
'file' => 'certificatelistpage.class.php'),
// Information elements
'tag' => array('class' => 'tagpage',
'file' => 'tagpage.class.php'),
'env' => array('class' => 'envpage',
'file' => 'envpage.class.php'),
// Manage Users
'usr' => array('class' => 'userpage',
'file' => 'userpage.class.php'),
'stucur' => array('class' => 'studentcurriculumpage',
'file' => 'curriculumstudentpage.class.php'),
'usrclst' => array('class' => 'userclusterpage',
'file' => 'enrol/userset/manual/usersetassignmentpage.class.php'),
'usrtrk' => array('class' => 'usertrackpage',
'file' => 'usertrackpage.class.php'),
'usrrole' => array('class' => 'user_rolepage',
'file' => 'rolepage.class.php'),
// Manage Clusters
'clst' => array('class' => 'usersetpage',
'file' => 'usersetpage.class.php'),
'clstsub' => array(
'class' => 'usersetsubusersetpage',
'file' => 'usersetpage.class.php'
),
'clstcur' => array('class' => 'clustercurriculumpage',
'file' => 'clustercurriculumpage.class.php'),
'clsttrk' => array('class' => 'clustertrackpage',
'file' => 'clustertrackpage.class.php'),
'clstusr' => array('class' => 'clusteruserpage',
'file' => 'enrol/userset/manual/usersetassignmentpage.class.php'),
'clstrole' => array('class' => 'cluster_rolepage',
'file' => 'rolepage.class.php'),
'clstusrsel' => array('class' => 'clusteruserselectpage',
'file' => 'enrol/userset/manual/selectpage.class.php'),
// Manage Curricula
'cur' => array('class' => 'curriculumpage',
'file' => 'curriculumpage.class.php'),
'curcrs' => array('class' => 'curriculumcoursepage',
'file' => 'curriculumcoursepage.class.php'),
'currcrs' => array('class' => 'curriculumcoursepage', // why do we have two different spellings?
'file' => 'curriculumcoursepage.class.php'),
'curstu' => array('class' => 'curriculumstudentpage',
'file' => 'curriculumstudentpage.class.php'),
'curclst' => array('class' => 'curriculumclusterpage',
'file' => 'clustercurriculumpage.class.php'),
'curtag' => array('class' => 'curtaginstancepage',
'file' => 'taginstancepage.class.php'),
'currole' => array('class' => 'curriculum_rolepage',
'file' => 'rolepage.class.php'),
// Manage Tracks
'trk' => array('class' => 'trackpage',
'file' => 'trackpage.class.php'),
'trkm' => array('class' => 'trackpage', // why do we have two different spellings?
'file' => 'trackpage.class.php'),
'trkusr' => array('class' => 'trackuserpage',
'file' => 'usertrackpage.class.php'),
'trkclst' => array('class' => 'trackclusterpage',
'file' => 'clustertrackpage.class.php'),
'trkcls' => array('class' => 'trackassignmentpage',
'file' => 'trackassignmentpage.class.php'),
'trkrole' => array('class' => 'track_rolepage',
'file' => 'rolepage.class.php'),
// Manage Courses
'crs' => array('class' => 'coursepage',
'file' => 'coursepage.class.php'),
'cfc' => array('class' => 'curriculumforcoursepage',
'file' => 'curriculumpage.class.php'),
'crscurr' => array('class' => 'coursecurriculumpage',
'file' => 'curriculumcoursepage.class.php'),
'crstag' => array('class' => 'crstaginstancepage',
'file' => 'taginstancepage.class.php'),
'crsrole' => array('class' => 'course_rolepage',
'file' => 'rolepage.class.php'),
'crsengine' => array('class' => 'course_enginepage',
'file' => 'resultspage.class.php'),
'crsenginestatus' => array('class' => 'course_enginestatuspage',
'file' => 'resultsstatuspage.class.php'),
'crscertificate' => array('class' => 'course_certificatepage',
'file' => 'certificatepage.class.php'),
// Manage Classes
'cls' => array('class' => 'pmclasspage',
'file' => 'pmclasspage.class.php'),
'ins' => array('class' => 'instructorpage',
'file' => 'instructorpage.class.php'),
'stu' => array('class' => 'studentpage',
'file' => 'studentpage.class.php'),
'wtg' => array('class' => 'waitlistpage',
'file' => 'waitlistpage.class.php'),
'clstag' => array('class' => 'clstaginstancepage',
'file' => 'taginstancepage.class.php'),
'clsrole' => array('class' => 'class_rolepage',
'file' => 'rolepage.class.php'),
'clsengine' => array('class' => 'class_enginepage',
'file' => 'resultspage.class.php'),
'clsenginestatus' => array('class' => 'class_enginestatuspage',
'file' => 'resultsstatuspage.class.php'),
// Administration
'replnk' => array('class' => 'class_reportlinkspage',
'file' => 'reportlinkspage.class.php'),
'bulkuser' => array('class' => 'bulkuserpage',
'file' => 'bulkuserpage.class.php'),
'resultsconfig' => array('class' => 'resultsconfigpage',
'file' => 'resultsconfigpage.class.php'),
'field' => array('class' => 'customfieldpage',
'file' => 'customfieldpage.class.php'),
'health' => array('class' => 'healthpage',
'file' => 'healthpage.class.php'),
'clstclass' => array('class' => 'usersetclassificationpage',
'file' => 'plugins/usetclassify/usersetclassificationpage.class.php'),
'dim' => array('class' => 'dataimportpage',
'file' => 'elis_ip/elis_ip_page.php'),
'dftcls' => array('class' => 'configclsdefaultpage',
'file' => 'configclsdefaultpage.class.php'),
'dftcrs' => array('class' => 'configcrsdefaultpage',
'file' => 'configcrsdefaultpage.class.php'),
'ntf' => array('class' => 'notifications',
'file' => 'notificationspage.class.php'),
// Course Requests
'crp' => array(
'class' => 'RequestPage',
'file' => '../../blocks/courserequest/requestpage.php'
),
'erp' => array(
'class' => 'EditRequestPage',
'file' => '../../blocks/courserequest/editrequestpage.php'
),
'arp' => array(
'class' => 'courserequestapprovepage',
'file' => '../../blocks/courserequest/approvepage.class.php'
)
);
$section = optional_param('s', '', PARAM_ACTION);
if (isset($pages[$section])) {
include elispm::file($pages[$section]['file']);
$classname = $pages[$section]['class'];
$PAGE = new $classname();
} else {
include elispm::file('dashboardpage.class.php');
$PAGE = new dashboardpage();
}
$PAGE->requires->css('/local/elisprogram/icons.css');
// ELIS-3042
if (empty($PAGE->nologin) && !isloggedin()) {
redirect($CFG->wwwroot);
}
//calculate the path of curriculum entities corresponding to the most recent click
$currentitypath = optional_param('currentitypath', '', PARAM_TEXT);
if (!empty($currentitypath)) {
//parameter is set directly, so use it
$USER->currentitypath = $currentitypath;
} else {
//determine whether to unset the parameter based on comparing the current
//page type with the last entity set
$effective_entity_type = $PAGE->get_page_context();
if (isset($USER->currentitypath)) {
$parts = explode('/', $USER->currentitypath);
$final_part = $parts[count($parts) - 1];
$parts = explode('-', $final_part);
if ($parts[0] != $effective_entity_type) {
unset($USER->currentitypath);
}
}
}
$PAGE->run();