mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
mobile addon 개선. 게시판/페이지 wap class 제작. module별 wap interface 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5283 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
8486f9b132
commit
01839ccf3b
17 changed files with 507 additions and 204 deletions
|
|
@ -67,8 +67,7 @@
|
|||
/**
|
||||
* 카테고리를 사용하는지 확인후 사용시 카테고리 목록을 구해와서 Context에 세팅
|
||||
**/
|
||||
$this->dispBoardCatogoryList();
|
||||
|
||||
$this->dispBoardCategoryList();
|
||||
|
||||
/**
|
||||
* 목록이 노출될때 같이 나오는 검색 옵션을 정리하여 스킨에서 쓸 수 있도록 context set
|
||||
|
|
@ -98,7 +97,7 @@
|
|||
$this->setTemplateFile('list');
|
||||
}
|
||||
|
||||
function dispBoardCatogoryList(){
|
||||
function dispBoardCategoryList(){
|
||||
if($this->module_info->use_category=='Y') {
|
||||
$oDocumentModel = &getModel('document');
|
||||
Context::set('category_list', $oDocumentModel->getCategoryList($this->module_srl));
|
||||
|
|
@ -113,10 +112,8 @@
|
|||
$document_srl = Context::get('document_srl');
|
||||
$page = Context::get('page');
|
||||
|
||||
// document model 객체를 생성
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
// 혹시 선택된 문서가 있다면 해당 문서에 대한 객체를 생성함 (일단 빈객체를 만드는 것은 선택된 글이 없을때 스킨에서 object 오류발생하는 것을 막기 위함)
|
||||
// 혹시 선택된 문서가 있다면 해당 문서에 대한 객체를 생성함
|
||||
// (일단 빈객체를 만드는 것은 선택된 글이 없을때 스킨에서 object 오류발생하는 것을 막기 위함)
|
||||
$oDocument = $oDocumentModel->getDocument(0);
|
||||
|
||||
// document_srl이 있다면 해당 글을 구해와서 $oDocument로 세팅
|
||||
|
|
@ -210,6 +207,7 @@
|
|||
function dispBoardContentList(){
|
||||
$oDocumentModel = &getModel('document');
|
||||
$args->module_srl = $this->module_srl; ///< 현재 모듈의 module_srl
|
||||
|
||||
// 목록을 구하기 위한 대상 모듈/ 페이지 수/ 목록 수/ 페이지 목록 수에 대한 옵션 설정
|
||||
$args->page = Context::get('page');; ///< 페이지
|
||||
$args->list_count = $this->list_count; ///< 한페이지에 보여줄 글 수
|
||||
|
|
|
|||
115
modules/board/board.wap.php
Normal file
115
modules/board/board.wap.php
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
<?php
|
||||
/**
|
||||
* @class boardWAP
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief board 모듈의 WAP class
|
||||
**/
|
||||
|
||||
class boardWAP extends board {
|
||||
|
||||
/**
|
||||
* @brief wap procedure method
|
||||
**/
|
||||
function procWAP(&$oMobile) {
|
||||
// 권한 체크
|
||||
if(!$this->grant->list || $this->module_info->consultation == 'Y') return $oMobile->setContent(Context::getLang('msg_not_permitted'));
|
||||
|
||||
// document model 객체 생성
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
// 선택된 게시글이 있을 경우
|
||||
$document_srl = Context::get('document_srl');
|
||||
if($document_srl) {
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
if($oDocument->isExists()) {
|
||||
// 권한 확인
|
||||
if(!$this->grant->view) return $oMobile->setContent(Context::getLang('msg_not_permitted'));
|
||||
|
||||
// 글 제목 설정
|
||||
Context::setBrowserTitle($oDocument->getTitleText());
|
||||
|
||||
// 댓글 보기 일 경우
|
||||
if($this->act=='dispBoardContentCommentList') {
|
||||
|
||||
$oCommentModel = &getModel('comment');
|
||||
$output = $oCommentModel->getCommentList($oDocument->document_srl, 0, false, $oDocument->getCommentCount());
|
||||
|
||||
$content = '';
|
||||
if(count($output->data)) {
|
||||
foreach($output->data as $key => $val){
|
||||
$oComment = new commentItem();
|
||||
$oComment->setAttribute($val);
|
||||
if(!$oComment->isAccessible()) continue;
|
||||
$content .= "<b>".$oComment->getNickName()."</b> (".$oComment->getRegdate("Y-m-d").")<br>\r\n".$oComment->getContent(false,false)."<br>\r\n";
|
||||
}
|
||||
}
|
||||
|
||||
// 내용 설정
|
||||
$oMobile->setContent( $content );
|
||||
|
||||
// 상위 페이지를 목록으로 돌아가기로 지정
|
||||
$oMobile->setUpperUrl( getUrl('act',''), Context::getLang('cmd_go_upper') );
|
||||
|
||||
// 댓글 보기가 아니면 글 보여줌
|
||||
} else {
|
||||
|
||||
// 내용 지정 (태그를 모두 제거한 내용을 설정)
|
||||
$content = strip_tags($oDocument->getContent(false,false,false));
|
||||
|
||||
|
||||
// 내용 상단에 정보 출력 (댓글 보기 링크 포함)
|
||||
$content = Context::getLang('replies').' : <a href="'.getUrl('act','dispBoardContentCommentList').'">'.$oDocument->getCommentCount().'</a><br>'."\r\n".$content;
|
||||
$content = '<b>'.$oDocument->getNickName()."</b> (".$oDocument->getRegdate("Y-m-d").")<br>\r\n".$content;
|
||||
|
||||
// 내용 설정
|
||||
$oMobile->setContent( $content );
|
||||
|
||||
// 상위 페이지를 목록으로 돌아가기로 지정
|
||||
$oMobile->setUpperUrl( getUrl('document_srl',''), Context::getLang('cmd_list') );
|
||||
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 게시글 목록
|
||||
$args->module_srl = $this->module_srl;
|
||||
$args->page = Context::get('page');;
|
||||
$args->list_count = 9;
|
||||
$args->sort_index = $this->module_info->order_target?$this->module_info->order_target:'list_order';
|
||||
$args->order_type = $this->module_info->order_type?$this->module_info->order_type:'asc';
|
||||
$output = $oDocumentModel->getDocumentList($args, $this->except_notice);
|
||||
$document_list = $output->data;
|
||||
$page_navigation = $output->page_navigation;
|
||||
|
||||
$childs = array();
|
||||
if($document_list && count($document_list)) {
|
||||
foreach($document_list as $key => $val) {
|
||||
$href = getUrl('mid',$_GET['mid'],'document_srl',$val->document_srl);
|
||||
$obj = null;
|
||||
$obj['href'] = $val->getPermanentUrl();
|
||||
|
||||
$title = $val->getTitleText();
|
||||
if($val->getCommentCount()) $title .= ' ['.$val->getCommentCount().']';
|
||||
$obj['link'] = $obj['text'] = $title;
|
||||
$childs[] = $obj;
|
||||
}
|
||||
$oMobile->setChilds($childs);
|
||||
}
|
||||
|
||||
$totalPage = $page_navigation->last_page;
|
||||
$page = (int)Context::get('page');
|
||||
if(!$page) $page = 1;
|
||||
|
||||
// next/prevUrl 지정
|
||||
if($page>1) $oMobile->setPrevUrl(getUrl('mid',$_GET['mid'],'page',$page-1), sprintf('%s (%d/%d)', Context::getLang('cmd_prev'), $page-1, $totalPage));
|
||||
|
||||
if($page<$totalPage) $oMobile->setNextUrl(getUrl('mid',$_GET['mid'],'page',$page+1), sprintf('%s (%d/%d)', Context::getLang('cmd_next'), $page+1, $totalPage));
|
||||
|
||||
$oMobile->mobilePage = $page;
|
||||
$oMobile->totalPage = $totalPage;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -34,6 +34,5 @@
|
|||
|
||||
$this->setTemplateFile('content');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
24
modules/page/page.wap.php
Normal file
24
modules/page/page.wap.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pageWap
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief page 모듈의 wap class
|
||||
**/
|
||||
|
||||
class pageWap extends page {
|
||||
|
||||
/**
|
||||
* @brief wap procedure method
|
||||
*
|
||||
* 페이지 모듈은 형식이 정해져 있지 않기에 전체 컨텐츠를 mobile class에서 제어해서 출력함
|
||||
**/
|
||||
function procWAP(&$oMobile) {
|
||||
// 권한 체크
|
||||
if(!$this->grant->view) return $oMobile->setContent(Context::getLang('msg_not_permitted'));
|
||||
|
||||
// 위젯의 내용을 추출/ 정리해서 보여줌
|
||||
$oMobile->setContent( Context::transContent($this->module_info->content) );
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue