mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
issue 46 apply server side validator in document module
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8498 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
e129e7c227
commit
8791643bb1
12 changed files with 83 additions and 27 deletions
|
|
@ -38,14 +38,14 @@
|
|||
<action name="getDocumentCategoryTplInfo" type="model" standalone="true" />
|
||||
<action name="getDocumentVotedMemberList" type="model" standalone="true" />
|
||||
|
||||
<action name="procDocumentInsertCategory" type="controller" standalone="true" />
|
||||
<action name="procDocumentInsertCategory" type="controller" standalone="true" ruleset="insertCategory" />
|
||||
<action name="procDocumentDeleteCategory" type="controller" standalone="true" />
|
||||
<action name="procDocumentMoveCategory" type="controller" standalone="true" />
|
||||
<action name="procDocumentMakeXmlFile" type="controller" standalone="true" />
|
||||
<action name="procDocumentTempSave" type="controller" standalone="true" />
|
||||
|
||||
<action name="procDocumentAdminInsertAlias" type="controller" standalone="true" />
|
||||
<action name="procDocumentAdminDeleteAlias" type="controller" standalone="true" />
|
||||
<action name="procDocumentAdminInsertAlias" type="controller" standalone="true" ruleset="insertAlias" />
|
||||
<action name="procDocumentAdminDeleteAlias" type="controller" standalone="true" ruleset="deleteAlias" />
|
||||
<action name="procDocumentAdminRestoreTrash" type="controller" standalone="true" />
|
||||
<action name="procDocumentAdminMoveExtraVar" type="controller" standalone="true" />
|
||||
|
||||
|
|
|
|||
|
|
@ -279,6 +279,12 @@
|
|||
// Insert by creating the module Controller object
|
||||
$oModuleController = &getController('module');
|
||||
$output = $oModuleController->insertModuleConfig('document',$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', 'dispDocumentAdminConfig');
|
||||
header('location:'.$returnUrl);
|
||||
return;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -446,20 +452,27 @@
|
|||
$query = "document.updateAlias";
|
||||
}
|
||||
$output = executeQuery($query, $args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
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', 'dispDocumentAdminAlias', 'document_srl', $args->document_srl);
|
||||
header('location:'.$returnUrl);
|
||||
return;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
function procDocumentAdminDeleteAlias() {
|
||||
$alias_srl = Context::get('alias_srl');
|
||||
$document_srl = Context::get('document_srl');
|
||||
$alias_srl = Context::get('target_srl');
|
||||
$args->alias_srl = $alias_srl;
|
||||
$output = executeQuery("document.deleteAlias", $args);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
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', 'dispDocumentAdminAlias', 'document_srl', $document_srl);
|
||||
header('location:'.$returnUrl);
|
||||
return;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
function procDocumentAdminRestoreTrash() {
|
||||
|
|
|
|||
|
|
@ -1055,7 +1055,10 @@ class documentController extends document {
|
|||
**/
|
||||
function procDocumentInsertCategory($args = null) {
|
||||
// List variables
|
||||
if(!$args) $args = Context::gets('module_srl','category_srl','parent_srl','title','description','expand','group_srls','color','mid');
|
||||
if(!$args) $args = Context::gets('module_srl','category_srl','parent_srl','category_title','category_description','expand','group_srls','category_color','mid');
|
||||
$args->title = $args->category_title;
|
||||
$args->description = $args->category_description;
|
||||
$args->color = $args->category_color;
|
||||
|
||||
if(!$args->module_srl && $args->mid){
|
||||
$mid = $args->mid;
|
||||
|
|
@ -1070,7 +1073,8 @@ class documentController extends document {
|
|||
if(!$grant->manager) return new Object(-1,'msg_not_permitted');
|
||||
|
||||
if($args->expand !="Y") $args->expand = "N";
|
||||
$args->group_srls = str_replace('|@|',',',$args->group_srls);
|
||||
if(!is_array($args->group_srls)) $args->group_srls = str_replace('|@|',',',$args->group_srls);
|
||||
else $args->group_srls = implode(',', $args->group_srls);
|
||||
$args->parent_srl = (int)$args->parent_srl;
|
||||
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
|
@ -1106,6 +1110,12 @@ class documentController extends document {
|
|||
$this->add('module_srl', $args->module_srl);
|
||||
$this->add('category_srl', $args->category_srl);
|
||||
$this->add('parent_srl', $args->parent_srl);
|
||||
|
||||
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminCategoryInfo', 'module_srl', $args->module_srl);
|
||||
header('location:'.$returnUrl);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
9
modules/document/ruleset/deleteAlias.xml
Normal file
9
modules/document/ruleset/deleteAlias.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ruleset version="1.5.0">
|
||||
<customrules>
|
||||
</customrules>
|
||||
<fields>
|
||||
<field name="target_srl" required="true" rule="number" default="0" />
|
||||
<field name="document_srl" required="true" rule="number" default="0" />
|
||||
</fields>
|
||||
</ruleset>
|
||||
10
modules/document/ruleset/insertAlias.xml
Normal file
10
modules/document/ruleset/insertAlias.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ruleset version="1.5.0">
|
||||
<customrules>
|
||||
</customrules>
|
||||
<fields>
|
||||
<field name="module_srl" required="true" rule="number" default="0" />
|
||||
<field name="document_srl" required="true" rule="number" default="0" />
|
||||
<field name="alias_title" required="true" />
|
||||
</fields>
|
||||
</ruleset>
|
||||
10
modules/document/ruleset/insertCategory.xml
Normal file
10
modules/document/ruleset/insertCategory.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ruleset version="1.5.0">
|
||||
<customrules>
|
||||
</customrules>
|
||||
<fields>
|
||||
<field name="module_srl" required="true" rule="number" default="0" />
|
||||
<field name="category_srl" required="true" rule="number" default="0" />
|
||||
<field name="category_title" required="true" />
|
||||
</fields>
|
||||
</ruleset>
|
||||
|
|
@ -48,10 +48,10 @@
|
|||
</td>
|
||||
</tr>
|
||||
<tr >
|
||||
<th scope="row2"><div>{$lang->category_group_srls} <input type="checkbox" onclick="XE.checkboxToggleAll('group_srls'); return false;" /></div></th>
|
||||
<th scope="row2"><div>{$lang->category_group_srls} <input type="checkbox" onclick="XE.checkboxToggleAll('group_srls[]'); return false;" /></div></th>
|
||||
<td>
|
||||
<!--@foreach($group_list as $key=>$val)-->
|
||||
<div><input type="checkbox" name="group_srls" value="{$key}" id="group_{$key}" <!--@if(is_array($category_info->group_srls)&&in_array($key, $category_info->group_srls))-->checked="checked"<!--@end--> class="checkbox" /> <label for="group_{$key}">{$val->title}</label></div>
|
||||
<div><input type="checkbox" name="group_srls[]" value="{$key}" id="group_{$key}" <!--@if(is_array($category_info->group_srls)&&in_array($key, $category_info->group_srls))-->checked="checked"<!--@end--> class="checkbox" /> <label for="group_{$key}">{$val->title}</label></div>
|
||||
<!--@end-->
|
||||
<p>{$lang->about_category_group_srls}</p>
|
||||
</td>
|
||||
|
|
@ -69,4 +69,4 @@
|
|||
jQuery(function(){
|
||||
jQuery('input.color-indicator').xe_colorpicker();
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
<!--%import("filter/insert_category.xml")-->
|
||||
<!--%import("filter/delete_category.xml")-->
|
||||
<!--%import("filter/move_category.xml")-->
|
||||
|
||||
|
|
@ -15,7 +14,9 @@
|
|||
<span style="float:right"><a href="#" onclick="doReloadTreeCategory('{$module_info->module_srl}');return false;" class="button black"><span>{$lang->cmd_remake_cache}</span></a></span>
|
||||
|
||||
<div class="gap1">
|
||||
<form id="fo_category" action="./" method="get" onsubmit="return procFilter(this, insert_category)">
|
||||
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
|
||||
<form ruleset="insertCategory" id="fo_category" action="./" method="post">
|
||||
<input type="hidden" name="act" value="procDocumentInsertCategory" />
|
||||
<input type="hidden" name="module_srl" value="{$module_info->module_srl}" />
|
||||
<input type="hidden" name="xml_file" value="{$category_xml_file}" />
|
||||
<div id="category_info"></div>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
<!--#include("header.html")-->
|
||||
<!--%import("css/document.css")-->
|
||||
<!--%import("filter/insert_alias.xml")-->
|
||||
<!--%import("filter/delete_alias.xml")-->
|
||||
|
||||
<form id="deleteForm" action="./" method="POST">
|
||||
<form ruleset="deleteAlias" id="deleteForm" action="./" method="post">
|
||||
<input type="hidden" name="act" value="procDocumentAdminDeleteAlias" />
|
||||
<input type="hidden" id="target_srl" name="target_srl" value="" />
|
||||
<input type="hidden" name="document_srl" value="{$document_srl}" />
|
||||
</form>
|
||||
|
||||
<form action="{Context::getRequestUri()}" method="post" onsubmit="return procFilter(this, insert_alias)">
|
||||
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
|
||||
<form ruleset="insertAlias" action="{Context::getRequestUri()}" method="post">
|
||||
<input type="hidden" name="act" value="procDocumentAdminInsertAlias" />
|
||||
<input type="hidden" name="document_srl" value="{$document_srl}" />
|
||||
<input type="hidden" name="module_srl" value="{$oDocument->get('module_srl')}" />
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<!--#include("header.html")-->
|
||||
<!--%import("filter/insert_config.xml")-->
|
||||
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, insert_config)">
|
||||
<form action="./" method="post">
|
||||
<input type="hidden" name="act" value="procDocumentAdminInsertConfig" />
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<tr>
|
||||
<th scope="col"><div>{$lang->thumbnail_type}</div></th>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<h4 class="xeAdmin">{$lang->extra_vars} {$selected_var_idx}</h4>
|
||||
<table cellspacing="0" class="crossTable ">
|
||||
<tr>
|
||||
<th><div>{$lang->eid}</div></th>
|
||||
<th><div>thisthis{$lang->eid}</div></th>
|
||||
<td class="wide">
|
||||
<input type="text" name="eid" value="{$selected_var->eid}" class="inputTypeText w200" id="eid" /><p>{$lang->about_extra_vars_eid_value}</p>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -115,8 +115,8 @@ function insertSelectedModule(id, module_srl, mid, browser_title) {
|
|||
function deleteByFilter(target_srl, filter)
|
||||
{
|
||||
jQuery('#target_srl').val(target_srl);
|
||||
var hF = jQuery("deleteForm")[0];
|
||||
procFilter(hF, filter);
|
||||
var hF = jQuery("#deleteForm")[0];
|
||||
hF.submit();
|
||||
}
|
||||
|
||||
function executeFilterByTargetSrl(form_name, target_srl, filter)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue