XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
page.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) NAVER <http://www.navercorp.com> */
8 class page extends ModuleObject
9 {
13  function moduleInstall()
14  {
15  // page generated from the cache directory to use
16  FileHandler::makeDir('./files/cache/page');
17 
18  return new BaseObject();
19  }
20 
24  function checkUpdate()
25  {
26  $oModuleModel = getModel('module');
28  $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
29  if($oModuleModel->needUpdate($version_update_id))
30  {
31  $output = executeQuery('page.pageTypeOpageCheck');
32  if($output->toBool() && $output->data) return true;
33 
34  $output = executeQuery('page.pageTypeNullCheck');
35  if($output->toBool() && $output->data) return true;
36 
37  $oModuleController->insertUpdatedLog($version_update_id);
38  }
39 
40  return false;
41  }
42 
46  function moduleUpdate()
47  {
48  $oModuleModel = getModel('module');
50  $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
51  if($oModuleModel->needUpdate($version_update_id))
52  {
53  $args = new stdClass;
54  // opage module instance update
55  $output = executeQueryArray('page.pageTypeOpageCheck');
56  if($output->toBool() && count($output->data) > 0)
57  {
58  foreach($output->data as $val)
59  {
60  $args->module_srl = $val->module_srl;
61  $args->name = 'page_type';
62  $args->value= 'OUTSIDE';
63  $in_out = executeQuery('page.insertPageType', $args);
64  }
65  $output = executeQuery('page.updateAllOpage');
66  if(!$output->toBool()) return $output;
67  }
68 
69  // old page module instance update
70  $output = executeQueryArray('page.pageTypeNullCheck');
71  $skin_update_srls = array();
72  if($output->toBool() && $output->data)
73  {
74  foreach($output->data as $val)
75  {
76  $args->module_srl = $val->module_srl;
77  $args->name = 'page_type';
78  $args->value= 'WIDGET';
79  $in_out = executeQuery('page.insertPageType', $args);
80 
81  $skin_update_srls[] = $val->module_srl;
82  }
83  }
84 
85  if(count($skin_update_srls)>0)
86  {
87  $skin_args = new stdClass;
88  $skin_args->module_srls = implode(',',$skin_update_srls);
89  $skin_args->is_skin_fix = "Y";
90  $ouput = executeQuery('page.updateSkinFix', $skin_args);
91  }
92 
93  $oModuleController->insertUpdatedLog($version_update_id);
94  }
95 
96  return new BaseObject(0,'success_updated');
97  }
98 
102  function recompileCache()
103  {
104  }
105 }
106 /* End of file page.class.php */
107 /* Location: ./modules/page/page.class.php */
$oModuleModel
Definition: ko.install.php:236
getController($module_name)
Definition: func.inc.php:90
const __XE_VERSION__
Definition: config.inc.php:32
$output
Definition: ko.install.php:193
high class of the module page
Definition: page.class.php:8
checkUpdate()
a method to check if successfully installed
Definition: page.class.php:24
moduleUpdate()
Execute update.
Definition: page.class.php:46
$args
Definition: ko.install.php:185
recompileCache()
Re-generate the cache file.
Definition: page.class.php:102
moduleInstall()
Implement if additional tasks are necessary when installing.
Definition: page.class.php:13
makeDir($path_string)
getModel($module_name)
Definition: func.inc.php:145
executeQueryArray($query_id, $args=NULL, $arg_columns=NULL)
Definition: func.inc.php:219
executeQuery($query_id, $args=NULL, $arg_columns=NULL)
Definition: func.inc.php:203
$oModuleController
Definition: ko.install.php:287