-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlugin.php
85 lines (76 loc) · 3.82 KB
/
Plugin.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
<?php
/**
* Trilhas - Learning Management System
* Copyright (C) 2005-2010 Preceptor Educação a Distância Ltda. <http://www.preceptoead.com.br>
*
* 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/>.
*/
/**
* @category SelectionProcess
* @package SelectionProcess_Plugin
* @copyright Copyright (C) 2005-2010 Preceptor Educação a Distância Ltda. <http://www.preceptoead.com.br>
* @license http://www.gnu.org/licenses/ GNU GPL
*/
class SelectionProcess_Plugin extends Tri_Plugin_Abstract
{
protected $_name = "selection-process";
protected function _createDb()
{
$sql = "CREATE TABLE IF NOT EXISTS `SelectionProcess` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) NOT NULL,
`classroom_id` bigint(20) NOT NULL,
`question` text NOT NULL,
`answer` text NOT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
KEY `classroom_id` (`classroom_id`)
)";
$this->_getDb()->query($sql);
}
public function install()
{
$this->_createDb();
}
public function activate()
{
$this->_addAdminMenuItem('selection-process', 'processes','selection-process/index/index');
$this->_addAclItem('selection-process/index/index', 'teacher, coordinator, institution');
$this->_addAclItem('selection-process/index/form', 'teacher, coordinator, institution');
$this->_addAclItem('selection-process/index/save', 'teacher, coordinator, institution');
$this->_addAclItem('selection-process/index/list-classroom', 'teacher, coordinator, institution');
$this->_addAclItem('selection-process/index/add-course', 'teacher, coordinator, institution');
$this->_addAclItem('selection-process/index/remove-course', 'teacher, coordinator, institution');
$this->_addAclItem('selection-process/index/list-pre-registration', 'teacher, coordinator, institution');
$this->_addAclItem('selection-process/index/pre-register', 'identified');
$this->_addAclItem('selection-process/index/matriculate', 'teacher, coordinator, institution');
$this->_addAclItem('selection-process/index/reject', 'teacher, coordinator, institution');
$this->_addAclItem('selection-process/index/view', 'identified');
}
public function desactivate()
{
$this->_removeAdminMenuItem('selection-process', 'processes');
$this->_removeAclItem('selection-process/index/index');
$this->_removeAclItem('selection-process/index/form');
$this->_removeAclItem('selection-process/index/save');
$this->_removeAclItem('selection-process/index/list-classroom');
$this->_removeAclItem('selection-process/index/add-course');
$this->_removeAclItem('selection-process/index/remove-course');
$this->_removeAclItem('selection-process/index/list-pre-registration');
$this->_removeAclItem('selection-process/index/pre-register');
$this->_removeAclItem('selection-process/index/matriculate');
$this->_removeAclItem('selection-process/index/reject');
$this->_removeAclItem('selection-process/index/view');
}
}