forked from socialxe/module-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
socialxeserver.admin.view.php
128 lines (104 loc) · 4.31 KB
/
socialxeserver.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
<?php
class socialxeserverAdminView extends socialxeserver {
/**
* @brief 초기화
**/
function init() {
if (!$this->isSupported()) return $this->stop('msg_check_support');
// 서비스 모듈 정보를 얻는다.
$oSocialxeserverModel = &getModel('socialxeserver');
$this->service_module_info = $oSocialxeserverModel->getServiceModuleInfo();
Context::set('service_module_info', $this->service_module_info);
}
/**
* @brief 설정
**/
function dispSocialxeserverAdminConfig() {
// 설정 정보를 받아옴 (module model 객체를 이용)
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('socialxeserver');
Context::set('config',$config);
// 템플릿 파일 지정
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('index');
}
// 클라이언트 목록
function dispSocialxeserverAdminClient(){
// 클라이언트 목록
$args->page = Context::get('page');
$args->domain = Context::get('domain');
$output = executeQuery('socialxeserver.getAdminClientList', $args);
if (!$output->toBool()) return $output;
// 템플릿에 쓰기 위해서 comment_model::getTotalCommentList() 의 return object에 있는 값들을 세팅
Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page);
Context::set('page', $output->page);
Context::set('client_list', $output->data);
Context::set('page_navigation', $output->page_navigation);
// 템플릿 파일 지정
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('client');
}
// 클라이언트 추가
function dispSocialxeserverAdminInsertClient(){
// 템플릿 파일 지정
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('insert_client');
}
// 클라이언트 수정
function dispSocialxeserverAdminModifyClient(){
$client_srl = Context::get('client_srl');
if (!$client_srl) return $this->stop('msg_invalid_request');
// 클라이언트 정보 얻기
$args->client_srl = $client_srl;
$output = executeQuery('socialxeserver.getClient', $args);
if (!$output->toBool()) return $output;
if (!$output->data) return $this->stop('msg_invalid_request');
// 정보 가공
$client_info = $output->data;
$domain_array = explode(',', $client_info->domain);
foreach($domain_array as $name => $val){
$domain_array[$name] = trim($val);
}
// 템플릿에 사용하기 위해 셋
Context::set('client_info', $client_info);
Context::set('domain_list', $domain_array);
// 템플릿 파일 지정
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('modify_client');
}
// 서비스 모듈 설정
function dispSocialxeserverAdminServiceConfig(){
// 서비스 모듈이 생성되지 않았으면 생성 화면으로
$this->setTemplatePath($this->module_path.'tpl');
if (!$this->service_module_info){
$this->setTemplateFile('insert_service_module');
}
// 서비스 모듈이 설정되어 있으면 설정 화면으로
else{
$oModuleModel = &getModel('module');
$skin_list = $oModuleModel->getSkins($this->module_path);
Context::set('skin_list',$skin_list);
$mskin_list = $oModuleModel->getSkins($this->module_path, "m.skins");
Context::set('mskin_list', $mskin_list);
$oLayoutModel = &getModel('layout');
$layout_list = $oLayoutModel->getLayoutList();
Context::set('layout_list', $layout_list);
$mobile_layout_list = $oLayoutModel->getLayoutList(0,"M");
Context::set('mlayout_list', $mobile_layout_list);
$this->setTemplateFile('service_config');
$Security = new Security();
$Security->encodeHTML('skin_list..', 'mskin_list..', 'layout_list..', 'mlayout_list..');
}
}
// 권한 설정
function dispSocialxeserverAdminServiceGrant(){
// 공통 모듈 권한 설정 페이지 호출
$oModuleAdminModel = &getAdminModel('module');
$grant_content = $oModuleAdminModel->getModuleGrantHTML($this->service_module_info->module_srl, $this->xml_info->grant);
Context::set('grant_content', $grant_content);
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('grant_list');
}
}
?>