mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
issue 2662 poll, rss
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12257 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
580222822a
commit
ca9a828954
12 changed files with 1536 additions and 1408 deletions
|
|
@ -3,20 +3,21 @@
|
|||
* @class pollAdminController
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief The admin controller class of the poll module
|
||||
**/
|
||||
|
||||
class pollAdminController extends poll {
|
||||
|
||||
*/
|
||||
class pollAdminController extends poll
|
||||
{
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Save the configurations
|
||||
**/
|
||||
function procPollAdminInsertConfig() {
|
||||
*/
|
||||
function procPollAdminInsertConfig()
|
||||
{
|
||||
$config->skin = Context::get('skin');
|
||||
$config->colorset = Context::get('colorset');
|
||||
|
||||
|
|
@ -31,8 +32,9 @@
|
|||
|
||||
/**
|
||||
* @brief Delete the polls selected in the administrator's page
|
||||
**/
|
||||
function procPollAdminDeleteChecked() {
|
||||
*/
|
||||
function procPollAdminDeleteChecked()
|
||||
{
|
||||
// Display an error no post is selected
|
||||
$cart = Context::get('cart');
|
||||
|
||||
|
|
@ -42,7 +44,8 @@
|
|||
$poll_count = count($poll_srl_list);
|
||||
if(!$poll_count) return $this->stop('msg_cart_is_null');
|
||||
// Delete the post
|
||||
for($i=0;$i<$poll_count;$i++) {
|
||||
for($i=0;$i<$poll_count;$i++)
|
||||
{
|
||||
$poll_index_srl = trim($poll_srl_list[$i]);
|
||||
if(!$poll_index_srl) continue;
|
||||
|
||||
|
|
@ -79,7 +82,7 @@
|
|||
|
||||
/**
|
||||
* @brief Delete the poll (when several questions are registered in one poll, delete this question)
|
||||
**/
|
||||
*/
|
||||
function deletePollTitle($poll_index_srl)
|
||||
{
|
||||
$args->poll_index_srl = $poll_index_srl;
|
||||
|
|
@ -94,13 +97,15 @@
|
|||
}
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePollTitle', $args);
|
||||
if(!$output) {
|
||||
if(!$output)
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePollItem', $args);
|
||||
if(!$output) {
|
||||
if(!$output)
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -108,13 +113,15 @@
|
|||
if($dargs->poll_srl)
|
||||
{
|
||||
$output = executeQuery('poll.deletePoll', $dargs);
|
||||
if(!$output) {
|
||||
if(!$output)
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$output = executeQuery('poll.deletePollLog', $dargs);
|
||||
if(!$output) {
|
||||
if(!$output)
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -126,27 +133,31 @@
|
|||
|
||||
/**
|
||||
* @brief Delete the poll (delete the entire poll)
|
||||
**/
|
||||
function deletePoll($poll_srl) {
|
||||
*/
|
||||
function deletePoll($poll_srl)
|
||||
{
|
||||
$args->poll_srl = $poll_srl;
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePoll', $args);
|
||||
if(!$output) {
|
||||
if(!$output)
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePollTitle', $args);
|
||||
if(!$output) {
|
||||
if(!$output)
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePollItem', $args);
|
||||
if(!$output) {
|
||||
if(!$output)
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -156,4 +167,5 @@
|
|||
return new Object();
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file poll.admin.controller.php */
|
||||
/* Location: ./modules/poll/poll.admin.controller.php */
|
||||
|
|
|
|||
|
|
@ -3,20 +3,21 @@
|
|||
* @class pollAdminModel
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief The admin model class of the poll module
|
||||
**/
|
||||
|
||||
class pollAdminModel extends poll {
|
||||
|
||||
*/
|
||||
class pollAdminModel extends poll
|
||||
{
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the list of polls
|
||||
**/
|
||||
function getPollList($args) {
|
||||
*/
|
||||
function getPollList($args)
|
||||
{
|
||||
$output = executeQueryArray('poll.getPollList', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
|
|
@ -26,7 +27,7 @@
|
|||
|
||||
/**
|
||||
* @brief Get the list of polls with member info
|
||||
**/
|
||||
*/
|
||||
function getPollListWithMember($args)
|
||||
{
|
||||
$output = executeQueryArray('poll.getPollListWithMember', $args);
|
||||
|
|
@ -37,8 +38,9 @@
|
|||
|
||||
/**
|
||||
* @brief Get the original poll
|
||||
**/
|
||||
function getPollAdminTarget() {
|
||||
*/
|
||||
function getPollAdminTarget()
|
||||
{
|
||||
$poll_srl = Context::get('poll_srl');
|
||||
$upload_target_srl = Context::get('upload_target_srl');
|
||||
|
||||
|
|
@ -49,13 +51,17 @@
|
|||
|
||||
if(!$oDocument->isExists()) $oComment = $oCommentModel->getComment($upload_target_srl);
|
||||
|
||||
if($oComment && $oComment->isExists()) {
|
||||
if($oComment && $oComment->isExists())
|
||||
{
|
||||
$this->add('document_srl', $oComment->get('document_srl'));
|
||||
$this->add('comment_srl', $oComment->get('comment_srl'));
|
||||
} elseif($oDocument->isExists()) {
|
||||
}
|
||||
elseif($oDocument->isExists())
|
||||
{
|
||||
$this->add('document_srl', $oDocument->get('document_srl'));
|
||||
} else return new Object(-1, 'msg_not_founded');
|
||||
}
|
||||
|
||||
else return new Object(-1, 'msg_not_founded');
|
||||
}
|
||||
?>
|
||||
}
|
||||
/* End of file poll.admin.model.php */
|
||||
/* Location: ./modules/poll/poll.admin.model.php */
|
||||
|
|
|
|||
|
|
@ -3,26 +3,29 @@
|
|||
* @class pollAdminView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief The admin view class of the poll module
|
||||
**/
|
||||
|
||||
class pollAdminView extends poll {
|
||||
|
||||
*/
|
||||
class pollAdminView extends poll
|
||||
{
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Administrator's Page
|
||||
**/
|
||||
function dispPollAdminList() {
|
||||
*/
|
||||
function dispPollAdminList()
|
||||
{
|
||||
// Arrange the search options
|
||||
$search_target = trim(Context::get('search_target'));
|
||||
$search_keyword = trim(Context::get('search_keyword'));
|
||||
|
||||
if($search_target && $search_keyword) {
|
||||
switch($search_target) {
|
||||
if($search_target && $search_keyword)
|
||||
{
|
||||
switch($search_target)
|
||||
{
|
||||
case 'title' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_title= $search_keyword;
|
||||
|
|
@ -94,8 +97,9 @@
|
|||
|
||||
/**
|
||||
* @brief Confgure the poll skin and colorset
|
||||
**/
|
||||
function dispPollAdminConfig() {
|
||||
*/
|
||||
function dispPollAdminConfig()
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
// Get the configuration information
|
||||
$config = $oModuleModel->getModuleConfig('poll');
|
||||
|
|
@ -120,8 +124,9 @@
|
|||
|
||||
/**
|
||||
* @brief Poll Results
|
||||
**/
|
||||
function dispPollAdminResult() {
|
||||
*/
|
||||
function dispPollAdminResult()
|
||||
{
|
||||
// Popup layout
|
||||
$this->setLayoutFile("popup_layout");
|
||||
// Draw results
|
||||
|
|
@ -141,7 +146,8 @@
|
|||
$poll->poll[$args->poll_index_srl]->poll_count = $output->data->poll_count;
|
||||
|
||||
$output = executeQuery('poll.getPollItem', $args);
|
||||
foreach($output->data as $key => $val) {
|
||||
foreach($output->data as $key => $val)
|
||||
{
|
||||
$poll->poll[$val->poll_index_srl]->item[] = $val;
|
||||
}
|
||||
|
||||
|
|
@ -157,4 +163,5 @@
|
|||
$this->setTemplateFile('result');
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file poll.admin.view.php */
|
||||
/* Location: ./modules/poll/poll.admin.view.php */
|
||||
|
|
|
|||
|
|
@ -3,14 +3,14 @@
|
|||
* @class poll
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief The parent class of the poll module
|
||||
**/
|
||||
|
||||
class poll extends ModuleObject {
|
||||
|
||||
*/
|
||||
class poll extends ModuleObject
|
||||
{
|
||||
/**
|
||||
* @brief Additional tasks required to accomplish during the installation
|
||||
**/
|
||||
function moduleInstall() {
|
||||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
// Register in the action forward (to use in administrator mode)
|
||||
$oModuleController = &getController('module');
|
||||
// Set the default skin
|
||||
|
|
@ -31,8 +31,9 @@
|
|||
|
||||
/**
|
||||
* @brief A method to check if the installation has been successful
|
||||
**/
|
||||
function checkUpdate() {
|
||||
*/
|
||||
function checkUpdate()
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
// 2007.10.17 When deleting posts/comments delete the poll as well
|
||||
if(!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after')) return true;
|
||||
|
|
@ -47,8 +48,9 @@
|
|||
|
||||
/**
|
||||
* @brief Execute update
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleController = &getController('module');
|
||||
// 2007.10.17 When deleting posts/comments delete the poll as well
|
||||
|
|
@ -71,8 +73,10 @@
|
|||
|
||||
/**
|
||||
* @brief Re-generate the cache file
|
||||
**/
|
||||
function recompileCache() {
|
||||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file poll.class.php */
|
||||
/* Location: ./modules/poll/poll.class.php */
|
||||
|
|
|
|||
|
|
@ -3,25 +3,27 @@
|
|||
* @class pollController
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief Controller class for poll module
|
||||
**/
|
||||
|
||||
class pollController extends poll {
|
||||
|
||||
*/
|
||||
class pollController extends poll
|
||||
{
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief after a qeustion is created in the popup window, register the question during the save time
|
||||
**/
|
||||
function procInsert() {
|
||||
*/
|
||||
function procInsert()
|
||||
{
|
||||
$stop_date = Context::get('stop_date');
|
||||
if($stop_date < date("Ymd")) $stop_date = date("YmdHis", time()+60*60*24*365);
|
||||
|
||||
$vars = Context::getRequestVars();
|
||||
foreach($vars as $key => $val) {
|
||||
foreach($vars as $key => $val)
|
||||
{
|
||||
if(strpos($key,'tidx')) continue;
|
||||
if(!preg_match("/^(title|checkcount|item)_/i", $key)) continue;
|
||||
if(!trim($val)) continue;
|
||||
|
|
@ -30,7 +32,8 @@
|
|||
|
||||
$poll_index = $tmp_arr[1];
|
||||
|
||||
if(Context::get('is_logged')) {
|
||||
if(Context::get('is_logged'))
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
// Remove the tag if the it is not the top administrator in the session
|
||||
if($logged_info->is_admin != 'Y') $val = htmlspecialchars($val);
|
||||
|
|
@ -41,7 +44,8 @@
|
|||
else if($tmp_arr[0]=='item') $tmp_args[$poll_index]->item[] = $val;
|
||||
}
|
||||
|
||||
foreach($tmp_args as $key => $val) {
|
||||
foreach($tmp_args as $key => $val)
|
||||
{
|
||||
if(!$val->checkcount) $val->checkcount = 1;
|
||||
if($val->title && count($val->item)) $args->poll[] = $val;
|
||||
}
|
||||
|
|
@ -65,12 +69,14 @@
|
|||
$poll_args->stop_date = $args->stop_date;
|
||||
$poll_args->poll_count = 0;
|
||||
$output = executeQuery('poll.insertPoll', $poll_args);
|
||||
if(!$output->toBool()) {
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
// Individual poll registration
|
||||
foreach($args->poll as $key => $val) {
|
||||
foreach($args->poll as $key => $val)
|
||||
{
|
||||
unset($title_args);
|
||||
$title_args->poll_srl = $poll_srl;
|
||||
$title_args->poll_index_srl = getNextSequence();
|
||||
|
|
@ -81,12 +87,14 @@
|
|||
$title_args->member_srl = $member_srl;
|
||||
$title_args->upload_target_srl = $upload_target_srl;
|
||||
$output = executeQuery('poll.insertPollTitle', $title_args);
|
||||
if(!$output->toBool()) {
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
// Add the individual survey items
|
||||
foreach($val->item as $k => $v) {
|
||||
foreach($val->item as $k => $v)
|
||||
{
|
||||
unset($item_args);
|
||||
$item_args->poll_srl = $poll_srl;
|
||||
$item_args->poll_index_srl = $title_args->poll_index_srl;
|
||||
|
|
@ -94,7 +102,8 @@
|
|||
$item_args->poll_count = 0;
|
||||
$item_args->upload_target_srl = $upload_target_srl;
|
||||
$output = executeQuery('poll.insertPollItem', $item_args);
|
||||
if(!$output->toBool()) {
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -109,12 +118,14 @@
|
|||
|
||||
/**
|
||||
* @brief Accept the poll
|
||||
**/
|
||||
function procPoll() {
|
||||
*/
|
||||
function procPoll()
|
||||
{
|
||||
$poll_srl = Context::get('poll_srl');
|
||||
$poll_srl_indexes = Context::get('poll_srl_indexes');
|
||||
$tmp_item_srls = explode(',',$poll_srl_indexes);
|
||||
for($i=0;$i<count($tmp_item_srls);$i++) {
|
||||
for($i=0;$i<count($tmp_item_srls);$i++)
|
||||
{
|
||||
$srl = (int)trim($tmp_item_srls[$i]);
|
||||
if(!$srl) continue;
|
||||
$item_srls[] = $srl;
|
||||
|
|
@ -133,14 +144,16 @@
|
|||
// Update all poll responses related to the post
|
||||
$output = executeQuery('poll.updatePoll', $args);
|
||||
$output = executeQuery('poll.updatePollTitle', $args);
|
||||
if(!$output->toBool()) {
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
// Record each polls selected items
|
||||
$args->poll_item_srl = implode(',',$item_srls);
|
||||
$output = executeQuery('poll.updatePollItems', $args);
|
||||
if(!$output->toBool()) {
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -153,7 +166,8 @@
|
|||
$log_args->member_srl = $member_srl;
|
||||
$log_args->ipaddress = $_SERVER['REMOTE_ADDR'];
|
||||
$output = executeQuery('poll.insertPollLog', $log_args);
|
||||
if(!$output->toBool()) {
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -175,8 +189,9 @@
|
|||
|
||||
/**
|
||||
* @brief Preview the results
|
||||
**/
|
||||
function procPollViewResult() {
|
||||
*/
|
||||
function procPollViewResult()
|
||||
{
|
||||
$poll_srl = Context::get('poll_srl');
|
||||
|
||||
$skin = Context::get('skin');
|
||||
|
|
@ -191,7 +206,7 @@
|
|||
|
||||
/**
|
||||
* @brief poll list
|
||||
**/
|
||||
*/
|
||||
function procPollGetList()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
|
||||
|
|
@ -199,7 +214,8 @@
|
|||
if($pollSrls) $pollSrlList = explode(',', $pollSrls);
|
||||
|
||||
global $lang;
|
||||
if(count($pollSrlList) > 0) {
|
||||
if(count($pollSrlList) > 0)
|
||||
{
|
||||
$oPollAdminModel = &getAdminModel('poll');
|
||||
$args->pollIndexSrlList = $pollSrlList;
|
||||
$output = $oPollAdminModel->getPollListWithMember($args);
|
||||
|
|
@ -225,40 +241,45 @@
|
|||
|
||||
/**
|
||||
* @brief A poll synchronization trigger when a new post is registered
|
||||
**/
|
||||
function triggerInsertDocumentPoll(&$obj) {
|
||||
*/
|
||||
function triggerInsertDocumentPoll(&$obj)
|
||||
{
|
||||
$this->syncPoll($obj->document_srl, $obj->content);
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief A poll synchronization trigger when a new comment is registered
|
||||
**/
|
||||
function triggerInsertCommentPoll(&$obj) {
|
||||
*/
|
||||
function triggerInsertCommentPoll(&$obj)
|
||||
{
|
||||
$this->syncPoll($obj->comment_srl, $obj->content);
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief A poll synchronization trigger when a post is updated
|
||||
**/
|
||||
function triggerUpdateDocumentPoll(&$obj) {
|
||||
*/
|
||||
function triggerUpdateDocumentPoll(&$obj)
|
||||
{
|
||||
$this->syncPoll($obj->document_srl, $obj->content);
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief A poll synchronization trigger when a comment is updated
|
||||
**/
|
||||
function triggerUpdateCommentPoll(&$obj) {
|
||||
*/
|
||||
function triggerUpdateCommentPoll(&$obj)
|
||||
{
|
||||
$this->syncPoll($obj->comment_srl, $obj->content);
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief A poll deletion trigger when a post is removed
|
||||
**/
|
||||
function triggerDeleteDocumentPoll(&$obj) {
|
||||
*/
|
||||
function triggerDeleteDocumentPoll(&$obj)
|
||||
{
|
||||
$document_srl = $obj->document_srl;
|
||||
if(!$document_srl) return new Object();
|
||||
// Get the poll
|
||||
|
|
@ -288,8 +309,9 @@
|
|||
|
||||
/**
|
||||
* @brief A poll deletion trigger when a comment is removed
|
||||
**/
|
||||
function triggerDeleteCommentPoll(&$obj) {
|
||||
*/
|
||||
function triggerDeleteCommentPoll(&$obj)
|
||||
{
|
||||
$comment_srl = $obj->comment_srl;
|
||||
if(!$comment_srl) return new Object();
|
||||
// Get the poll
|
||||
|
|
@ -319,10 +341,12 @@
|
|||
|
||||
/**
|
||||
* @brief As post content's poll is obtained, synchronize the poll using the document number
|
||||
**/
|
||||
function syncPoll($upload_target_srl, $content) {
|
||||
*/
|
||||
function syncPoll($upload_target_srl, $content)
|
||||
{
|
||||
$match_cnt = preg_match_all('!<img([^\>]*)poll_srl=(["\']?)([0-9]*)(["\']?)([^\>]*?)\>!is',$content, $matches);
|
||||
for($i=0;$i<$match_cnt;$i++) {
|
||||
for($i=0;$i<$match_cnt;$i++)
|
||||
{
|
||||
$poll_srl = $matches[3][$i];
|
||||
|
||||
$args = null;
|
||||
|
|
@ -339,4 +363,5 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file poll.controller.php */
|
||||
/* Location: ./modules/poll/poll.controller.php */
|
||||
|
|
|
|||
|
|
@ -3,26 +3,30 @@
|
|||
* @class pollModel
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief The model class for the poll modules
|
||||
**/
|
||||
|
||||
class pollModel extends poll {
|
||||
|
||||
*/
|
||||
class pollModel extends poll
|
||||
{
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief The function examines if the user has already been polled
|
||||
**/
|
||||
function isPolled($poll_srl) {
|
||||
*/
|
||||
function isPolled($poll_srl)
|
||||
{
|
||||
$args->poll_srl = $poll_srl;
|
||||
|
||||
if(Context::get('is_logged')) {
|
||||
if(Context::get('is_logged'))
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->ipaddress = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
$output = executeQuery('poll.getPollLog', $args);
|
||||
|
|
@ -33,8 +37,9 @@
|
|||
/**
|
||||
* @brief Return the HTML data of the survey
|
||||
* Return the result after checking if the poll has responses
|
||||
**/
|
||||
function getPollHtml($poll_srl, $style = '', $skin = 'default') {
|
||||
*/
|
||||
function getPollHtml($poll_srl, $style = '', $skin = 'default')
|
||||
{
|
||||
$args->poll_srl = $poll_srl;
|
||||
// Get the information related to the survey
|
||||
$columnList = array('poll_count', 'stop_date');
|
||||
|
|
@ -49,23 +54,28 @@
|
|||
$output = executeQuery('poll.getPollTitle', $args, $columnList);
|
||||
if(!$output->data) return;
|
||||
if(!is_array($output->data)) $output->data = array($output->data);
|
||||
foreach($output->data as $key => $val) {
|
||||
foreach($output->data as $key => $val)
|
||||
{
|
||||
$poll->poll[$val->poll_index_srl]->title = $val->title;
|
||||
$poll->poll[$val->poll_index_srl]->checkcount = $val->checkcount;
|
||||
$poll->poll[$val->poll_index_srl]->poll_count = $val->poll_count;
|
||||
}
|
||||
|
||||
$output = executeQuery('poll.getPollItem', $args);
|
||||
foreach($output->data as $key => $val) {
|
||||
foreach($output->data as $key => $val)
|
||||
{
|
||||
$poll->poll[$val->poll_index_srl]->item[] = $val;
|
||||
}
|
||||
|
||||
$poll->poll_srl = $poll_srl;
|
||||
// Only ongoing poll results
|
||||
if($poll->stop_date > date("Ymd")) {
|
||||
if($poll->stop_date > date("Ymd"))
|
||||
{
|
||||
if($this->isPolled($poll_srl)) $tpl_file = "result";
|
||||
else $tpl_file = "form";
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$tpl_file = "result";
|
||||
}
|
||||
|
||||
|
|
@ -80,8 +90,9 @@
|
|||
|
||||
/**
|
||||
* @brief Return the result's HTML
|
||||
**/
|
||||
function getPollResultHtml($poll_srl, $skin = 'default') {
|
||||
*/
|
||||
function getPollResultHtml($poll_srl, $skin = 'default')
|
||||
{
|
||||
$args->poll_srl = $poll_srl;
|
||||
// Get the information related to the survey
|
||||
$output = executeQuery('poll.getPoll', $args);
|
||||
|
|
@ -95,14 +106,16 @@
|
|||
$output = executeQuery('poll.getPollTitle', $args, $columnList);
|
||||
if(!$output->data) return;
|
||||
if(!is_array($output->data)) $output->data = array($output->data);
|
||||
foreach($output->data as $key => $val) {
|
||||
foreach($output->data as $key => $val)
|
||||
{
|
||||
$poll->poll[$val->poll_index_srl]->title = $val->title;
|
||||
$poll->poll[$val->poll_index_srl]->checkcount = $val->checkcount;
|
||||
$poll->poll[$val->poll_index_srl]->poll_count = $val->poll_count;
|
||||
}
|
||||
|
||||
$output = executeQuery('poll.getPollItem', $args);
|
||||
foreach($output->data as $key => $val) {
|
||||
foreach($output->data as $key => $val)
|
||||
{
|
||||
$poll->poll[$val->poll_index_srl]->item[] = $val;
|
||||
}
|
||||
|
||||
|
|
@ -119,14 +132,16 @@
|
|||
}
|
||||
/** [TO REVIEW]
|
||||
* @brief Selected poll - return the colorset of the skin
|
||||
**/
|
||||
function getPollGetColorsetList() {
|
||||
*/
|
||||
function getPollGetColorsetList()
|
||||
{
|
||||
$skin = Context::get('skin');
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin);
|
||||
|
||||
for($i=0;$i<count($skin_info->colorset);$i++) {
|
||||
for($i=0;$i<count($skin_info->colorset);$i++)
|
||||
{
|
||||
$colorset = sprintf('%s|@|%s', $skin_info->colorset[$i]->name, $skin_info->colorset[$i]->title);
|
||||
$colorset_list[] = $colorset;
|
||||
}
|
||||
|
|
@ -135,4 +150,5 @@
|
|||
$this->add('colorset_list', $colorsets);
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file poll.model.php */
|
||||
/* Location: ./modules/poll/poll.model.php */
|
||||
|
|
|
|||
|
|
@ -3,24 +3,25 @@
|
|||
* The admin controller class of the rss module
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
**/
|
||||
|
||||
class rssAdminController extends rss {
|
||||
|
||||
*/
|
||||
class rssAdminController extends rss
|
||||
{
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function init() {
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* All RSS feeds configurations
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function procRssAdminInsertConfig() {
|
||||
*/
|
||||
function procRssAdminInsertConfig()
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$total_config = $oModuleModel->getModuleConfig('rss');
|
||||
|
||||
|
|
@ -31,31 +32,37 @@
|
|||
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($config_vars->image || $config_vars->del_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) {
|
||||
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'])) {
|
||||
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(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) $alt_message = 'msg_rss_invalid_image_format';
|
||||
else {
|
||||
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{
|
||||
else
|
||||
{
|
||||
$filename = $path.$image_obj['name'];
|
||||
// Move the file
|
||||
if(!move_uploaded_file($image_obj['tmp_name'], $filename)) $alt_message = 'msg_error_occured';
|
||||
else {
|
||||
else
|
||||
{
|
||||
$config_vars->image = $filename;
|
||||
}
|
||||
}
|
||||
|
|
@ -80,13 +87,13 @@
|
|||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* RSS Module configurations
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function procRssAdminInsertModuleConfig() {
|
||||
*/
|
||||
function procRssAdminInsertModuleConfig()
|
||||
{
|
||||
// Get the object
|
||||
$module_srl = Context::get('target_module_srl');
|
||||
// In case of batch configuration of several modules
|
||||
|
|
@ -105,7 +112,8 @@
|
|||
|
||||
if(!in_array($open_rss, array('Y','H','N'))) $open_rss = 'N';
|
||||
// Save configurations
|
||||
for($i=0;$i<count($module_srl);$i++) {
|
||||
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);
|
||||
|
|
@ -118,20 +126,19 @@
|
|||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A funciton to configure all Feeds of the RSS module
|
||||
*
|
||||
* @param Object $config RSS all feeds config list
|
||||
* @return Object
|
||||
**/
|
||||
function setFeedConfig($config) {
|
||||
*/
|
||||
function setFeedConfig($config)
|
||||
{
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertModuleConfig('rss',$config);
|
||||
return new Object();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A function t configure the RSS module
|
||||
*
|
||||
|
|
@ -141,8 +148,9 @@
|
|||
* @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') {
|
||||
*/
|
||||
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;
|
||||
|
|
@ -152,4 +160,5 @@
|
|||
return new Object();
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file rss.admin.controller.php */
|
||||
/* Location: ./modules/rss/rss.admin.controller.php */
|
||||
|
|
|
|||
|
|
@ -3,34 +3,38 @@
|
|||
* The admin view class of the rss module
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
**/
|
||||
|
||||
class rssAdminView extends rss {
|
||||
*/
|
||||
class rssAdminView extends rss
|
||||
{
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function init() {
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
//Set template path
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* In case an administrator page has been initialized
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
function dispRssAdminIndex() {
|
||||
*/
|
||||
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) {
|
||||
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);
|
||||
|
|
@ -57,4 +61,5 @@
|
|||
$this->setTemplateFile('rss_admin_index');
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file rss.admin.view.php */
|
||||
/* Location: ./modules/rss/rss.admin.view.php */
|
||||
|
|
|
|||
|
|
@ -1,18 +1,19 @@
|
|||
<?php
|
||||
include '../../config/config.inc.php';
|
||||
/**
|
||||
* High class of rss module
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
**/
|
||||
|
||||
class rss extends ModuleObject {
|
||||
|
||||
*/
|
||||
class rss extends ModuleObject
|
||||
{
|
||||
/**
|
||||
* Additional tasks required to accomplish during the installation
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
function moduleInstall() {
|
||||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
// Register in action forward
|
||||
$oModuleController = &getController('module');
|
||||
|
||||
|
|
@ -29,8 +30,9 @@
|
|||
/**
|
||||
* A method to check if the installation has been successful
|
||||
* @return bool
|
||||
**/
|
||||
function checkUpdate() {
|
||||
*/
|
||||
function checkUpdate()
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
// Add the Action forward for atom
|
||||
if(!$oModuleModel->getActionForward('atom')) return true;
|
||||
|
|
@ -51,8 +53,9 @@
|
|||
* Execute update
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleController = &getController('module');
|
||||
// Add atom act
|
||||
|
|
@ -80,9 +83,10 @@
|
|||
* Re-generate the cache file
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function recompileCache() {
|
||||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
/* End of file rss.class.php */
|
||||
/* Location: ./modules/rss/rss.class.php */
|
||||
|
|
|
|||
|
|
@ -3,24 +3,25 @@
|
|||
* The controller class of rss module
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
**/
|
||||
|
||||
class rssController extends rss {
|
||||
|
||||
*/
|
||||
class rssController extends rss
|
||||
{
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function init() {
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether to use RSS rss url by adding
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
function triggerRssUrlInsert() {
|
||||
*/
|
||||
function triggerRssUrlInsert()
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$total_config = $oModuleModel->getModuleConfig('rss');
|
||||
$current_module_srl = Context::get('module_srl');
|
||||
|
|
@ -40,17 +41,22 @@
|
|||
$oRssModel = &getModel('rss');
|
||||
$rss_config = $oRssModel->getRssModuleConfig($current_module_srl);
|
||||
|
||||
if($rss_config->open_rss != 'N') {
|
||||
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')) {
|
||||
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 {
|
||||
}
|
||||
else
|
||||
{
|
||||
Context::set('general_rss_url', getUrl('','module','rss','act','rss'));
|
||||
Context::set('general_atom_url', getUrl('','module','rss','act','atom'));
|
||||
}
|
||||
|
|
@ -74,4 +80,5 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file rss.controller.php */
|
||||
/* Location: ./modules/rss/rss.controller.php */
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
* The model class of the rss module
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
**/
|
||||
|
||||
class rssModel extends rss {
|
||||
*/
|
||||
class rssModel extends rss
|
||||
{
|
||||
/**
|
||||
* Create the Feed url.
|
||||
*
|
||||
|
|
@ -13,31 +13,36 @@
|
|||
* @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()) {
|
||||
*/
|
||||
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) {
|
||||
if($vid && $vid != $mid)
|
||||
{
|
||||
return $request_uri.$vid.'/'.$mid.'/'.$format;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
return $request_uri.$mid.'/'.$format;
|
||||
}
|
||||
}
|
||||
else {
|
||||
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) {
|
||||
*/
|
||||
function getRssModuleConfig($module_srl)
|
||||
{
|
||||
// Get the configurations of the rss module
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_rss_config = $oModuleModel->getModulePartConfig('rss', $module_srl);
|
||||
|
|
@ -46,4 +51,5 @@
|
|||
return $module_rss_config;
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file rss.model.php */
|
||||
/* Location: ./modules/rss/rss.model.php */
|
||||
|
|
|
|||
|
|
@ -3,16 +3,16 @@
|
|||
* The view class of the rss module
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
**/
|
||||
|
||||
class rssView extends rss {
|
||||
|
||||
*/
|
||||
class rssView extends rss
|
||||
{
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function init() {
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -22,13 +22,15 @@
|
|||
* @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) {
|
||||
*/
|
||||
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) {
|
||||
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
|
||||
|
|
@ -40,20 +42,28 @@
|
|||
$total_config = '';
|
||||
$total_config = $oModuleModel->getModuleConfig('rss');
|
||||
// If one is specified, extract only for this mid
|
||||
if($mid) {
|
||||
if($mid)
|
||||
{
|
||||
$module_srl = $this->module_info->module_srl;
|
||||
$config = $oModuleModel->getModulePartConfig('rss', $module_srl);
|
||||
if($config->open_rss && $config->open_rss != 'N') {
|
||||
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') {
|
||||
}
|
||||
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') {
|
||||
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;
|
||||
}
|
||||
|
|
@ -64,7 +74,8 @@
|
|||
|
||||
if(!count($module_srls) && !$add_description) return $this->dispError();
|
||||
|
||||
if($module_srls) {
|
||||
if($module_srls)
|
||||
{
|
||||
$args->module_srl = implode(',',$module_srls);
|
||||
//$module_list = $oModuleModel->getMidList($args); //perhaps module_list varialbles not use
|
||||
|
||||
|
|
@ -84,30 +95,36 @@
|
|||
$output = $oDocumentModel->getDocumentList($args);
|
||||
$document_list = $output->data;
|
||||
// Extract the feed title and information with Context::getBrowserTitle
|
||||
if($mid) {
|
||||
if($mid)
|
||||
{
|
||||
$info->title = Context::getBrowserTitle();
|
||||
$oModuleController->replaceDefinedLangCode($info->title);
|
||||
|
||||
$info->title = str_replace('\'', ''',$info->title);
|
||||
if($config->feed_description) {
|
||||
if($config->feed_description)
|
||||
{
|
||||
$info->description = str_replace('\'', ''', htmlspecialchars($config->feed_description));
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
$info->description = str_replace('\'', ''', htmlspecialchars($this->module_info->description));
|
||||
}
|
||||
$info->link = getUrl('','mid',$mid);
|
||||
$info->feed_copyright = str_replace('\'', ''', htmlspecialchars($feed_config->feed_copyright));
|
||||
if(!$info->feed_copyright) {
|
||||
if(!$info->feed_copyright)
|
||||
{
|
||||
$info->feed_copyright = str_replace('\'', ''', htmlspecialchars($total_config->feed_copyright));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$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 {
|
||||
else
|
||||
{
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$info->title = $site_module_info->browser_title;
|
||||
}
|
||||
|
|
@ -121,7 +138,8 @@
|
|||
if($add_description) $info->description .= "\r\n".$add_description;
|
||||
|
||||
if($total_config->image) $info->image = Context::getRequestUri().str_replace('\'', ''', htmlspecialchars($total_config->image));
|
||||
switch (Context::get('format')) {
|
||||
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')); }
|
||||
|
|
@ -139,12 +157,14 @@
|
|||
else $proctcl = 'http://';
|
||||
|
||||
$temp_link = explode('/', $info->link);
|
||||
if($temp_link[0]=='' && $info->link) {
|
||||
if($temp_link[0]=='' && $info->link)
|
||||
{
|
||||
$info->link = $proctcl.$_SERVER['HTTP_HOST'].$info->link;
|
||||
}
|
||||
|
||||
$temp_id = explode('/', $info->id);
|
||||
if($temp_id[0]=='' && $info->id) {
|
||||
if($temp_id[0]=='' && $info->id)
|
||||
{
|
||||
$info->id = $proctcl.$_SERVER['HTTP_HOST'].$info->id;
|
||||
}
|
||||
|
||||
|
|
@ -160,7 +180,8 @@
|
|||
$path = $this->module_path.'tpl/';
|
||||
//if($args->start_date || $args->end_date) $file = 'xe_rss';
|
||||
//else $file = 'rss20';
|
||||
switch (Context::get('format')) {
|
||||
switch (Context::get('format'))
|
||||
{
|
||||
case 'xe':
|
||||
$file = 'xe_rss';
|
||||
break;
|
||||
|
|
@ -183,12 +204,14 @@
|
|||
$this->setTemplatePath($path);
|
||||
$this->setTemplateFile('display');
|
||||
}
|
||||
|
||||
/**
|
||||
* ATOM output
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
function atom() {
|
||||
*/
|
||||
function atom()
|
||||
{
|
||||
Context::set('format', 'atom');
|
||||
$this->rss();
|
||||
}
|
||||
|
|
@ -197,8 +220,9 @@
|
|||
* Error output
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
function dispError() {
|
||||
*/
|
||||
function dispError()
|
||||
{
|
||||
// Prepare the output message
|
||||
$this->rss(null, null, Context::getLang('msg_rss_is_disabled') );
|
||||
}
|
||||
|
|
@ -209,12 +233,14 @@
|
|||
*
|
||||
* @param string $obj Will be inserted content in template
|
||||
* @return Object
|
||||
**/
|
||||
function triggerDispRssAdditionSetup(&$obj) {
|
||||
*/
|
||||
function triggerDispRssAdditionSetup(&$obj)
|
||||
{
|
||||
$current_module_srl = Context::get('module_srl');
|
||||
$current_module_srls = Context::get('module_srls');
|
||||
|
||||
if(!$current_module_srl && !$current_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;
|
||||
|
|
@ -232,4 +258,5 @@
|
|||
return new Object();
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file rss.view.php */
|
||||
/* Location: ./modules/rss/rss.view.php */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue