스프링노트 모듈에서 pageid 지정시 해당 페이지만 보기 또는 해당 페이지부터 보기 옵션 기능 추가

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3382 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-12-20 03:38:40 +00:00
parent 6d1e27a3c4
commit 1fee1ce68f
10 changed files with 56 additions and 3 deletions

View file

@ -111,7 +111,7 @@
/**
* @brief springnote 페이지 목록 가져오기
**/
function getPages($query = null, $fulltext = true) {
function getPages($query = null, $fulltext = true, $p_pageid = 0) {
if($query) {
if($this->domain) $url = sprintf('%s&q=%s&fulltext=%d', $this->getUrl(), urlencode($query), $fulltext?1:0);
@ -154,6 +154,8 @@
else $root->child[] = &$pages[$pageid];
}
if($p_pageid) $this->getNodes($root->child, $p_pageid, $root);
$pages = array();
$this->arrangePages($pages, $root->child, 0);
@ -162,6 +164,21 @@
return $pages;
}
/**
* @brief 특정 노드아래만 검색을 하기 위할때 해당 노드의 page_id를 받아서 해당 노드tree만 리턴
**/
function getNodes($list, $p_pageid, &$root) {
if(!count($list)) return;
foreach($list as $key => $val) {
if($val->pageid == $p_pageid) {
$root = $val;
return;
}
if($val->child) $this->getNodes($val->child, $p_pageid, $root);
}
}
/**
* @brief 스프링노트 서버에서 보내준 페이지를 정렬
**/