XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
widget.view.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) NAVER <http://www.navercorp.com> */
8 class widgetView extends widget
9 {
13  function init()
14  {
15  $this->setTemplatePath($this->module_path.'tpl');
16  }
17 
21  function dispWidgetInfo()
22  {
23  // If people have skin widget widget output as a function of the skin More Details
24  if(Context::get('skin')) return $this->dispWidgetSkinInfo();
25  // Wanted widget is selected information
26  $oWidgetModel = getModel('widget');
27  $widget_info = $oWidgetModel->getWidgetInfo(Context::get('selected_widget'));
28  Context::set('widget_info', $widget_info);
29  // Specifies the widget to pop up
30  $this->setLayoutFile('popup_layout');
31  // Set a template file
32  $this->setTemplateFile('widget_detail_info');
33  }
34 
38  function dispWidgetSkinInfo()
39  {
40  $widget = Context::get('selected_widget');
41  $skin = Context::get('skin');
42 
43  $path = sprintf('./widgets/%s/', $widget);
44  // Wanted widget is selected information
45  $oModuleModel = getModel('module');
46  $skin_info = $oModuleModel->loadSkinInfo($path, $skin);
47 
48  Context::set('skin_info',$skin_info);
49  // Specifies the widget to pop up
50  $this->setLayoutFile('popup_layout');
51  // Set a template file
52  $this->setTemplateFile('skin_info');
53  }
54 
59  {
60  // Wanted widget is selected information
61  $oWidgetModel = getModel('widget');
62 
63  $widget_list = $oWidgetModel->getDownloadedWidgetList();
64  $selected_widget = Context::get('selected_widget');
65  if(!$selected_widget) $selected_widget = $widget_list[0]->widget;
66 
67  $widget_info = $oWidgetModel->getWidgetInfo($selected_widget);
68  Context::set('widget_info', $widget_info);
69  Context::set('widget_list', $widget_list);
70  Context::set('selected_widget', $selected_widget);
71 
72  $oModuleModel = getModel('module');
73  // Get a list of module categories
74  $module_categories = $oModuleModel->getModuleCategories();
75  // Get a mid list
76  $site_module_info = Context::get('site_module_info');
77  $args = new stdClass();
78  $args->site_srl = $site_module_info->site_srl;
79  $columnList = array('module_srl', 'module_category_srl', 'browser_title', 'mid');
80  $mid_list = $oModuleModel->getMidList($args, $columnList);
81 
82  // Get a list of groups
83  $oMemberModel = getModel('member');
84  $group_list = $oMemberModel->getGroups($site_module_info->site_srl);
85  Context::set('group_list', $group_list);
86  // module_category and module combination
87  if($module_categories)
88  {
89  foreach($mid_list as $module_srl => $module) {
90  $module_categories[$module->module_category_srl]->list[$module_srl] = $module;
91  }
92  }
93  else
94  {
95  $module_categories[0] = new stdClass();
96  $module_categories[0]->list = $mid_list;
97  }
98 
99  Context::set('mid_list',$module_categories);
100  // Menu Get a list
101  $output = executeQueryArray('menu.getMenus');
102  Context::set('menu_list',$output->data);
103  // Wanted information on skin
104  $skin_list = $oModuleModel->getSkins($widget_info->path);
105  Context::set('skin_list', $skin_list);
106  // Specifies the widget to pop up
107  $this->setLayoutFile('popup_layout');
108  // Set a template file
109  $this->setTemplateFile('widget_generate_code');
110  }
111 
116  {
117  $oWidgetModel = getModel('widget');
118  $widget_list = $oWidgetModel->getDownloadedWidgetList();
119  Context::set('widget_list',$widget_list);
120  // When there is no widget is selected in the first widget
121  if(!Context::get('selected_widget')) Context::set('selected_widget',$widget_list[0]->widget);
122 
123  $this->dispWidgetGenerateCode();
124  $this->setLayoutFile('default_layout');
125  $this->setTemplateFile('widget_generate_code_in_page');
126  }
127 
132  {
133  // Widget-style list
134  $oWidgetModel = getModel('widget');
135  $widgetStyle_list = $oWidgetModel->getDownloadedWidgetStyleList();
136  Context::set('widgetStyle_list',$widgetStyle_list);
137  // Selected list of widget styles
138  $widgetstyle = Context::get('widgetstyle');
139  $widgetstyle_info = $oWidgetModel->getWidgetStyleInfo($widgetstyle);
140  if($widgetstyle && $widgetstyle_info)
141  {
142  Context::set('widgetstyle_info',$widgetstyle_info);
143  }
144 
145  $this->dispWidgetGenerateCode();
146  $this->setLayoutFile('default_layout');
147  $this->setTemplateFile('widget_style_generate_code_in_page');
148  }
149 }
150 /* End of file widget.view.php */
151 /* Location: ./modules/widget/widget.view.php */
setTemplateFile($filename)
$oModuleModel
Definition: ko.install.php:236
dispWidgetInfo()
Details of the widget (conf/info.xml) a pop-out.
Definition: widget.view.php:21
$output
Definition: ko.install.php:193
setLayoutFile($filename)
set($key, $val, $set_to_get_vars=0)
widget module&#39;s high class
Definition: widget.class.php:8
$module_srl
integer value to represent a run-time instance of Module (XE Module)
init()
Initialization.
Definition: widget.view.php:13
$args
Definition: ko.install.php:185
dispWidgetStyleGenerateCodeInPage()
Create widget style code page used in the pop-up management.
dispWidgetGenerateCode()
Widget&#39;s code generator.
Definition: widget.view.php:58
getModel($module_name)
Definition: func.inc.php:145
dispWidgetGenerateCodeInPage()
Managing pop-up pages used in the generated code.
executeQueryArray($query_id, $args=NULL, $arg_columns=NULL)
Definition: func.inc.php:219
$module
Class name of Xe Module that is identified by mid.
dispWidgetSkinInfo()
Widget details of the skin (skin.xml) a pop-out.
Definition: widget.view.php:38
View class of the widget modules.
Definition: widget.view.php:8