merge from 1.7.3.5(r13153:r13167)

git-svn-id: http://xe-core.googlecode.com/svn/trunk@13168 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ngleader 2013-09-29 23:32:39 +00:00
parent cc47d2b247
commit 2d3f149b5a
2042 changed files with 129266 additions and 126243 deletions

View file

@ -9,7 +9,7 @@
<title xml:lang="ru">RSS</title>
<title xml:lang="zh-TW">RSS</title>
<title xml:lang="tr">RSS</title>
<description xml:lang="ko">RSS 출력을 담당하는 모듈</description>
<description xml:lang="ko">RSS 출력을 담당</description>
<description xml:lang="zh-CN">负责输出RSS的模块。</description>
<description xml:lang="jp">RSS出力を担うモジュールです。</description>
<description xml:lang="en">This modules is for printing RSS.</description>

View file

@ -6,9 +6,9 @@
<action name="dispRssAdminIndex" type="view" index="true" standalone="true" admin_index="true" menu_name="rss" menu_index="true" />
<action name="rss" type="view" standalone="true" />
<action name="atom" type="view" standalone="true" />
<action name="procRssAdminToggleActivate" type="controller" standalone="true" />
<action name="procRssAdminInsertConfig" type="controller" standalone="true" ruleset="insertRssConfig" />
<action name="procRssAdminInsertModuleConfig" type="controller" standalone="true" ruleset="insertRssModuleConfig" />
<action name="procRssAdminDeleteFeedImage" type="controller" standalone="true" />
<action name="procRssAdminInsertModuleConfig" type="controller" standalone="true" />
</actions>
<menus>
<menu name="rss">

View file

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<lang>
<item name="feed">
<value xml:lang="ko"><![CDATA[피드(Feed) 발행]]></value>
<value xml:lang="ko"><![CDATA[피드 발행]]></value>
<value xml:lang="en"><![CDATA[Publish RSS Feed]]></value>
<value xml:lang="jp"><![CDATA[RSS発行]]></value>
<value xml:lang="zh-CN"><![CDATA[RSS发布]]></value>
@ -17,7 +17,7 @@
<value xml:lang="ru"><![CDATA[Общий Feed]]></value>
</item>
<item name="rss_disable">
<value xml:lang="ko"><![CDATA[피드(Feed) 끄기]]></value>
<value xml:lang="ko"><![CDATA[피드 끄기]]></value>
<value xml:lang="en"><![CDATA[Disable RSS Feed]]></value>
<value xml:lang="jp"><![CDATA[RSS機能オフ]]></value>
<value xml:lang="zh-CN"><![CDATA[关闭RSS]]></value>
@ -123,7 +123,7 @@
<value xml:lang="ru"><![CDATA[Включено в общий Feed]]></value>
</item>
<item name="about_rss_disable">
<value xml:lang="ko"><![CDATA[체크하면 피드(Feed) 출력을 하지 않습니다.]]></value>
<value xml:lang="ko"><![CDATA[체크하면 피드(Feed) 출력을 하지 않습니다.]]></value>
<value xml:lang="en"><![CDATA[If checked, RSS will be disabled.]]></value>
<value xml:lang="jp"><![CDATA[チェックを入れるとRSSの出力を行いません。]]></value>
<value xml:lang="zh-CN"><![CDATA[选此项不显示RSS。]]></value>
@ -135,7 +135,7 @@
<value xml:lang="vi"><![CDATA[Nếu chọn, RSS sẽ bị tắt.]]></value>
</item>
<item name="about_rss_type">
<value xml:lang="ko"><![CDATA[출력하실 피드(Feed) 형식을 지정하실 수 있습니다.]]></value>
<value xml:lang="ko"><![CDATA[출력할 피드(Feed) 형식을 지정할 수 있습니다.]]></value>
<value xml:lang="en"><![CDATA[You can assign RSS feed type.]]></value>
<value xml:lang="jp"><![CDATA[出力するRSSタイプを指定することができます。]]></value>
<value xml:lang="zh-CN"><![CDATA[可以指定要显示的RSS形式。]]></value>
@ -147,8 +147,8 @@
<value xml:lang="vi"><![CDATA[Bạn có thể đặt định dạng cho RSS.]]></value>
</item>
<item name="about_open_rss">
<value xml:lang="ko"><![CDATA[현재 모듈에 대한 피드(Feed) 공개를 선택하실 수 있습니다. 글 열람 권한과 상관없이 옵션에 따라 RSS가 공개됩니다.]]></value>
<value xml:lang="en"><![CDATA[You can select RSS on the current module to be open to the public.\nIf it is enabled, the article will be open to the public despite its view permissions.]]></value>
<value xml:lang="ko"><![CDATA[현재 페이지에 대한 피드(Feed) 공개를 선택할 수 있습니다. 글 열람 권한과 상관없이 옵션에 따라 RSS가 공개됩니다.]]></value>
<value xml:lang="en"><![CDATA[You can select RSS on the current page to be open to the public.\nIf it is enabled, the article will be open to the public despite its view permissions.]]></value>
<value xml:lang="jp"><![CDATA[現在のモジュールに対して「RSS配信」を選択することができます。書き込みの内容が読める権限とは関係なくオプションによってRSSが配信されます。]]></value>
<value xml:lang="zh-CN"><![CDATA[可以指定RSS公开程度,RSS公开不受查看内容权限的限制。]]></value>
<value xml:lang="zh-TW"><![CDATA[選擇該模組 RSS Feed 的公開程度。公開 RSS Feed 將不受檢視內容權限的限制,隨公開 RSS Feed 的選項公開 RSS Feed。]]></value>
@ -159,14 +159,14 @@
<value xml:lang="vi"><![CDATA[Bạn có thể mở công khai RSS trên Module hiện tại.\nKhông ảnh hưởng tới quyền truy cập bài viết, RSS sẽ mở công khai với tùy chọn của nó.]]></value>
</item>
<item name="about_feed_description">
<value xml:lang="ko"><![CDATA[발행될 피드에 대한 설명을 입력하실 수 있습니다. 설명을 입력하지 않으실 경우, 해당 모듈에 설정된 관리용 설명이 포함됩니다.]]></value>
<value xml:lang="ko"><![CDATA[발행될 피드에 대한 설명을 입력할 수 있습니다. 설명을 입력하지 않으면 해당 페이지의 관리용 설명이 포함됩니다.]]></value>
<value xml:lang="en"><![CDATA[You can enter the description on the RSS feed to be published. If you don't enter this, the description of each module is displayed by default.]]></value>
<value xml:lang="jp"><![CDATA[発行するRSSに関する説明を入力します。未入力した場合は該当モジュールで設定された管理用説明が含まれます。]]></value>
<value xml:lang="zh-CN"><![CDATA[可以输入简单说明,留空输出该模块的说明。]]></value>
<value xml:lang="zh-TW"><![CDATA[請輸入簡介。 也可輸入相關管理使用說明。]]></value>
</item>
<item name="about_feed_copyright">
<value xml:lang="ko"><![CDATA[발행될 피드에 대한 저작권 정보를 입력하실 수 있습니다. 입력하지 않으면 전체 피드 저작권 설정과 동일하게 적용됩니다.]]></value>
<value xml:lang="ko"><![CDATA[발행될 피드에 대한 저작권 정보를 입력 수 있습니다. 입력하지 않으면 전체 피드 저작권 설정과 동일하게 적용됩니다.]]></value>
<value xml:lang="en"><![CDATA[You can enter copyright information on the RSS feed. If you don't enter this, the copyright of the entire RSS feeds is applied.]]></value>
<value xml:lang="jp"><![CDATA[発行するRSSのコンテンツに対する著作権情報です。未入力の場合、全体RSS著作権の設定と同様に適用されます。]]></value>
<value xml:lang="zh-CN"><![CDATA[RSS Feed版权信息。留空版权信息参照整站RSS的版权信息。]]></value>
@ -199,4 +199,4 @@
<value xml:lang="zh-TW"><![CDATA[錯誤的檔案格式,無法上傳。\n只允許上傳 JPEG, GIF, PNG 等檔案格式。]]></value>
<value xml:lang="ru"><![CDATA[Неправильный тип картинки\nПоддерживаются только JPEG, GIF, PNG файлы]]></value>
</item>
</lang>
</lang>

View file

@ -1,180 +1,189 @@
<?php
/**
* The admin controller class of the rss module
/**
* The admin controller class of the rss module
*
* @author NHN (developers@xpressengine.com)
*/
class rssAdminController extends rss
{
/**
* Initialization
*
* @author NHN (developers@xpressengine.com)
**/
* @return void
*/
function init()
{
}
class rssAdminController extends rss {
/**
* All RSS feeds configurations
*
* @return void
*/
function procRssAdminInsertConfig()
{
$oModuleModel = &getModel('module');
$total_config = $oModuleModel->getModuleConfig('rss');
/**
* Initialization
*
* @return void
**/
function init() {
}
$config_vars = Context::getRequestVars();
/**
* All RSS feeds configurations
*
* @return void
**/
function procRssAdminInsertConfig() {
$oModuleModel = &getModel('module');
$total_config = $oModuleModel->getModuleConfig('rss');
$config_vars->feed_document_count = (int)$config_vars->feed_document_count;
$config_vars = Context::getRequestVars();
if(!$config_vars->use_total_feed) $alt_message = 'msg_invalid_request';
if(!in_array($config_vars->use_total_feed, array('Y','N'))) $config_vars->open_rss = 'Y';
$config_vars->feed_document_count = (int)$config_vars->feed_document_count;
if($config_vars->image || $config_vars->del_image)
{
$image_obj = $config_vars->image;
$config_vars->image = $total_config->image;
// Get a variable for the delete request
if($config_vars->del_image == 'Y' || $image_obj)
{
FileHandler::removeFile($config_vars->image);
$config_vars->image = '';
$total_config->image = '';
}
// Ignore if the file is not the one which has been successfully uploaded
if($image_obj['tmp_name'] && is_uploaded_file($image_obj['tmp_name']))
{
// Ignore if the file is not an image (swf is accepted ~)
$image_obj['name'] = Context::convertEncodingStr($image_obj['name']);
if(!$config_vars->use_total_feed) $alt_message = 'msg_invalid_request';
if(!in_array($config_vars->use_total_feed, array('Y','N'))) $config_vars->open_rss = 'Y';
if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) $alt_message = 'msg_rss_invalid_image_format';
else
{
// Upload the file to a path
$path = './files/attach/images/rss/';
// Create a directory
if(!FileHandler::makeDir($path)) $alt_message = 'msg_error_occured';
else
{
$filename = $path.$image_obj['name'];
// Move the file
if(!move_uploaded_file($image_obj['tmp_name'], $filename)) $alt_message = 'msg_error_occured';
else
{
$config_vars->image = $filename;
}
}
}
}
}
if(!$config_vars->image && $config_vars->del_image != 'Y') $config_vars->image = $total_config->image;
if($config_vars->image || $config_vars->del_image) {
$image_obj = $config_vars->image;
$config_vars->image = $total_config->image;
// Get a variable for the delete request
if($config_vars->del_image == 'Y' || $image_obj) {
FileHandler::removeFile($config_vars->image);
$config_vars->image = '';
$total_config->image = '';
}
// Ignore if the file is not the one which has been successfully uploaded
if($image_obj['tmp_name'] && is_uploaded_file($image_obj['tmp_name'])) {
// Ignore if the file is not an image (swf is accepted ~)
$image_obj['name'] = Context::convertEncodingStr($image_obj['name']);
$output = $this->setFeedConfig($config_vars);
if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) $alt_message = 'msg_rss_invalid_image_format';
else {
// Upload the file to a path
$path = './files/attach/images/rss/';
// Create a directory
if(!FileHandler::makeDir($path)) $alt_message = 'msg_error_occured';
else{
$filename = $path.$image_obj['name'];
// Move the file
if(!move_uploaded_file($image_obj['tmp_name'], $filename)) $alt_message = 'msg_error_occured';
else {
$config_vars->image = $filename;
}
}
}
}
}
if(!$config_vars->image && $config_vars->del_image != 'Y') $config_vars->image = $total_config->image;
if(!$alt_message) $alt_message = 'success_updated';
$output = $this->setFeedConfig($config_vars);
$alt_message = Context::getLang($alt_message);
$this->setMessage($alt_message, 'info');
if(!$alt_message) $alt_message = 'success_updated';
//$this->setLayoutPath('./common/tpl');
//$this->setLayoutFile('default_layout.html');
//$this->setTemplatePath($this->module_path.'tpl');
//$this->setTemplateFile("top_refresh.html");
$alt_message = Context::getLang($alt_message);
Context::set('msg', $alt_message);
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispRssAdminIndex');
$this->setRedirectUrl($returnUrl);
}
//$this->setLayoutPath('./common/tpl');
//$this->setLayoutFile('default_layout.html');
//$this->setTemplatePath($this->module_path.'tpl');
//$this->setTemplateFile("top_refresh.html");
public function procRssAdminDeleteFeedImage()
{
$delImage = Context::get('del_image');
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispRssAdminIndex');
$this->setRedirectUrl($returnUrl);
}
$oModuleModel = &getModel('module');
$originConfig = $oModuleModel->getModuleConfig('rss');
// Get a variable for the delete request
if($delImage == 'Y')
{
FileHandler::removeFile($originConfig->image);
/**
* RSS Module configurations
*
* @return void
**/
function procRssAdminInsertModuleConfig() {
// Get the object
$module_srl = Context::get('target_module_srl');
// In case of batch configuration of several modules
if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
else $module_srl = array($module_srl);
if(!is_array($module_srl)) $module_srl[0] = $module_srl;
$originConfig->image = '';
$output = $this->setFeedConfig($originConfig);
return new Object(0, 'success_updated');
}
return new Object(-1, 'fail_to_delete');
}
$config_vars = Context::getRequestVars();
/**
* RSS Module configurations
*
* @return void
*/
function procRssAdminInsertModuleConfig()
{
$config_vars = Context::getRequestVars();
$open_rss = $config_vars->open_rss;
$open_total_feed = $config_vars->open_total_feed;
$feed_description = trim($config_vars->feed_description);
$feed_copyright = trim($config_vars->feed_copyright);
$openRssList = $config_vars->open_rss;
$openTotalFeedList = $config_vars->open_total_feed;
$feedDescriptionList = $config_vars->feed_description;
$feedCopyrightList = $config_vars->feed_copyright;
$targetModuleSrl = $config_vars->target_module_srl;
if(!$module_srl || !$open_rss) return new Object(-1, 'msg_invalid_request');
if($targetModuleSrl && !is_array($openRssList))
{
$openRssList = array($targetModuleSrl => $openRssList);
$openTotalFeedList = array($targetModuleSrl => $openTotalFeedList);
$feedDescriptionList = array($targetModuleSrl => $feedDescriptionList);
$feedCopyrightList = array($targetModuleSrl => $feedCopyrightList);
}
if(!in_array($open_rss, array('Y','H','N'))) $open_rss = 'N';
// Save configurations
for($i=0;$i<count($module_srl);$i++) {
$srl = trim($module_srl[$i]);
if(!$srl) continue;
$output = $this->setRssModuleConfig($srl, $open_rss, $open_total_feed, $feed_description, $feed_copyright);
}
if(is_array($openRssList))
{
foreach($openRssList AS $module_srl=>$open_rss)
{
if(!$module_srl || !$open_rss)
{
return new Object(-1, 'msg_invalid_request');
}
//$this->setError(0);
$this->setMessage('success_updated', 'info');
if(!in_array($open_rss, array('Y','H','N'))) $open_rss = 'N';
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminContent');
$this->setRedirectUrl($returnUrl);
}
$this->setRssModuleConfig($module_srl, $open_rss, $openTotalFeedList[$module_srl], $feedDescriptionList[$module_srl], $feedCopyrightList[$module_srl]);
}
}
//$this->setError(0);
$this->setMessage('success_updated', 'info');
/**
* All Feeds with or without change
*
* @return Object
**/
function procRssAdminToggleActivate() {
$oRssModel = &getModel('rss');
// Get mid value
$module_srl = Context::get('module_srl');
if($module_srl) {
$config = $oRssModel->getRssModuleConfig($module_srl);
if($config->open_total_feed == 'T_N') {
$this->setRssModuleConfig($module_srl, $config->open_rss, 'T_Y', $config->feed_description, $config->feed_copyright);
$this->add("open_total_feed", 'T_Y');
}
else {
$this->setRssModuleConfig($module_srl, $config->open_rss, 'T_N', $config->feed_description, $config->feed_copyright);
$this->add("open_total_feed", 'T_N');
}
}
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminContent');
$this->setRedirectUrl($returnUrl);
}
$this->add("module_srl", $module_srl);
}
/**
* A funciton to configure all Feeds of the RSS module
*
* @param Object $config RSS all feeds config list
* @return Object
*/
function setFeedConfig($config)
{
$oModuleController = &getController('module');
$oModuleController->insertModuleConfig('rss',$config);
return new Object();
}
/**
* A funciton to configure all Feeds of the RSS module
*
* @param Object $config RSS all feeds config list
* @return Object
**/
function setFeedConfig($config) {
$oModuleController = &getController('module');
$oModuleController->insertModuleConfig('rss',$config);
return new Object();
}
/**
* A function t configure the RSS module
*
* @param integer $module_srl Module_srl
* @param string $open_rss Choose open rss type. Y : Open all, H : Open summary, N : Not open
* @param string $open_total_feed N : use open total feed, T_N : not use open total feed
* @param string $feed_description Default value is 'N'
* @param string $feed_copyright Default value is 'N'
* @return Object
**/
function setRssModuleConfig($module_srl, $open_rss, $open_total_feed = 'N', $feed_description = 'N', $feed_copyright = 'N') {
$oModuleController = &getController('module');
$config->open_rss = $open_rss;
$config->open_total_feed = $open_total_feed;
if($feed_description != 'N') { $config->feed_description = $feed_description; }
if($feed_copyright != 'N') { $config->feed_copyright = $feed_copyright; }
$oModuleController->insertModulePartConfig('rss',$module_srl,$config);
return new Object();
}
}
?>
/**
* A function t configure the RSS module
*
* @param integer $module_srl Module_srl
* @param string $open_rss Choose open rss type. Y : Open all, H : Open summary, N : Not open
* @param string $open_total_feed N : use open total feed, T_N : not use open total feed
* @param string $feed_description Default value is 'N'
* @param string $feed_copyright Default value is 'N'
* @return Object
*/
function setRssModuleConfig($module_srl, $open_rss, $open_total_feed = 'N', $feed_description = 'N', $feed_copyright = 'N')
{
$oModuleController = &getController('module');
$config->open_rss = $open_rss;
$config->open_total_feed = $open_total_feed;
if($feed_description != 'N') { $config->feed_description = $feed_description; }
if($feed_copyright != 'N') { $config->feed_copyright = $feed_copyright; }
$oModuleController->insertModulePartConfig('rss',$module_srl,$config);
return new Object();
}
}
/* End of file rss.admin.controller.php */
/* Location: ./modules/rss/rss.admin.controller.php */

View file

@ -1,60 +1,69 @@
<?php
/**
* The admin view class of the rss module
/**
* The admin view class of the rss module
*
* @author NHN (developers@xpressengine.com)
*/
class rssAdminView extends rss
{
/**
* Initialization
*
* @author NHN (developers@xpressengine.com)
**/
* @return void
*/
function init()
{
//Set template path
$this->setTemplatePath($this->module_path.'tpl');
}
class rssAdminView extends rss {
/**
* Initialization
*
* @return void
**/
function init() {
//Set template path
$this->setTemplatePath($this->module_path.'tpl');
/**
* In case an administrator page has been initialized
*
* @return Object
*/
function dispRssAdminIndex()
{
$oModuleModel = &getModel('module');
$rss_config = $oModuleModel->getModulePartConfigs('rss');
$total_config = $oModuleModel->getModuleConfig('rss');
if(!$total_config)
{
$total_config =new stdClass();
}
$oRssModel = &getModel('rss');
/**
* In case an administrator page has been initialized
*
* @return Object
**/
function dispRssAdminIndex() {
$oModuleModel = &getModel('module');
$rss_config = $oModuleModel->getModulePartConfigs('rss');
$total_config = $oModuleModel->getModuleConfig('rss');
$oRssModel = &getModel('rss');
if($rss_config) {
foreach($rss_config as $module_srl => $config) {
if($config) {
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
$columnList = array('sites.domain');
$site = $oModuleModel->getSiteInfo($module_info->site_srl, $columnList);
if(!strpos($site->domain, '.')) $vid = $site->domain;
else $site = null;
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]['open_feed'] = $config->open_rss;
$feed_config[$module_srl]['open_total_feed'] = $config->open_total_feed;
$feed_config[$module_srl]['feed_description'] = $config->feed_description;
}
if($rss_config)
{
foreach($rss_config as $module_srl => $config)
{
if($config)
{
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
$columnList = array('sites.domain');
$site = $oModuleModel->getSiteInfo($module_info->site_srl, $columnList);
if(!strpos($site->domain, '.')) $vid = $site->domain;
else $site = null;
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]['open_feed'] = $config->open_rss;
$feed_config[$module_srl]['open_total_feed'] = $config->open_total_feed;
$feed_config[$module_srl]['feed_description'] = $config->feed_description;
}
}
if(!$total_config->feed_document_count) $total_config->feed_document_count = 15;
Context::set('feed_config', $feed_config);
Context::set('total_config', $total_config);
$security = new Security();
$security->encodeHTML('feed_config..mid','feed_config..url');
$security->encodeHTML('total_config..');
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('rss_admin_index');
}
if(!$total_config->feed_document_count) $total_config->feed_document_count = 15;
Context::set('feed_config', $feed_config);
Context::set('total_config', $total_config);
$security = new Security();
$security->encodeHTML('feed_config..mid','feed_config..url');
$security->encodeHTML('total_config..');
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('rss_admin_index');
}
?>
}
/* End of file rss.admin.view.php */
/* Location: ./modules/rss/rss.admin.view.php */

View file

@ -1,88 +1,91 @@
<?php
/**
* High class of rss module
/**
* High class of rss module
*
* @author NHN (developers@xpressengine.com)
*/
class rss extends ModuleObject
{
/**
* Additional tasks required to accomplish during the installation
*
* @author NHN (developers@xpressengine.com)
**/
* @return Object
*/
function moduleInstall()
{
// Register in action forward
$oModuleController = &getController('module');
class rss extends ModuleObject {
$oModuleController->insertActionForward('rss', 'view', 'rss');
$oModuleController->insertActionForward('rss', 'view', 'atom');
// 2007.10.18 Add a trigger for participating additional configurations of the service module
$oModuleController->insertTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before');
// 2007. 10. 19 Call the trigger to set RSS URL before outputing
$oModuleController->insertTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after');
/**
* Additional tasks required to accomplish during the installation
*
* @return Object
**/
function moduleInstall() {
// Register in action forward
$oModuleController = &getController('module');
return new Object();
}
$oModuleController->insertActionForward('rss', 'view', 'rss');
$oModuleController->insertActionForward('rss', 'view', 'atom');
// 2007.10.18 Add a trigger for participating additional configurations of the service module
$oModuleController->insertTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before');
// 2007. 10. 19 Call the trigger to set RSS URL before outputing
$oModuleController->insertTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after');
/**
* A method to check if the installation has been successful
* @return bool
*/
function checkUpdate()
{
$oModuleModel = &getModel('module');
// Add the Action forward for atom
if(!$oModuleModel->getActionForward('atom')) return true;
// 2007. 10. Add a trigger for participating additional configurations of the service module
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before')) return true;
// 2007. 10. 19 Call the trigger to set RSS URL before outputing
if(!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after')) return true;
return new Object();
}
if($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before')) return true;
/**
* A method to check if the installation has been successful
* @return bool
**/
function checkUpdate() {
$oModuleModel = &getModel('module');
// Add the Action forward for atom
if(!$oModuleModel->getActionForward('atom')) return true;
// 2007. 10. Add a trigger for participating additional configurations of the service module
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before')) return true;
// 2007. 10. 19 Call the trigger to set RSS URL before outputing
if(!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after')) return true;
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after')) return true;
if($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before')) return true;
return false;
}
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after')) return true;
/**
* Execute update
*
* @return Object
*/
function moduleUpdate()
{
$oModuleModel = &getModel('module');
$oModuleController = &getController('module');
// Add atom act
if(!$oModuleModel->getActionForward('atom'))
$oModuleController->insertActionForward('rss', 'view', 'atom');
// 2007. 10. An additional set of 18 to participate in a service module, add a trigger
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before'))
$oModuleController->insertTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before');
// 2007. 10. 19 outputs the trigger before you call to set up rss url
if(!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after'))
$oModuleController->insertTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after');
if($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before'))
$oModuleController->deleteTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before');
return false;
}
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after'))
{
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after');
}
/**
* Execute update
*
* @return Object
**/
function moduleUpdate() {
$oModuleModel = &getModel('module');
$oModuleController = &getController('module');
// Add atom act
if(!$oModuleModel->getActionForward('atom'))
$oModuleController->insertActionForward('rss', 'view', 'atom');
// 2007. 10. An additional set of 18 to participate in a service module, add a trigger
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before'))
$oModuleController->insertTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before');
// 2007. 10. 19 outputs the trigger before you call to set up rss url
if(!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after'))
$oModuleController->insertTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after');
if($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before'))
$oModuleController->deleteTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before');
return new Object(0, 'success_updated');
}
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after'))
{
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after');
}
return new Object(0, 'success_updated');
}
/**
* Re-generate the cache file
*
* @return void
**/
function recompileCache() {
}
}
?>
/**
* Re-generate the cache file
*
* @return void
*/
function recompileCache()
{
}
}
/* End of file rss.class.php */
/* Location: ./modules/rss/rss.class.php */

View file

@ -1,77 +1,84 @@
<?php
/**
* The controller class of rss module
/**
* The controller class of rss module
*
* @author NHN (developers@xpressengine.com)
*/
class rssController extends rss
{
/**
* Initialization
*
* @author NHN (developers@xpressengine.com)
**/
* @return void
*/
function init()
{
}
class rssController extends rss {
/**
* Check whether to use RSS rss url by adding
*
* @return Object
*/
function triggerRssUrlInsert()
{
$oModuleModel = &getModel('module');
$total_config = $oModuleModel->getModuleConfig('rss');
$current_module_srl = Context::get('module_srl');
$site_module_info = Context::get('site_module_info');
/**
* Initialization
*
* @return void
**/
function init() {
}
/**
* Check whether to use RSS rss url by adding
*
* @return Object
**/
function triggerRssUrlInsert() {
$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))
{
unset($current_module_srl);
}
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') {
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'));
}
if(Context::isInstalled() && $site_module_info->mid == Context::get('mid') && $total_config->use_total_feed != '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'));
}
}
return new Object();
}
function triggerCopyModule(&$obj)
if(is_array($current_module_srl))
{
$oModuleModel = &getModel('module');
$rssConfig = $oModuleModel->getModulePartConfig('rss', $obj->originModuleSrl);
unset($current_module_srl);
}
if(!$current_module_srl) {
$current_module_info = Context::get('current_module_info');
$current_module_srl = $current_module_info->module_srl;
}
$oModuleController = &getController('module');
if(is_array($obj->moduleSrlList))
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')
{
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'));
}
if(Context::isInstalled() && $site_module_info->mid == Context::get('mid') && $total_config->use_total_feed != 'N')
{
if(Context::isAllowRewrite() && !Context::get('vid'))
{
foreach($obj->moduleSrlList AS $key=>$moduleSrl)
{
$oModuleController->insertModulePartConfig('rss', $moduleSrl, $rssConfig);
}
$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'));
}
}
}
?>
return new Object();
}
function triggerCopyModule(&$obj)
{
$oModuleModel = &getModel('module');
$rssConfig = $oModuleModel->getModulePartConfig('rss', $obj->originModuleSrl);
$oModuleController = &getController('module');
if(is_array($obj->moduleSrlList))
{
foreach($obj->moduleSrlList AS $key=>$moduleSrl)
{
$oModuleController->insertModulePartConfig('rss', $moduleSrl, $rssConfig);
}
}
}
}
/* End of file rss.controller.php */
/* Location: ./modules/rss/rss.controller.php */

View file

@ -1,49 +1,59 @@
<?php
/**
* The model class of the rss module
/**
* The model class of the rss module
*
* @author NHN (developers@xpressengine.com)
*/
class rssModel extends rss
{
/**
* Create the Feed url.
*
* @author NHN (developers@xpressengine.com)
**/
* @param string $vid Vid
* @param string $mid mid
* @param string $format Feed format. ef)xe, atom, rss1.0
* @return string
*/
function getModuleFeedUrl($vid = null, $mid, $format)
{
if(Context::isAllowRewrite())
{
$request_uri = Context::getRequestUri();
// If the virtual site variable exists and it is different from mid (vid and mid should not be the same)
if($vid && $vid != $mid)
{
return $request_uri.$vid.'/'.$mid.'/'.$format;
}
else
{
return $request_uri.$mid.'/'.$format;
}
}
else
{
return getUrl('','mid',$mid,'act',$format);
}
}
class rssModel extends rss {
/**
* Create the Feed url.
*
* @param string $vid Vid
* @param string $mid mid
* @param string $format Feed format. ef)xe, atom, rss1.0
* @return string
**/
function getModuleFeedUrl($vid = null, $mid, $format) {
if(Context::isAllowRewrite()) {
$request_uri = Context::getRequestUri();
// If the virtual site variable exists and it is different from mid (vid and mid should not be the same)
if($vid && $vid != $mid) {
return $request_uri.$vid.'/'.$mid.'/'.$format;
}
else {
return $request_uri.$mid.'/'.$format;
}
}
else {
return getUrl('','mid',$mid,'act',$format);
}
}
/**
* Return the RSS configurations of the specific modules
*
* @param integer $module_srl Module_srl
* @return Object
**/
function getRssModuleConfig($module_srl) {
// Get the configurations of the rss module
$oModuleModel = &getModel('module');
$module_rss_config = $oModuleModel->getModulePartConfig('rss', $module_srl);
if(!$module_rss_config) $module_rss_config->open_rss = 'N';
$module_rss_config->module_srl = $module_srl;
return $module_rss_config;
}
}
?>
/**
* Return the RSS configurations of the specific modules
*
* @param integer $module_srl Module_srl
* @return Object
*/
function getRssModuleConfig($module_srl)
{
// Get the configurations of the rss module
$oModuleModel = &getModel('module');
$module_rss_config = $oModuleModel->getModulePartConfig('rss', $module_srl);
if(!$module_rss_config)
{
$module_rss_config = new stdClass();
$module_rss_config->open_rss = 'N';
}
$module_rss_config->module_srl = $module_srl;
return $module_rss_config;
}
}
/* End of file rss.model.php */
/* Location: ./modules/rss/rss.model.php */

View file

@ -1,235 +1,262 @@
<?php
/**
* The view class of the rss module
/**
* The view class of the rss module
*
* @author NHN (developers@xpressengine.com)
*/
class rssView extends rss
{
/**
* Initialization
*
* @author NHN (developers@xpressengine.com)
**/
* @return void
*/
function init()
{
}
class rssView extends rss {
/**
* Feed output.
* When trying to directly print out the RSS, the results variable can be directly specified through $oRssView->rss($document_list)
*
* @param Object $document_list Document list
* @param string $rss_title Rss title
* @param string $add_description Add description
*/
function rss($document_list = null, $rss_title = null, $add_description = null)
{
$oDocumentModel = &getModel('document');
$oModuleModel = &getModel('module');
$oModuleController = &getController('module');
// Get the content and information for the current requested module if the method is not called from another module
if(!$document_list)
{
$site_module_info = Context::get('site_module_info');
$site_srl = $site_module_info->site_srl;
$mid = Context::get('mid'); // The target module id, if absent, then all
$start_date = (int)Context::get('start_date');
$end_date = (int)Context::get('end_date');
/**
* Initialization
*
* @return void
**/
function init() {
}
$module_srls = array();
$rss_config = array();
$total_config = '';
$total_config = $oModuleModel->getModuleConfig('rss');
// If one is specified, extract only for this mid
if($mid)
{
$module_srl = $this->module_info->module_srl;
$config = $oModuleModel->getModulePartConfig('rss', $module_srl);
if($config->open_rss && $config->open_rss != 'N')
{
$module_srls[] = $module_srl;
$open_rss_config[$module_srl] = $config->open_rss;
}
// If mid is not selected, then get all
}
else
{
if($total_config->use_total_feed != 'N')
{
$rss_config = $oModuleModel->getModulePartConfigs('rss', $site_srl);
if($rss_config)
{
foreach($rss_config as $module_srl => $config)
{
if($config && $config->open_rss != 'N' && $config->open_total_feed != 'T_N')
{
$module_srls[] = $module_srl;
$open_rss_config[$module_srl] = $config->open_rss;
}
}
}
}
}
/**
* Feed output.
* When trying to directly print out the RSS, the results variable can be directly specified through $oRssView->rss($document_list)
*
* @param Object $document_list Document list
* @param string $rss_title Rss title
* @param string $add_description Add description
**/
function rss($document_list = null, $rss_title = null, $add_description = null) {
$oDocumentModel = &getModel('document');
$oModuleModel = &getModel('module');
$oModuleController = &getController('module');
// Get the content and information for the current requested module if the method is not called from another module
if(!$document_list) {
$site_module_info = Context::get('site_module_info');
$site_srl = $site_module_info->site_srl;
$mid = Context::get('mid'); // The target module id, if absent, then all
$start_date = (int)Context::get('start_date');
$end_date = (int)Context::get('end_date');
if(!count($module_srls) && !$add_description) return $this->dispError();
$module_srls = array();
$rss_config = array();
$total_config = '';
$total_config = $oModuleModel->getModuleConfig('rss');
// If one is specified, extract only for this mid
if($mid) {
$module_srl = $this->module_info->module_srl;
$config = $oModuleModel->getModulePartConfig('rss', $module_srl);
if($config->open_rss && $config->open_rss != 'N') {
$module_srls[] = $module_srl;
$open_rss_config[$module_srl] = $config->open_rss;
}
// If mid is not selected, then get all
} else {
if($total_config->use_total_feed != 'N') {
$rss_config = $oModuleModel->getModulePartConfigs('rss', $site_srl);
if($rss_config) {
foreach($rss_config as $module_srl => $config) {
if($config && $config->open_rss != 'N' && $config->open_total_feed != 'T_N') {
$module_srls[] = $module_srl;
$open_rss_config[$module_srl] = $config->open_rss;
}
}
}
}
}
if($module_srls)
{
$args->module_srl = implode(',',$module_srls);
//$module_list = $oModuleModel->getMidList($args); //perhaps module_list varialbles not use
if(!count($module_srls) && !$add_description) return $this->dispError();
$args->search_target = 'is_secret';
$args->search_keyword = 'N';
$args->page = (int)Context::get('page');
$args->list_count = 15;
if($total_config->feed_document_count) $args->list_count = $total_config->feed_document_count;
if(!$args->page || $args->page < 1) $args->page = 1;
if($start_date || $start_date != 0) $args->start_date = $start_date;
if($end_date || $end_date != 0) $args->end_date = $end_date;
if($start_date == 0) unset($start_date);
if($end_date == 0) unset($end_date);
if($module_srls) {
$args->module_srl = implode(',',$module_srls);
//$module_list = $oModuleModel->getMidList($args); //perhaps module_list varialbles not use
$args->sort_index = 'list_order';
$args->order_type = 'asc';
$output = $oDocumentModel->getDocumentList($args);
$document_list = $output->data;
// Extract the feed title and information with Context::getBrowserTitle
if($mid)
{
$info->title = Context::getBrowserTitle();
$oModuleController->replaceDefinedLangCode($info->title);
$args->search_target = 'is_secret';
$args->search_keyword = 'N';
$args->page = (int)Context::get('page');
$args->list_count = 15;
if($total_config->feed_document_count) $args->list_count = $total_config->feed_document_count;
if(!$args->page || $args->page < 1) $args->page = 1;
if($start_date || $start_date != 0) $args->start_date = $start_date;
if($end_date || $end_date != 0) $args->end_date = $end_date;
if($start_date == 0) unset($start_date);
if($end_date == 0) unset($end_date);
$info->title = str_replace('\'', '&apos;',$info->title);
if($config->feed_description)
{
$info->description = str_replace('\'', '&apos;', htmlspecialchars($config->feed_description));
}
else
{
$info->description = str_replace('\'', '&apos;', htmlspecialchars($this->module_info->description));
}
$info->link = getUrl('','mid',$mid);
$info->feed_copyright = str_replace('\'', '&apos;', htmlspecialchars($feed_config->feed_copyright));
if(!$info->feed_copyright)
{
$info->feed_copyright = str_replace('\'', '&apos;', htmlspecialchars($total_config->feed_copyright));
}
}
}
}
$args->sort_index = 'list_order';
$args->order_type = 'asc';
$output = $oDocumentModel->getDocumentList($args);
$document_list = $output->data;
// Extract the feed title and information with Context::getBrowserTitle
if($mid) {
$info->title = Context::getBrowserTitle();
$oModuleController->replaceDefinedLangCode($info->title);
if(!$info->title)
{
if($rss_title) $info->title = $rss_title;
else if($total_config->feed_title) $info->title = $total_config->feed_title;
else
{
$site_module_info = Context::get('site_module_info');
$info->title = $site_module_info->browser_title;
}
$info->title = str_replace('\'', '&apos;',$info->title);
if($config->feed_description) {
$info->description = str_replace('\'', '&apos;', htmlspecialchars($config->feed_description));
}
else {
$info->description = str_replace('\'', '&apos;', htmlspecialchars($this->module_info->description));
}
$info->link = getUrl('','mid',$mid);
$info->feed_copyright = str_replace('\'', '&apos;', htmlspecialchars($feed_config->feed_copyright));
if(!$info->feed_copyright) {
$info->feed_copyright = str_replace('\'', '&apos;', htmlspecialchars($total_config->feed_copyright));
}
}
}
}
$oModuleController->replaceDefinedLangCode($info->title);
$info->title = str_replace('\'', '&apos;', htmlspecialchars($info->title));
$info->description = str_replace('\'', '&apos;', htmlspecialchars($total_config->feed_description));
$info->link = Context::getRequestUri();
$info->feed_copyright = str_replace('\'', '&apos;', htmlspecialchars($total_config->feed_copyright));
}
if($add_description) $info->description .= "\r\n".$add_description;
if(!$info->title) {
if($rss_title) $info->title = $rss_title;
else if($total_config->feed_title) $info->title = $total_config->feed_title;
else {
$site_module_info = Context::get('site_module_info');
$info->title = $site_module_info->browser_title;
}
if($total_config->image) $info->image = Context::getRequestUri().str_replace('\'', '&apos;', htmlspecialchars($total_config->image));
switch(Context::get('format'))
{
case 'atom':
$info->date = date('Y-m-d\TH:i:sP');
if($mid) { $info->id = getUrl('','mid',$mid,'act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); }
else { $info->id = getUrl('','module','rss','act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); }
break;
case 'rss1.0':
$info->date = date('Y-m-d\TH:i:sP');
break;
default:
$info->date = date("D, d M Y H:i:s").' '.$GLOBALS['_time_zone'];
break;
}
$oModuleController->replaceDefinedLangCode($info->title);
$info->title = str_replace('\'', '&apos;', htmlspecialchars($info->title));
$info->description = str_replace('\'', '&apos;', htmlspecialchars($total_config->feed_description));
$info->link = Context::getRequestUri();
$info->feed_copyright = str_replace('\'', '&apos;', htmlspecialchars($total_config->feed_copyright));
}
if($add_description) $info->description .= "\r\n".$add_description;
if($_SERVER['HTTPS']=='on') $proctcl = 'https://';
else $proctcl = 'http://';
if($total_config->image) $info->image = Context::getRequestUri().str_replace('\'', '&apos;', htmlspecialchars($total_config->image));
switch (Context::get('format')) {
case 'atom':
$info->date = date('Y-m-d\TH:i:sP');
if($mid) { $info->id = getUrl('','mid',$mid,'act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); }
else { $info->id = getUrl('','module','rss','act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); }
break;
case 'rss1.0':
$info->date = date('Y-m-d\TH:i:sP');
break;
default:
$info->date = date("D, d M Y H:i:s").' '.$GLOBALS['_time_zone'];
break;
}
$temp_link = explode('/', $info->link);
if($temp_link[0]=='' && $info->link)
{
$info->link = $proctcl.$_SERVER['HTTP_HOST'].$info->link;
}
if($_SERVER['HTTPS']=='on') $proctcl = 'https://';
else $proctcl = 'http://';
$temp_id = explode('/', $info->id);
if($temp_id[0]=='' && $info->id)
{
$info->id = $proctcl.$_SERVER['HTTP_HOST'].$info->id;
}
$temp_link = explode('/', $info->link);
if($temp_link[0]=='' && $info->link) {
$info->link = $proctcl.$_SERVER['HTTP_HOST'].$info->link;
}
$info->language = Context::getLangType();
// Set the variables used in the RSS output
Context::set('info', $info);
Context::set('feed_config', $config);
Context::set('open_rss_config', $open_rss_config);
Context::set('document_list', $document_list);
// Force the result output to be of XMLRPC
Context::setResponseMethod("XMLRPC");
// Perform the preprocessing function of the editor component as the results are obtained
$path = $this->module_path.'tpl/';
//if($args->start_date || $args->end_date) $file = 'xe_rss';
//else $file = 'rss20';
switch (Context::get('format'))
{
case 'xe':
$file = 'xe_rss';
break;
case 'atom':
$file = 'atom10';
break;
case 'rss1.0':
$file = 'rss10';
break;
default:
$file = 'rss20';
break;
}
$temp_id = explode('/', $info->id);
if($temp_id[0]=='' && $info->id) {
$info->id = $proctcl.$_SERVER['HTTP_HOST'].$info->id;
}
$oTemplate = new TemplateHandler();
$info->language = Context::getLangType();
// Set the variables used in the RSS output
Context::set('info', $info);
Context::set('feed_config', $config);
Context::set('open_rss_config', $open_rss_config);
Context::set('document_list', $document_list);
// Force the result output to be of XMLRPC
Context::setResponseMethod("XMLRPC");
// Perform the preprocessing function of the editor component as the results are obtained
$path = $this->module_path.'tpl/';
//if($args->start_date || $args->end_date) $file = 'xe_rss';
//else $file = 'rss20';
switch (Context::get('format')) {
case 'xe':
$file = 'xe_rss';
break;
case 'atom':
$file = 'atom10';
break;
case 'rss1.0':
$file = 'rss10';
break;
default:
$file = 'rss20';
break;
}
$content = $oTemplate->compile($path, $file);
Context::set('content', $content);
// Set the template file
$this->setTemplatePath($path);
$this->setTemplateFile('display');
}
$oTemplate = new TemplateHandler();
/**
* ATOM output
*
* @return Object
*/
function atom()
{
Context::set('format', 'atom');
$this->rss();
}
$content = $oTemplate->compile($path, $file);
Context::set('content', $content);
// Set the template file
$this->setTemplatePath($path);
$this->setTemplateFile('display');
}
/**
* ATOM output
*
* @return Object
**/
function atom() {
Context::set('format', 'atom');
$this->rss();
}
/**
* Error output
*
* @return Object
*/
function dispError()
{
// Prepare the output message
$this->rss(null, null, Context::getLang('msg_rss_is_disabled') );
}
/**
* Error output
*
* @return Object
**/
function dispError() {
// Prepare the output message
$this->rss(null, null, Context::getLang('msg_rss_is_disabled') );
}
/**
* Additional configurations for a service module
* Receive the form for the form used by rss
*
* @param string $obj Will be inserted content in template
* @return Object
*/
function triggerDispRssAdditionSetup(&$obj)
{
$current_module_srl = Context::get('module_srl');
$current_module_srls = Context::get('module_srls');
/**
* Additional configurations for a service module
* Receive the form for the form used by rss
*
* @param string $obj Will be inserted content in template
* @return Object
**/
function triggerDispRssAdditionSetup(&$obj) {
$current_module_srl = Context::get('module_srl');
$current_module_srls = Context::get('module_srls');
if(!$current_module_srl && !$current_module_srls)
{
// Get information of the selected module
$current_module_info = Context::get('current_module_info');
$current_module_srl = $current_module_info->module_srl;
if(!$current_module_srl) return new Object();
}
// Get teh RSS configurations for the selected module
$oRssModel = &getModel('rss');
$rss_config = $oRssModel->getRssModuleConfig($current_module_srl);
Context::set('rss_config', $rss_config);
// Set the template file
$oTemplate = &TemplateHandler::getInstance();
$tpl = $oTemplate->compile($this->module_path.'tpl', 'rss_module_config');
$obj .= $tpl;
if(!$current_module_srl && !$current_module_srls) {
// Get information of the selected module
$current_module_info = Context::get('current_module_info');
$current_module_srl = $current_module_info->module_srl;
if(!$current_module_srl) return new Object();
}
// Get teh RSS configurations for the selected module
$oRssModel = &getModel('rss');
$rss_config = $oRssModel->getRssModuleConfig($current_module_srl);
Context::set('rss_config', $rss_config);
// Set the template file
$oTemplate = &TemplateHandler::getInstance();
$tpl = $oTemplate->compile($this->module_path.'tpl', 'rss_module_config');
$obj .= $tpl;
return new Object();
}
}
?>
return new Object();
}
}
/* End of file rss.view.php */
/* Location: ./modules/rss/rss.view.php */

View file

@ -7,7 +7,10 @@
<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_title" required="true">
<title xml:lang="ko">피드(Feed) 제목</title>
<title xml:lang="en">Feed Title</title>
</field>
<field name="feed_document_count" required="true" rule="number" default="15" />
</fields>
</ruleset>

View file

@ -1,7 +0,0 @@
<filter name="insert_rss_config" module="rss" act="procRssAdminInsertConfig" confirm_msg_code="confirm_submit">
<form />
<response>
<tag name="error" />
<tag name="message" />
</response>
</filter>

View file

@ -1,7 +0,0 @@
<filter name="insert_rss_module_config" module="rss" act="procRssAdminInsertModuleConfig" confirm_msg_code="confirm_submit">
<form />
<response>
<tag name="error" />
<tag name="message" />
</response>
</filter>

View file

@ -1,17 +0,0 @@
function doToggleRss(module_srl) {
var params = new Array();
params['module_srl'] = module_srl;
var response_tags = new Array('error','message','module_srl','open_total_feed');
exec_xml('rss','procRssAdminToggleActivate',params, doChangeIcon ,response_tags );
}
function doChangeIcon(ret_obj, response_tags) {
var obj = document.getElementById('dotogglerss_'+ret_obj['module_srl']);
if(ret_obj['open_total_feed'] == 'T_N') {
obj.className = "buttonSet buttonDisable";
} else {
obj.className = "buttonSet buttonActive";
}
}

View file

@ -1,90 +1,124 @@
<load target="js/rss.js" usecdn="true" />
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<div class="x_page-header">
<h1>RSS <a class="x_icon-question-sign" href="./admin/help/index.html#UMAN_content_rss" target="_blank">{$lang->help}</a></h1>
</div>
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/rss/tpl/rss_admin_index/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<h1 class="h1">RSS</h1>
<form ruleset="insertRssConfig" id="fo_layout" action="./" method="post" enctype="multipart/form-data" class="form">
<input type="hidden" name="module" value="rss" />
<input type="hidden" name="act" value="procRssAdminInsertConfig" />
<h2 class="h2">{$lang->total_feed} {$lang->cmd_management}</h2>
<ul>
<li>
<p class="q">{$lang->total_feed}</p>
<p class="a">
<input type="radio" name="use_total_feed" value="Y" id="use_total_feed_yes" <!--@if(!$total_config->use_total_feed || $total_config->use_total_feed == 'Y')-->checked="checked"<!--@end--> /> <label for="use_total_feed_yes">{$lang->use}(<a href="{getFullSiteUrl()}rss">{getFullSiteUrl()}rss</a>)</label>
<input type="radio" name="use_total_feed" value="N" id="use_total_feed_no" <!--@if($total_config->use_total_feed == 'N')-->checked="checked"<!--@end--> /> <label for="use_total_feed_no">{$lang->notuse}</label>
</p>
</li>
<li>
<p class="q"><label for="feed_title">{$lang->title}</label></p>
<p class="a"><input type="text" name="feed_title" value="{htmlspecialchars($total_config->feed_title)}" id="feed_title" /></p>
</li>
<li>
<p class="q"><label for="feed_description">{$lang->description}</label></p>
<p class="a"><textarea name="feed_description" id="feed_description" rows="8" cols="42">{$total_config->feed_description}</textarea></p>
</li>
<li>
<p class="q"><label for="image">{$lang->feed_image}</label></p>
<section class="section">
<h1>{$lang->total_feed} {$lang->cmd_management}</h1>
<form ruleset="insertRssConfig" action="./" method="post" enctype="multipart/form-data" class="x_form-horizontal">
<input type="hidden" name="module" value="rss" />
<input type="hidden" name="act" value="procRssAdminInsertConfig" />
<input type="hidden" name="xe_validator_id" value="modules/rss/tpl/rss_admin_index/1" />
<div class="x_control-group">
<div class="x_control-label">{$lang->url}</div>
<div class="x_controls" style="padding-top:5px"><a href="{getFullSiteUrl()}rss" target="_blank">{getFullSiteUrl()}rss</a></div>
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->total_feed}</label>
<div class="x_controls">
<label class="x_inline">
<input type="radio" name="use_total_feed" value="Y" id="use_total_feed_yes" checked="checked"|cond="!$total_config->use_total_feed || $total_config->use_total_feed == 'Y'" /> {$lang->use}
</label>
<label class="x_inline">
<input type="radio" name="use_total_feed" value="N" id="use_total_feed_no" checked="checked"|cond="$total_config->use_total_feed == 'N'" /> {$lang->notuse}
</label>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label" for="feed_title">{$lang->title}</label>
<div class="x_controls">
<input type="text" name="feed_title" value="{htmlspecialchars($total_config->feed_title)}" id="feed_title" />
</div>
</div>
<div class="x_control-group">
<label class="x_control-label" for="feed_description">{$lang->description}</label>
<div class="x_controls">
<textarea name="feed_description" id="feed_description" rows="4" cols="42" style="float:left;margin-right:8px">{$total_config->feed_description}</textarea>
<p class="x_help-block">{$lang->about_feed_description}</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label" for="image">{$lang->feed_image}</label>
<div class="x_controls">
<!--@if($total_config->image)-->
<p class="a">
<img src="../../../{$total_config->image}" alt="image" />
<input type="checkbox" name="del_image" value="Y" id="del_image" />
<label for="del_image">{$lang->cmd_delete}</label>
</p>
<div class="_rss_image_container">
<div class="x_thumbnail" cond="$total_config->image" style="display:inline-block;margin:0 0 5px 0">
<img src="../../../{$total_config->image}" alt="image" style="max-width:210px;max-height:150px" />
<input type="button" class="_delete_rss_image x_icon-remove" value="{$lang->cmd_delete}" style="width:14px" />
</div>
</div>
<!--@end-->
<p class="a"><input type="file" name="image" value="" id="image" /></p>
</li>
<li>
<p class="q"><label for="feed_copyright">{$lang->feed_copyright}</label></p>
<p class="a"><input type="text" name="feed_copyright" value="{htmlspecialchars($total_config->feed_copyright)}" id="feed_copyright" /></p>
</li>
<li>
<p class="q"><label for="feed_document_count">{$lang->feed_document_count}</label></p>
<p class="a"><input type="text" name="feed_document_count" value="{$total_config->feed_document_count}" id="feed_document_count" /></p>
</li>
</ul>
<div class="btnArea">
<span class="btn small"><input type="submit" value="{$lang->cmd_save}" /></span>
</div>
</form>
<h2 class="h2">{$lang->feed} {$lang->cmd_management}</h2>
<div class="table form">
<table width="100%" border="1" cellspacing="0">
<thead>
<tr>
<th scope="col">{$lang->mid}</th>
<th scope="col" class="title">{$lang->description}</th>
<th scope="col">{$lang->open_rss}</th>
<th scope="col">
<label for="feed_integration">{$lang->open_feed_to_total}</label>
</th>
<th scope="col">{$lang->cmd_save}</th>
</tr>
</thead>
<tbody>
<tr loop="$feed_config => $key,$value">
<form ruleset="insertRssModuleConfig" action="./" method="post">
<input type="hidden" name="act" value="procRssAdminInsertModuleConfig" />
<input type="hidden" name="success_return_url" value="{getUrl('', 'module', $module, 'act', 'dispRssAdminIndex')}" />
<input type="hidden" name="target_module_srl" value="{$key}" />
<th scope="row" class="nowr">
<!--@if($value['url'])--><a href="{$value['url']}" target="_blank"><!--@endif-->{$value['mid']}<!--@if($value['url'])--></a><!--@endif-->
<p><input type="file" name="image" value="" id="image" /></p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label" for="feed_copyright">{$lang->feed_copyright}</label>
<div class="x_controls">
<input type="text" name="feed_copyright" value="{htmlspecialchars($total_config->feed_copyright)}" id="feed_copyright" />
</div>
</div>
<div class="x_control-group">
<label class="x_control-label" for="feed_document_count">{$lang->feed_document_count}</label>
<div class="x_controls">
<input type="number" min="1" max="100" name="feed_document_count" value="{$total_config->feed_document_count}" id="feed_document_count" />
</div>
</div>
<div class="btnArea x_clearfix">
<button type="submit" class="x_btn x_btn-primary x_pull-right">{$lang->cmd_save}</button>
</div>
</form>
</section>
<section class="section">
<h1 style="margin-bottom:0">{$lang->feed} {$lang->cmd_management}</h1>
<form action="./" method="post">
<input type="hidden" name="act" value="procRssAdminInsertModuleConfig" />
<input type="hidden" name="success_return_url" value="{getUrl('', 'module', $module, 'act', 'dispRssAdminIndex')}" />
<input type="hidden" name="xe_validator_id" value="modules/rss/tpl/rss_admin_index/1" />
<table class="x_table x_table-striped x_table-hover" style="border-top:0;margin-top:0">
<thead>
<tr>
<th>{$lang->mid}</th>
<th>{$lang->description}</th>
<th>{$lang->open_rss}</th>
<th>{$lang->open_feed_to_total}</th>
</tr>
</thead>
<tbody>
<tr loop="$feed_config => $key,$value">
<th cond="!$value['url']">
{$value['mid']}
</th>
<td class="title">{$value['feed_description']}</td>
<td class="nowr">
<!--@foreach($lang->open_rss_types as $key2=>$value2)-->
<input type="radio" name="open_rss" value="{$key2}" id="feed_open_{$key2}" <!--@if($key2 == $value['open_feed'])-->checked="checked"<!--@end--> /><label for="feed_open_{$key2}">{$value2}</label>
<!--@end-->
<th cond="$value['url']">
<a href="{$value['url']}" target="_blank">{$value['mid']}</a>
</th>
<td class="title">{$value['feed_description']}<textarea name="feed_description[{$key}]" hidden>{$value['feed_description']}</textarea></td>
<td>
<label class="x_inline" loop="$lang->open_rss_types => $key2,$value2"><input type="radio" name="open_rss[{$key}]" value="{$key2}" checked="checked"|cond="$key2 == $value['open_feed']" /> {$value2}</label>
</td>
<td class="nowr">
<input type="radio" name="open_total_feed" value="N" id="open_total_feed_N" <!--@if($value['open_total_feed'] == 'N')-->checked="checked"<!--@end--> />
<label for="open_total_feed_N">{$lang->use}</label>
<input type="radio" name="open_total_feed" value="T_N" id="open_total_feed_T_N" <!--@if($value['open_total_feed'] == 'T_N')-->checked="checked"<!--@end--> />
<label for="open_total_feed_T_N">{$lang->notuse}</label>
<td>
<label class="x_inline"><input type="radio" name="open_total_feed[{$key}]" value="N" checked="checked"|cond="$value['open_total_feed'] != 'T_N'" /> {$lang->use}</label>
<label class="x_inline"><input type="radio" name="open_total_feed[{$key}]" value="T_N" checked="checked"|cond="$value['open_total_feed'] == 'T_N'" /> {$lang->notuse}</label>
</td>
<td class="nowr"><input type="submit" value="{$lang->cmd_save}" class="text" /></td>
</form>
</tr>
</tbody>
</table>
</div>
</tr>
<tr cond="!$feed_config">
<td style="text-align:center">{$lang->no_data}</td>
</tr>
</tbody>
</table>
<div class="x_clearfix">
<button type="submit" class="x_btn x_btn-primary x_pull-right">{$lang->cmd_save}</button>
</div>
</form>
</section>
<script>
jQuery(function($){
$("._delete_rss_image").click(function(){
$.exec_json('rss.procRssAdminDeleteFeedImage', {del_image:'Y'}, function(){
$("._rss_image_container").hide();
});
});
});
</script>

View file

@ -1,49 +1,46 @@
<form ruleset="insertRssModuleConfig" action="./" method="post" class="form">
<input type="hidden" name="module" value="rss" />
<input type="hidden" name="act" value="procRssAdminInsertModuleConfig" />
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
<input type="hidden" name="target_module_srl" value="{$rss_config->module_srl?$rss_config->module_srl:$module_srls}" />
<h3 class="h3">{$lang->open_rss}</h3>
<p>{$lang->about_open_rss}</p>
<div class="table">
<table width="100%" border="1" cellspacing="0">
<tr>
<th scope="row"><label for="open_rss">{$lang->open_rss}</label></th>
<td class="text">
<select name="open_rss" id="open_rss">
<!--@foreach($lang->open_rss_types as $key=>$val)-->
<option value="{$key}" <!--@if(!$rss_config->open_rss && $key=='N')-->selected="selected"<!--@elseif($rss_config->open_rss==$key)-->selected="selected"<!--@end-->>{$val}</option>
<!--@end-->
</select>
</td>
</tr>
<tr>
<th scope="row"><label for="open_total_feed">{$lang->open_feed_to_total}</label></th>
<td class="text">
<select name="open_total_feed" id="open_total_feed">
<option value="N" <!--@if(!$rss_config->open_total_feed || $rss_config->open_total_feed == 'N')-->selected="selected"<!--@end-->>{$lang->use}</option>
<option value="T_N" <!--@if($rss_config->open_total_feed == 'T_N')-->selected="selected"<!--@end-->>{$lang->notuse}</option>
</select>
</td>
</tr>
<tr>
<th scope="row"><label for="feed_description">{$lang->description}</label></th>
<td class="text">
<textarea name="feed_description" id="feed_description" rows="8" cols="42">{$rss_config->feed_description}</textarea>
<p class="desc">{$lang->about_feed_description}</p>
</td>
</tr>
<tr>
<th scope="row"><label for="feed_copyright">{$lang->feed_copyright}</label></th>
<td class="text">
<input type="text" name="feed_copyright" id="feed_copyright" value="{htmlspecialchars($rss_config->feed_copyright)}" />
<p class="desc">{$lang->about_feed_copyright}</p>
</td>
</tr>
</table>
</div>
<div class="btnArea">
<span class="btn"><input type="submit" value="{$lang->cmd_save}"/></span>
</div>
</form>
<section class="section">
<h1>{$lang->open_rss}</h1>
<p>{$lang->about_open_rss}</p>
<form ruleset="insertRssModuleConfig" action="./" method="post" class="x_form-horizontal">
<input type="hidden" name="module" value="rss" />
<input type="hidden" name="act" value="procRssAdminInsertModuleConfig" />
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
<input type="hidden" name="target_module_srl" value="{$rss_config->module_srl?$rss_config->module_srl:$module_srls}" />
<div class="x_control-group">
<label for="open_rss" class="x_control-label">{$lang->open_rss}</label>
<div class="x_controls">
<select name="open_rss" id="open_rss">
<option loop="$lang->open_rss_types => $key, $val" value="{$key}" selected="selected"|cond="(!$rss_config->open_rss && $key == 'N') || ($rss_config->open_rss == $key)">{$val}</option>
</select>
</div>
</div>
<div class="x_control-group">
<label for="open_total_feed" class="x_control-label">{$lang->open_feed_to_total}</label>
<div class="x_controls">
<select name="open_total_feed" id="open_total_feed">
<option value="N" selected="selected"|cond="!$rss_config->open_total_feed || $rss_config->open_total_feed == 'N'">{$lang->use}</option>
<option value="T_N" selected="selected"|cond="$rss_config->open_total_feed == 'T_N'">{$lang->notuse}</option>
</select>
</div>
</div>
<div class="x_control-group">
<label for="feed_description" class="x_control-label">{$lang->description}</label>
<div class="x_controls">
<textarea name="feed_description" id="feed_description" rows="4" cols="42" style="float:left;margin-right:8px">{htmlspecialchars($rss_config->feed_description)}</textarea>
<p class="x_help-block">{$lang->about_feed_description}</p>
</div>
</div>
<div class="x_control-group">
<label for="feed_copyright" class="x_control-label">{$lang->feed_copyright}</label>
<div class="x_controls">
<textarea name="feed_copyright" id="feed_copyright" rows="4" cols="42" style="float:left;margin-right:8px">{htmlspecialchars($rss_config->feed_copyright)}</textarea>
<p class="x_help-block">{$lang->about_feed_copyright}</p>
</div>
</div>
<div class="btnArea">
<button type="submit" class="x_btn x_btn-primary">{$lang->cmd_save}</button>
</div>
</form>
</section>

View file

@ -1,4 +1,4 @@
<script type="text/javascript">//<![CDATA[
<script>//<![CDATA[
alert('{$msg}');
top.location.href = top.location.href;
//]]></script>