|
1
|
|
|
<?php |
|
2
|
|
|
/* Copyright (C) NAVER <http://www.navercorp.com> */ |
|
3
|
|
|
|
|
4
|
|
|
/** |
|
5
|
|
|
* @class communication |
|
6
|
|
|
* @author NAVER ([email protected]) |
|
7
|
|
|
* communication module of the high class |
|
8
|
|
|
*/ |
|
9
|
|
|
class communication extends ModuleObject |
|
10
|
|
|
{ |
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* Implement if additional tasks are necessary when installing |
|
14
|
|
|
* @return Object |
|
15
|
|
|
*/ |
|
16
|
|
|
function moduleInstall() |
|
17
|
|
|
{ |
|
18
|
|
|
// Create a temporary file storage for one new private message notification |
|
19
|
|
|
FileHandler::makeDir('./files/member_extra_info/new_message_flags'); |
|
20
|
|
|
return new Object(); |
|
21
|
|
|
} |
|
22
|
|
|
|
|
23
|
|
|
/** |
|
24
|
|
|
* method to check if successfully installed. |
|
25
|
|
|
* @return boolean true : need to update false : don't need to update |
|
26
|
|
|
*/ |
|
27
|
|
|
function checkUpdate() |
|
28
|
|
|
{ |
|
29
|
|
|
$oModuleModel = getModel('module'); |
|
30
|
|
|
$oModuleController = getController('module'); |
|
31
|
|
|
$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
|
32
|
|
|
if($oModuleModel->needUpdate($version_update_id)) |
|
33
|
|
|
{ |
|
34
|
|
|
$config = $oModuleModel->getModuleConfig('message'); |
|
35
|
|
|
|
|
36
|
|
|
if($config->skin) |
|
37
|
|
|
{ |
|
38
|
|
|
$config_parse = explode('.', $config->skin); |
|
39
|
|
|
if(count($config_parse) > 1) |
|
40
|
|
|
{ |
|
41
|
|
|
$template_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]); |
|
42
|
|
|
if(is_dir($template_path)) |
|
43
|
|
|
{ |
|
44
|
|
|
return TRUE; |
|
45
|
|
|
} |
|
46
|
|
|
} |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
$oModuleController->insertUpdatedLog($version_update_id); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
if(!is_dir("./files/member_extra_info/new_message_flags")) |
|
53
|
|
|
{ |
|
54
|
|
|
return TRUE; |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
return FALSE; |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* Update |
|
62
|
|
|
* @return Object |
|
63
|
|
|
*/ |
|
64
|
|
|
function moduleUpdate() |
|
65
|
|
|
{ |
|
66
|
|
|
$oModuleModel = getModel('module'); |
|
67
|
|
|
$oModuleController = getController('module'); |
|
68
|
|
|
$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
|
69
|
|
|
if($oModuleModel->needUpdate($version_update_id)) |
|
70
|
|
|
{ |
|
71
|
|
|
$config = $oModuleModel->getModuleConfig('message'); |
|
72
|
|
|
if(!is_object($config)) |
|
73
|
|
|
{ |
|
74
|
|
|
$config = new stdClass(); |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
if($config->skin) |
|
78
|
|
|
{ |
|
79
|
|
|
$config_parse = explode('.', $config->skin); |
|
80
|
|
|
if(count($config_parse) > 1) |
|
81
|
|
|
{ |
|
82
|
|
|
$template_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]); |
|
83
|
|
|
if(is_dir($template_path)) |
|
84
|
|
|
{ |
|
85
|
|
|
$config->skin = implode('|@|', $config_parse); |
|
86
|
|
|
$oModuleController = getController('module'); |
|
87
|
|
|
$oModuleController->updateModuleConfig('communication', $config); |
|
88
|
|
|
} |
|
89
|
|
|
} |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
$oModuleController->insertUpdatedLog($version_update_id); |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
if(!is_dir("./files/member_extra_info/new_message_flags")) |
|
96
|
|
|
{ |
|
97
|
|
|
FileHandler::makeDir('./files/member_extra_info/new_message_flags'); |
|
98
|
|
|
} |
|
99
|
|
|
|
|
100
|
|
|
return new Object(0, 'success_updated'); |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
/** |
|
104
|
|
|
* Re-generate the cache file |
|
105
|
|
|
* @return void |
|
106
|
|
|
*/ |
|
107
|
|
|
function recompileCache() |
|
108
|
|
|
{ |
|
109
|
|
|
|
|
110
|
|
|
} |
|
111
|
|
|
|
|
112
|
|
|
} |
|
113
|
|
|
/* End of file communication.class.php */ |
|
114
|
|
|
/* Location: ./modules/comment/communication.class.php */ |
|
115
|
|
|
|