mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-25 14:19:58 +09:00
merged 1.5.0 branch into 1.5.0-DB
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8547 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
4973c78fbc
commit
01d0925dd5
145 changed files with 990 additions and 31147 deletions
20
modules/trash/conf/info.xml
Normal file
20
modules/trash/conf/info.xml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="0.2">
|
||||
<title xml:lang="ko">휴지통</title>
|
||||
<title xml:lang="en">trash</title>
|
||||
<description xml:lang="ko">문서, 댓글 등을 완전히 삭제하지 않고 복구 가능한 상태로 만들어 관리하는 모듈입니다. </description>
|
||||
<version>0.1</version>
|
||||
<date>2011-05-12</date>
|
||||
<category>content</category>
|
||||
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">
|
||||
<name xml:lang="ko">NHN</name>
|
||||
<name xml:lang="en">NHN</name>
|
||||
<name xml:lang="vi">NHN</name>
|
||||
<name xml:lang="es">NHN</name>
|
||||
<name xml:lang="zh-CN">NHN</name>
|
||||
<name xml:lang="jp">NHN</name>
|
||||
<name xml:lang="ru">NHN</name>
|
||||
<name xml:lang="zh-TW">NHN</name>
|
||||
<name xml:lang="tr">NHN</name>
|
||||
</author>
|
||||
</module>
|
||||
15
modules/trash/conf/module.xml
Normal file
15
modules/trash/conf/module.xml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<module>
|
||||
<grants />
|
||||
<permissions>
|
||||
<permission action="dispTrashAdminList" target="manager" />
|
||||
<permission action="procTrashAdminEmptyTrash" target="manager" />
|
||||
<permission action="procTrashAdminRestore" target="manager" />
|
||||
</permissions>
|
||||
<actions>
|
||||
<action name="dispTrashAdminList" type="view" standalone="true" admin_index="true" />
|
||||
|
||||
<action name="procTrashAdminEmptyTrash" type="controller" standalone="true" />
|
||||
<action name="procTrashAdminRestore" type="controller" standalone="true" />
|
||||
</actions>
|
||||
</module>
|
||||
23
modules/trash/lang/ko.lang.php
Normal file
23
modules/trash/lang/ko.lang.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/document/lang/ko.lang.php
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief Document (document) of the basic language modules
|
||||
**/
|
||||
$lang->cmd_trash = '휴지통';
|
||||
$lang->cmd_restore = '복원';
|
||||
$lang->cmd_restore_all = '모두 복원';
|
||||
$lang->in_trash = '휴지통';
|
||||
$lang->trash_nick_name = '삭제자 닉네임';
|
||||
$lang->trash_date = '삭제 날짜';
|
||||
$lang->trash_description = '설명';
|
||||
$lang->trash_type = '원본 종류';
|
||||
$lang->success_trashed = '휴지통으로 이동되었습니다.';
|
||||
$lang->empty_trash_selected = '선택 비우기';
|
||||
$lang->empty_trash_all = '휴지통 비우기';
|
||||
$lang->confirm_restore = '복원하시겠습니까?';
|
||||
$lang->success_empty = '성공적으로 비웠습니다.';
|
||||
$lang->fail_empty = '휴지통 비우기에 실패하였습니다.';
|
||||
$lang->success_restore = '성공적으로 복원하였습니다.';
|
||||
$lang->fail_restore = '복원에 실패하였습니다.';
|
||||
?>
|
||||
103
modules/trash/model/TrashVO.php
Normal file
103
modules/trash/model/TrashVO.php
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
<?php
|
||||
|
||||
class TrashVO
|
||||
{
|
||||
var $trashSrl;
|
||||
var $title;
|
||||
var $originModule;
|
||||
var $serializedObject;
|
||||
var $description;
|
||||
var $ipaddress;
|
||||
var $removerSrl;
|
||||
var $userId;
|
||||
var $nickName;
|
||||
var $regdate;
|
||||
|
||||
function getTrashSrl()
|
||||
{
|
||||
return $this->trashSrl;
|
||||
}
|
||||
function setTrashSrl($trashSrl)
|
||||
{
|
||||
$this->trashSrl = $trashSrl;
|
||||
}
|
||||
function getTitle()
|
||||
{
|
||||
if(empty($this->title)) return $lang->untitle;
|
||||
return $this->title;
|
||||
}
|
||||
function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
}
|
||||
function getOriginModule()
|
||||
{
|
||||
if(empty($this->originModule)) return 'document';
|
||||
return $this->originModule;
|
||||
}
|
||||
function setOriginModule($originModule)
|
||||
{
|
||||
$this->originModule = $originModule;
|
||||
}
|
||||
function getSerializedObject()
|
||||
{
|
||||
return $this->serializedObject;
|
||||
}
|
||||
function setSerializedObject($serializedObject)
|
||||
{
|
||||
$this->serializedObject = $serializedObject;
|
||||
}
|
||||
function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
}
|
||||
function getIpaddress()
|
||||
{
|
||||
return $this->ipaddress;
|
||||
}
|
||||
function setIpaddress($ipaddress)
|
||||
{
|
||||
$this->ipaddress = $ipaddress;
|
||||
}
|
||||
function getRemoverSrl()
|
||||
{
|
||||
return $this->removerSrl;
|
||||
}
|
||||
function setRemoverSrl($removerSrl)
|
||||
{
|
||||
$this->removerSrl = $removerSrl;
|
||||
}
|
||||
function getUserId()
|
||||
{
|
||||
return $this->userId;
|
||||
}
|
||||
function setUserId($userId)
|
||||
{
|
||||
$this->userId = $userId;
|
||||
}
|
||||
function getNickName()
|
||||
{
|
||||
return $this->nickName;
|
||||
}
|
||||
function setNickName($nickName)
|
||||
{
|
||||
$this->nickName = $nickName;
|
||||
}
|
||||
function getRegdate()
|
||||
{
|
||||
if(empty($this->regdate)) return date('YmdHis');
|
||||
|
||||
return $this->regdate;
|
||||
}
|
||||
function setRegdate($regdate)
|
||||
{
|
||||
$this->regdate = $regdate;
|
||||
}
|
||||
}
|
||||
|
||||
/* End of file Trash.php */
|
||||
/* Location: ./modules/trash/model/Trash.php */
|
||||
9
modules/trash/queries/deleteTrash.xml
Normal file
9
modules/trash/queries/deleteTrash.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<query id="deleteTrash" action="delete">
|
||||
<tables>
|
||||
<table name="trash" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="trash_srl" var="trashSrl" filter="number" />
|
||||
<condition operation="in" column="trash_srl" var="trashSrls" filter="number" />
|
||||
</conditions>
|
||||
</query>
|
||||
11
modules/trash/queries/getTrash.xml
Normal file
11
modules/trash/queries/getTrash.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="getTrash" action="select">
|
||||
<tables>
|
||||
<table name="trash" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="trash_srl" var="trashSrl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
21
modules/trash/queries/getTrashList.xml
Normal file
21
modules/trash/queries/getTrashList.xml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<query id="getTrashList" action="select">
|
||||
<tables>
|
||||
<table name="trash" alias="T" />
|
||||
<table name="member" alias="M" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="T.*" />
|
||||
<column name="M.user_id" />
|
||||
<column name="M.nick_name" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="T.remover_srl" default="M.member_srl" notnull="notnull" />
|
||||
<condition operation="equal" column="trash_srl" var="trashSrl" filter="number" />
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="sort_index" default="trash_srl" order="desc" />
|
||||
<list_count var="list_count" default="20" />
|
||||
<page_count var="page_count" default="10" />
|
||||
<page var="page" default="1" />
|
||||
</navigation>
|
||||
</query>
|
||||
15
modules/trash/queries/insertTrash.xml
Normal file
15
modules/trash/queries/insertTrash.xml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<query id="insertTrash" action="insert">
|
||||
<tables>
|
||||
<table name="trash" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="trash_srl" var="trashSrl" filter="number" notnull="notnull" />
|
||||
<column name="title" var="title" notnull="notnull" />
|
||||
<column name="origin_module" var="originModule" notnull="notnull" default="document" />
|
||||
<column name="serialized_object" var="serializedObject" />
|
||||
<column name="description" var="description" />
|
||||
<column name="ipaddress" var="ipaddress" default="ipaddress()" />
|
||||
<column name="remover_srl" var="removerSrl" default="0" filter="number" />
|
||||
<column name="regdate" var="regdate" default="curdate()" />
|
||||
</columns>
|
||||
</query>
|
||||
10
modules/trash/schemas/trash.xml
Normal file
10
modules/trash/schemas/trash.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<table name="trash">
|
||||
<column name="trash_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" />
|
||||
<column name="title" type="varchar" size="250" />
|
||||
<column name="origin_module" type="varchar" size="250" default="document" notnull="notnull" />
|
||||
<column name="serialized_object" type="bigtext" notnull="notnull" />
|
||||
<column name="description" type="text" />
|
||||
<column name="ipaddress" type="varchar" size="128" notnull="notnull" />
|
||||
<column name="remover_srl" type="number" size="11" notnull="notnull" />
|
||||
<column name="regdate" type="date" index="idx_regdate" />
|
||||
</table>
|
||||
12
modules/trash/tpl/filter/emptyTrash.xml
Normal file
12
modules/trash/tpl/filter/emptyTrash.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<filter name="emptyTrash" module="trash" act="procTrashAdminEmptyTrash" confirm_msg_code="confirm_delete">
|
||||
<form>
|
||||
<node target="trash_srl" />
|
||||
</form>
|
||||
<parameter>
|
||||
<param name="trash_srl" target="trash_srl" />
|
||||
</parameter>
|
||||
<response callback_func="completeEmptyTrash">
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
</response>
|
||||
</filter>
|
||||
2
modules/trash/tpl/header.html
Normal file
2
modules/trash/tpl/header.html
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<!--%import("js/trash_admin.js")-->
|
||||
<h3 class="xeAdmin">{$lang->cmd_trash} <span class="gray">{$lang->cmd_management}</span></h3>
|
||||
33
modules/trash/tpl/js/trash_admin.js
Normal file
33
modules/trash/tpl/js/trash_admin.js
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/**
|
||||
* @file modules/trash/js/trash_admin.js
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief trash 모듈의 관리자용 javascript
|
||||
**/
|
||||
|
||||
|
||||
/* 휴지통 비우기 후 */
|
||||
function completeEmptyTrash(ret_obj) {
|
||||
var error = ret_obj['error'];
|
||||
var message = ret_obj['message'];
|
||||
|
||||
alert(message);
|
||||
if(error == '0') window.location.reload();
|
||||
}
|
||||
|
||||
function goRestore(trash_srl)
|
||||
{
|
||||
if(confirm(confirm_restore_msg))
|
||||
{
|
||||
var params = {'trash_srl':trash_srl};
|
||||
exec_xml('admin', 'procTrashAdminRestore', params, completeRestore);
|
||||
}
|
||||
}
|
||||
|
||||
function completeRestore(ret_obj)
|
||||
{
|
||||
var error = ret_obj['error'];
|
||||
var message = ret_obj['message'];
|
||||
|
||||
alert(message);
|
||||
if(error == '0') window.location.reload();
|
||||
}
|
||||
69
modules/trash/tpl/trash_list.html
Normal file
69
modules/trash/tpl/trash_list.html
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
<script>
|
||||
var confirm_restore_msg = '{$lang->confirm_restore}';
|
||||
</script>
|
||||
<!--%import("filter/emptyTrash.xml")-->
|
||||
<!--#include("header.html")-->
|
||||
|
||||
<form id="fo_list" action="./" method="get" onsubmit="return procFilter(this, emptyTrash)">
|
||||
<input type="hidden" name="page" value="{$page}" />
|
||||
<input type="hidden" name="is_all" value="false" />
|
||||
|
||||
<!-- 목록 -->
|
||||
<table cellspacing="0" class="rowTable clear">
|
||||
<caption>Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><div>{$lang->no}</div></th>
|
||||
<th scope="col"><div><input type="checkbox" onclick="XE.checkboxToggleAll('trash_srls[]');" /></div></th>
|
||||
<th scope="col" class="wide"><div>{$lang->document} ({$lang->trash_type})</div></th>
|
||||
<th scope="col"><div>{$lang->trash_nick_name}</div></th>
|
||||
<th scope="col"><div>{$lang->trash_date}</div></th>
|
||||
<th scope="col"><div>{$lang->ipaddress}</div></th>
|
||||
<th scope="col"><dib>{$lang->trash_description}</div></th>
|
||||
<th scope="col"><div>{$lang->cmd_restore}</div></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!--@foreach($trash_list as $no => $oTrashVO)-->
|
||||
<tr>
|
||||
<td class="number center">{$no}</td>
|
||||
<td><div><input type="checkbox" name="trash_srls[]" value="{$oTrashVO->getTrashSrl()}" /></div></t>
|
||||
<td class="left subject">
|
||||
{$oTrashVO->getTitle()} (
|
||||
<!--@if($oTrashVO->getOriginModule() == 'document')-->
|
||||
{$lang->document}
|
||||
<!--@else if($oTrashVO->getOriginModule() == 'comment')-->
|
||||
{$lang->replies}
|
||||
<!--@else-->
|
||||
{$lang->etc}
|
||||
<!--@end-->
|
||||
)
|
||||
</td>
|
||||
<td class="nowrap"><span class="member_{$oTrashVO->getMemberSrl()">{htmlspecialchars($oTrashVO->getNickName())}</span></td>
|
||||
<td class="date center nowrap">{zdate($oTrashVO->getRegdate(), "Y-m-d H:i:s")}</td>
|
||||
<td class="number center nowrap">{$oTrashVO->getIpaddress()}</td>
|
||||
<td class="left">{$oTrashVO->getDescription()}</td>
|
||||
<td class="center"><a href="#" onclick="goRestore({$oTrashVO->getTrashSrl()})">{$lang->cmd_restore}</a></td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="fr">
|
||||
<span class="button green"><input type="submit" value="{$lang->empty_trash_selected}" onclick="this.form.is_all.value=false" /></span>
|
||||
<span class="button blue"><input type="submit" value="{$lang->empty_trash_all}" onclick="this.form.is_all.value=true" /></span>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- 페이지 네비게이션 -->
|
||||
<div class="pagination a1">
|
||||
<a href="{getUrl('page','','module_srl',$module_srl)}" class="prevEnd">{$lang->first_page}</a>
|
||||
<!--@while($page_no = $page_navigation->getNextPage())-->
|
||||
<!--@if($page == $page_no)-->
|
||||
<strong>{$page_no}</strong>
|
||||
<!--@else-->
|
||||
<a href="{getUrl('page',$page_no,'module_srl',$module_srl)}">{$page_no}</a>
|
||||
<!--@end-->
|
||||
<!--@end-->
|
||||
<a href="{getUrl('page',$page_navigation->last_page,'module_srl',$module_srl)}" class="nextEnd">{$lang->last_page}</a>
|
||||
</div>
|
||||
140
modules/trash/trash.admin.controller.php
Normal file
140
modules/trash/trash.admin.controller.php
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
<?php
|
||||
/**
|
||||
* @class documentController
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief document the module's controller class
|
||||
**/
|
||||
class trashAdminController extends trash
|
||||
{
|
||||
/**
|
||||
* @brief object insert to trash
|
||||
**/
|
||||
function insertTrash($obj)
|
||||
{
|
||||
if(Context::get('is_logged'))
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
$oTrashVO = new TrashVO();
|
||||
$oTrashVO->setTrashSrl(getNextSequence());
|
||||
$oTrashVO->setTitle($obj->title);
|
||||
$oTrashVO->setOriginModule($obj->trashType);
|
||||
$oTrashVO->setSerializedObject(serialize($obj->originObject));
|
||||
$oTrashVO->setDescription($obj->description);
|
||||
$oTrashVO->setIpaddress($_SERVER['REMOTE_ADDR']);
|
||||
$oTrashVO->setRemoverSrl($logged_info->member_srl);
|
||||
$oTrashVO->setRegdate(date('YmdHis'));
|
||||
|
||||
$output = executeQuery('trash.insertTrash', $oTrashVO);
|
||||
return $output;
|
||||
}
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief empty trash
|
||||
* @param trashSrls : trash_srl in array
|
||||
**/
|
||||
function procTrashAdminEmptyTrash()
|
||||
{
|
||||
global $lang;
|
||||
$isAll = Context::get('is_all');
|
||||
$trashSrls = explode('|@|', Context::get('trash_srls'));
|
||||
|
||||
$oTrashModel = &getModel('trash');
|
||||
if($isAll == 'true')
|
||||
{
|
||||
$trashSrls = array();
|
||||
|
||||
//module relation data delete...
|
||||
$output = $oTrashModel->getTrashList($args);
|
||||
if(!$output->toBool()) return new Object(-1, $output->message);
|
||||
|
||||
if(is_array($output->data))
|
||||
{
|
||||
foreach($output->data AS $key=>$oTrashVO)
|
||||
{
|
||||
//class file check
|
||||
$classPath = ModuleHandler::getModulePath($oTrashVO->getOriginModule());
|
||||
if(!is_dir(FileHandler::getRealPath($classPath))) return new Object(-1, 'not exist restore module directory');
|
||||
|
||||
$classFile = sprintf('%s%s.admin.controller.php', $classPath, $oTrashVO->getOriginModule());
|
||||
$classFile = FileHandler::getRealPath($classFile);
|
||||
if(!file_exists($classFile)) return new Object(-1, 'not exist restore module class file');
|
||||
|
||||
$oAdminController = &getAdminController($oTrashVO->getOriginModule());
|
||||
if(!method_exists($oAdminController, 'emptyTrash')) return new Object(-1, 'not exist restore method in module class file');
|
||||
|
||||
$output = $oAdminController->emptyTrash($oTrashVO->getSerializedObject());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$this->_emptyTrash($trashSrls))
|
||||
return new Object(-1, $lang->fail_empty);
|
||||
|
||||
return new Object(0, $lang->success_empty);
|
||||
}
|
||||
|
||||
function procTrashAdminRestore()
|
||||
{
|
||||
global $lang;
|
||||
$trashSrl = Context::get('trash_srl');
|
||||
|
||||
$oTrashModel = &getModel('trash');
|
||||
$output = $oTrashModel->getTrash($trashSrl);
|
||||
if(!$output->toBool()) return new Object(-1, $output->message);
|
||||
|
||||
//class file check
|
||||
$classPath = ModuleHandler::getModulePath($output->data->getOriginModule());
|
||||
if(!is_dir(FileHandler::getRealPath($classPath))) return new Object(-1, 'not exist restore module directory');
|
||||
|
||||
$classFile = sprintf('%s%s.admin.controller.php', $classPath, $output->data->getOriginModule());
|
||||
$classFile = FileHandler::getRealPath($classFile);
|
||||
if(!file_exists($classFile)) return new Object(-1, 'not exist restore module class file');
|
||||
|
||||
$oAdminController = &getAdminController($output->data->getOriginModule());
|
||||
if(!method_exists($oAdminController, 'restoreTrash')) return new Object(-1, 'not exist restore method in module class file');
|
||||
|
||||
// begin transaction
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$originObject = unserialize($output->data->getSerializedObject());
|
||||
$output = $oAdminController->restoreTrash($originObject);
|
||||
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return new Object(-1, $output->message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Context::set('is_all', 'false');
|
||||
Context::set('trash_srls', $trashSrl);
|
||||
$output = $this->procTrashAdminEmptyTrash();
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return new Object(-1, $output->message);
|
||||
}
|
||||
}
|
||||
$oDB->commit();
|
||||
return new Object(0, $lang->success_restore);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief empty trash
|
||||
* @param trashSrls : trash_srl in array
|
||||
**/
|
||||
function _emptyTrash($trashSrls)
|
||||
{
|
||||
if(!is_array($trashSrls)) return false;
|
||||
$args->trashSrls = $trashSrls;
|
||||
$output = executeQuery('trash.deleteTrash', $args);
|
||||
if(!$output->toBool()) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* End of file trash.controller.php */
|
||||
/* Location: ./modules/trash/trash.controller.php */
|
||||
36
modules/trash/trash.admin.view.php
Normal file
36
modules/trash/trash.admin.view.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
/**
|
||||
* @class trashView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief View class of the module trash
|
||||
**/
|
||||
|
||||
class trashAdminView extends trash {
|
||||
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
// 템플릿 경로 지정 (board의 경우 tpl에 관리자용 템플릿 모아놓음)
|
||||
$template_path = sprintf("%stpl/",$this->module_path);
|
||||
$this->setTemplatePath($template_path);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief trash list
|
||||
**/
|
||||
function dispTrashAdminList() {
|
||||
$oTrashModel = getModel('trash');
|
||||
$output = $oTrashModel->getTrashList($args);
|
||||
|
||||
Context::set('trash_list', $output->data);
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('trash_list');
|
||||
}
|
||||
}
|
||||
?>
|
||||
39
modules/trash/trash.class.php
Normal file
39
modules/trash/trash.class.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
/**
|
||||
* @class document
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief document the module's high class
|
||||
**/
|
||||
|
||||
require_once(_XE_PATH_.'modules/trash/model/TrashVO.php');
|
||||
|
||||
class trash extends ModuleObject {
|
||||
/**
|
||||
* @brief Implement if additional tasks are necessary when installing
|
||||
**/
|
||||
function moduleInstall() {
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief a method to check if successfully installed
|
||||
**/
|
||||
function checkUpdate() {
|
||||
//$oDB = &DB::getInstance();
|
||||
//$oModuleModel = &getModel('module');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Execute update
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
//$oDB = &DB::getInstance();
|
||||
//$oModuleModel = &getModel('module');
|
||||
|
||||
return new Object(0,'success_updated');
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
12
modules/trash/trash.controller.php
Normal file
12
modules/trash/trash.controller.php
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
/**
|
||||
* @class documentController
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief document the module's controller class
|
||||
**/
|
||||
class trashController extends trash
|
||||
{
|
||||
}
|
||||
|
||||
/* End of file trash.controller.php */
|
||||
/* Location: ./modules/trash/trash.controller.php */
|
||||
58
modules/trash/trash.model.php
Normal file
58
modules/trash/trash.model.php
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
class trashModel extends trash
|
||||
{
|
||||
/**
|
||||
* @brief get one trash object
|
||||
**/
|
||||
function getTrash($trashSrl, $columnList = array())
|
||||
{
|
||||
$oTrashVO = new TrashVO();
|
||||
if(!$trashSrl) return $oTrashVO;
|
||||
|
||||
$args->trashSrl = $trashSrl;
|
||||
$output = executeQuery('trash.getTrash', $args, $columnList);
|
||||
|
||||
$this->_setTrashObject(&$oTrashVO, $output->data);
|
||||
$output->data = $oTrashVO;
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get trash object list
|
||||
**/
|
||||
function getTrashList($args, $columnList = array())
|
||||
{
|
||||
$output = executeQueryArray('trash.getTrashList', $args, $columnList);
|
||||
|
||||
if(is_array($output->data))
|
||||
{
|
||||
foreach($output->data AS $key=>$value)
|
||||
{
|
||||
$oTrashVO = new TrashVO();
|
||||
$this->_setTrashObject(&$oTrashVO, $value);
|
||||
$output->data[$key] = $oTrashVO;
|
||||
}
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief set trash object from std object
|
||||
**/
|
||||
function _setTrashObject(&$oTrashVO, $stdObject)
|
||||
{
|
||||
$oTrashVO->setTrashSrl($stdObject->trash_srl);
|
||||
$oTrashVO->setTitle($stdObject->title);
|
||||
$oTrashVO->setOriginModule($stdObject->origin_module);
|
||||
$oTrashVO->setSerializedObject($stdObject->serialized_object);
|
||||
$oTrashVO->setDescription($stdObject->description);
|
||||
$oTrashVO->setIpaddress($stdObject->ipaddress);
|
||||
$oTrashVO->setRemoverSrl($stdObject->remover_srl);
|
||||
$oTrashVO->setUserId($stdObject->user_id);
|
||||
$oTrashVO->setNickName($stdObject->nick_name);
|
||||
$oTrashVO->setRegdate($stdObject->regdate);
|
||||
}
|
||||
}
|
||||
|
||||
16
modules/trash/trash.view.php
Normal file
16
modules/trash/trash.view.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
/**
|
||||
* @class trashView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief View class of the module trash
|
||||
**/
|
||||
|
||||
class trashView extends trash {
|
||||
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue