mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@454 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
825ea283b6
commit
a45441815a
6 changed files with 276 additions and 3 deletions
|
|
@ -188,8 +188,7 @@
|
|||
}
|
||||
$tmp_arr[$i] = implode(".",$tmp2_arr);
|
||||
}
|
||||
if(is_array($tmp_arg)) $arg = implode("/",$tmp_arr);
|
||||
else $args = $tmp_arr;
|
||||
$arg = implode("/",$tmp_arr);
|
||||
if(substr($arg,0,2)=='./') $arg = substr($arg,2);
|
||||
|
||||
// 1단계로 해당 tpl 내의 파일을 체크
|
||||
|
|
|
|||
|
|
@ -3,5 +3,6 @@
|
|||
<grants />
|
||||
<actions>
|
||||
<action name="dispList" type="view" admin_index="true" standalone="true" />
|
||||
<action name="dispWrite" type="view" standalone="true" />
|
||||
</actions>
|
||||
</module>
|
||||
|
|
|
|||
|
|
@ -13,5 +13,17 @@
|
|||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief pagemaker로 등록된 module_srl을 찾아서 return
|
||||
* pagemaker의 내용은 게시판처럼 document에 저장이 된다.
|
||||
* 설치시에 pagemaker 모듈을 modules에 등록을 하며 이 module_srl은 sequence값으로 입력되기에 찾아야한다.
|
||||
**/
|
||||
function getModuleSrl() {
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_info = $oModuleModel->getModuleInfoByMid('pagemaker');
|
||||
$module_srl = $module_info->module_srl;
|
||||
return $module_srl;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -7,17 +7,125 @@
|
|||
|
||||
class pagemakerView extends pagemaker {
|
||||
|
||||
var $module_srl = 0;
|
||||
var $list_count = 20;
|
||||
var $page_count = 10;
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
// pagemaker 모듈로 등록된 module_srl을 구함
|
||||
$oPagemakerModel = &getModel('pagemaker');
|
||||
$this->module_srl = $oPagemakerModel->getModuleSrl();
|
||||
|
||||
// template path 지정
|
||||
$this->setTemplatePath($this->module_path.'tpl.admin');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 목록 출력 (관리자용)
|
||||
* @brief 관리자에서 요청될때 초기화 할 것들을 정리
|
||||
**/
|
||||
function initAdmin() {
|
||||
|
||||
// 카테고리를 사용하는지 확인후 사용시 카테고리 목록을 구해와서 Context에 세팅
|
||||
/*
|
||||
if($this->module_info->use_category=='Y') {
|
||||
$oDocumentModel = &getModel('document');
|
||||
$this->category_list = $oDocumentModel->getCategoryList($this->module_srl);
|
||||
Context::set('category_list', $this->category_list);
|
||||
}
|
||||
*/
|
||||
|
||||
// 에디터 세팅
|
||||
$editor = "default";
|
||||
Context::set('editor', $editor);
|
||||
$editor_path = sprintf("./editor/%s/", $editor);
|
||||
Context::set('editor_path', $editor_path);
|
||||
Context::loadLang($editor_path);
|
||||
|
||||
// 템플릿에서 사용할 변수를 Context::set()
|
||||
if($this->module_srl) Context::set('module_srl',$this->module_srl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 목록 출력
|
||||
**/
|
||||
function dispList() {
|
||||
$this->initAdmin();
|
||||
|
||||
// 목록 구현에 필요한 변수들을 가져온다
|
||||
$page_srl = Context::get('page_srl');
|
||||
$page = Context::get('page');
|
||||
|
||||
// document 객체를 생성. 기본 데이터 구조의 경우 document모듈만 쓰면 만사 해결.. -_-;
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
// 목록을 구하기 위한 옵션
|
||||
$args->module_srl = $this->module_srl; ///< 현재 모듈의 module_srl
|
||||
$args->page = $page; ///< 페이지
|
||||
$args->list_count = $this->list_count; ///< 한페이지에 보여줄 글 수
|
||||
$args->page_count = $this->page_count; ///< 페이지 네비게이션에 나타날 페이지의 수
|
||||
|
||||
$args->search_target = Context::get('search_target'); ///< 검색 대상 (title, contents...)
|
||||
$args->search_keyword = Context::get('search_keyword'); ///< 검색어
|
||||
if($this->module_info->use_category=='Y') $args->category_srl = Context::get('category'); ///< 카테고리 사용시 선택된 카테고리
|
||||
|
||||
$args->sort_index = 'list_order'; ///< 소팅 값
|
||||
|
||||
// 목록 구함, document->getDocumentList 에서 걍 알아서 다 해버리는 구조이다... (아.. 이거 나쁜 버릇인데.. ㅡ.ㅜ 어쩔수 없다)
|
||||
$output = $oDocumentModel->getDocumentList($args);
|
||||
|
||||
// 템플릿에 쓰기 위해서 document_model::getDocumentList() 의 return object에 있는 값들을 세팅
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('document_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
|
||||
// 템플릿에서 사용할 검색옵션 세팅
|
||||
$count_search_option = count($this->search_option);
|
||||
for($i=0;$i<$count_search_option;$i++) {
|
||||
$search_option[$this->search_option[$i]] = Context::getLang($this->search_option[$i]);
|
||||
}
|
||||
Context::set('search_option', $search_option);
|
||||
|
||||
$this->setTemplateFile('list');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 작성 화면 출력
|
||||
**/
|
||||
function dispWrite() {
|
||||
$this->initAdmin();
|
||||
|
||||
// GET parameter에서 document_srl을 가져옴
|
||||
$document_srl = Context::get('document_srl');
|
||||
|
||||
// document 모듈 객체 생성
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
// 지정된 글이 없다면 (신규) 새로운 번호를 만든다
|
||||
if($document_srl) {
|
||||
$document = $oDocumentModel->getDocument($document_srl, $this->grant->manager);
|
||||
if(!$document) {
|
||||
unset($document_srl);
|
||||
Context::set('document_srl','');
|
||||
}
|
||||
}
|
||||
|
||||
// 문서 번호가 없으면 새로운 값을 받아옴
|
||||
if(!$document_srl) {
|
||||
$oDB = &DB::getInstance();
|
||||
$document_srl = $oDB->getNextSequence();
|
||||
}
|
||||
|
||||
Context::set('document_srl',$document_srl);
|
||||
Context::set('document', $document);
|
||||
|
||||
$this->setTemplateFile('write_form');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
76
modules/pagemaker/tpl.admin/list.html
Normal file
76
modules/pagemaker/tpl.admin/list.html
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
<!-- 정보 -->
|
||||
<div>
|
||||
{$lang->document_count} : {number_format($total_count)},
|
||||
{$lang->page_count} : {number_format($page)} / {number_format($total_page)}
|
||||
</div>
|
||||
|
||||
<!-- 목록 -->
|
||||
<div>
|
||||
<table>
|
||||
<tr>
|
||||
<th>{$lang->no}</th>
|
||||
<!--@if($category_list)-->
|
||||
<th>
|
||||
<form action="./" method="get">
|
||||
<select name="category" onchange="doChangeCategory(this, '{getUrl('category','')}')" >
|
||||
<option value="">{$lang->category}</option>
|
||||
<!--@foreach($category_list as $val)-->
|
||||
<option value="{$val->category_srl}" <!--@if($category==$val->category_srl)-->selected="true"<!--@end-->>{$val->title} <!--@if($val->document_count)-->({$val->document_count})<!--@end--></option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
</form>
|
||||
</th>
|
||||
<!--@end-->
|
||||
<th>{$lang->title}</th>
|
||||
<th>{$lang->date}</th>
|
||||
</tr>
|
||||
<!--@foreach($document_list as $no => $val)-->
|
||||
<tr>
|
||||
<td>{$no}</td>
|
||||
<!--@if($category_list)-->
|
||||
<td>{$category_list[$val->category_srl]->title}</td>
|
||||
<!--@end-->
|
||||
<td>
|
||||
<a href="{getUrl('document_srl',$val->document_srl)}">{$val->title}</a>
|
||||
</td>
|
||||
<td>{zdate($val->regdate,"Y-m-d")}</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 버튼 -->
|
||||
<div>
|
||||
<a href="{getUrl('act','dispWrite','document_srl','')}">[{$lang->cmd_make}]</a>
|
||||
</div>
|
||||
|
||||
<!-- 검색 -->
|
||||
<div>
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, search)">
|
||||
<input type="hidden" name="mid" value="{$mid}" />
|
||||
<input type="hidden" name="category" value="{$category}" />
|
||||
<select name="search_target">
|
||||
<!--@foreach($search_option as $key => $val)-->
|
||||
<option value="{$key}" <!--@if($search_target==$key)-->selected="true"<!--@end-->>{$val}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" />
|
||||
<input type="submit" value="{$lang->cmd_search}" />
|
||||
<input type="button" value="{$lang->cmd_cancel}" onclick="location.href='{getUrl('search_target','','search_keyword','','page','1','document_srl','')}'"/>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- 페이지 네비게이션 -->
|
||||
<div>
|
||||
<a href="{getUrl('page','','document_srl','')}">[{$lang->first_page}]</a>
|
||||
|
||||
<!--@while($page_no = $page_navigation->getNextPage())-->
|
||||
<!--@if($page == $page_no)-->
|
||||
{$page_no}
|
||||
<!--@else-->
|
||||
<a href="{getUrl('page',$page_no,'document_srl','')}">[{$page_no}]</a>
|
||||
<!--@end-->
|
||||
<!--@end-->
|
||||
|
||||
<a href="{getUrl('page',$page_navigation->last_page,'document_srl','')}">[{$lang->last_page}]</a>
|
||||
</div>
|
||||
77
modules/pagemaker/tpl.admin/write_form.html
Normal file
77
modules/pagemaker/tpl.admin/write_form.html
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
<form action="./" method="post" onsubmit="return procFilter(this, insert)" enctype="multipart/form-data">
|
||||
<input type="hidden" name="content" value="{htmlspecialchars($document->content)}" />
|
||||
<input type="hidden" name="document_srl" value="{$document_srl}" />
|
||||
<table width="100%">
|
||||
<col width="120" />
|
||||
<col width="*" />
|
||||
<!--@if($category_list)-->
|
||||
<tr>
|
||||
<th>{$lang->category}</th>
|
||||
<td>
|
||||
<select name="category_srl" >
|
||||
<option value="">{$lang->category}</option>
|
||||
<!--@foreach($category_list as $val)-->
|
||||
<option value="{$val->category_srl}" <!--@if($category==$val->category_srl||$val->category_srl==$document->category_srl)-->selected="true"<!--@end-->>{$val->title} <!--@if($val->document_count)-->({$val->document_count})<!--@end--></option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
</td>
|
||||
<!--@end-->
|
||||
|
||||
<tr>
|
||||
<th>{$lang->title}</th>
|
||||
<td><input type="text" name="title" value="{$document->title}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<input type="checkbox" name="is_secret" value="Y" <!--@if($document->is_secret== "Y")-->checked="true"<!--@end--> id="is_secret" />
|
||||
<label for="is_secret">{$lang->secret}</label>
|
||||
|
||||
<input type="checkbox" name="allow_comment" value="Y" <!--@if($document->allow_comment != "N")-->checked="true"<!--@end--> id="allow_comment" />
|
||||
<label for="allow_comment">{$lang->allow_comment}</label>
|
||||
|
||||
<input type="checkbox" name="lock_comment" value="Y" <!--@if($document->lock_comment == "Y")-->checked="true"<!--@end--> id="lock_comment" />
|
||||
<label for="lock_comment">{$lang->lock_comment}</label>
|
||||
|
||||
<input type="checkbox" name="allow_trackback" value="Y" <!--@if($document->allow_trackback != "N")-->checked="true"<!--@end--> id="allow_trackback" />
|
||||
<label for="allow_trackback">{$lang->allow_trackback}</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{$lang->content}</th>
|
||||
<td>
|
||||
<!--#include("$editor_path/editor.html")-->
|
||||
<!--#include("$editor_path/editor_uploader.html")-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{$lang->cmd_send_trackback}</th>
|
||||
<td>
|
||||
<input type="text" name="trackback_url" />
|
||||
<select name="trackback_charset">
|
||||
<option value='UTF-8'>UTF-8</option>
|
||||
<option value='EUC-KR'>EUC-KR</option>
|
||||
<option value='EUC-JP'>EUC-JP</option>
|
||||
<option value='SHIFT_JIS'>SHIFT_JIS</option>
|
||||
<option value='EUC-CN'>EUC-CN</option>
|
||||
<option value='HZ'>HZ</option>
|
||||
<option value='BIG5'>BIG5</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{$lang->tag}</th>
|
||||
<td>
|
||||
<input type="text" name="tags" value="{htmlspecialchars($document->tags)}" /> <br />
|
||||
{$lang->about_tag}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="button" value="{$lang->cmd_cancel}" onclick="location.href='{getUrl('act','dispList')}'" />
|
||||
<input type="submit" value="{$lang->cmd_registration}" accesskey="s" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
Loading…
Add table
Add a link
Reference in a new issue