XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
board.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 
10 class board extends ModuleObject
11 {
12  var $search_option = array('title_content','title','content','comment','user_name','nick_name','user_id','tag');
13 
14  var $order_target = array('list_order', 'update_order', 'regdate', 'voted_count', 'blamed_count', 'readed_count', 'comment_count', 'title', 'nick_name', 'user_name', 'user_id'); // 정렬 옵션
15 
16  var $skin = "default";
17  var $list_count = 20;
18  var $page_count = 10;
19  var $category_list = NULL;
20 
26  function __construct()
27  {
28  if(!Context::isInstalled()) return;
29 
30  if(!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional')
31  {
32  $ssl_actions = array('dispBoardWrite', 'dispBoardWriteComment', 'dispBoardReplyComment', 'dispBoardModifyComment', 'dispBoardDelete', 'dispBoardDeleteComment', 'procBoardInsertDocument', 'procBoardDeleteDocument', 'procBoardInsertComment', 'procBoardDeleteComment', 'procBoardVerificationPassword');
33  Context::addSSLActions($ssl_actions);
34  }
35  if(!Context::isExistsSSLAction('dispTempSavedList') && Context::getSslStatus() == 'optional')
36  {
37  Context::addSSLAction('dispTempSavedList');
38  }
39  }
40 
44  function moduleInstall()
45  {
46  // use action forward(enabled in the admin model)
48  $oModuleModel = getModel('module');
49 
50  // 2007. 10. 17 insert member menu trigger
51  $oModuleController->insertTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after');
52 
53  // install board module
54  $args = new stdClass;
55  $args->site_srl = 0;
56  $output = executeQuery('module.getSite', $args);
57  if(!$output->data->index_module_srl)
58  {
59  $args->mid = 'board';
60  $args->module = 'board';
61  $args->browser_title = 'XpressEngine';
62  $args->skin = 'default';
63  $args->site_srl = 0;
64  $output = $oModuleController->insertModule($args);
65 
66  if($output->toBool())
67  {
68  $module_srl = $output->get('module_srl');
69 
70  $site_args = new stdClass;
71  $site_args->site_srl = 0;
72  $site_args->index_module_srl = $module_srl;
73 
75  $oModuleController->updateSite($site_args);
76  }
77  }
78 
79  return new BaseObject();
80  }
81 
85  function checkUpdate()
86  {
87  $oModuleModel = getModel('module');
89  $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
90  if($oModuleModel->needUpdate($version_update_id))
91  {
92  // 2007. 10. 17 get the member menu trigger
93  if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true;
94 
95  // 2011. 09. 20 when add new menu in sitemap, custom menu add
96  if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true;
97 
98  $oModuleController->insertUpdatedLog($version_update_id);
99  }
100 
101  return false;
102  }
103 
107  function moduleUpdate()
108  {
109  $oModuleModel = getModel('module');
110  $oModuleController = getController('module');
111  $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
112  if($oModuleModel->needUpdate($version_update_id))
113  {
114  // 2007. 10. 17 check the member menu trigger, if it is not existed then insert
115  if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after'))
116  {
117  $oModuleController->insertTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after');
118  }
119 
120  // 2011. 09. 20 when add new menu in sitemap, custom menu add
121  if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after'))
122  {
123  $oModuleController->insertTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after');
124  }
125  $oModuleController->insertUpdatedLog($version_update_id);
126  }
127 
128  return new BaseObject(0, 'success_updated');
129  }
130 
131  function moduleUninstall()
132  {
133  $output = executeQueryArray("board.getAllBoard");
134  if(!$output->data) return new BaseObject();
135  @set_time_limit(0);
136 
137  $oModuleController = getController('module');
138 
139  foreach($output->data as $board)
140  {
141  $oModuleController->deleteModule($board->module_srl);
142  }
143 
144  return new BaseObject();
145  }
146 }
$oModuleModel
Definition: ko.install.php:236
getController($module_name)
Definition: func.inc.php:90
__construct()
Definition: board.class.php:26
const __XE_VERSION__
Definition: config.inc.php:32
$search_option
검색 옵션
Definition: board.class.php:12
$output
Definition: ko.install.php:193
$category_list
category list
Definition: board.class.php:19
moduleInstall()
install the module
Definition: board.class.php:44
addSSLActions($action_array)
$skin
skin name
Definition: board.class.php:16
$module_srl
integer value to represent a run-time instance of Module (XE Module)
$args
Definition: ko.install.php:185
moduleUninstall()
$page_count
page number
Definition: board.class.php:18
moduleUpdate()
update module
addSSLAction($action)
$list_count
the number of documents displayed in a page
Definition: board.class.php:17
getModel($module_name)
Definition: func.inc.php:145
executeQueryArray($query_id, $args=NULL, $arg_columns=NULL)
Definition: func.inc.php:219
$order_target
Definition: board.class.php:14
executeQuery($query_id, $args=NULL, $arg_columns=NULL)
Definition: func.inc.php:203
$oModuleController
Definition: ko.install.php:287
board module high class
Definition: board.class.php:10
isExistsSSLAction($action)
checkUpdate()
chgeck module method
Definition: board.class.php:85
$site_args
Definition: ko.install.php:296