mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-21 12:19:56 +09:00
게시글의 카테고리를 다중 depth를 지원하게 하고 게시판 모듈에서 이 다중 depth를 적용하도록 기본 스킨 수정. 게시글 분류 위젯 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3549 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
e539a5e8a2
commit
3a12a24a1f
38 changed files with 475 additions and 112 deletions
56
widgets/category/category.class.php
Normal file
56
widgets/category/category.class.php
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
/**
|
||||
* @class category
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief 분류 출력기
|
||||
* @version 0.1
|
||||
**/
|
||||
|
||||
class category extends WidgetHandler {
|
||||
|
||||
/**
|
||||
* @brief 위젯의 실행 부분
|
||||
*
|
||||
* ./widgets/위젯/conf/info.xml 에 선언한 extra_vars를 args로 받는다
|
||||
* 결과를 만든후 print가 아니라 return 해주어야 한다
|
||||
**/
|
||||
function proc($args) {
|
||||
// 위젯 자체적으로 설정한 변수들을 체크
|
||||
$pos = strpos($args->mid_list, ',');
|
||||
if($pos === false) $mid = $args->mid_list;
|
||||
else $mid = substr($args->mid_list, 0, $pos);
|
||||
if(!$mid) return;
|
||||
|
||||
// 대상 mid의 module_srl 을 구함
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_info = $oModuleModel->getModuleInfoByMid($mid);
|
||||
|
||||
$module_srl = $module_info->module_srl;
|
||||
|
||||
// 대상 모듈의 카테고리 파일을 불러옴
|
||||
$oDocumentModel = &getModel('document');
|
||||
$category_list = $oDocumentModel->getCategoryList($module_srl);
|
||||
|
||||
// 모듈의 정보를 구함
|
||||
$widget_info->module_info = $module_info;
|
||||
|
||||
$widget_info->mid = $mid;
|
||||
$widget_info->document_category = $document_category;
|
||||
$widget_info->module_info = $module_info;
|
||||
$widget_info->category_list = $category_list;
|
||||
|
||||
// 전체 개수를 구함
|
||||
$total_count = $oDocumentModel->getDocumentCount($module_srl);
|
||||
$widget_info->total_document_count = $total_count;
|
||||
|
||||
Context::set('widget_info', $widget_info);
|
||||
|
||||
// 템플릿 컴파일
|
||||
$tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
|
||||
$tpl_file = 'category';
|
||||
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
return $oTemplate->compile($tpl_path, $tpl_file);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue