XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
communication.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 
10 {
11 
16  function moduleInstall()
17  {
18  // Create a temporary file storage for one new private message notification
19  FileHandler::makeDir('./files/member_extra_info/new_message_flags');
20  return new BaseObject();
21  }
22 
27  function checkUpdate()
28  {
29  $oModuleModel = getModel('module');
31  $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
32  if($oModuleModel->needUpdate($version_update_id))
33  {
34  $config = $oModuleModel->getModuleConfig('message');
35 
36  if($config->skin)
37  {
38  $config_parse = explode('.', $config->skin);
39  if(count($config_parse) > 1)
40  {
41  $template_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]);
42  if(is_dir($template_path))
43  {
44  return TRUE;
45  }
46  }
47  }
48 
49  $oModuleController->insertUpdatedLog($version_update_id);
50  }
51 
52  if(!is_dir("./files/member_extra_info/new_message_flags"))
53  {
54  return TRUE;
55  }
56 
57  return FALSE;
58  }
59 
64  function moduleUpdate()
65  {
66  $oModuleModel = getModel('module');
68  $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
69  if($oModuleModel->needUpdate($version_update_id))
70  {
71  $config = $oModuleModel->getModuleConfig('message');
72  if(!is_object($config))
73  {
74  $config = new stdClass();
75  }
76 
77  if($config->skin)
78  {
79  $config_parse = explode('.', $config->skin);
80  if(count($config_parse) > 1)
81  {
82  $template_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]);
83  if(is_dir($template_path))
84  {
85  $config->skin = implode('|@|', $config_parse);
87  $oModuleController->updateModuleConfig('communication', $config);
88  }
89  }
90  }
91 
92  $oModuleController->insertUpdatedLog($version_update_id);
93  }
94 
95  if(!is_dir("./files/member_extra_info/new_message_flags"))
96  {
97  FileHandler::makeDir('./files/member_extra_info/new_message_flags');
98  }
99 
100  return new BaseObject(0, 'success_updated');
101  }
102 
107  function recompileCache()
108  {
109 
110  }
111 
112 }
113 /* End of file communication.class.php */
114 /* Location: ./modules/comment/communication.class.php */
$oModuleModel
Definition: ko.install.php:236
getController($module_name)
Definition: func.inc.php:90
const __XE_VERSION__
Definition: config.inc.php:32
$template_path
a path of directory where template files reside
makeDir($path_string)
getModel($module_name)
Definition: func.inc.php:145
$oModuleController
Definition: ko.install.php:287