mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,45 +5,45 @@
|
||||||
* @brief The admin view class of the rss module
|
* @brief The admin view class of the rss module
|
||||||
**/
|
**/
|
||||||
|
|
||||||
class rssAdminView extends rss {
|
class rssAdminView extends rss {
|
||||||
/**
|
/**
|
||||||
* @brief Initialization
|
* @brief Initialization
|
||||||
**/
|
**/
|
||||||
function init() {
|
function init() {
|
||||||
//Set template path
|
//Set template path
|
||||||
$this->setTemplatePath($this->module_path.'tpl');
|
$this->setTemplatePath($this->module_path.'tpl');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief In case an administrator page has been initialized
|
* @brief In case an administrator page has been initialized
|
||||||
**/
|
**/
|
||||||
function dispRssAdminIndex() {
|
function dispRssAdminIndex() {
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$rss_config = $oModuleModel->getModulePartConfigs('rss');
|
$rss_config = $oModuleModel->getModulePartConfigs('rss');
|
||||||
$total_config = $oModuleModel->getModuleConfig('rss');
|
$total_config = $oModuleModel->getModuleConfig('rss');
|
||||||
$oRssModel = &getModel('rss');
|
$oRssModel = &getModel('rss');
|
||||||
|
|
||||||
if($rss_config) {
|
if($rss_config) {
|
||||||
foreach($rss_config as $module_srl => $config) {
|
foreach($rss_config as $module_srl => $config) {
|
||||||
if($config) {
|
if($config) {
|
||||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||||
$columnList = array('sites.domain');
|
$columnList = array('sites.domain');
|
||||||
$site = $oModuleModel->getSiteInfo($module_info->site_srl, $columnList);
|
$site = $oModuleModel->getSiteInfo($module_info->site_srl, $columnList);
|
||||||
if(!strpos($site->domain, '.')) $vid = $site->domain;
|
if(!strpos($site->domain, '.')) $vid = $site->domain;
|
||||||
else $site = null;
|
else $site = null;
|
||||||
if($site) $feed_config[$module_srl]['url'] = $oRssModel->getModuleFeedUrl($vid, $module_info->mid, 'rss');
|
if($site) $feed_config[$module_srl]['url'] = $oRssModel->getModuleFeedUrl($vid, $module_info->mid, 'rss');
|
||||||
$feed_config[$module_srl]['mid'] = $module_info->mid;
|
$feed_config[$module_srl]['mid'] = $module_info->mid;
|
||||||
$feed_config[$module_srl]['open_feed'] = $config->open_rss;
|
$feed_config[$module_srl]['open_feed'] = $config->open_rss;
|
||||||
$feed_config[$module_srl]['open_total_feed'] = $config->open_total_feed;
|
$feed_config[$module_srl]['open_total_feed'] = $config->open_total_feed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Context::set('feed_config', $feed_config);
|
Context::set('feed_config', $feed_config);
|
||||||
Context::set('total_config', $total_config);
|
Context::set('total_config', $total_config);
|
||||||
$this->setTemplatePath($this->module_path.'tpl');
|
$this->setTemplatePath($this->module_path.'tpl');
|
||||||
$this->setTemplateFile('rss_admin_index');
|
$this->setTemplateFile('rss_admin_index');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
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,10 +1,10 @@
|
||||||
<!--%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">
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row"><div>{$lang->total_feed}</div></th>
|
<th scope="row"><div>{$lang->total_feed}</div></th>
|
||||||
|
|
@ -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