mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-22 04:39:55 +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
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<script type="text/javascript">
|
||||
function moveDate() {
|
||||
xGetElementById('fo_calendar').submit();
|
||||
document.forms['calendar'].submit();
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
<div class="header4 gap1">
|
||||
|
||||
<form action="./index.php" method="get" id="fo_calendar">
|
||||
<form action="./index.php" method="get" name="calendar" id="fo_calendar">
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<input type="hidden" name="selected_date" id="selected_date" value="{zDate('Ymd',$selected_date)}" />
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@
|
|||
<action name="procFileImageResize" type="controller" standalone="true" />
|
||||
<action name="procFileDelete" type="controller" standalone="true" />
|
||||
<action name="procFileDownload" type="controller" standalone="true" />
|
||||
<action name="procFileAdminDeleteChecked" type="controller" standalone="true" />
|
||||
<action name="procFileAdminInsertConfig" type="controller" standalone="true" />
|
||||
<action name="procFileAdminInsertModuleConfig" type="controller" standalone="true" />
|
||||
<action name="procFileAdminDeleteChecked" type="controller" standalone="true" ruleset="deleteChecked" />
|
||||
<action name="procFileAdminInsertConfig" type="controller" standalone="true" ruleset="insertConfig" />
|
||||
<action name="procFileAdminInsertModuleConfig" type="controller" standalone="true" ruleset="fileModuleConfig" />
|
||||
</actions>
|
||||
</module>
|
||||
|
|
|
|||
|
|
@ -53,7 +53,8 @@
|
|||
// An error appears if no document is selected
|
||||
$cart = Context::get('cart');
|
||||
if(!$cart) return $this->stop('msg_cart_is_null');
|
||||
$file_srl_list= explode('|@|', $cart);
|
||||
if(!is_array($cart)) $file_srl_list= explode('|@|', $cart);
|
||||
else $file_srl_list = $cart;
|
||||
$file_count = count($file_srl_list);
|
||||
if(!$file_count) return $this->stop('msg_cart_is_null');
|
||||
|
||||
|
|
@ -67,6 +68,11 @@
|
|||
}
|
||||
|
||||
$this->setMessage( sprintf(Context::getLang('msg_checked_file_is_deleted'), $file_count) );
|
||||
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispFileAdminList');
|
||||
header('location:'.$returnUrl);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -76,13 +82,18 @@
|
|||
// Get configurations (using module model object)
|
||||
$config->allowed_filesize = Context::get('allowed_filesize');
|
||||
$config->allowed_attach_size = Context::get('allowed_attach_size');
|
||||
$config->allowed_filetypes = Context::get('allowed_filetypes');
|
||||
$config->allowed_filetypes = str_replace(' ', '', Context::get('allowed_filetypes'));
|
||||
$config->allow_outlink = Context::get('allow_outlink');
|
||||
$config->allow_outlink_format = Context::get('allow_outlink_format');
|
||||
$config->allow_outlink_site = Context::get('allow_outlink_site');
|
||||
// Create module Controller object
|
||||
$oModuleController = &getController('module');
|
||||
$output = $oModuleController->insertModuleConfig('file',$config);
|
||||
if($output->toBool() && !in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispFileAdminConfig');
|
||||
header('location:'.$returnUrl);
|
||||
return;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -96,16 +107,17 @@
|
|||
if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
|
||||
else $module_srl = array($module_srl);
|
||||
|
||||
$download_grant = trim(Context::get('download_grant'));
|
||||
$download_grant = Context::get('download_grant');
|
||||
|
||||
$file_config->allow_outlink = Context::get('allow_outlink');
|
||||
$file_config->allow_outlink_format = Context::get('allow_outlink_format');
|
||||
$file_config->allow_outlink_site = Context::get('allow_outlink_site');
|
||||
$file_config->allowed_filesize = Context::get('allowed_filesize');
|
||||
$file_config->allowed_attach_size = Context::get('allowed_attach_size');
|
||||
$file_config->allowed_filetypes = Context::get('allowed_filetypes');
|
||||
if($download_grant) $file_config->download_grant = explode('|@|',$download_grant);
|
||||
else $file_config->download_grant = array();
|
||||
$file_config->allowed_filetypes = str_replace(' ', '', Context::get('allowed_filetypes'));
|
||||
|
||||
if(!is_array($download_grant)) $file_config->download_grant = explode('|@|',$download_grant);
|
||||
else $file_config->download_grant = $download_grant;
|
||||
|
||||
//관리자가 허용한 첨부파일의 사이즈가 php.ini의 값보다 큰지 확인하기 - by ovclas
|
||||
$userFileAllowSize = $this->_changeBytes($file_config->allowed_filesize.'M');
|
||||
|
|
@ -126,6 +138,11 @@
|
|||
|
||||
$this->setError(-1);
|
||||
$this->setMessage('success_updated');
|
||||
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminContent');
|
||||
header('location:'.$returnUrl);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -129,9 +129,12 @@
|
|||
$doc_srls_count = count($doc_srls);
|
||||
if($doc_srls_count) {
|
||||
$document_output = $oDocumentModel->getDocuments($doc_srls);
|
||||
foreach($document_output as $document) {
|
||||
$document_list[$document->document_srl] = $document;
|
||||
}
|
||||
if(is_array($document_output))
|
||||
{
|
||||
foreach($document_output as $document) {
|
||||
$document_list[$document->document_srl] = $document;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Module List
|
||||
$mod_srls_count = count($mod_srls);
|
||||
|
|
|
|||
8
modules/file/ruleset/deleteChecked.xml
Normal file
8
modules/file/ruleset/deleteChecked.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ruleset version="1.5.0">
|
||||
<customrules>
|
||||
</customrules>
|
||||
<fields>
|
||||
<field name="cart" required="true"/>
|
||||
</fields>
|
||||
</ruleset>
|
||||
12
modules/file/ruleset/fileModuleConfig.xml
Normal file
12
modules/file/ruleset/fileModuleConfig.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ruleset version="1.5.0">
|
||||
<customrules>
|
||||
<rule name="extension" type="regex" test="/^(?:\*\.\*|(\*\.\w+;\s*)*\*\.\w+;?)$/i" />
|
||||
</customrules>
|
||||
<fields>
|
||||
<field name="allowed_filesize" required="true" rule="number" default="2" />
|
||||
<field name="allowed_attach_size" required="true" rule="number" default="2" />
|
||||
<field name="allowed_filetypes" required="true" rule="extension" />
|
||||
<field name="download_grant" required="true" />
|
||||
</fields>
|
||||
</ruleset>
|
||||
11
modules/file/ruleset/insertConfig.xml
Normal file
11
modules/file/ruleset/insertConfig.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ruleset version="1.5.0">
|
||||
<customrules>
|
||||
<rule name="extension" type="regex" test="/^(?:\*\.\*|(\*\.\w+;\s*)*\*\.\w+;?)$/i" />
|
||||
</customrules>
|
||||
<fields>
|
||||
<field name="allowed_filesize" required="true" rule="number" default="2" />
|
||||
<field name="allowed_attach_size" required="true" rule="number" default="2" />
|
||||
<field name="allowed_filetypes" required="true" rule="extension" />
|
||||
</fields>
|
||||
</ruleset>
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
<!--#include("header.html")-->
|
||||
<!--%import("filter/insert_config.xml")-->
|
||||
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, insert_config)">
|
||||
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
|
||||
<form ruleset="insertConfig" action="./" method="post">
|
||||
<input type="hidden" name="act" value="procFileAdminInsertConfig" />
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<tr class="row2">
|
||||
<th scope="col"><div>{$lang->allow_outlink}</div></th>
|
||||
|
|
@ -55,4 +57,4 @@
|
|||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<!--%import("filter/delete_checked.xml")-->
|
||||
<!--%import("css/file_list.css")-->
|
||||
<!--#include("header.html")-->
|
||||
|
||||
<!-- 검색 -->
|
||||
<div class="fl">
|
||||
<form action="./" method="get" class="adminSearch">
|
||||
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
|
||||
<form ruleset="deleteChecked" action="./" method="get" class="adminSearch">
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<input type="hidden" name="module_srl" value="{$module_srl}" />
|
||||
|
|
@ -29,7 +29,8 @@
|
|||
</form>
|
||||
</div>
|
||||
|
||||
<form id="fo_list" action="./" method="get" onsubmit="return procFilter(this, delete_checked)">
|
||||
<form id="fo_list" action="./" method="post">
|
||||
<input type="hidden" name="act" value="procFileAdminDeleteChecked" />
|
||||
<input type="hidden" name="page" value="{$page}" />
|
||||
|
||||
<!-- 모듈 선택 -->
|
||||
|
|
@ -91,7 +92,7 @@
|
|||
|
||||
<tr>
|
||||
<td class="tCenter number">{$no}</td>
|
||||
<td class="tCenter"><input type="checkbox" name="cart" value="{$val->file_srl}" /></td>
|
||||
<td class="tCenter"><input type="checkbox" name="cart[]" value="{$val->file_srl}" /></td>
|
||||
<td class="wide"><a href="{$val->download_url}" class="red">{htmlspecialchars($val->source_filename)}</a></td>
|
||||
<td class="number tRight">{FileHandler::filesize($val->file_size)}</td>
|
||||
<td class="tCenter">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<!--%import("filter/insert_file_module_config.xml")-->
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, insert_file_module_config)">
|
||||
<form ruleset="fileModuleConfig" action="./" method="post">
|
||||
<input type="hidden" name="act" value="procFileAdminInsertModuleConfig" />
|
||||
<input type="hidden" name="success_return_url" value="{getUrl('', 'module', $module, 'act', $act, 'module_srl', $module_srl)}" />
|
||||
<input type="hidden" name="target_module_srl" value="{$module_info->module_srl?$module_info->module_srl:$module_srls}" />
|
||||
|
||||
<h4 class="xeAdmin">{$lang->file}</h4>
|
||||
|
|
@ -30,7 +31,7 @@
|
|||
<th scope="col"><div>{$lang->enable_download_group}</div></th>
|
||||
<td>
|
||||
<!--@foreach($group_list as $k => $v)-->
|
||||
<input type="checkbox" class="checkbox" name="download_grant" value="{$v->group_srl}" id="grant_{$key}_{$v->group_srl}" <!--@if(in_array($v->group_srl, $file_config->download_grant))-->checked="checked"<!--@end-->/>
|
||||
<input type="checkbox" class="checkbox" name="download_grant[]" value="{$v->group_srl}" id="grant_{$key}_{$v->group_srl}" <!--@if(in_array($v->group_srl, $file_config->download_grant))-->checked="checked"<!--@end-->/>
|
||||
<label for="grant_{$key}_{$v->group_srl}">{$v->title}</label>
|
||||
|
||||
<!--@end-->
|
||||
|
|
|
|||
|
|
@ -37,8 +37,7 @@
|
|||
Context::set('system_message', nl2br($this->getMessage()));
|
||||
|
||||
$this->setTemplatePath($template_path);
|
||||
$this->setTemplateFile('system_message');
|
||||
$this->setTemplateFile('system_message');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<!--%import("filter/insert_config.xml")-->
|
||||
|
||||
<h3 class="xeAdmin">{$lang->message} <span class="gray">{$lang->cmd_management}</span></h3>
|
||||
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, insert_config)">
|
||||
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
|
||||
<form action="./" method="post">
|
||||
<input type="hidden" name="act" value="procMessageAdminInsertConfig" />
|
||||
<p class="summary">{$lang->about_skin}</p>
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<tr>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<condition operation="equal" column="doc.module_srl" var="module_srl" filter="number" />
|
||||
<condition operation="notin" column="doc.module_srl" var="except_module_srls" pipe="and" />
|
||||
<condition operation="null" column="except_modules.module_srl" default="1" pipe="and" />
|
||||
<condition operation="equal" column="doc.is_secret" default="N" pipe="and" />
|
||||
<condition operation="equal" column="doc.status" default="PUBLIC" pipe="and" />
|
||||
<condition operation="equal" column="modules.module_srl" default="doc.module_srl" filter="number" pipe="and" />
|
||||
<condition operation="notin" column="modules.module_srl" var="except_modules" filter="numbers" pipe="and" />
|
||||
<condition operation="more" column="doc.last_update" var="start_date" filter="number" pipe="and" />
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
function insertSelectedModules(id, module_srl, mid, browser_title) {
|
||||
var sel_obj = xGetElementById('_'+id);
|
||||
var sel_obj = get_by_id('_'+id);
|
||||
for(var i=0;i<sel_obj.options.length;i++) if(sel_obj.options[i].value==module_srl) return;
|
||||
var opt = new Option(browser_title+' ('+mid+')', module_srl, false, false);
|
||||
sel_obj.options[sel_obj.options.length] = opt;
|
||||
|
|
@ -9,7 +9,7 @@ function insertSelectedModules(id, module_srl, mid, browser_title) {
|
|||
}
|
||||
|
||||
function removeExceptModule(id) {
|
||||
var sel_obj = xGetElementById('_'+id);
|
||||
var sel_obj = get_by_id('_'+id);
|
||||
sel_obj.remove(sel_obj.selectedIndex);
|
||||
if(sel_obj.options.length) sel_obj.selectedIndex = sel_obj.options.length-1;
|
||||
doSyncExceptModules(id);
|
||||
|
|
@ -17,11 +17,11 @@ function removeExceptModule(id) {
|
|||
|
||||
function doSyncExceptModules(id) {
|
||||
var selected_module_srls = new Array();
|
||||
var sel_obj = xGetElementById('_'+id);
|
||||
var sel_obj = get_by_id('_'+id);
|
||||
for(var i=0;i<sel_obj.options.length;i++) {
|
||||
selected_module_srls.push(sel_obj.options[i].value);
|
||||
}
|
||||
xGetElementById(id).value = selected_module_srls.join(',');
|
||||
get_by_id(id).value = selected_module_srls.join(',');
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
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