-
Notifications
You must be signed in to change notification settings - Fork 0
/
gradeup.class.php
59 lines (49 loc) · 1.32 KB
/
gradeup.class.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
<?php
class gradeup extends ModuleObject
{
var $triggers = array(
array('member.doLogin', 'gradeup', 'controller', 'triggerDoLoginAfter','after')
);
function moduleInstall()
{
return new Object();
}
function checkUpdate()
{
// 모듈정보가 없으면 업데이트
$oModuleModel = getModel('module');
$module_info = $oModuleModel->getModuleInfoByMid('gradeup');
if(!$module_info) return true;
foreach($this->triggers as $trigger)
{
if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) return true;
}
return false;
}
function moduleUpdate()
{
//모듈 생성
$oModuleModel = getModel('module');
$oModuleController = getController('module');
$module_info = $oModuleModel->getModuleInfoByMid('gradeup');
if(!$module_info->module_srl)
{
$args = new stdClass;
$args->module = 'gradeup';
$args->mid = 'gradeup';
$args->browser_title = '등업관리 모듈';
$oModuleController->insertModule($args);
}
foreach($this->triggers as $trigger)
{
if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]))
{
$oModuleController->insertTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]);
}
}
return new Object(0, 'success_updated');
}
function recompileCache()
{
}
}