mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-10 04:24:14 +09:00
issue 46 apply validator to rss module
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8551 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
ac301bd6be
commit
6436d9da91
7 changed files with 85 additions and 51 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
<action name="rss" type="view" standalone="true" />
|
<action name="rss" type="view" standalone="true" />
|
||||||
<action name="atom" type="view" standalone="true" />
|
<action name="atom" type="view" standalone="true" />
|
||||||
<action name="procRssAdminToggleActivate" type="controller" standalone="true" />
|
<action name="procRssAdminToggleActivate" type="controller" standalone="true" />
|
||||||
<action name="procRssAdminInsertConfig" type="controller" standalone="true" />
|
<action name="procRssAdminInsertConfig" type="controller" standalone="true" ruleset="insertRssConfig" />
|
||||||
<action name="procRssAdminInsertModuleConfig" type="controller" standalone="true" />
|
<action name="procRssAdminInsertModuleConfig" type="controller" standalone="true" ruleset="insertRssModuleConfig" />
|
||||||
</actions>
|
</actions>
|
||||||
</module>
|
</module>
|
||||||
|
|
|
||||||
|
|
@ -70,10 +70,15 @@
|
||||||
$alt_message = Context::getLang($alt_message);
|
$alt_message = Context::getLang($alt_message);
|
||||||
Context::set('msg', $alt_message);
|
Context::set('msg', $alt_message);
|
||||||
|
|
||||||
$this->setLayoutPath('./common/tpl');
|
//$this->setLayoutPath('./common/tpl');
|
||||||
$this->setLayoutFile('default_layout.html');
|
//$this->setLayoutFile('default_layout.html');
|
||||||
$this->setTemplatePath($this->module_path.'tpl');
|
//$this->setTemplatePath($this->module_path.'tpl');
|
||||||
$this->setTemplateFile("top_refresh.html");
|
//$this->setTemplateFile("top_refresh.html");
|
||||||
|
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
|
||||||
|
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispRssAdminIndex');
|
||||||
|
header('location:'.$returnUrl);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -107,6 +112,11 @@
|
||||||
|
|
||||||
$this->setError(-1);
|
$this->setError(-1);
|
||||||
$this->setMessage('success_updated');
|
$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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
13
modules/rss/ruleset/insertRssConfig.xml
Normal file
13
modules/rss/ruleset/insertRssConfig.xml
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ruleset version="1.5.0">
|
||||||
|
<customrules>
|
||||||
|
<rule name="boolean" type="enum" test="Y,N" />
|
||||||
|
</customrules>
|
||||||
|
<fields>
|
||||||
|
<field name="module" required="true" default="rss" />
|
||||||
|
<field name="act" required="true" default="procRssAdminInsertConfig" />
|
||||||
|
<field name="use_total_feed" required="true" default="Y" rule="boolean" />
|
||||||
|
<field name="feed_title" required="true" />
|
||||||
|
<field name="feed_document_count" required="true" rule="number" default="15" />
|
||||||
|
</fields>
|
||||||
|
</ruleset>
|
||||||
13
modules/rss/ruleset/insertRssModuleConfig.xml
Normal file
13
modules/rss/ruleset/insertRssModuleConfig.xml
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ruleset version="1.5.0">
|
||||||
|
<customrules>
|
||||||
|
<rule name="open_type" type="enum" test="Y,N,H" />
|
||||||
|
<rule name="total_type" type="enum" test="N,T_N" />
|
||||||
|
</customrules>
|
||||||
|
<fields>
|
||||||
|
<field name="act" required="true" default="procRssAdminInsertModuleConfig" />
|
||||||
|
<field name="target_module_srl" required="true" />
|
||||||
|
<field name="open_rss" required="true" rule="open_type" default="Y" />
|
||||||
|
<field name="open_total_feed" required="true" rule="total_type" default="N" />
|
||||||
|
</fields>
|
||||||
|
</ruleset>
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
<!--%import("js/rss.js")-->
|
<!--%import("js/rss.js")-->
|
||||||
<h3 class="xeAdmin">{$lang->total_feed} <span class="gray">{$lang->cmd_management}</span></h3>
|
<h3 class="xeAdmin">{$lang->total_feed} <span class="gray">{$lang->cmd_management}</span></h3>
|
||||||
|
|
||||||
<!--%import("filter/insert_rss_config.xml")-->
|
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
|
||||||
<form id="fo_layout" action="./" method="post" enctype="multipart/form-data" target="hidden_iframe">
|
<form ruleset="insertRssConfig" id="fo_layout" action="./" method="post" enctype="multipart/form-data">
|
||||||
<input type="hidden" name="module" value="rss" />
|
<input type="hidden" name="module" value="rss" />
|
||||||
<input type="hidden" name="act" value="procRssAdminInsertConfig" />
|
<input type="hidden" name="act" value="procRssAdminInsertConfig" />
|
||||||
<table cellspacing="0" class="rowTable">
|
<table cellspacing="0" class="rowTable">
|
||||||
|
|
@ -79,5 +79,3 @@
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<iframe name="hidden_iframe" frameborder="0" style="display:none"></iframe>
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<!--%import("filter/insert_rss_module_config.xml")-->
|
<form ruleset="insertRssModuleConfig" action="./" method="post">
|
||||||
|
<input type="hidden" name="act" value="procRssAdminInsertModuleConfig" />
|
||||||
<form action="./" method="post" onsubmit="return procFilter(this, insert_rss_module_config)">
|
<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="{$rss_config->module_srl?$rss_config->module_srl:$module_srls}" />
|
<input type="hidden" name="target_module_srl" value="{$rss_config->module_srl?$rss_config->module_srl:$module_srls}" />
|
||||||
|
|
||||||
<h4 class="xeAdmin">{$lang->open_rss}</h4>
|
<h4 class="xeAdmin">{$lang->open_rss}</h4>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue