XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
board.api.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 
10 class boardAPI extends board {
11 
12 /* do not use dispBoardContent .
13  function dispBoardContent(&$oModule) {
14  }
15 */
16 
20  function dispBoardNoticeList(&$oModule) {
21  $oModule->add('notice_list',$this->arrangeContentList(Context::get('notice_list')));
22  }
23 
24 
28  function dispBoardContentList(&$oModule) {
29  $api_type = Context::get('api_type');
30  $document_list = $this->arrangeContentList(Context::get('document_list'));
31 
32  if($api_type =='summary')
33  {
34  $content_cut_size = Context::get('content_cut_size');
35  $content_cut_size = $content_cut_size?$content_cut_size:50;
36  foreach($document_list as $k=>$v)
37  {
38  $oDocument = new documentItem();
39  $oDocument->setAttribute($v, false);
40  $document_list[$k]->content = $oDocument->getSummary($content_cut_size);
41  unset($oDocument);
42  }
43  }
44 
45  $oModule->add('document_list',$document_list);
46  $oModule->add('page_navigation',Context::get('page_navigation'));
47  }
48 
49 
53  function dispBoardCategoryList(&$oModule) {
54  $oModule->add('category_list',Context::get('category_list'));
55  }
56 
60  function dispBoardContentView(&$oModule) {
61  $oDocument = Context::get('oDocument');
62  $extra_vars = $oDocument->getExtraVars();
63  if($oDocument->isGranted())
64  {
65  $oDocument->add('extra_vars',$this->arrangeExtraVars($extra_vars));
66  }
67  $oModule->add('oDocument',$this->arrangeContent($oDocument));
68  }
69 
70 
74  function dispBoardContentFileList(&$oModule) {
75  $oDocument = Context::get('oDocument');
76  if($oDocument->isAccessible())
77  {
78  $oModule->add('file_list', $this->arrangeFile(Context::get('file_list')));
79  }
80  else
81  {
82  $oModule->add('file_list', array());
83  }
84  }
85 
86 
90  function dispBoardTagList(&$oModule) {
91  $oModule->add('tag_list',Context::get('tag_list'));
92  }
93 
97  function dispBoardContentCommentList(&$oModule) {
98  $oModule->add('comment_list',$this->arrangeComment(Context::get('comment_list')));
99  }
100 
101  function arrangeContentList($content_list) {
102  $output = array();
103  if(count($content_list)) {
104  foreach($content_list as $key => $val) $output[] = $this->arrangeContent($val);
105  }
106  return $output;
107  }
108 
109 
110  function arrangeContent($content) {
111  $oBoardView = getView('board');
112  $output = new stdClass;
113  if($content){
114  $output = $content->gets('document_srl','category_srl','member_srl','nick_name','title','content','tags','readed_count','voted_count','blamed_count','comment_count','regdate','last_update','extra_vars','status');
115 
116  $output->content = $content->getContent(false, false, true, false, true);
117 
118  $t_width = Context::get('thumbnail_width');
119  $t_height = Context::get('thumbnail_height');
120  $t_type = Context::get('thumbnail_type');
121 
122  if ($t_width && $t_height && $t_type && $content->thumbnailExists($t_width, $t_height, $t_type)) {
123  $output->thumbnail_src = $content->getThumbnail($t_width, $t_height, $t_type);
124  }
125  }
126  return $output;
127  }
128 
129  function arrangeComment($comment_list) {
130  $output = array();
131  if(count($comment_list) > 0 ) {
132  foreach($comment_list as $key => $val){
133  $item = null;
134  $item = $val->gets('comment_srl','parent_srl','depth','nick_name','content','is_secret','voted_count','blamed_count','regdate','last_update');
135 
136  $item->content = $val->getContent(false, false, false);
137 
138  $output[] = $item;
139  }
140  }
141  return $output;
142  }
143 
144 
145  function arrangeFile($file_list) {
146  $output = array();
147  if(count($file_list) > 0) {
148  foreach($file_list as $key => $val){
149  $item = new stdClass;
150  $item->download_count = $val->download_count;
151  $item->source_filename = $val->source_filename;
152  $item->file_size = $val->file_size;
153  $item->regdate = $val->regdate;
154  $output[] = $item;
155  }
156  }
157  return $output;
158  }
159 
160  function arrangeExtraVars($list) {
161  $output = array();
162  if(count($list)) {
163  foreach($list as $key => $val){
164  $item = new stdClass;
165  $item->name = $val->name;
166  $item->type = $val->type;
167  $item->desc = $val->desc;
168  $item->value = $val->value;
169  $output[] = $item;
170  }
171  }
172  return $output;
173  }
174 }
dispBoardContentView(&$oModule)
board content view
Definition: board.api.php:60
$output
Definition: ko.install.php:193
arrangeExtraVars($list)
Definition: board.api.php:160
foreach($sitemap as $id=> &$val) $extra_vars
Definition: ko.install.php:180
board module View Action에 대한 API 처리
Definition: board.api.php:10
arrangeContentList($content_list)
Definition: board.api.php:101
dispBoardContentList(&$oModule)
content list
Definition: board.api.php:28
dispBoardContentCommentList(&$oModule)
comments list
Definition: board.api.php:97
dispBoardCategoryList(&$oModule)
category list
Definition: board.api.php:53
getView($module_name)
Definition: func.inc.php:112
dispBoardNoticeList(&$oModule)
notice list
Definition: board.api.php:20
arrangeFile($file_list)
Definition: board.api.php:145
arrangeContent($content)
Definition: board.api.php:110
dispBoardTagList(&$oModule)
tag list
Definition: board.api.php:90
dispBoardContentFileList(&$oModule)
contents file list
Definition: board.api.php:74
board module high class
Definition: board.class.php:10
arrangeComment($comment_list)
Definition: board.api.php:129