mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-12 15:21:40 +09:00
스프링노트 연동 모듈의 내용 볼때 이전/다음 링크 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3920 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
675bfb7d34
commit
10c6124c71
4 changed files with 55 additions and 6 deletions
|
|
@ -160,7 +160,8 @@
|
|||
if($p_pageid) $this->getNodes($root->child, $p_pageid, $root);
|
||||
|
||||
$pages = array();
|
||||
$this->arrangePages($pages, $root->child, 0);
|
||||
$prev_pageid = 0;
|
||||
$this->arrangePages($pages, $root->child, 0, $prev_pageid);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -185,7 +186,7 @@
|
|||
/**
|
||||
* @brief 스프링노트 서버에서 보내준 페이지를 정렬
|
||||
**/
|
||||
function arrangePages(&$pages, $list, $depth) {
|
||||
function arrangePages(&$pages, $list, $depth, &$prev_pageid) {
|
||||
if(!count($list)) return;
|
||||
|
||||
foreach($list as $key => $val) {
|
||||
|
|
@ -196,7 +197,16 @@
|
|||
$val->depth = $depth;
|
||||
$pages[$val->pageid] = $val;
|
||||
|
||||
if($child) $this->arrangePages($pages, $child,$depth+1);
|
||||
if($prev_pageid) {
|
||||
$pages[$prev_pageid]->next->pageid = $pages[$val->pageid]->pageid;
|
||||
$pages[$prev_pageid]->next->title = $pages[$val->pageid]->title;
|
||||
$pages[$val->pageid]->prev->pageid = $pages[$prev_pageid]->pageid;
|
||||
$pages[$val->pageid]->prev->title = $pages[$prev_pageid]->title;
|
||||
}
|
||||
|
||||
$prev_pageid = $val->pageid;
|
||||
|
||||
if($child) $this->arrangePages($pages, $child,$depth+1, $prev_pageid);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue