This repository was archived by the owner on Jul 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathwiki.admin.view.php
More file actions
254 lines (230 loc) · 7.45 KB
/
wiki.admin.view.php
File metadata and controls
254 lines (230 loc) · 7.45 KB
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
<?php
/**
* @class wikiAdminView
* @developer NHN (developers@xpressengine.com)
* @brief wiki admin view class
*/
class WikiAdminView extends Wiki
{
var $wiki_markup_list = array("markdown", "mediawiki_markup", "googlecode_markup", "xe_wiki_markup" );
/**
* @brief Admin view initialisation
* @developer NHN (developers@xpressengine.com)
* @access public
* @return
*/
function init()
{
// check if module_srl is already set
$module_srl = Context::get('module_srl');
if(!$module_srl && $this->module_srl)
{
$module_srl = $this->module_srl;
Context::set('module_srl', $module_srl);
}
// Create Object Module model
$oModuleModel = &getModel('module');
// Second module_srl come over to save the module, putting the information in advance
if($module_srl)
{
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
if(!$module_info)
{
Context::set('module_srl', '');
$this->act = 'list';
}
else
{
ModuleModel::syncModuleToSite($module_info);
$this->module_info = $module_info;
$this->module_info->use_status = explode('|@|', $module_info->use_status);
Context::set('module_info', $module_info);
}
}
$module_category = $oModuleModel->getModuleCategories();
Context::set('module_category', $module_category);
// Initialize default markup type
if(!$this->module_info->markup_type)
{
$this->module_info->markup_type = 'markdown';
}
// Specify template path
$template_path = sprintf("%stpl/", $this->module_path);
$this->setTemplatePath($template_path);
$security = new Security();
$security->encodeHTML('module_category..');
}
/**
* @brief List of Wiki module
* @developer NHN (developers@xpressengine.com)
* @access public
* @return
*/
function dispWikiAdminContent()
{
$args->sort_index = "module_srl";
$args->page = Context::get('page');
$args->list_count = 20;
$args->page_count = 10;
$args->s_module_category_srl = Context::get('module_category_srl');
$output = executeQueryArray('wiki.getWikiList', $args);
ModuleModel::syncModuleToSite($output->data);
// In order to write in the template context::set
Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page);
Context::set('page', $output->page);
Context::set('wiki_list', $output->data);
Context::set('page_navigation', $output->page_navigation);
// Specify the template file
$this->setTemplateFile('index');
$security = new Security();
$security->encodeHTML('wiki_list..');
}
/**
* @brief Wiki module input screen for additional information
* @developer NHN (developers@xpressengine.com)
* @access public
* @return
*/
function dispWikiAdminInsertWiki()
{
if(!in_array($this->module_info->module, array('admin', 'wiki')))
{
return $this->alertMessage('msg_invalid_request');
}
// set skin list
$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);
// set layout 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);
$wiki_markup_list = $this->wiki_markup_list;
Context::set('wiki_markup_list', $wiki_markup_list);
// get document status list
$oDocumentModel = &getModel('document');
$documentStatusList = $oDocumentModel->getStatusNameList();
Context::set('document_status_list', $documentStatusList);
$security = new Security();
$security->encodeHTML('wiki_list..browser_title', 'wiki_list..mid');
$security->encodeHTML('skin_list..title', 'mskin_list..title');
$security->encodeHTML('layout_list..title', 'layout_list..layout');
$security->encodeHTML('mlayout_list..title', 'mlayout_list..layout');
// Specify the template file
$this->setTemplateFile('wiki_insert');
}
/**
* @brief Help page for wiki markup type
* @developer Corina Udrescu (xe_dev@arnia.ro)
* @access public
* @return
*/
function dispWikiAdminMarkupExamples()
{
$wiki_markup_list = $this->wiki_markup_list;
Context::set('wiki_markup_list', $wiki_markup_list);
$this->setTemplateFile('markup_examples');
}
/**
* @brief Confirmation screen for deleting wiki module
* @developer NHN (developers@xpressengine.com)
* @access public
* @return
*/
function dispWikiAdminDeleteWiki()
{
if(!Context::get('module_srl'))
{
return $this->dispWikiAdminContent();
}
if(!in_array($this->module_info->module, array('admin', 'wiki')))
{
return $this->alertMessage('msg_invalid_request');
}
$module_info = Context::get('module_info');
$oDocumentModel = &getModel('document');
$document_count = $oDocumentModel->getDocumentCount($module_info->module_srl);
$module_info->document_count = $document_count;
Context::set('module_info', $module_info);
$this->setTemplateFile('wiki_delete');
}
/**
* @brief Additional setup screen for Wiki module
* @developer NHN (developers@xpressengine.com)
* @access public
* @return
*/
function dispWikiAdminWikiAdditionSetup()
{
// content will be passsed by reference to all triggers
$content = '';
// Trigger calls for additional settings
// trigger name to be used
$output = ModuleHandler::triggerCall('module.dispAdditionSetup', 'before', $content);
$output = ModuleHandler::triggerCall('module.dispAdditionSetup', 'after', $content);
Context::set('setup_content', $content);
// Setup markup type, for disabling certain fields when wiki syntax is used
Context::set('markup_type', $this->module_info->markup_type);
// Specify the template file
$this->setTemplateFile('addition_setup');
}
/**
* @brief Set permissions for a wiki module screen
* @developer NHN (developers@xpressengine.com)
* @access public
* @return
*/
function dispWikiAdminGrantInfo()
{
// Call the common page for managing grants information
$oModuleAdminModel = getAdminModel('module');
$grant_content = $oModuleAdminModel->getModuleGrantHTML($this->module_info->module_srl, $this->xml_info->grant);
Context::set('grant_content', $grant_content);
$this->setTemplateFile('grant_list');
}
/**
* @brief Wiki module screen skins settings
* @developer NHN (developers@xpressengine.com)
* @access public
* @return
*/
function dispWikiAdminSkinInfo()
{
// Call the common page for managing skin information
$oModuleAdminModel = & getAdminModel('module');
$skin_content = $oModuleAdminModel->getModuleSkinHTML($this->module_info->module_srl);
Context::set('skin_content', $skin_content);
$this->setTemplateFile('skin_info');
}
/**
* @brief Wiki module screen mobile skins settings
* @developer NHN (developers@xpressengine.com)
* @access public
* @return
*/
function dispWikiAdminMobileSkinInfo()
{
// Call the common page for managing skin information
$oModuleAdminModel = & getAdminModel('module');
$skin_content = $oModuleAdminModel->getModuleMobileSkinHTML($this->module_info->module_srl);
Context::set('skin_content', $skin_content);
$this->setTemplateFile('skin_info');
}
/**
* @brief Wiki module list update screen
* @developer NHN (developers@xpressengine.com)
* @access public
* @return
*/
function dispWikiAdminArrange()
{
$this->setTemplateFile('arrange_list') ;
}
}
/* End of file wiki.admin.view.php */
/* Location: wiki.admin.view.php */