-
Notifications
You must be signed in to change notification settings - Fork 0
/
notification.admin.view.php
183 lines (156 loc) · 5.77 KB
/
notification.admin.view.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
<?php
/**
* vi:set sw=4 ts=4 noexpandtab fileencoding=utf8:
* @class notificationAdminView
* @author diver([email protected])
* @brief notificationAdminView
*/
class notificationAdminView extends notification {
var $group_list;
function init() {
$oMemberModel = &getModel('member');
// group 목록 가져오기
$this->group_list = $oMemberModel->getGroups();
Context::set('group_list', $this->group_list);
// 템플릿 설정
$this->setTemplatePath($this->module_path.'tpl');
}
/**
* basic settings.
**/
function dispNotificationAdminConfig() {
$oNotificationModel = &getModel('notification');
$oMemberModel = &getModel('member');
$config = $oNotificationModel->getModuleConfig();
$member_config = $oMemberModel->getMemberConfig();
Context::set('config', $config);
Context::set('member_config', $member_config);
$this->setTemplateFile('config');
}
/**
* @brief notification configuration list.
**/
function dispNotificationAdminList() {
$notification_list = array();
$args->page = Context::get('page');
$output = executeQueryArray('notification.getNotiComList', $args);
if ($output->toBool() && $output->data) {
foreach ($output->data as $no => $val) {
$val->no = $no;
$val->module_info = array();
$notification_list[$val->notification_srl] = $val;
}
}
Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page);
Context::set('page', $output->page);
Context::set('page_navigation', $output->page_navigation);
// module infos
if (count($notification_list) > 0) {
$notification_srls = array_keys($notification_list);
$notification_srls = join(',', $notification_srls);
$query_id = "notification.getModuleInfoByNotificationSrl";
$args->notification_srls = $notification_srls;
$output = executeQueryArray($query_id, $args);
if ($output->data) {
foreach ($output->data as $no => $val) {
$notification_list[$val->notification_srl]->module_info[] = $val;
}
}
}
Context::set('notification_list', $notification_list);
$oNotificationModel = &getModel('notification');
$config = $oNotificationModel->getModuleConfig();
Context::set('config',$config);
$this->setTemplateFile('list');
}
/**
* @brief insert notification configuration info.
**/
function dispNotificationAdminInsert() {
$oMemberModel = &getModel('member');
$oEditorModel = &getModel('editor');
$oNotificationModel = &getModel('notification');
$config = $oEditorModel->getEditorConfig(0);
// set editor options.
$option->skin = $config->editor_skin;
$option->content_style = $config->content_style;
$option->content_font = $config->content_font;
$option->content_font_size = $config->content_font_size;
$option->colorset = $config->sel_editor_colorset;
$option->allow_fileupload = true;
$option->enable_default_component = true;
$option->enable_component = true;
$option->disable_html = false;
$option->height = 200;
$option->enable_autosave = false;
$option->primary_key_name = 'noti_srl';
$option->content_key_name = 'mail_content';
$editor = $oEditorModel->getEditor(0, $option);
Context::set('editor', $editor);
//get sender ids
$sender_ids = $oNotificationModel->getRegisteredSenderIds();
Context::set('sender_ids', $sender_ids);
$notification_info->content = Context::getLang('default_content');
$notification_info->mail_content = Context::getLang('default_mail_content');
Context::set('notification_info', $notification_info);
$member_config = $oMemberModel->getMemberConfig();
Context::set('member_config', $member_config);
$this->setTemplateFile('insert');
}
/**
* @brief modify notification configuration.
**/
function dispNotificationAdminModify() {
$oMemberModel = &getModel('member');
$oNotificationModel = &getModel('notification');
$notification_srl = Context::get('notification_srl');
// load notification info
$args->notification_srl = $notification_srl;
$output = executeQuery("notification.getNotiComInfo", $args);
$notification_info = $output->data;
$extra_vars = unserialize($notification_info->extra_vars);
if ($extra_vars) {
foreach ($extra_vars as $key => $val) {
$notification_info->{$key} = $val;
}
}
// load module srls
$args->notification_srl = $notification_srl;
$output = executeQueryArray("notification.getNotificationModuleSrls", $args);
$module_srls = array();
if ($output->toBool() && $output->data) {
foreach ($output->data as $no => $val) {
$module_srls[] = $val->module_srl;
}
}
$notification_info->module_srls = join(',', $module_srls);
Context::set('notification_info', $notification_info);
//get sender ids
$sender_ids = $oNotificationModel->getRegisteredSenderIds();
Context::set('sender_ids', $sender_ids);
// editor
$oEditorModel = &getModel('editor');
$config = $oEditorModel->getEditorConfig(0);
// set options.
$option->skin = $config->editor_skin;
$option->content_style = $config->content_style;
$option->content_font = $config->content_font;
$option->content_font_size = $config->content_font_size;
$option->colorset = $config->sel_editor_colorset;
$option->allow_fileupload = true;
$option->enable_default_component = true;
$option->enable_component = true;
$option->disable_html = false;
$option->height = 200;
$option->enable_autosave = false;
$option->primary_key_name = 'noti_srl';
$option->content_key_name = 'mail_content';
$editor = $oEditorModel->getEditor($notification_srl, $option);
Context::set('editor', $editor);
$member_config = $oMemberModel->getMemberConfig();
Context::set('member_config', $member_config);
$this->setTemplateFile('insert');
}
}
?>