mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
RSS 모듈 재정비
This commit is contained in:
parent
cc21af669f
commit
2440058557
27 changed files with 613 additions and 764 deletions
|
|
@ -7,77 +7,49 @@
|
|||
*/
|
||||
class rssController extends rss
|
||||
{
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check whether to use RSS rss url by adding
|
||||
*
|
||||
* @return Object
|
||||
* Set RSS URL
|
||||
*/
|
||||
function triggerRssUrlInsert()
|
||||
function triggerRssUrlInsert($obj)
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$total_config = $oModuleModel->getModuleConfig('rss');
|
||||
$current_module_srl = Context::get('module_srl');
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
|
||||
if(is_array($current_module_srl))
|
||||
if(!$current_module_srl = Context::get('current_module_info')->module_srl)
|
||||
{
|
||||
unset($current_module_srl);
|
||||
return new Object();
|
||||
}
|
||||
if(!$current_module_srl) {
|
||||
$current_module_info = Context::get('current_module_info');
|
||||
$current_module_srl = $current_module_info->module_srl;
|
||||
}
|
||||
|
||||
if(!$current_module_srl) return new Object();
|
||||
// Imported rss settings of the selected module
|
||||
|
||||
$oRssModel = getModel('rss');
|
||||
$rss_config = $oRssModel->getRssModuleConfig($current_module_srl);
|
||||
|
||||
if($rss_config->open_rss != 'N')
|
||||
$config = $oRssModel->getConfig();
|
||||
$module_config = $oRssModel->getRssModuleConfig($current_module_srl);
|
||||
|
||||
if($config->use_total_feed != 'N' && Context::get('site_module_info')->mid == Context::get('mid'))
|
||||
{
|
||||
Context::set('rss_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'rss'));
|
||||
Context::set('atom_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'atom'));
|
||||
Context::set('general_rss_url', $oRssModel->getRssURL('rss'));
|
||||
Context::set('general_atom_url', $oRssModel->getRssURL('atom'));
|
||||
}
|
||||
|
||||
if(Context::isInstalled() && $site_module_info->mid == Context::get('mid') && $total_config->use_total_feed != 'N')
|
||||
|
||||
if($module_config->open_rss != 'N')
|
||||
{
|
||||
if(Context::isAllowRewrite() && !Context::get('vid'))
|
||||
{
|
||||
$request_uri = Context::getRequestUri();
|
||||
Context::set('general_rss_url', $request_uri.'rss');
|
||||
Context::set('general_atom_url', $request_uri.'atom');
|
||||
}
|
||||
else
|
||||
{
|
||||
Context::set('general_rss_url', getUrl('','module','rss','act','rss'));
|
||||
Context::set('general_atom_url', getUrl('','module','rss','act','atom'));
|
||||
}
|
||||
Context::set('rss_url', $oRssModel->getRssURL('rss', Context::get('mid')));
|
||||
Context::set('atom_url', $oRssModel->getRssURL('atom', Context::get('mid')));
|
||||
}
|
||||
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Copy RSS configuration
|
||||
*/
|
||||
function triggerCopyModule(&$obj)
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$rssConfig = $oModuleModel->getModulePartConfig('rss', $obj->originModuleSrl);
|
||||
|
||||
$oModuleController = getController('module');
|
||||
if(is_array($obj->moduleSrlList))
|
||||
$module_config = getModel('rss')->getRssModuleConfig($obj->originModuleSrl);
|
||||
|
||||
foreach($obj->moduleSrlList as $module_srl)
|
||||
{
|
||||
foreach($obj->moduleSrlList AS $key=>$moduleSrl)
|
||||
{
|
||||
$oModuleController->insertModulePartConfig('rss', $moduleSrl, $rssConfig);
|
||||
}
|
||||
getController('module')->insertModulePartConfig('rss', $module_srl, $module_config);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue