-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplanet.api.php
More file actions
87 lines (76 loc) · 2.75 KB
/
planet.api.php
File metadata and controls
87 lines (76 loc) · 2.75 KB
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
<?php
/**
* @class planetAPI
* @author zero (zero@zeroboard.com)
* @brief planet 모듈의 View Action에 대한 API 처리
**/
class planetAPI extends planet {
function dispPlanetHome(&$oModule) {
$oModule->add('contentList', $this->arrangeContentList( Context::get('content_list') ) );
$oModule->add('pageNavigation', Context::get('page_navigation'));
}
function dispPlanet(&$oModule) {
$oModule->add('contentList', $this->arrangeContentList( Context::get('content_list') ) );
$oModule->add('pageNavigation', Context::get('page_navigation'));
}
function favorite(&$oModule) {
$oModule->add('contentList', $this->arrangeContentList( Context::get('content_list') ) );
$oModule->add('pageNavigation', Context::get('page_navigation'));
}
function dispPlanetContentTagSearch(&$oModule){
$oModule->add('contentList', $this->arrangeContentList( Context::get('content_list') ) );
$oModule->add('pageNavigation', Context::get('page_navigation'));
}
function dispPlanetContentSearch(&$oModule){
$oModule->add('contentList', $this->arrangeContentList( Context::get('content_list') ) );
$oModule->add('pageNavigation', Context::get('page_navigation'));
}
function dispPlanetTagSearch(&$oModule){
$oModule->add('planetList', $this->arrangePlanetList( Context::get('planet_list') ) );
$oModule->add('pageNavigation', Context::get('page_navigation'));
}
function dispReplyList(&$oModule){
$reply_list = Context::get('reply_list');
$output = array();
if(count($reply_list)) {
foreach($reply_list as $key => $val) {
unset($obj);
$obj->mid = $val->mid;
$obj->document_srl = $val->document_srl;
$obj->nick_name = $val->nick_name;
$obj->content = $val->content;
$obj->regdate = $val->regdate;
$output[] = $obj;
}
}
$oModule->add('planetReplyList', $output );
$oModule->add('pageNavigation', Context::get('page_navigation'));
}
function arrangeContentList($content_list) {
$output = array();
if(count($content_list)) {
foreach($content_list as $key => $val) {
$item = null;
$item = $val->gets('mid','document_srl','nick_name','content','voted_count','regdate','tag_list','comment_count');
$item->postscript = $val->getExtraVars(20);
$item->photo = $val->getPlanetPhotoSrc();
$output[] = $item;
}
}
return $output;
}
function arrangePlanetList($planet_list) {
$output = array();
if(count($planet_list)) {
foreach($planet_list as $key => $val) {
$item = null;
$item = $val->gets('mid','document_srl','nick_name','content','voted_count','regdate','tag_list');
$item->postscript = $val->getExtraVars(20);
$item->photo = $val->getPhotoSrc();
$output[] = $item;
}
}
return $output;
}
}
?>