This repository has been archived by the owner on Feb 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
board.class.php
116 lines (93 loc) · 3.34 KB
/
board.class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
/* Copyright (C) NAVER <http://www.navercorp.com> */
/**
* @class board
* @author NAVER ([email protected])
* @brief board module high class
**/
class board extends ModuleObject
{
var $search_option = array('title','content','title_content','comment','user_name','nick_name','user_id','tag'); ///< 검색 옵션
var $order_target = array('list_order', 'update_order', 'regdate', 'voted_count', 'blamed_count', 'readed_count', 'comment_count', 'title'); // 정렬 옵션
var $skin = "default"; ///< skin name
var $list_count = 20; ///< the number of documents displayed in a page
var $page_count = 10; ///< page number
var $category_list = NULL; ///< category list
/**
* @brief install the module
**/
function moduleInstall()
{
// use action forward(enabled in the admin model)
$oModuleController = getController('module');
$oModuleModel = getModel('module');
// 2007. 10. 17 insert member menu trigger
$oModuleController->insertTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after');
// install board module
$args = new stdClass;
$args->site_srl = 0;
$output = executeQuery('module.getSite', $args);
if(!$output->data->index_module_srl)
{
$args->mid = 'board';
$args->module = 'board';
$args->browser_title = 'XpressEngine';
$args->skin = 'default';
$args->site_srl = 0;
$output = $oModuleController->insertModule($args);
if($output->toBool())
{
$module_srl = $output->get('module_srl');
$site_args = new stdClass;
$site_args->site_srl = 0;
$site_args->index_module_srl = $module_srl;
$oModuleController = getController('module');
$oModuleController->updateSite($site_args);
}
}
return new Object();
}
/**
* @brief chgeck module method
**/
function checkUpdate()
{
$oModuleModel = getModel('module');
// 2007. 10. 17 get the member menu trigger
if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true;
// 2011. 09. 20 when add new menu in sitemap, custom menu add
if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true;
return false;
}
/**
* @brief update module
**/
function moduleUpdate()
{
$oModuleModel = getModel('module');
$oModuleController = getController('module');
// 2007. 10. 17 check the member menu trigger, if it is not existed then insert
if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after'))
{
$oModuleController->insertTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after');
}
// 2011. 09. 20 when add new menu in sitemap, custom menu add
if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after'))
{
$oModuleController->insertTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after');
}
return new Object(0, 'success_updated');
}
function moduleUninstall()
{
$output = executeQueryArray("board.getAllBoard");
if(!$output->data) return new Object();
@set_time_limit(0);
$oModuleController = getController('module');
foreach($output->data as $board)
{
$oModuleController->deleteModule($board->module_srl);
}
return new Object();
}
}