XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
module.admin.view.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) NAVER <http://www.navercorp.com> */
8 class moduleAdminView extends module
9 {
13  function init()
14  {
15  // Set the template path
16  $this->setTemplatePath($this->module_path.'tpl');
17  }
18 
23  {
24  $this->dispModuleAdminList();
25  }
26 
31  {
32  // Obtain a list of modules
33  $oAdminModel = getAdminModel('admin');
34  $oModuleModel = getModel('module');
35  $oAutoinstallModel = getModel('autoinstall');
36 
37  $module_list = $oModuleModel->getModuleList();
38  if(is_array($module_list))
39  {
40  foreach($module_list as $key => $val)
41  {
42  $module_list[$key]->delete_url = $oAutoinstallModel->getRemoveUrlByPath($val->path);
43 
44  // get easyinstall need update
45  $packageSrl = $oAutoinstallModel->getPackageSrlByPath($val->path);
46  $package = $oAutoinstallModel->getInstalledPackages($packageSrl);
47  $module_list[$key]->need_autoinstall_update = $package[$packageSrl]->need_update;
48 
49  // get easyinstall update url
50  if($module_list[$key]->need_autoinstall_update == 'Y')
51  {
52  $module_list[$key]->update_url = $oAutoinstallModel->getUpdateUrlByPackageSrl($packageSrl);
53  }
54  }
55  }
56 
57  $output = $oAdminModel->getFavoriteList('0');
58 
59  $favoriteList = $output->get('favoriteList');
60  $favoriteModuleList = array();
61  if($favoriteList)
62  {
63  foreach($favoriteList as $favorite => $favorite_info)
64  {
65  $favoriteModuleList[] = $favorite_info->module;
66  }
67  }
68 
69  Context::set('favoriteModuleList', $favoriteModuleList);
70  Context::set('module_list', $module_list);
71 
72  $security = new Security();
73  $security->encodeHTML('module_list....');
74 
75  // Set a template file
76  $this->setTemplateFile('module_list');
77 
78  }
79 
84  {
85  // Obtain a list of modules
86  $oModuleModel = getModel('module');
87  $module_info = $oModuleModel->getModuleInfoXml(Context::get('selected_module'));
88  Context::set('module_info', $module_info);
89 
90  $security = new Security();
91  $security->encodeHTML('module_info...');
92 
93  // Set the layout to be pop-up
94  $this->setLayoutPath('./common/tpl');
95  $this->setLayoutFile('popup_layout');
96  // Set a template file
97  $this->setTemplateFile('module_info');
98  }
99 
104  {
105  $module_category_srl = Context::get('module_category_srl');
106 
107  // Obtain a list of modules
108  $oModuleModel = getModel('module');
109  // Display the category page if a category is selected
110  //Security
111  $security = new Security();
112 
113  if($module_category_srl)
114  {
115  $selected_category = $oModuleModel->getModuleCategory($module_category_srl);
116  Context::set('selected_category', $selected_category);
117 
118  //Security
119  $security->encodeHTML('selected_category.title');
120 
121  // Set a template file
122  $this->setTemplateFile('category_update_form');
123  // If not selected, display a list of categories
124  }
125  else
126  {
127  $category_list = $oModuleModel->getModuleCategories();
128  Context::set('category_list', $category_list);
129 
130  //Security
131  $security->encodeHTML('category_list..title');
132 
133  // Set a template file
134  $this->setTemplateFile('category_list');
135  }
136  }
137 
142  {
143  // Get a target module to copy
144  $module_srl = Context::get('module_srl');
145  // Get information of the module
146  $oModuleModel = getModel('module');
147  $columnList = array('module_srl', 'module', 'mid', 'browser_title');
148  $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
149  Context::set('module_info', $module_info);
150 
151  $oSecurity = new Security();
152  $oSecurity->encodeHTML('module_info.');
153  // Set the layout to be pop-up
154  $this->setLayoutPath('./common/tpl');
155  $this->setLayoutFile('popup_layout');
156  // Set a template file
157  $this->setTemplateFile('copy_module');
158  }
159 
164  {
165  $module_srls = Context::get('module_srls');
166 
167  $modules = explode(',',$module_srls);
168  if(!count($modules)) if(!$module_srls) return new BaseObject(-1,'msg_invalid_request');
169 
170  $oModuleModel = getModel('module');
171  $columnList = array('module_srl', 'module');
172  $module_info = $oModuleModel->getModuleInfoByModuleSrl($modules[0], $columnList);
173  // Get a skin list of the module
174  $skin_list = $oModuleModel->getSkins(_XE_PATH_ . 'modules/'.$module_info->module);
175  Context::set('skin_list',$skin_list);
176  // Get a layout list
177  $oLayoutModel = getModel('layout');
178  $layout_list = $oLayoutModel->getLayoutList();
179  Context::set('layout_list', $layout_list);
180  // Get a list of module categories
181  $module_category = $oModuleModel->getModuleCategories();
182  Context::set('module_category', $module_category);
183 
184  $security = new Security();
185  $security->encodeHTML('layout_list..title','layout_list..layout');
186  $security->encodeHTML('skin_list....');
187  $security->encodeHTML('module_category...');
188 
189  // Set the layout to be pop-up
190  $this->setLayoutPath('./common/tpl');
191  $this->setLayoutFile('popup_layout');
192  // Set a template file
193  $this->setTemplateFile('module_setup');
194  }
195 
200  {
201  $module_srls = Context::get('module_srls');
202 
203  $modules = explode(',',$module_srls);
204  if(!count($modules)) if(!$module_srls) return new BaseObject(-1,'msg_invalid_request');
205  // pre-define variables because you can get contents from other module (call by reference)
206  $content = '';
207  // Call a trigger for additional settings
208  // Considering uses in the other modules, trigger name cen be publicly used
209  $output = ModuleHandler::triggerCall('module.dispAdditionSetup', 'before', $content);
210  $output = ModuleHandler::triggerCall('module.dispAdditionSetup', 'after', $content);
211  Context::set('setup_content', $content);
212  // Set the layout to be pop-up
213  $this->setLayoutPath('./common/tpl');
214  $this->setLayoutFile('popup_layout');
215  // Set a template file
216  $this->setTemplateFile('module_addition_setup');
217  }
218 
223  {
224  $module_srls = Context::get('module_srls');
225 
226  $modules = explode(',',$module_srls);
227  if(!count($modules)) if(!$module_srls) return new BaseObject(-1,'msg_invalid_request');
228 
229  $oModuleModel = getModel('module');
230  $columnList = array('module_srl', 'module', 'site_srl');
231  $module_info = $oModuleModel->getModuleInfoByModuleSrl($modules[0], $columnList);
232  $xml_info = $oModuleModel->getModuleActionXml($module_info->module);
233  $source_grant_list = $xml_info->grant;
234  // Grant virtual permissions for access and manager
235  $grant_list->access->title = Context::getLang('grant_access');
236  $grant_list->access->default = 'guest';
237  if(count($source_grant_list))
238  {
239  foreach($source_grant_list as $key => $val)
240  {
241  if(!$val->default) $val->default = 'guest';
242  if($val->default == 'root') $val->default = 'manager';
243  $grant_list->{$key} = $val;
244  }
245  }
246  $grant_list->manager->title = Context::getLang('grant_manager');
247  $grant_list->manager->default = 'manager';
248  Context::set('grant_list', $grant_list);
249  // Get a list of groups
250  $oMemberModel = getModel('member');
251  $group_list = $oMemberModel->getGroups($module_info->site_srl);
252  Context::set('group_list', $group_list);
253  $security = new Security();
254  $security->encodeHTML('group_list..title');
255 
256  // Set the layout to be pop-up
257  $this->setLayoutPath('./common/tpl');
258  $this->setLayoutFile('popup_layout');
259  // Set a template file
260  $this->setTemplateFile('module_grant_setup');
261  }
262 
267  {
268  // Get the language file of the current site
269  $site_module_info = Context::get('site_module_info');
270  $args = new stdClass();
271  $args->site_srl = (int)$site_module_info->site_srl;
272  $args->langCode = Context::get('lang_type');
273  $args->page = Context::get('page'); // /< Page
274  $args->list_count = 30; // /< the number of posts to display on a single page
275  $args->page_count = 5; // /< the number of pages that appear in the page navigation
276  $args->sort_index = 'name';
277  $args->order_type = 'asc';
278  $args->search_target = Context::get('search_target'); // /< search (title, contents ...)
279  $args->search_keyword = Context::get('search_keyword'); // /< keyword to search
280 
281  $oModuleAdminModel = getAdminModel('module');
282  $output = $oModuleAdminModel->getLangListByLangcode($args);
283 
284  Context::set('total_count', $output->total_count);
285  Context::set('total_page', $output->total_page);
286  Context::set('page', $output->page);
287  Context::set('lang_code_list', $output->data);
288  Context::set('page_navigation', $output->page_navigation);
289 
290  if(Context::get('module') != 'admin')
291  {
292  $this->setLayoutPath('./common/tpl');
293  $this->setLayoutFile('popup_layout');
294  }
295  // Set a template file
296  $this->setTemplateFile('module_langcode');
297  }
298 
300  {
301  $oModuleModel = getModel('module');
302  $output = $oModuleModel->getModuleFileBoxList();
303  $page = Context::get('page');
304  $page = $page?$page:1;
305  Context::set('filebox_list', $output->data);
306  Context::set('page_navigation', $output->page_navigation);
307  Context::set('page', $page);
308 
309  $oSecurity = new Security();
310  $oSecurity->encodeHTML('filebox_list..comment', 'filebox_list..attributes.');
311  $this->setTemplateFile('adminFileBox');
312  }
313 }
314 /* End of file module.admin.view.php */
315 /* Location: ./modules/module/module.admin.view.php */
setTemplateFile($filename)
$oModuleModel
Definition: ko.install.php:236
dispModuleAdminCopyModule()
Feature to copy module.
$output
Definition: ko.install.php:193
setLayoutFile($filename)
set($key, $val, $set_to_get_vars=0)
$xml_info
an object containing the module description extracted from XML file
dispModuleAdminModuleGrantSetup()
Applying module permission settings to all modules.
dispModuleAdminInfo()
Pop-up details of the module (conf/info.xml)
$module_srl
integer value to represent a run-time instance of Module (XE Module)
$args
Definition: ko.install.php:185
$module_info
an object containing the module information
dispModuleAdminCategory()
Module Categories.
getAdminModel($module_name)
Definition: func.inc.php:156
getLang($code)
const _XE_PATH_
Definition: config.inc.php:49
admin view class of the module module
getModel($module_name)
Definition: func.inc.php:145
dispModuleAdminContent()
Module admin page.
dispModuleAdminList()
Display a lost of modules.
dispModuleAdminModuleSetup()
Applying the default settings to all modules.
init()
Initialization.
dispModuleAdminModuleAdditionSetup()
Apply module addition settings to all modules.
triggerCall($trigger_name, $called_position, &$obj)
dispModuleAdminLangcode()
Language codes.
high class of the module module
Definition: module.class.php:8