diff --git a/modules/board/board.admin.controller.php b/modules/board/board.admin.controller.php
index 30ee3ddea..b6faf4e0a 100644
--- a/modules/board/board.admin.controller.php
+++ b/modules/board/board.admin.controller.php
@@ -14,7 +14,7 @@ class boardAdminController extends board {
**/
function init()
{
-
+
}
/**
@@ -37,7 +37,7 @@ class boardAdminController extends board {
{
$module_info = ModuleModel::getModuleInfoByModuleSrl($args->module_srl);
}
-
+
// setup extra_order_target
$extra_order_target = array();
if($args->module_srl)
@@ -77,10 +77,10 @@ class boardAdminController extends board {
$args->protect_admin_content_delete = 'N';
}
}
-
+
if(!in_array($args->order_target,$this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) $args->order_target = 'list_order';
if(!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc';
-
+
$args->skip_bottom_list_days = max(0, intval($args->skip_bottom_list_days));
$args->browser_title = trim(utf8_normalize_spaces($args->browser_title));
$args->meta_keywords = $args->meta_keywords ? implode(', ', array_map('trim', explode(',', $args->meta_keywords))) : '';
@@ -91,7 +91,7 @@ class boardAdminController extends board {
{
unset($args->module_srl);
}
-
+
// preserve existing config
if ($args->module_srl)
{
@@ -209,25 +209,25 @@ class boardAdminController extends board {
$include_modules = array_map('intval', $vars->include_modules ?: []);
$include_days = max(0, floatval($vars->include_days));
$include_notice = $vars->include_notice === 'Y' ? 'Y' : 'N';
-
+
$module_info = ModuleModel::getModuleInfoByModuleSrl($module_srl);
if (!$module_info)
{
throw new Rhymix\Framework\Exceptions\TargetNotFound;
}
-
+
$module_info->include_modules = implode(',', array_filter($include_modules, function($item) {
return $item > 0;
}));
$module_info->include_days = floatval(number_format($include_days, 2, '.', ''));
$module_info->include_notice = $include_notice;
-
+
$output = getController('module')->updateModule($module_info);
if (!$output->toBool())
{
return $output;
}
-
+
$this->setMessage('success_updated');
if (Context::get('success_return_url'))
{
diff --git a/modules/board/board.admin.view.php b/modules/board/board.admin.view.php
index 8074390ec..2f45b976b 100644
--- a/modules/board/board.admin.view.php
+++ b/modules/board/board.admin.view.php
@@ -213,7 +213,7 @@ class boardAdminView extends board {
$args->list_count = 1000;
$output = executeQueryArray('board.getBoardList', $args, ['module_srl', 'mid', 'browser_title']);
Context::set('board_list', $output->data);
-
+
// setup the template file
$this->setTemplateFile('addition_setup');
}
diff --git a/modules/board/board.api.php b/modules/board/board.api.php
index 49eb68310..fed18f707 100644
--- a/modules/board/board.api.php
+++ b/modules/board/board.api.php
@@ -103,7 +103,7 @@ class boardAPI extends board
/**
* Apply _arrangeContent to a list of documents.
- *
+ *
* @param array $content_list
* @param object $grant
* @return array
@@ -120,7 +120,7 @@ class boardAPI extends board
/**
* Clean up document info so that only some fields are exposed.
- *
+ *
* @param object $content
* @param object $grant
* @return stdClass
@@ -162,7 +162,7 @@ class boardAPI extends board
/**
* Clean up comment info so that only some fields are exposed.
- *
+ *
* @param array $comment_list
* @return array
*/
@@ -190,7 +190,7 @@ class boardAPI extends board
/**
* Clean up file info so that only some fields are exposed.
- *
+ *
* @param array $file_list
* @return array
*/
@@ -211,7 +211,7 @@ class boardAPI extends board
/**
* Clean up extra vars so that only some fields are exposed.
- *
+ *
* @param array $extra_var_list
* @return array
*/
diff --git a/modules/board/board.controller.php b/modules/board/board.controller.php
index 86ed1f08e..6bd316b04 100644
--- a/modules/board/board.controller.php
+++ b/modules/board/board.controller.php
@@ -15,7 +15,7 @@ class boardController extends board
function init()
{
}
-
+
/**
* @brief insert document
**/
@@ -26,12 +26,12 @@ class boardController extends board
{
throw new Rhymix\Framework\Exceptions\NotPermitted;
}
-
+
// setup variables
$obj = Context::getRequestVars();
$obj->module_srl = $this->module_srl;
$obj->commentStatus = $obj->comment_status;
-
+
// Remove disallowed Unicode symbols.
if ($this->module_info->filter_specialchars !== 'N')
{
@@ -48,20 +48,20 @@ class boardController extends board
$obj->tags = utf8_clean($obj->tags);
}
}
-
+
// Return error if content is empty.
if (is_empty_html_content($obj->content))
{
throw new Rhymix\Framework\Exception('msg_empty_content');
}
-
+
// Return error if content is too large.
$document_length_limit = ($this->module_info->document_length_limit ?: 1024) * 1024;
if (strlen($obj->content) > $document_length_limit && !$this->grant->manager)
{
throw new Rhymix\Framework\Exception('msg_content_too_long');
}
-
+
// unset document style if not manager
if(!$this->grant->manager)
{
@@ -73,12 +73,12 @@ class boardController extends board
{
$obj->is_admin = 'Y';
}
-
+
$oDocumentController = getController('document');
-
+
$secret_status = DocumentModel::getConfigStatus('secret');
$use_status = explode('|@|', $this->module_info->use_status);
-
+
// Set status
if(($obj->is_secret == 'Y' || $obj->status == $secret_status) && is_array($use_status) && in_array($secret_status, $use_status))
{
@@ -89,16 +89,16 @@ class boardController extends board
unset($obj->is_secret);
$obj->status = DocumentModel::getConfigStatus('public');
}
-
+
// Set update log
if($this->module_info->update_log == 'Y')
{
$obj->update_log_setting = 'Y';
}
-
+
$manual = false;
$logged_info = Context::get('logged_info');
-
+
$oDocument = DocumentModel::getDocument($obj->document_srl);
// Set anonymous information when insert mode or status is temp
@@ -108,17 +108,17 @@ class boardController extends board
{
$obj->document_srl = getNextSequence();
}
-
+
$manual = true;
$anonymous_name = $this->module_info->anonymous_name ?: 'anonymous';
$anonymous_name = $this->createAnonymousName($anonymous_name, $logged_info->member_srl, $obj->document_srl);
$this->module_info->admin_mail = '';
-
+
$obj->notify_message = 'N';
$obj->email_address = $obj->homepage = $obj->user_id = '';
$obj->user_name = $obj->nick_name = $anonymous_name;
}
-
+
// Update if the document already exists.
if($oDocument->isExists())
{
@@ -126,7 +126,7 @@ class boardController extends board
{
throw new Rhymix\Framework\Exceptions\NotPermitted;
}
-
+
// Protect admin document
if ($this->module_info->protect_admin_content_update !== 'N')
{
@@ -136,7 +136,7 @@ class boardController extends board
throw new Rhymix\Framework\Exception('msg_admin_document_no_modify');
}
}
-
+
// if document status is temp
if($oDocument->get('status') == DocumentModel::getConfigStatus('temp'))
{
@@ -146,7 +146,7 @@ class boardController extends board
$obj->member_srl = abs($oDocument->get('member_srl')) * -1;
$oDocument->add('member_srl', $obj->member_srl);
}
-
+
// Update list order, date
$obj->last_update = $obj->regdate = date('YmdHis');
$obj->update_order = $obj->list_order = (getNextSequence() * -1);
@@ -161,7 +161,7 @@ class boardController extends board
throw new Rhymix\Framework\Exception('msg_protect_update_content');
}
}
-
+
// Protect document by date
if($this->module_info->protect_document_regdate > 0 && !$this->grant->manager)
{
@@ -170,7 +170,7 @@ class boardController extends board
throw new Rhymix\Framework\Exception(sprintf(lang('msg_protect_regdate_document'), $this->module_info->protect_document_regdate));
}
}
-
+
// Preserve module_srl if the document belongs to a module that is included in this board
if ($oDocument->get('module_srl') != $obj->module_srl && in_array($oDocument->get('module_srl'), explode(',', $this->module_info->include_modules ?: '')))
{
@@ -181,7 +181,7 @@ class boardController extends board
{
$obj->module_srl = $oDocument->get('module_srl');
}
-
+
// notice & document style same as before if not manager
if(!$this->grant->manager)
{
@@ -189,13 +189,13 @@ class boardController extends board
$obj->title_color = $oDocument->get('title_color');
$obj->title_bold = $oDocument->get('title_bold');
}
-
+
$obj->reason_update = escape($obj->reason_update);
}
-
+
// Update
$output = $oDocumentController->updateDocument($oDocument, $obj, $manual);
-
+
$msg_code = 'success_updated';
}
// Insert a new document.
@@ -206,29 +206,29 @@ class boardController extends board
{
$obj->member_srl = $logged_info->member_srl * -1;
}
-
+
// Update list order if document_srl is already assigned
if ($obj->document_srl)
{
$obj->update_order = $obj->list_order = (getNextSequence() * -1);
}
-
+
// Insert
$output = $oDocumentController->insertDocument($obj, $manual, false, $obj->document_srl ? false : true);
-
+
if ($output->toBool())
{
// Set grant for the new document.
$oDocument = DocumentModel::getDocument($output->get('document_srl'));
$oDocument->setGrantForSession();
-
+
// send an email to admin user
if ($this->module_info->admin_mail && config('mail.default_from'))
{
$browser_title = Context::replaceUserLang($this->module_info->browser_title);
$mail_title = sprintf(lang('msg_document_notify_mail'), $browser_title, cut_str($obj->title, 20, '...'));
$mail_content = sprintf("From : %s
\r\n%s", getFullUrl('', 'document_srl', $output->get('document_srl')), getFullUrl('', 'document_srl', $output->get('document_srl')), $obj->content);
-
+
$oMail = new \Rhymix\Framework\Mail();
$oMail->setSubject($mail_title);
$oMail->setBody($mail_content);
@@ -242,21 +242,21 @@ class boardController extends board
$oMail->send();
}
}
-
+
$msg_code = 'success_registed';
}
-
+
// if there is an error
if(!$output->toBool())
{
return $output;
}
-
+
// return the results
$this->add('mid', Context::get('mid'));
$this->add('document_srl', $output->get('document_srl'));
$this->setRedirectUrl(getNotEncodedUrl('', 'mid', Context::get('mid'), 'document_srl', $output->get('document_srl')));
-
+
// alert a message
$this->setMessage($msg_code);
}
@@ -325,7 +325,7 @@ class boardController extends board
{
throw new Rhymix\Framework\Exceptions\NotPermitted;
}
-
+
// check protect content
if($this->module_info->protect_content == 'Y' || $this->module_info->protect_delete_content == 'Y')
{
@@ -415,7 +415,7 @@ class boardController extends board
$obj->content = utf8_clean($obj->content);
}
}
-
+
// Return error if content is empty.
if (is_empty_html_content($obj->content))
{
@@ -428,7 +428,7 @@ class boardController extends board
{
throw new Rhymix\Framework\Exception('msg_content_too_long');
}
-
+
if(!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC';
if(!is_array($this->module_info->use_status))
{
@@ -453,7 +453,7 @@ class boardController extends board
}
$obj->module_srl = $oDocument->get('module_srl');
-
+
// For anonymous use, remove writer's information and notifying information
if($this->module_info->use_anonymous == 'Y' && (!$this->grant->manager || ($this->module_info->anonymous_except_admin ?? 'N') !== 'Y'))
{
@@ -505,7 +505,7 @@ class boardController extends board
{
// Update document last_update info?
$update_document = $this->module_info->update_order_on_comment === 'N' ? false : true;
-
+
// Parent exists.
if($obj->parent_srl)
{
@@ -592,7 +592,7 @@ class boardController extends board
{
throw new Rhymix\Framework\Exceptions\NotPermitted;
}
-
+
$childs = null;
if($this->module_info->protect_delete_comment === 'Y' && $this->grant->manager == false)
{
@@ -602,7 +602,7 @@ class boardController extends board
throw new Rhymix\Framework\Exception('msg_board_delete_protect_comment');
}
}
-
+
if ($this->module_info->protect_admin_content_delete !== 'N' && $this->user->is_admin !== 'Y')
{
$member_info = MemberModel::getMemberInfo($comment->get('member_srl'));
@@ -760,7 +760,7 @@ class boardController extends board
{
return;
}
-
+
// get the module information
$module_info = ModuleModel::getModuleInfoByMid($mid);
if (!$module_info || !isset($module_info->module) || $module_info->module !== 'board')
@@ -774,14 +774,14 @@ class boardController extends board
return;
}
}
-
+
$url = getUrl('', 'mid', $mid, 'member_srl', $obj->member_srl);
getController('member')->addMemberPopupMenu($url, 'cmd_view_own_document', '', 'self', 'board_own_document');
}
-
+
/**
* Create an anonymous nickname.
- *
+ *
* @param string $format
* @param int $member_srl
* @param int $document_srl
@@ -800,10 +800,10 @@ class boardController extends board
}
}, $format);
}
-
+
/**
* Subroutine for hashing anonymous nickname.
- *
+ *
* @param string $content
* @param int $digits
* @return string
diff --git a/modules/board/board.view.php b/modules/board/board.view.php
index c7c27bb22..49b320d28 100644
--- a/modules/board/board.view.php
+++ b/modules/board/board.view.php
@@ -370,7 +370,7 @@ class boardView extends board
// Check if a permission for file download is granted
// Get configurations (using module model object)
$file_module_config = ModuleModel::getModulePartConfig('file',$this->module_srl);
-
+
$downloadGrantCount = 0;
if(is_array($file_module_config->download_grant))
{
@@ -384,7 +384,7 @@ class boardView extends board
{
throw new Rhymix\Framework\Exceptions\NotPermitted('msg_not_permitted_download');
}
-
+
$logged_info = Context::get('logged_info');
if($logged_info->is_admin != 'Y')
{
@@ -470,7 +470,7 @@ class boardView extends board
}
$output = DocumentModel::getNoticeList($args, $this->columnList);
$notice_list = $output->data ?? [];
-
+
$this->_fillModuleTitles($notice_list);
Context::set('notice_list', $notice_list);
}
@@ -507,7 +507,7 @@ class boardView extends board
$args->search_target = Context::get('search_target');
$args->search_keyword = Context::get('search_keyword');
}
-
+
if(!$search_option = Context::get('search_option'))
{
$search_option = $this->search_option;
@@ -516,13 +516,13 @@ class boardView extends board
{
$args->search_target = '';
}
-
+
// set member_srl for view particular member's document
if($this->module_info->use_anonymous !== 'Y')
{
$args->member_srl = abs(Context::get('member_srl') ?? 0) ?: null;
}
-
+
// if the category is enabled, then get the category
if($this->module_info->use_category=='Y')
{
@@ -603,12 +603,12 @@ class boardView extends board
public function _fillModuleTitles(&$document_list)
{
static $map = null;
-
+
if (!$document_list)
{
return;
}
-
+
if ($this->include_modules)
{
if ($map === null)
@@ -655,17 +655,17 @@ class boardView extends board
'regdate', 'last_update', 'last_updater', 'ipaddress', 'list_order', 'update_order',
'allow_trackback', 'notify_message', 'status', 'comment_status',
);
-
+
// List of columns that should always be selected
$defaultColumnList = array(
'document_srl', 'module_srl', 'category_srl', 'lang_code', 'is_notice',
'title', 'title_bold', 'title_color', 'member_srl', 'nick_name', 'tags', 'extra_vars',
'comment_count', 'trackback_count', 'uploaded_count', 'status', 'regdate', 'last_update',
);
-
+
// List of columns selected by the user
$selectedColumnList = array_keys($this->listConfig);
-
+
// Return all columns for some legacy skins
if($this->module_info->skin == 'xe_guestbook' || $this->module_info->default_style == 'blog')
{
@@ -682,12 +682,12 @@ class boardView extends board
{
$selectedColumnList[] = 'last_updater';
}
-
+
// Remove duplicates and/or invalid column names
$selectedColumnList = array_intersect($selectedColumnList, $allColumnList);
$this->columnList = array_unique(array_merge($defaultColumnList, $selectedColumnList));
}
-
+
// add table name
foreach($this->columnList as $no => $value)
{
@@ -756,19 +756,19 @@ class boardView extends board
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
}
-
+
if($this->grant->view == false || ($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read))
{
throw new Rhymix\Framework\Exceptions\NotPermitted;
}
-
+
$oDocument = DocumentModel::getDocument($document_srl);
if(!$oDocument->isExists())
{
throw new Rhymix\Framework\Exceptions\TargetNotFound;
}
Context::set('oDocument', $oDocument);
-
+
$this->setLayoutPath('./common/tpl');
$this->setLayoutFile('default_layout');
$this->setTemplateFile('comment.html');
@@ -819,7 +819,7 @@ class boardView extends board
if($is_granted) $category_list[$category_srl] = $category;
}
}
-
+
// check if at least one category is granted
$grant_exists = false;
foreach ($category_list as $category)
@@ -866,7 +866,7 @@ class boardView extends board
throw new Rhymix\Framework\Exception('msg_protect_update_content');
}
}
-
+
if ($this->module_info->protect_admin_content_update !== 'N')
{
$member_info = MemberModel::getMemberInfo($oDocument->get('member_srl'));
@@ -894,7 +894,7 @@ class boardView extends board
{
$pointForInsert = 0;
}
-
+
if($pointForInsert < 0)
{
if(!$this->user->isMember())
@@ -1195,7 +1195,7 @@ class boardView extends board
throw new Rhymix\Framework\Exception('msg_admin_comment_no_modify');
}
}
-
+
// setup the comment variables on context
Context::set('oSourceComment', CommentModel::getComment());
Context::set('oComment', $oComment);
@@ -1256,7 +1256,7 @@ class boardView extends board
throw new Rhymix\Framework\Exception('msg_admin_comment_no_delete');
}
}
-
+
// if the comment is not existed, then back to the board content page
if(!$oComment->isExists() )
{
@@ -1321,7 +1321,7 @@ class boardView extends board
{
throw new Rhymix\Framework\Exceptions\NotPermitted;
}
-
+
$document_srl = Context::get('document_srl');
if(!$document_srl)
{
@@ -1333,7 +1333,7 @@ class boardView extends board
{
return $updatelog;
}
-
+
Context::set('total_count', $updatelog->page_navigation->total_count);
Context::set('total_page', $updatelog->page_navigation->total_page);
Context::set('page', $updatelog->page);
@@ -1440,7 +1440,7 @@ class boardView extends board
Context::set('blame_member_info', $blame_member_infos);
$this->setTemplateFile('vote_log');
}
-
+
/**
* Default 404 Handler.
*/
@@ -1451,7 +1451,7 @@ class boardView extends board
/**
* Display an error page.
- *
+ *
* @param string $msg_code
* @param int $http_code
* @return void
@@ -1470,9 +1470,9 @@ class boardView extends board
/**
* Display an alert window on top of the page.
- *
+ *
* @deprecated
- *
+ *
* @param string $msg_code
* @param int $http_code
* @return void
diff --git a/modules/board/board.wap.php b/modules/board/board.wap.php
index 10d06f85f..ffdfe29e8 100644
--- a/modules/board/board.wap.php
+++ b/modules/board/board.wap.php
@@ -1,138 +1,138 @@
- */
-
-/**
- * @class boardWAP
- * @author NAVER (developers@xpressengine.com)
- * @brief board module WAP class
- **/
-
-class boardWAP extends board
-{
- /**
- * @brief wap procedure method
- **/
- function procWAP(&$oMobile)
- {
- // check grant
- if(!$this->grant->list || $this->module_info->consultation == 'Y')
- {
- return $oMobile->setContent(lang('msg_not_permitted'));
- }
-
- // generate document model object
- $oDocumentModel = getModel('document');
-
- // if the doument is existed
- $document_srl = Context::get('document_srl');
- if($document_srl)
- {
- $oDocument = $oDocumentModel->getDocument($document_srl);
- if($oDocument->isExists())
- {
- // check the grant
- if(!$this->grant->view)
- {
- return $oMobile->setContent(lang('msg_not_permitted'));
- }
-
- // setup the browser title
- Context::setBrowserTitle($oDocument->getTitleText());
-
- // if the act is display comment list
- if($this->act=='dispBoardContentCommentList')
- {
-
- $oCommentModel = getModel('comment');
- $output = $oCommentModel->getCommentList($oDocument->document_srl, 0, false, $oDocument->getCommentCount());
-
- $content = '';
- if(count($output->data))
- {
- foreach($output->data as $key => $val)
- {
- $oComment = new commentItem();
- $oComment->setAttribute($val);
-
- if(!$oComment->isAccessible()) continue;
-
- $content .= "".$oComment->getNickName()." (".$oComment->getRegdate("Y-m-d").")
\r\n".$oComment->getContent(false,false)."
\r\n";
- }
- }
-
- // setup mobile contents
- $oMobile->setContent( $content );
-
- // setup upper URL
- $oMobile->setUpperUrl( getUrl('act',''), lang('cmd_go_upper') );
-
- // display the document if the act is not display the comment list
- } else {
-
- // setup contents (strip all html tags)
- $content = strip_tags(str_replace('
',' ','
',$oDocument->getContent(false,false,false)),'
');
-
-
- // setup content information(include the comments link)
- $content = lang('replies').' : '.$oDocument->getCommentCount().'
'."\r\n".$content;
- $content = ''.$oDocument->getNickName().' ('.$oDocument->getRegdate("Y-m-d").")
\r\n".$content;
-
- // setup mobile contents
- $oMobile->setContent( $content );
-
- // setup upper URL
- $oMobile->setUpperUrl( getUrl('document_srl',''), lang('cmd_list') );
-
- }
-
- return;
- }
- }
-
- // board index
- $args = new stdClass;
- $args->module_srl = $this->module_srl;
- $args->page = Context::get('page');;
- $args->list_count = 9;
- $args->sort_index = $this->module_info->order_target?$this->module_info->order_target:'list_order';
- $args->order_type = $this->module_info->order_type?$this->module_info->order_type:'asc';
- $output = $oDocumentModel->getDocumentList($args, $this->except_notice);
- $document_list = $output->data;
- $page_navigation = $output->page_navigation;
-
- $childs = array();
- if($document_list && count($document_list))
- {
- foreach($document_list as $key => $val)
- {
- $href = getUrl('mid',$_GET['mid'],'document_srl',$val->document_srl);
- $obj = null;
- $obj['href'] = $val->getPermanentUrl();
-
- $title = htmlspecialchars($val->getTitleText());
- if($val->getCommentCount()) $title .= ' ['.$val->getCommentCount().']';
- $obj['link'] = $obj['text'] = '['.$val->getNickName().'] '.$title;
- $childs[] = $obj;
- }
- $oMobile->setChilds($childs);
- }
-
- $totalPage = $page_navigation->last_page;
- $page = (int)Context::get('page');
- if(!$page) $page = 1;
-
- // next/prevUrl specification
- if($page > 1)
- {
- $oMobile->setPrevUrl(getUrl('mid',$_GET['mid'],'page',$page-1), sprintf('%s (%d/%d)', lang('cmd_prev'), $page-1, $totalPage));
- }
-
- if($page < $totalPage)
- {
- $oMobile->setNextUrl(getUrl('mid',$_GET['mid'],'page',$page+1), sprintf('%s (%d/%d)', lang('cmd_next'), $page+1, $totalPage));
- }
-
- $oMobile->mobilePage = $page;
- $oMobile->totalPage = $totalPage;
- }
-}
+ */
+
+/**
+ * @class boardWAP
+ * @author NAVER (developers@xpressengine.com)
+ * @brief board module WAP class
+ **/
+
+class boardWAP extends board
+{
+ /**
+ * @brief wap procedure method
+ **/
+ function procWAP(&$oMobile)
+ {
+ // check grant
+ if(!$this->grant->list || $this->module_info->consultation == 'Y')
+ {
+ return $oMobile->setContent(lang('msg_not_permitted'));
+ }
+
+ // generate document model object
+ $oDocumentModel = getModel('document');
+
+ // if the doument is existed
+ $document_srl = Context::get('document_srl');
+ if($document_srl)
+ {
+ $oDocument = $oDocumentModel->getDocument($document_srl);
+ if($oDocument->isExists())
+ {
+ // check the grant
+ if(!$this->grant->view)
+ {
+ return $oMobile->setContent(lang('msg_not_permitted'));
+ }
+
+ // setup the browser title
+ Context::setBrowserTitle($oDocument->getTitleText());
+
+ // if the act is display comment list
+ if($this->act=='dispBoardContentCommentList')
+ {
+
+ $oCommentModel = getModel('comment');
+ $output = $oCommentModel->getCommentList($oDocument->document_srl, 0, false, $oDocument->getCommentCount());
+
+ $content = '';
+ if(count($output->data))
+ {
+ foreach($output->data as $key => $val)
+ {
+ $oComment = new commentItem();
+ $oComment->setAttribute($val);
+
+ if(!$oComment->isAccessible()) continue;
+
+ $content .= "".$oComment->getNickName()." (".$oComment->getRegdate("Y-m-d").")
\r\n".$oComment->getContent(false,false)."
\r\n";
+ }
+ }
+
+ // setup mobile contents
+ $oMobile->setContent( $content );
+
+ // setup upper URL
+ $oMobile->setUpperUrl( getUrl('act',''), lang('cmd_go_upper') );
+
+ // display the document if the act is not display the comment list
+ } else {
+
+ // setup contents (strip all html tags)
+ $content = strip_tags(str_replace('
',$oDocument->getContent(false,false,false)),'
');
+
+
+ // setup content information(include the comments link)
+ $content = lang('replies').' : '.$oDocument->getCommentCount().'
'."\r\n".$content;
+ $content = ''.$oDocument->getNickName().' ('.$oDocument->getRegdate("Y-m-d").")
\r\n".$content;
+
+ // setup mobile contents
+ $oMobile->setContent( $content );
+
+ // setup upper URL
+ $oMobile->setUpperUrl( getUrl('document_srl',''), lang('cmd_list') );
+
+ }
+
+ return;
+ }
+ }
+
+ // board index
+ $args = new stdClass;
+ $args->module_srl = $this->module_srl;
+ $args->page = Context::get('page');;
+ $args->list_count = 9;
+ $args->sort_index = $this->module_info->order_target?$this->module_info->order_target:'list_order';
+ $args->order_type = $this->module_info->order_type?$this->module_info->order_type:'asc';
+ $output = $oDocumentModel->getDocumentList($args, $this->except_notice);
+ $document_list = $output->data;
+ $page_navigation = $output->page_navigation;
+
+ $childs = array();
+ if($document_list && count($document_list))
+ {
+ foreach($document_list as $key => $val)
+ {
+ $href = getUrl('mid',$_GET['mid'],'document_srl',$val->document_srl);
+ $obj = null;
+ $obj['href'] = $val->getPermanentUrl();
+
+ $title = htmlspecialchars($val->getTitleText());
+ if($val->getCommentCount()) $title .= ' ['.$val->getCommentCount().']';
+ $obj['link'] = $obj['text'] = '['.$val->getNickName().'] '.$title;
+ $childs[] = $obj;
+ }
+ $oMobile->setChilds($childs);
+ }
+
+ $totalPage = $page_navigation->last_page;
+ $page = (int)Context::get('page');
+ if(!$page) $page = 1;
+
+ // next/prevUrl specification
+ if($page > 1)
+ {
+ $oMobile->setPrevUrl(getUrl('mid',$_GET['mid'],'page',$page-1), sprintf('%s (%d/%d)', lang('cmd_prev'), $page-1, $totalPage));
+ }
+
+ if($page < $totalPage)
+ {
+ $oMobile->setNextUrl(getUrl('mid',$_GET['mid'],'page',$page+1), sprintf('%s (%d/%d)', lang('cmd_next'), $page+1, $totalPage));
+ }
+
+ $oMobile->mobilePage = $page;
+ $oMobile->totalPage = $totalPage;
+ }
+}
diff --git a/modules/comment/comment.admin.controller.php b/modules/comment/comment.admin.controller.php
index 8baab9f4e..38702809a 100644
--- a/modules/comment/comment.admin.controller.php
+++ b/modules/comment/comment.admin.controller.php
@@ -215,7 +215,7 @@ class CommentAdminController extends Comment
$deleted_count = 0;
$module_infos = [];
-
+
// Delete the comment posting
for($i = 0; $i < $comment_count; $i++)
{
@@ -230,13 +230,13 @@ class CommentAdminController extends Comment
{
continue;
}
-
+
$module_srl = $comment->get('module_srl');
if (!isset($module_infos[$module_srl]))
{
$module_infos[$module_srl] = ModuleModel::getModuleInfoByModuleSrl($module_srl)->comment_delete_message ?? '';
}
-
+
if($module_infos[$module_srl] === 'yes')
{
$output = $oCommentController->updateCommentByDelete($comment, true);
@@ -257,7 +257,7 @@ class CommentAdminController extends Comment
{
$output = $oCommentController->deleteComment($comment_srl, true, toBool($isTrash));
}
-
+
if(!$output->toBool() && $output->error !== -2)
{
$oDB->rollback();
@@ -276,7 +276,7 @@ class CommentAdminController extends Comment
$deleted_count++;
}
-
+
$oDB->commit();
$msgCode = '';
@@ -357,7 +357,7 @@ class CommentAdminController extends Comment
$oDB->rollback();
return $output;
}
-
+
$obj = new stdClass;
$obj->comment_srl = $oComment->get('comment_srl');
$obj->module_srl = $oComment->get('module_srl');
@@ -482,7 +482,7 @@ class CommentAdminController extends Comment
{
$originObject = (object) $originObject;
}
-
+
$oCommentController = getController('comment');
$oCommentModel = getModel('comment');
diff --git a/modules/comment/comment.admin.view.php b/modules/comment/comment.admin.view.php
index f7f6eac6f..a332bc085 100644
--- a/modules/comment/comment.admin.view.php
+++ b/modules/comment/comment.admin.view.php
@@ -49,7 +49,7 @@ class CommentAdminView extends Comment
}
*/
- // get a list by using comment->getCommentList.
+ // get a list by using comment->getCommentList.
$oCommentModel = getModel('comment');
$secretNameList = $oCommentModel->getSecretNameList();
$output = $oCommentModel->getTotalCommentList($args);
@@ -89,7 +89,7 @@ class CommentAdminView extends Comment
}
}
Context::set('module_list', $module_list);
-
+
// Get anonymous nicknames
$anonymous_member_srls = array();
foreach($output->data as $val)
@@ -114,11 +114,11 @@ class CommentAdminView extends Comment
}
}
Context::set('member_nick_name', $member_nick_neme);
-
+
$security = new Security();
$security->encodeHTML('search_target', 'search_keyword');
- // set the template
+ // set the template
$this->setTemplatePath($this->module_path . 'tpl');
$this->setTemplateFile('comment_list');
}
@@ -135,7 +135,7 @@ class CommentAdminView extends Comment
$args->list_count = 30; // /< the number of comment postings to appear on a single page
$args->page_count = 10; // /< the number of pages to appear on the page navigation
$args->order_type = 'desc'; // /< sorted value
-
+
// select sort method
$sort_index = Context::get('sort_index');
if (!in_array($sort_index, array('declared_latest', 'declared_count', 'regdate')))
@@ -143,7 +143,7 @@ class CommentAdminView extends Comment
$sort_index = 'declared_latest';
}
Context::set('sort_index', $sort_index);
-
+
// get latest declared list
if ($sort_index === 'declared_latest')
{
diff --git a/modules/comment/comment.class.php b/modules/comment/comment.class.php
index 0ff599d9e..73bcc2635 100644
--- a/modules/comment/comment.class.php
+++ b/modules/comment/comment.class.php
@@ -63,7 +63,7 @@ class Comment extends ModuleObject
return TRUE;
}
- // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
+ // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
{
return TRUE;
@@ -85,7 +85,7 @@ class Comment extends ModuleObject
{
return true;
}
-
+
// 2018.01.24 Improve mass file deletion
if(!ModuleModel::getTrigger('document.moveDocumentModule', 'comment', 'controller', 'triggerMoveDocument', 'after'))
{
@@ -95,7 +95,7 @@ class Comment extends ModuleObject
{
return true;
}
-
+
return false;
}
@@ -107,7 +107,7 @@ class Comment extends ModuleObject
{
$oDB = DB::getInstance();
$oModuleController = getController('module');
-
+
// 2007. 10. 17 add a trigger to delete comments together with posting deleted
if(!ModuleModel::getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
{
@@ -128,7 +128,7 @@ class Comment extends ModuleObject
$oDB->addIndex("comments", "idx_module_list_order", array("module_srl", "list_order"), TRUE);
}
- // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
+ // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
{
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after');
@@ -144,13 +144,13 @@ class Comment extends ModuleObject
{
$oDB->addIndex('comments', 'idx_parent_srl', array('parent_srl'));
}
-
+
// 2017.12.21 Add an index for nick_name
if(!$oDB->isIndexExists('comments', 'idx_nick_name'))
{
$oDB->addIndex('comments', 'idx_nick_name', array('nick_name'));
}
-
+
// 2018.01.24 Improve mass file deletion
if(!ModuleModel::getTrigger('document.moveDocumentModule', 'comment', 'controller', 'triggerMoveDocument', 'after'))
{
@@ -168,7 +168,7 @@ class Comment extends ModuleObject
*/
function recompileCache()
{
-
+
}
}
diff --git a/modules/comment/comment.controller.php b/modules/comment/comment.controller.php
index c8598f1d5..d7a1e54ce 100644
--- a/modules/comment/comment.controller.php
+++ b/modules/comment/comment.controller.php
@@ -88,7 +88,7 @@ class CommentController extends Comment
{
throw new Rhymix\Framework\Exception('failed_voted_canceled');
}
-
+
$point = 1;
$output = $this->updateVotedCountCancel($comment_srl, $oComment, $point);
@@ -167,7 +167,7 @@ class CommentController extends Comment
{
throw new Rhymix\Framework\Exception('failed_blamed_canceled');
}
-
+
$point = -1;
$output = $this->updateVotedCountCancel($comment_srl, $oComment, $point);
@@ -183,7 +183,7 @@ class CommentController extends Comment
{
return new BaseObject(-1, $point > 0 ? 'failed_voted_canceled' : 'failed_blamed_canceled');
}
-
+
// Check if the current user has voted previously.
$args = new stdClass;
$args->comment_srl = $comment_srl;
@@ -243,10 +243,10 @@ class CommentController extends Comment
//session reset
unset($_SESSION['voted_comment'][$comment_srl]);
-
+
// Call a trigger (after)
ModuleHandler::triggerCall('comment.updateVotedCountCancel', 'after', $trigger_obj);
-
+
$oDB->commit();
return $output;
}
@@ -276,7 +276,7 @@ class CommentController extends Comment
{
throw new Rhymix\Framework\Exceptions\NotPermitted;
}
-
+
// if an user select message from options, message would be the option.
$message_option = strval(Context::get('message_option'));
$improper_comment_reasons = lang('improper_comment_reasons');
@@ -460,7 +460,7 @@ class CommentController extends Comment
// Remove manual member info to prevent forgery. This variable can be set by triggers only.
unset($obj->manual_member_info);
-
+
// Sanitize variables
$obj->comment_srl = intval($obj->comment_srl);
$obj->module_srl = intval($obj->module_srl);
@@ -468,7 +468,7 @@ class CommentController extends Comment
$obj->parent_srl = intval($obj->parent_srl);
$obj->uploaded_count = FileModel::getFilesCount($obj->comment_srl);
-
+
// call a trigger (before)
$output = ModuleHandler::triggerCall('comment.insertComment', 'before', $obj);
if(!$output->toBool())
@@ -537,7 +537,7 @@ class CommentController extends Comment
{
$obj->comment_srl = getNextSequence();
}
- elseif(!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl))
+ elseif(!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl))
{
return new BaseObject(-1, 'msg_not_permitted');
}
@@ -553,13 +553,13 @@ class CommentController extends Comment
{
return new BaseObject(-1, 'msg_empty_content');
}
-
+
// if use editor of nohtml, Remove HTML tags from the contents.
if(!$manual_inserted || isset($obj->allow_html) || isset($obj->use_html))
{
$obj->content = getModel('editor')->converter($obj, 'comment');
}
-
+
if(!$obj->regdate)
{
$obj->regdate = date("YmdHis");
@@ -659,7 +659,7 @@ class CommentController extends Comment
$oDB->rollback();
return $output;
}
-
+
// create the controller object of the document
$oDocumentController = getController('document');
@@ -684,7 +684,7 @@ class CommentController extends Comment
{
$obj->updated_file_count = 0;
}
-
+
// call a trigger(after)
ModuleHandler::triggerCall('comment.insertComment', 'after', $obj);
@@ -722,8 +722,8 @@ class CommentController extends Comment
/**
* Send email to module's admins after a new comment was interted successfully
- * if Comments Approval System is used
- * @param object $obj
+ * if Comments Approval System is used
+ * @param object $obj
* @return void
*/
function sendEmailToAdminAfterInsertComment($obj)
@@ -836,7 +836,7 @@ class CommentController extends Comment
// Remove manual member info to prevent forgery. This variable can be set by triggers only.
unset($obj->manual_member_info);
-
+
// Sanitize variables
$obj->comment_srl = intval($obj->comment_srl);
$obj->module_srl = intval($obj->module_srl);
@@ -844,7 +844,7 @@ class CommentController extends Comment
$obj->parent_srl = intval($obj->parent_srl);
$obj->uploaded_count = FileModel::getFilesCount($obj->comment_srl);
-
+
// call a trigger (before)
$output = ModuleHandler::triggerCall('comment.updateComment', 'before', $obj);
if(!$output->toBool())
@@ -874,7 +874,7 @@ class CommentController extends Comment
$obj->password = MemberModel::hashPassword($obj->password);
}
- if($obj->homepage)
+ if($obj->homepage)
{
$obj->homepage = escape($obj->homepage);
if(!preg_match('/^[a-z]+:\/\//i',$obj->homepage))
@@ -919,13 +919,13 @@ class CommentController extends Comment
{
return new BaseObject(-1, 'msg_empty_content');
}
-
+
// if use editor of nohtml, Remove HTML tags from the contents.
if(!$manual_updated || isset($obj->allow_html) || isset($obj->use_html))
{
$obj->content = getModel('editor')->converter($obj, 'comment');
}
-
+
// remove iframe and script if not a top administrator on the session
if($logged_info->is_admin != 'Y')
{
@@ -983,7 +983,7 @@ class CommentController extends Comment
{
return new BaseObject(-1, 'msg_invalid_request');
}
-
+
// check if comment exists and permission is granted
$comment = CommentModel::getComment($obj->comment_srl);
if(!$comment->isExists())
@@ -994,7 +994,7 @@ class CommentController extends Comment
{
return new BaseObject(-1, 'msg_not_permitted');
}
-
+
// call a trigger (before)
$output = ModuleHandler::triggerCall('comment.deleteComment', 'before', $comment);
if(!$output->toBool())
@@ -1017,7 +1017,7 @@ class CommentController extends Comment
// Begin transaction
$oDB = DB::getInstance();
$oDB->begin();
-
+
// Update
$obj->member_srl = 0;
unset($obj->last_update);
@@ -1109,7 +1109,7 @@ class CommentController extends Comment
{
// check if comment already exists
$comment = CommentModel::getComment($comment_srl);
-
+
if(!$comment->isExists())
{
return new BaseObject(-2, 'msg_not_founded');
@@ -1231,8 +1231,8 @@ class CommentController extends Comment
{
$this->_deleteDeclaredComments($args);
$this->_deleteVotedComments($args);
- }
- else
+ }
+ else
{
$args = new stdClass();
$args->upload_target_srl = $comment_srl;
@@ -1268,10 +1268,10 @@ class CommentController extends Comment
{
return new BaseObject(-1, 'msg_not_permitted');
}
-
+
$logged_info = Context::get('logged_info');
$module_info = ModuleModel::getModuleInfo($oComment->get('module_srl'));
-
+
if ($module_info->protect_admin_content_delete !== 'N' && $logged_info->is_admin !== 'Y')
{
$member_info = MemberModel::getMemberInfo($oComment->get('member_srl'));
@@ -1608,15 +1608,15 @@ class CommentController extends Comment
{
return $output;
}
-
+
$declared_count = ($output->data->declared_count) ? $output->data->declared_count : 0;
$declare_message = trim(htmlspecialchars($declare_message));
-
+
$trigger_obj = new stdClass();
$trigger_obj->comment_srl = $comment_srl;
$trigger_obj->declared_count = $declared_count;
$trigger_obj->declare_message = $declare_message;
-
+
// Call a trigger (before)
$trigger_output = ModuleHandler::triggerCall('comment.declaredComment', 'before', $trigger_obj);
if(!$trigger_output->toBool())
@@ -1636,7 +1636,7 @@ class CommentController extends Comment
// Get currently logged in user.
$member_srl = intval($this->user->member_srl);
-
+
// if the comment author is a member
if($oComment->get('member_srl'))
{
@@ -1665,12 +1665,12 @@ class CommentController extends Comment
$_SESSION['declared_comment'][$comment_srl] = FALSE;
return new BaseObject(-1, 'failed_declared');
}
-
+
// Fill in remaining information for logging.
$args->member_srl = $member_srl;
$args->ipaddress = \RX_CLIENT_IP;
$args->declare_message = $declare_message;
-
+
// begin transaction
$oDB = DB::getInstance();
$oDB->begin();
@@ -1757,7 +1757,7 @@ class CommentController extends Comment
{
return new BaseObject(-1, 'failed_declared_cancel');
}
-
+
// Get the original document
$oComment = CommentModel::getComment($comment_srl);
@@ -1796,7 +1796,7 @@ class CommentController extends Comment
{
return $trigger_output;
}
-
+
if ($declared_count > 1)
{
$output = executeQuery('comment.updateDeclaredCommentCancel', $args);
@@ -1810,14 +1810,14 @@ class CommentController extends Comment
$oDB->rollback();
return $output;
}
-
+
$output = executeQuery('comment.deleteDeclaredCommentLog', $args);
if (!$output->toBool())
{
$oDB->rollback();
return $output;
}
-
+
$message_targets = array();
$module_srl = $oComment->get('module_srl');
$comment_config = ModuleModel::getModulePartConfig('comment', $module_srl);
@@ -1897,19 +1897,19 @@ class CommentController extends Comment
foreach ($target_module_srl as $srl)
{
if (!$srl) continue;
-
+
$module_info = ModuleModel::getModuleInfoByModuleSrl($srl);
if (!$module_info->module_srl)
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
}
-
+
$module_grant = ModuleModel::getGrant($module_info, $logged_info);
if (!$module_grant->manager)
{
throw new Rhymix\Framework\Exceptions\NotPermitted;
}
-
+
$module_srl[] = $srl;
}
@@ -2019,19 +2019,19 @@ class CommentController extends Comment
$this->add('comment_list', $commentList);
}
-
+
function triggerMoveDocument($obj)
{
executeQuery('comment.updateCommentModule', $obj);
executeQuery('comment.updateCommentListModule', $obj);
}
-
+
function triggerAddCopyDocument(&$obj)
{
$args = new stdClass;
$args->document_srls = $obj->source->document_srl;
$comment_list = executeQueryArray('comment.getCommentsByDocumentSrls', $args)->data;
-
+
$copied_comments = array();
foreach($comment_list as $comment)
{
@@ -2040,24 +2040,24 @@ class CommentController extends Comment
$copy->module_srl = $obj->copied->module_srl;
$copy->document_srl = $obj->copied->document_srl;
$copy->parent_srl = $comment->parent_srl ? $copied_comments[$comment->parent_srl] : 0;
-
+
// call a trigger (add)
$args = new stdClass;
$args->source = $comment;
$args->copied = $copy;
ModuleHandler::triggerCall('comment.copyCommentByDocument', 'add', $args);
-
+
// insert a copied comment
$this->insertComment($copy, true);
-
+
$copied_comments[$comment->comment_srl] = $copy->comment_srl;
}
-
+
// update
$obj->copied->last_updater = $copy->nick_name;
$obj->copied->comment_count = count($copied_comments);
}
-
+
function triggerCopyModule(&$obj)
{
$commentConfig = ModuleModel::getModulePartConfig('comment', $obj->originModuleSrl);
diff --git a/modules/comment/comment.item.php b/modules/comment/comment.item.php
index 438893e63..00395f1c1 100644
--- a/modules/comment/comment.item.php
+++ b/modules/comment/comment.item.php
@@ -93,24 +93,24 @@ class CommentItem extends BaseObject
{
return (bool) ($this->comment_srl);
}
-
+
function isGranted()
{
if(!$this->isExists())
{
return false;
}
-
+
if (isset($_SESSION['granted_comment'][$this->comment_srl]))
{
return true;
}
-
+
if ($this->grant_cache !== null)
{
return $this->grant_cache;
}
-
+
$logged_info = Context::get('logged_info');
if (!$logged_info->member_srl)
{
@@ -124,30 +124,30 @@ class CommentItem extends BaseObject
{
return $this->grant_cache = true;
}
-
+
$grant = ModuleModel::getGrant(ModuleModel::getModuleInfoByModuleSrl($this->get('module_srl')), $logged_info);
if ($grant->manager)
{
return $this->grant_cache = true;
}
-
+
return $this->grant_cache = false;
}
-
+
function setGrant()
{
$this->grant_cache = true;
}
-
+
function setGrantForSession()
{
$_SESSION['granted_comment'][$this->comment_srl] = true;
$this->setGrant();
}
-
+
/**
* Return the status code.
- *
+ *
* @return string
*/
public function getStatus()
@@ -170,7 +170,7 @@ class CommentItem extends BaseObject
/**
* Return the status in human-readable text.
- *
+ *
* @return string
*/
public function getStatusText()
@@ -193,7 +193,7 @@ class CommentItem extends BaseObject
{
return false;
}
-
+
if ($strict)
{
$module_info = ModuleModel::getModuleInfoByModuleSrl($this->get('module_srl'));
@@ -207,34 +207,34 @@ class CommentItem extends BaseObject
return false;
}
}
-
+
if (isset($_SESSION['accessible'][$this->comment_srl]) && $_SESSION['accessible'][$this->comment_srl] === $this->get('last_update'))
{
return true;
}
-
+
if ($this->get('status') == RX_STATUS_PUBLIC && $this->get('is_secret') !== 'Y')
{
$this->setAccessible();
return true;
}
-
+
if ($this->isGranted())
{
$this->setAccessible();
return true;
}
-
+
$oDocument = DocumentModel::getDocument($this->get('document_srl'));
if ($oDocument->isGranted())
{
$this->setAccessible();
return true;
}
-
+
return false;
}
-
+
function setAccessible()
{
if(Context::getSessionStatus())
@@ -242,27 +242,27 @@ class CommentItem extends BaseObject
$_SESSION['accessible'][$this->comment_srl] = $this->get('last_update');
}
}
-
+
function isEditable()
{
return !$this->get('member_srl') || $this->isGranted();
}
-
+
function isSecret()
{
return $this->get('status') == RX_STATUS_SECRET || $this->get('is_secret') == 'Y';
}
-
+
function isDeleted()
{
return $this->get('status') == RX_STATUS_DELETED || $this->get('status') == RX_STATUS_DELETED_BY_ADMIN;
}
-
+
function isDeletedByAdmin()
{
return $this->get('status') == RX_STATUS_DELETED_BY_ADMIN;
}
-
+
function useNotify()
{
return $this->get('notify_message') == 'Y';
@@ -280,7 +280,7 @@ class CommentItem extends BaseObject
return;
}
- // pass if the author is not logged-in user
+ // pass if the author is not logged-in user
if(!$this->get('member_srl'))
{
return;
@@ -293,7 +293,7 @@ class CommentItem extends BaseObject
return;
}
- // get where the comment belongs to
+ // get where the comment belongs to
$oDocument = DocumentModel::getDocument($this->get('document_srl'));
// Variables
@@ -422,7 +422,7 @@ class CommentItem extends BaseObject
{
return $_SESSION['declared_comment'][$this->comment_srl];
}
-
+
$args = new stdClass();
if ($logged_info->member_srl)
{
@@ -439,7 +439,7 @@ class CommentItem extends BaseObject
{
return $_SESSION['declared_comment'][$this->comment_srl] = $declared_count;
}
-
+
return false;
}
@@ -461,7 +461,7 @@ class CommentItem extends BaseObject
{
$content = $this->get('content');
}
-
+
$content = trim(utf8_normalize_spaces(html_entity_decode(strip_tags($content))));
if($strlen)
{
@@ -492,7 +492,7 @@ class CommentItem extends BaseObject
{
$content = $this->get('content');
}
-
+
if($strlen)
{
$content = trim(utf8_normalize_spaces(html_entity_decode(strip_tags($content))));
@@ -568,16 +568,16 @@ class CommentItem extends BaseObject
{
// Remove tags
$content = strip_tags($this->getContent(false, false));
-
+
// Convert temporarily html entity for truncate
$content = html_entity_decode($content, ENT_QUOTES);
-
+
// Replace all whitespaces to single space
$content = utf8_trim(utf8_normalize_spaces($content));
-
+
// Truncate string
$content = cut_str($content, $str_size, $tail);
-
+
return escape($content);
}
@@ -633,7 +633,7 @@ class CommentItem extends BaseObject
{
return false;
}
-
+
return $this->get('uploaded_count') ? TRUE : FALSE;
}
@@ -643,12 +643,12 @@ class CommentItem extends BaseObject
{
return;
}
-
+
if(!$this->get('uploaded_count'))
{
return;
}
-
+
$file_list = FileModel::getFiles($this->comment_srl, array(), 'file_srl', TRUE);
return $file_list;
}
@@ -755,7 +755,7 @@ class CommentItem extends BaseObject
{
$config->thumbnail_quality = 75;
}
-
+
// If signiture height setting is omitted, create a square
if(!is_int($width))
{
@@ -799,7 +799,7 @@ class CommentItem extends BaseObject
{
return $thumbnail_url . '?' . date('YmdHis', filemtime($thumbnail_file));
}
-
+
// return false if neigher attached file nor image;
if(!$this->get('uploaded_count') && !preg_match("!get('content')))
{
@@ -846,7 +846,7 @@ class CommentItem extends BaseObject
}
}
- // get an image file from the doc content if no file attached.
+ // get an image file from the doc content if no file attached.
if(!$source_file && $config->thumbnail_target !== 'attachment')
{
$external_image_min_width = min(100, round($trigger_obj->width * 0.3));
diff --git a/modules/comment/comment.model.php b/modules/comment/comment.model.php
index d2886998e..0fbabdabc 100644
--- a/modules/comment/comment.model.php
+++ b/modules/comment/comment.model.php
@@ -375,9 +375,9 @@ class CommentModel extends Comment
/**
* Get the module info without duplication
- *
+ *
* @deprecated
- *
+ *
* @return array
*/
public static function getDistinctModules()
@@ -573,7 +573,7 @@ class CommentModel extends Comment
{
return $trigger_output;
}
-
+
// If an alternate output is set, use it instead of running the default queries
if (isset($args->use_alternate_output) && $args->use_alternate_output instanceof BaseObject)
{
@@ -587,7 +587,7 @@ class CommentModel extends Comment
{
return;
}
-
+
// insert data into CommentPageList table if the number of results is different from stored comments
if(!$output->data)
{
@@ -605,7 +605,7 @@ class CommentModel extends Comment
ModuleHandler::triggerCall('comment.getCommentList', 'after', $output);
return $output;
}
-
+
/**
* Find out which page a comment is on
* @param int $document_srl
@@ -623,14 +623,14 @@ class CommentModel extends Comment
{
return 0;
}
-
+
// return if no comment exists
$document_comment_count = $oDocument->getCommentCount();
if($document_comment_count < 1)
{
return 0;
}
-
+
// Get the comment count per page
if(!$count)
{
@@ -642,14 +642,14 @@ class CommentModel extends Comment
{
$comment_count = $count;
}
-
+
// Get the number of pages
$total_pages = max(1, ceil($document_comment_count / $comment_count));
if ($total_pages == 1)
{
return 1;
}
-
+
// Find out which page the comment is on
$args = new stdClass();
$args->document_srl = $document_srl;
@@ -961,7 +961,7 @@ class CommentModel extends Comment
{
return $output;
}
-
+
// If an alternate output is set, use it instead of running the default queries
if (isset($args->use_alternate_output) && $args->use_alternate_output instanceof BaseObject)
{
@@ -972,7 +972,7 @@ class CommentModel extends Comment
{
$output = executeQueryArray($query_id, $args, $columnList);
}
-
+
// return when no result or error occurance
if(!$output->toBool() || !count($output->data))
{
@@ -1132,7 +1132,7 @@ class CommentModel extends Comment
return $comment_config;
}
-
+
/**
* Return a list of voting member
* @return void
diff --git a/modules/document/document.admin.controller.php b/modules/document/document.admin.controller.php
index 1a2e0b6f0..866469964 100644
--- a/modules/document/document.admin.controller.php
+++ b/modules/document/document.admin.controller.php
@@ -43,7 +43,7 @@ class DocumentAdminController extends Document
$this->setMessage(sprintf(lang('msg_checked_document_is_deleted'), $document_count) );
}
-
+
/**
* Save the default settings of the document module
* @return object
@@ -56,7 +56,7 @@ class DocumentAdminController extends Document
$config->view_count_option = Context::get('view_count_option');
$config->icons = Context::get('icons');
$config->micons = Context::get('micons');
-
+
// Get icon skin type
$config->icons_type = 'gif';
$config->micons_type = 'gif';
@@ -364,7 +364,7 @@ class DocumentAdminController extends Document
$oDocumentController->moveDocumentToTrash($args);
$returnUrl = Context::get('success_return_url');
- if(!$returnUrl)
+ if(!$returnUrl)
{
$arrUrl = parse_url(Context::get('cur_url'));
$query = "";
@@ -424,7 +424,7 @@ class DocumentAdminController extends Document
$trash_srl = Context::get('trash_srl');
$this->restoreTrash($trash_srl);
}
-
+
/**
* Move module of the documents
* @param array $document_srl_list
@@ -443,17 +443,17 @@ class DocumentAdminController extends Document
$document_srl_list = array_map('trim', explode(',', $document_srl_list));
}
$document_srl_list = array_map('intval', $document_srl_list);
-
+
$obj = new stdClass;
$obj->document_srls = $document_srl_list;
$obj->list_count = count($document_srl_list);
$obj->document_list = executeQueryArray('document.getDocuments', $obj)->data;
$obj->module_srl = $target_module_srl;
$obj->category_srl = $target_category_srl;
-
+
$oDB = DB::getInstance();
$oDB->begin();
-
+
// call a trigger (before)
$output = ModuleHandler::triggerCall('document.moveDocumentModule', 'before', $obj);
if(!$output->toBool())
@@ -461,10 +461,10 @@ class DocumentAdminController extends Document
$oDB->rollback();
return $output;
}
-
+
$origin_category = array();
$oDocumentController = getController('document');
-
+
foreach($obj->document_list as $document)
{
// if the target module is different
@@ -472,16 +472,16 @@ class DocumentAdminController extends Document
{
$oDocumentController->deleteDocumentAliasByDocument($document->document_srl);
}
-
+
// if the target category is different
if($document->category_srl != $obj->category_srl && $document->category_srl)
{
$origin_category[$document->category_srl] = $document->module_srl;
}
-
+
$oDocumentController->insertDocumentUpdateLog($document);
}
-
+
// update documents
$output = executeQuery('document.updateDocumentsModule', $obj);
if(!$output->toBool())
@@ -489,7 +489,7 @@ class DocumentAdminController extends Document
$oDB->rollback();
return $output;
}
-
+
// update extra vars
$output = executeQuery('document.updateDocumentExtraVarsModule', $obj);
if(!$output->toBool())
@@ -497,10 +497,10 @@ class DocumentAdminController extends Document
$oDB->rollback();
return $output;
}
-
+
// call a trigger (after)
ModuleHandler::triggerCall('document.moveDocumentModule', 'after', $obj);
-
+
// update category count
foreach($origin_category as $category_srl => $module_srl)
{
@@ -510,15 +510,15 @@ class DocumentAdminController extends Document
{
$oDocumentController->updateCategoryCount($obj->module_srl, $obj->category_srl);
}
-
+
$oDB->commit();
-
+
// remove from cache
foreach($obj->document_list as $document)
{
DocumentController::clearDocumentCache($document->document_srl);
}
-
+
return new BaseObject();
}
@@ -540,17 +540,17 @@ class DocumentAdminController extends Document
$document_srl_list = array_map('trim', explode(',', $document_srl_list));
}
$document_srl_list = array_map('intval', $document_srl_list);
-
+
$obj = new stdClass;
$obj->document_srls = $document_srl_list;
$obj->list_count = count($document_srl_list);
$obj->document_list = executeQueryArray('document.getDocuments', $obj)->data;
$obj->module_srl = $target_module_srl;
$obj->category_srl = $target_category_srl;
-
+
$oDB = DB::getInstance();
$oDB->begin();
-
+
// call a trigger (before)
$output = ModuleHandler::triggerCall('document.copyDocumentModule', 'before', $obj);
if(!$output->toBool())
@@ -558,10 +558,10 @@ class DocumentAdminController extends Document
$oDB->rollback();
return $output;
}
-
+
$oDocumentController = getController('document');
$extra_vars_list = getModel('document')->getDocumentExtraVarsFromDB($document_srl_list)->data;
-
+
$extra_vars = array();
foreach($extra_vars_list as $extra)
{
@@ -569,10 +569,10 @@ class DocumentAdminController extends Document
{
$extra_vars[$extra->document_srl] = array();
}
-
+
$extra_vars[$extra->document_srl][] = $extra;
}
-
+
$copied_srls = array();
foreach($obj->document_list as $document)
{
@@ -583,13 +583,13 @@ class DocumentAdminController extends Document
$copy->comment_count = 0;
$copy->trackback_count = 0;
$copy->password_is_hashed = true;
-
+
// call a trigger (add)
$args = new stdClass;
$args->source = $document;
$args->copied = $copy;
ModuleHandler::triggerCall('document.copyDocumentModule', 'add', $args);
-
+
// insert a copied document
$output = $oDocumentController->insertDocument($copy, true, true);
if(!$output->toBool())
@@ -597,7 +597,7 @@ class DocumentAdminController extends Document
$oDB->rollback();
return $output;
}
-
+
// insert copied extra vars of the document
if(isset($extra_vars[$document->document_srl]))
{
@@ -606,22 +606,22 @@ class DocumentAdminController extends Document
$oDocumentController->insertDocumentExtraVar($copy->module_srl, $copy->document_srl, $extra->var_idx, $extra->value, $extra->eid, $extra->lang_code);
}
}
-
+
$copied_srls[$document->document_srl] = $copy->document_srl;
}
-
+
// call a trigger (after)
$obj->copied_srls = $copied_srls;
ModuleHandler::triggerCall('document.copyDocumentModule', 'after', $obj);
-
+
$oDB->commit();
-
+
// return copied document_srls
$output = new BaseObject();
$output->add('copied_srls', $copied_srls);
return $output;
}
-
+
/**
* Delete all documents of the module
* @param int $module_srl
@@ -633,23 +633,23 @@ class DocumentAdminController extends Document
$args->list_count = 0;
$args->module_srl = intval($module_srl);
$document_list = executeQueryArray('document.getDocumentList', $args, array('document_srl'))->data;
-
+
// delete documents
$output = executeQuery('document.deleteModuleDocument', $args);
if(!$output->toBool())
{
return $output;
}
-
+
// remove from cache
foreach ($document_list as $document)
{
DocumentController::clearDocumentCache($document->document_srl);
}
-
+
return new BaseObject();
}
-
+
/**
* Restore document from trash module, called by trash module
* This method is passived
diff --git a/modules/document/document.admin.view.php b/modules/document/document.admin.view.php
index 0ac300dd1..55f557e63 100644
--- a/modules/document/document.admin.view.php
+++ b/modules/document/document.admin.view.php
@@ -40,7 +40,7 @@ class DocumentAdminView extends Document
$args->page = Context::get('page'); // /< Page
$args->list_count = 30; // /< the number of posts to display on a single page
$args->page_count = 5; // /< the number of pages that appear in the page navigation
-
+
$args->search_target = Context::get('search_target'); // /< search (title, contents ...)
$args->search_keyword = Context::get('search_keyword'); // /< keyword to search
if ($args->search_target === 'member_srl')
@@ -56,7 +56,7 @@ class DocumentAdminView extends Document
$args->sort_index = 'list_order'; // /< sorting value
$args->module_srl = Context::get('module_srl');
$args->statusList = array($this->getConfigStatus('public'), $this->getConfigStatus('secret'), $this->getConfigStatus('temp'));
-
+
// get a list
$oDocumentModel = getModel('document');
$columnList = array('document_srl', 'module_srl', 'category_srl', 'member_srl', 'title', 'nick_name', 'comment_count', 'trackback_count', 'readed_count', 'voted_count', 'blamed_count', 'regdate', 'ipaddress', 'status');
@@ -104,7 +104,7 @@ class DocumentAdminView extends Document
}
}
Context::set('module_list', $module_list);
-
+
// Get anonymous nicknames
$anonymous_member_srls = array();
$member_nick_name = array();
@@ -176,7 +176,7 @@ class DocumentAdminView extends Document
$args->list_count = 20; // /< the number of posts to display on a single page
$args->page_count = 10; // /< the number of pages that appear in the page navigation
$args->order_type = strtolower(Context::get('order_type')) === 'asc' ? 'asc' : 'desc';
-
+
// select sort method
$sort_index = Context::get('sort_index');
if (!in_array($sort_index, array('declared_latest', 'declared_count', 'regdate')))
@@ -184,7 +184,7 @@ class DocumentAdminView extends Document
$sort_index = 'declared_latest';
}
Context::set('sort_index', $sort_index);
-
+
// get latest declared list
if ($sort_index === 'declared_latest')
{
@@ -325,7 +325,7 @@ class DocumentAdminView extends Document
}
else
{
- $aliases = $output->data;
+ $aliases = $output->data;
}
Context::set('aliases', $aliases);
diff --git a/modules/document/document.class.php b/modules/document/document.class.php
index 6769e2da4..d35e437c5 100644
--- a/modules/document/document.class.php
+++ b/modules/document/document.class.php
@@ -20,10 +20,10 @@ class Document extends ModuleObject
/**
* List of status texts supported by Rhymix.
- *
+ *
* Also see status constants in common/constants.php
* and integer status codes used in the comment module.
- *
+ *
* @var array
*/
public static $statusList = array(
@@ -107,10 +107,10 @@ class Document extends ModuleObject
// 2011. 10. 25 status index check
if(!$oDB->isIndexExists("documents", "idx_module_status")) return true;
- // 2012. 02. 27 Add a trigger to copy extra keys when the module is copied
+ // 2012. 02. 27 Add a trigger to copy extra keys when the module is copied
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after')) return true;
- // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
+ // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after')) return true;
// 2016. 1. 27: Add a column(declare_message) for report
@@ -121,13 +121,13 @@ class Document extends ModuleObject
// 2019. 3. 07 #1146
if(!$oDB->isColumnExists('document_update_log', 'reason_update')) return true;
-
+
// 2017.12.21 Add an index for nick_name
if(!$oDB->isIndexExists('documents', 'idx_nick_name')) return true;
-
+
// 2018.01.24 Improve mass file deletion
if(!ModuleModel::getTrigger('file.deleteFile', 'document', 'controller', 'triggerAfterDeleteFile', 'after')) return true;
-
+
return false;
}
@@ -217,13 +217,13 @@ class Document extends ModuleObject
$oDB->addIndex("documents", "idx_module_status", array("module_srl","status"));
}
- // 2012. 02. 27 Add a trigger to copy extra keys when the module is copied
+ // 2012. 02. 27 Add a trigger to copy extra keys when the module is copied
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after'))
{
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after');
}
- // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
+ // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after'))
{
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after');
@@ -241,19 +241,19 @@ class Document extends ModuleObject
$oDB->addColumn('document_update_log', 'is_admin', 'varchar', 1);
$oDB->addIndex('document_update_log', 'idx_is_admin', array('is_admin'));
}
-
+
// 2019. 3. 07 #1146
if(!$oDB->isColumnExists('document_update_log', 'reason_update'))
{
$oDB->addColumn('document_update_log', 'reason_update', 'text', '', null, false, 'extra_vars');
}
-
+
// 2017.12.21 Add an index for nick_name
if(!$oDB->isIndexExists('documents', 'idx_nick_name'))
{
$oDB->addIndex('documents', 'idx_nick_name', array('nick_name'));
}
-
+
// 2018.01.24 Improve mass file deletion
if(!ModuleModel::getTrigger('file.deleteFile', 'document', 'controller', 'triggerAfterDeleteFile', 'after'))
{
diff --git a/modules/document/document.controller.php b/modules/document/document.controller.php
index e755cd4c4..a67d1b8b5 100644
--- a/modules/document/document.controller.php
+++ b/modules/document/document.controller.php
@@ -29,7 +29,7 @@ class DocumentController extends Document
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
}
-
+
$module_info = $this->module_info;
if(!$module_info->module_srl)
{
@@ -42,7 +42,7 @@ class DocumentController extends Document
throw new Rhymix\Framework\Exceptions\NotPermitted;
}
}
-
+
$oDocument = DocumentModel::getDocument($document_srl, false, false);
if(!$oDocument->isExists())
{
@@ -75,7 +75,7 @@ class DocumentController extends Document
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
}
-
+
$module_info = $this->module_info;
if(!$module_info->module_srl)
{
@@ -106,7 +106,7 @@ class DocumentController extends Document
{
throw new Rhymix\Framework\Exception('failed_voted_canceled');
}
-
+
$point = 1;
$output = $this->updateVotedCountCancel($document_srl, $oDocument, $point);
if(!$output->toBool())
@@ -171,7 +171,7 @@ class DocumentController extends Document
{
throw new Rhymix\Framework\Exceptions\FeatureDisabled;
}
-
+
$point = -1;
$output = $this->updateVotedCount($document_srl, $point);
if(!$output->toBool())
@@ -214,7 +214,7 @@ class DocumentController extends Document
{
throw new Rhymix\Framework\Exception('failed_blamed_canceled');
}
-
+
$point = -1;
$output = $this->updateVotedCountCancel($document_srl, $oDocument, $point);
if(!$output->toBool())
@@ -254,14 +254,14 @@ class DocumentController extends Document
$args->ipaddress = \RX_CLIENT_IP;
}
$output = executeQuery('document.getDocumentVotedLogInfo', $args);
-
+
if(!$output->data->count)
{
return new BaseObject(-1, $point > 0 ? 'failed_voted_canceled' : 'failed_blamed_canceled');
}
$point = $output->data->point;
-
+
// Call a trigger (before)
$trigger_obj = new stdClass;
$trigger_obj->member_srl = $oDocument->get('member_srl');
@@ -277,11 +277,11 @@ class DocumentController extends Document
{
return $trigger_output;
}
-
+
// begin transaction
$oDB = DB::getInstance();
$oDB->begin();
-
+
if($point != 0)
{
$args = new stdClass();
@@ -306,9 +306,9 @@ class DocumentController extends Document
// Call a trigger (after)
ModuleHandler::triggerCall('document.updateVotedCountCancel', 'after', $trigger_obj);
-
+
$oDB->commit();
-
+
return $output;
}
@@ -403,7 +403,7 @@ class DocumentController extends Document
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
}
-
+
$oDocument = DocumentModel::getDocument($document_srl);
if (!$oDocument || !$oDocument->isExists())
{
@@ -413,14 +413,14 @@ class DocumentController extends Document
{
throw new Rhymix\Framework\Exceptions\TargetNotFound;
}
-
+
$output = $this->deleteDocument($document_srl);
if ($output instanceof BaseObject && !$output->toBool())
{
return $output;
}
}
-
+
/**
* Delete alias when module deleted
* @param int $module_srl
@@ -521,13 +521,13 @@ class DocumentController extends Document
// begin transaction
$oDB = DB::getInstance();
$oDB->begin();
-
+
// List variables
if($obj->comment_status) $obj->commentStatus = $obj->comment_status;
if(!$obj->commentStatus) $obj->commentStatus = 'DENY';
if($obj->commentStatus == 'DENY') $this->_checkCommentStatusForOldVersion($obj);
if($obj->allow_trackback!='Y') $obj->allow_trackback = 'N';
- if($obj->homepage)
+ if($obj->homepage)
{
$obj->homepage = escape($obj->homepage);
if(!preg_match('/^[a-z]+:\/\//i',$obj->homepage))
@@ -535,17 +535,17 @@ class DocumentController extends Document
$obj->homepage = 'http://'.$obj->homepage;
}
}
-
+
if($obj->notify_message != 'Y') $obj->notify_message = 'N';
if(!$obj->email_address) $obj->email_address = '';
if(!$isRestore) $obj->ipaddress = \RX_CLIENT_IP;
$obj->isRestore = $isRestore ? true : false;
-
+
// Sanitize variables
$obj->document_srl = intval($obj->document_srl);
$obj->category_srl = intval($obj->category_srl);
$obj->module_srl = intval($obj->module_srl);
-
+
// Default Status
if($obj->status)
{
@@ -558,14 +558,14 @@ class DocumentController extends Document
{
$this->_checkDocumentStatusForOldVersion($obj);
}
-
+
// can modify regdate only manager
$grant = Context::get('grant');
if(!$grant->manager)
{
unset($obj->regdate);
}
-
+
// Serialize the $extra_vars, check the extra_vars type, because duplicate serialized avoid
if (!isset($obj->extra_vars))
{
@@ -586,7 +586,7 @@ class DocumentController extends Document
unset($obj->manual_member_info);
$obj->uploaded_count = FileModel::getFilesCount($obj->document_srl);
-
+
// Call a trigger (before)
$output = ModuleHandler::triggerCall('document.insertDocument', 'before', $obj);
if(!$output->toBool())
@@ -665,7 +665,7 @@ class DocumentController extends Document
{
$obj->content = getModel('editor')->converter($obj, 'document');
}
-
+
// Remove iframe and script if not a top adminisrator in the session.
if($logged_info->is_admin != 'Y')
{
@@ -680,7 +680,7 @@ class DocumentController extends Document
$obj->content = utf8_mbencode($obj->content);
$obj->lang_code = Context::getLangType();
-
+
// Insert data into the DB
$output = executeQuery('document.insertDocument', $obj);
if(!$output->toBool())
@@ -718,10 +718,10 @@ class DocumentController extends Document
$this->insertDocumentExtraVar($obj->module_srl, $obj->document_srl, $idx, $value, $extra_item->eid);
}
}
-
+
// Update the category if the category_srl exists.
if($obj->category_srl) $this->updateCategoryCount($obj->module_srl, $obj->category_srl);
-
+
// Call a trigger (after)
if($obj->update_log_setting === 'Y')
{
@@ -741,7 +741,7 @@ class DocumentController extends Document
$oDB->rollback();
return $attachOutput;
}
-
+
$obj->updated_file_count = $attachOutput->get('updated_file_count');
ModuleHandler::triggerCall('document.insertDocument', 'after', $obj);
@@ -772,17 +772,17 @@ class DocumentController extends Document
{
return new BaseObject(-1, 'msg_security_violation');
}
-
+
if(!$source_obj->document_srl || !$obj->document_srl)
{
return new BaseObject(-1, 'msg_invalied_request');
}
-
+
// Sanitize variables
$obj->document_srl = intval($obj->document_srl);
$obj->category_srl = intval($obj->category_srl);
$obj->module_srl = intval($obj->module_srl);
-
+
// Default Status
if($obj->status)
{
@@ -790,7 +790,7 @@ class DocumentController extends Document
{
$obj->status = $this->getDefaultStatus();
}
-
+
// Do not update to temp document (point problem)
if($obj->status == $this->getConfigStatus('temp'))
{
@@ -801,12 +801,12 @@ class DocumentController extends Document
{
$this->_checkDocumentStatusForOldVersion($obj);
}
-
+
// Remove manual member info to prevent forgery. This variable can be set by triggers only.
unset($obj->manual_member_info);
$obj->uploaded_count = FileModel::getFilesCount($obj->document_srl);
-
+
// Call a trigger (before)
$output = ModuleHandler::triggerCall('document.updateDocument', 'before', $obj);
if(!$output->toBool())
@@ -817,9 +817,9 @@ class DocumentController extends Document
// begin transaction
$oDB = &DB::getInstance();
$oDB->begin();
-
+
if(!$obj->module_srl) $obj->module_srl = $source_obj->get('module_srl');
-
+
$document_config = ModuleModel::getModulePartConfig('document', $obj->module_srl);
if(!$document_config)
{
@@ -829,7 +829,7 @@ class DocumentController extends Document
$bUseHistory = $document_config->use_history == 'Y' || $document_config->use_history == 'Trace';
$logged_info = Context::get('logged_info');
-
+
if($bUseHistory)
{
$args = new stdClass;
@@ -861,16 +861,16 @@ class DocumentController extends Document
$obj->homepage = 'http://'.$obj->homepage;
}
}
-
+
if($obj->notify_message != 'Y') $obj->notify_message = 'N';
-
+
// can modify regdate only manager
$grant = Context::get('grant');
if(!$grant->manager)
{
unset($obj->regdate);
}
-
+
// Serialize the $extra_vars
if (isset($obj->extra_vars) && !is_string($obj->extra_vars))
{
@@ -952,7 +952,7 @@ class DocumentController extends Document
{
$obj->content = getModel('editor')->converter($obj, 'document');
}
-
+
// Remove iframe and script if not a top adminisrator in the session.
if($logged_info->is_admin != 'Y')
{
@@ -1069,7 +1069,7 @@ class DocumentController extends Document
return $attachOutput;
}
$obj->updated_file_count = $attachOutput->get('updated_file_count');
-
+
// Call a trigger (after)
ModuleHandler::triggerCall('document.updateDocument', 'after', $obj);
@@ -1080,7 +1080,7 @@ class DocumentController extends Document
Rhymix\Framework\Storage::deleteDirectory(RX_BASEDIR . sprintf('files/thumbnails/%s', getNumberingPath($obj->document_srl, 3)));
$output->add('document_srl',$obj->document_srl);
-
+
//remove from cache
self::clearDocumentCache($obj->document_srl);
return $output;
@@ -1195,7 +1195,7 @@ class DocumentController extends Document
$trigger_obj = $oDocument->getObjectVars();
$trigger_obj->isEmptyTrash = $isEmptyTrash ? true : false;
ModuleHandler::triggerCall('document.deleteDocument', 'after', $trigger_obj);
-
+
// declared document, log delete
$this->_deleteDeclaredDocuments($args);
$this->_deleteDocumentReadedLog($args);
@@ -1356,7 +1356,7 @@ class DocumentController extends Document
$args->isvalid = 'N';
executeQuery('file.updateFileValid', $args);
}
-
+
// Call a trigger (after)
$obj->module_srl = $oDocument->get('module_srl');
$obj->member_srl = $oDocument->get('member_srl');
@@ -1384,7 +1384,7 @@ class DocumentController extends Document
{
return false;
}
-
+
// Get the view count option, and use the default if the value is empty or invalid.
$valid_options = array(
'all' => true,
@@ -1392,7 +1392,7 @@ class DocumentController extends Document
'once' => true,
'none' => true,
);
-
+
$config = DocumentModel::getDocumentConfig();
if (!isset($config->view_count_option) || !isset($valid_options[$config->view_count_option]))
{
@@ -1404,12 +1404,12 @@ class DocumentController extends Document
{
return false;
}
-
+
// Get document and user information.
$document_srl = $oDocument->document_srl;
$member_srl = $oDocument->get('member_srl');
$logged_info = Context::get('logged_info');
-
+
// Option 'some': only count once per session.
if ($config->view_count_option != 'all' && isset($_SESSION['readed_document'][$document_srl]))
{
@@ -1428,7 +1428,7 @@ class DocumentController extends Document
}
return false;
}
-
+
// Pass if the author's member_srl is the same as the visitor's.
if($member_srl && $logged_info && $logged_info->member_srl && $logged_info->member_srl == $member_srl)
{
@@ -1440,7 +1440,7 @@ class DocumentController extends Document
// Call a trigger when the read count is updated (before)
$trigger_output = ModuleHandler::triggerCall('document.updateReadedCount', 'before', $oDocument);
if(!$trigger_output->toBool()) return $trigger_output;
-
+
// Update read counts
$oDB = DB::getInstance();
$oDB->begin();
@@ -1453,7 +1453,7 @@ class DocumentController extends Document
$oDB->commit();
// Register session
- if(!isset($_SESSION['readed_document'][$document_srl]) && Context::getSessionStatus())
+ if(!isset($_SESSION['readed_document'][$document_srl]) && Context::getSessionStatus())
{
$_SESSION['readed_document'][$document_srl] = true;
}
@@ -1577,7 +1577,7 @@ class DocumentController extends Document
{
return new BaseObject(-1, 'msg_invalid_request');
}
-
+
if (is_int($idx_or_eid) || ctype_digit($idx_or_eid))
{
if (!$eid)
@@ -1598,7 +1598,7 @@ class DocumentController extends Document
return new BaseObject(-1, 'Invalid eid: ' . $eid);
}
}
-
+
$obj = new stdClass;
$obj->module_srl = $module_srl;
$obj->document_srl = $document_srl;
@@ -1626,7 +1626,7 @@ class DocumentController extends Document
{
return new BaseObject(-1, 'msg_invalid_request');
}
-
+
if (is_int($idx_or_eid) || ctype_digit($idx_or_eid))
{
if (!$eid)
@@ -1647,7 +1647,7 @@ class DocumentController extends Document
return new BaseObject(-1, 'Invalid eid: ' . $eid);
}
}
-
+
$obj = new stdClass;
$obj->module_srl = $module_srl;
$obj->document_srl = $document_srl;
@@ -1658,21 +1658,21 @@ class DocumentController extends Document
$oDB = DB::getInstance();
$oDB->begin();
-
+
$output = self::deleteDocumentExtraVars($module_srl, $document_srl, $idx_or_eid, $lang_code, $eid);
if (!$output->toBool())
{
$oDB->rollback();
return $output;
}
-
+
$output = self::insertDocumentExtraVar($module_srl, $document_srl, $idx_or_eid, $value, $eid, $lang_code);
if (!$output->toBool())
{
$oDB->rollback();
return $output;
}
-
+
$oDB->commit();
return $output;
}
@@ -1782,7 +1782,7 @@ class DocumentController extends Document
{
return $trigger_output;
}
-
+
// begin transaction
$oDB = DB::getInstance();
$oDB->begin();
@@ -1806,7 +1806,7 @@ class DocumentController extends Document
// Leave in the session information
$_SESSION['voted_document'][$document_srl] = $trigger_obj->point;
-
+
// Leave logs
$args->point = $trigger_obj->point;
$output = executeQuery('document.insertDocumentVotedLog', $args);
@@ -1815,7 +1815,7 @@ class DocumentController extends Document
$oDB->rollback();
return $output;
}
-
+
// Call a trigger (after)
ModuleHandler::triggerCall('document.updateVotedCount', 'after', $trigger_obj);
@@ -1836,7 +1836,7 @@ class DocumentController extends Document
$output->setMessage('success_blamed');
$output->add('blamed_count', $trigger_obj->after_point);
}
-
+
return $output;
}
@@ -1862,10 +1862,10 @@ class DocumentController extends Document
{
return $output;
}
-
+
$declared_count = ($output->data->declared_count) ? $output->data->declared_count : 0;
$declare_message = trim(htmlspecialchars($declare_message));
-
+
$trigger_obj = new stdClass();
$trigger_obj->document_srl = $document_srl;
$trigger_obj->declared_count = $declared_count;
@@ -1890,7 +1890,7 @@ class DocumentController extends Document
// Get currently logged in user.
$member_srl = $this->user->member_srl;
-
+
// Check if document's author is a member.
if($oDocument->get('member_srl'))
{
@@ -1919,12 +1919,12 @@ class DocumentController extends Document
$_SESSION['declared_document'][$document_srl] = false;
return new BaseObject(-1, 'failed_declared');
}
-
+
// Fill in remaining information for logging.
$args->member_srl = $member_srl;
$args->ipaddress = \RX_CLIENT_IP;
$args->declare_message = $declare_message;
-
+
// begin transaction
$oDB = DB::getInstance();
$oDB->begin();
@@ -1954,7 +1954,7 @@ class DocumentController extends Document
}
$this->add('declared_count', $declared_count + 1);
-
+
// Send message to admin
$message_targets = array();
$module_srl = $oDocument->get('module_srl');
@@ -2011,7 +2011,7 @@ class DocumentController extends Document
{
return new BaseObject(-1, 'failed_declared_cancel');
}
-
+
// Get the original document
$oDocument = DocumentModel::getDocument($document_srl, false, false);
@@ -2034,7 +2034,7 @@ class DocumentController extends Document
unset($_SESSION['declared_document'][$document_srl]);
return new BaseObject(-1, 'failed_declared_cancel');
}
-
+
// Get current declared count
$args = new stdClass();
$args->document_srl = $document_srl;
@@ -2050,7 +2050,7 @@ class DocumentController extends Document
{
return $trigger_output;
}
-
+
if($declared_count > 1)
{
$output = executeQuery('document.updateDeclaredDocumentCancel', $args);
@@ -2064,14 +2064,14 @@ class DocumentController extends Document
$oDB->rollback();
return $output;
}
-
+
$output = executeQuery('document.deleteDeclaredDocumentLog', $args);
if(!$output->toBool())
{
$oDB->rollback();
return $output;
}
-
+
$message_targets = array();
$module_srl = $oDocument->get('module_srl');
$document_config = ModuleModel::getModulePartConfig('document', $module_srl);
@@ -2101,7 +2101,7 @@ class DocumentController extends Document
$oCommunicationController->sendMessage($this->user->member_srl, $target_member_srl, $message_title, $message_content, false. null, false);
}
}
-
+
$oDB->commit();
$trigger_obj->declared_count = $declared_count - 1;
@@ -2258,7 +2258,7 @@ class DocumentController extends Document
if(!$output->toBool()) return $output;
$this->makeCategoryFile($category_info->module_srl);
-
+
// remove cache
$page = 0;
while(true)
@@ -3022,7 +3022,7 @@ class DocumentController extends Document
{
@set_time_limit(0);
$logged_info = Context::get('logged_info');
-
+
$obj = new stdClass;
$obj->type = Context::get('type');
$obj->document_list = array();
@@ -3032,7 +3032,7 @@ class DocumentController extends Document
$obj->manager_message = Context::get('message_content') ? nl2br(escape(strip_tags(Context::get('message_content')))) : '';
$obj->send_message = $obj->manager_message || Context::get('send_default_message') == 'Y';
$obj->return_message = '';
-
+
// Check permission of target module
if($obj->target_module_srl)
{
@@ -3047,7 +3047,7 @@ class DocumentController extends Document
throw new Rhymix\Framework\Exceptions\NotPermitted;
}
}
-
+
// Set Cart
$cart = Context::get('cart');
if(!is_array($cart))
@@ -3055,21 +3055,21 @@ class DocumentController extends Document
$cart = explode('|@|', $cart);
}
$obj->document_srl_list = array_unique(array_map('intval', $cart));
-
+
// Set document list
$obj->document_list = DocumentModel::getDocuments($obj->document_srl_list, false, false);
if(empty($obj->document_list))
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
}
-
+
// Call a trigger (before)
$output = ModuleHandler::triggerCall('document.manage', 'before', $obj);
if(!$output->toBool())
{
return $output;
}
-
+
$oController = getAdminController('document');
if($obj->type == 'move')
{
@@ -3077,13 +3077,13 @@ class DocumentController extends Document
{
throw new Rhymix\Framework\Exception('fail_to_move');
}
-
+
$output = $oController->moveDocumentModule($obj->document_srl_list, $obj->target_module_srl, $obj->target_category_srl);
if(!$output->toBool())
{
return $output;
}
-
+
$obj->return_message = 'success_moved';
}
else if($obj->type == 'copy')
@@ -3092,13 +3092,13 @@ class DocumentController extends Document
{
throw new Rhymix\Framework\Exception('fail_to_move');
}
-
+
$output = $oController->copyDocumentModule($obj->document_srl_list, $obj->target_module_srl, $obj->target_category_srl);
if(!$output->toBool())
{
return $output;
}
-
+
$obj->return_message = 'success_copied';
}
else if($obj->type == 'delete')
@@ -3112,14 +3112,14 @@ class DocumentController extends Document
$obj->return_message = $output->getMessage();
}
}
-
+
$obj->return_message = $obj->return_message ?: 'success_deleted';
}
else if($obj->type == 'trash')
{
$args = new stdClass;
$args->description = $obj->manager_message;
-
+
foreach ($obj->document_list as $document_srl => $oDocument)
{
$args->document_srl = $document_srl;
@@ -3130,7 +3130,7 @@ class DocumentController extends Document
$obj->return_message = $output->getMessage();
}
}
-
+
$obj->return_message = $obj->return_message ?: 'success_trashed';
}
else if($obj->type == 'cancelDeclare')
@@ -3142,17 +3142,17 @@ class DocumentController extends Document
{
return $output;
}
-
+
$obj->return_message = 'success_declare_canceled';
}
else
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
}
-
+
// Call a trigger (after)
ModuleHandler::triggerCall('document.manage', 'after', $obj);
-
+
// Send a message
$actions = lang('default_message_verbs');
if(isset($actions[$obj->type]) && $obj->send_message)
@@ -3166,7 +3166,7 @@ class DocumentController extends Document
%1\$s
Content;
$document_item = '
from : %s',$content, getFullUrl('', 'document_srl', $this->document_srl), getFullUrl('', 'document_srl', $this->document_srl));
-
+
// Send a message
$sender_member_srl = $logged_info->member_srl ?: $this->get('member_srl');
getController('communication')->sendMessage($sender_member_srl, $this->get('member_srl'), $title, $content, false, null, false);
@@ -439,7 +439,7 @@ class DocumentItem extends BaseObject
{
return $this->get('ipaddress');
}
-
+
return '*' . strstr($this->get('ipaddress') ?? '', '.');
}
@@ -454,12 +454,12 @@ class DocumentItem extends BaseObject
{
return;
}
-
+
if(!preg_match('@^[a-z]+://@i', $url))
{
$url = 'http://' . $url;
}
-
+
return escape($url, false);
}
@@ -494,7 +494,7 @@ class DocumentItem extends BaseObject
{
return;
}
-
+
return $cut_size ? cut_str($this->get('title'), $cut_size, $tail) : $this->get('title');
}
@@ -514,7 +514,7 @@ class DocumentItem extends BaseObject
{
return $_SESSION['voted_document'][$this->document_srl];
}
-
+
$logged_info = Context::get('logged_info');
if(!$logged_info->member_srl)
{
@@ -554,7 +554,7 @@ class DocumentItem extends BaseObject
{
return false;
}
-
+
$logged_info = Context::get('logged_info');
if(!$logged_info->member_srl)
{
@@ -565,7 +565,7 @@ class DocumentItem extends BaseObject
{
return $_SESSION['declared_document'][$this->document_srl];
}
-
+
$args = new stdClass();
if($logged_info->member_srl)
{
@@ -582,7 +582,7 @@ class DocumentItem extends BaseObject
{
return $_SESSION['declared_document'][$this->document_srl] = $declaredCount;
}
-
+
return false;
}
@@ -592,10 +592,10 @@ class DocumentItem extends BaseObject
{
return false;
}
-
+
$title = escape($this->getTitleText($cut_size, $tail), false);
$this->add('title_color', trim($this->get('title_color') ?? ''));
-
+
$attrs = array();
if($this->get('title_bold') == 'Y')
{
@@ -609,7 +609,7 @@ class DocumentItem extends BaseObject
{
return sprintf('%s', implode(';', $attrs), $title);
}
-
+
return $title;
}
@@ -619,19 +619,19 @@ class DocumentItem extends BaseObject
{
return;
}
-
+
if(!$this->isAccessible())
{
return lang('msg_is_secret');
}
-
+
$content = $this->get('content');
$content = trim(utf8_normalize_spaces(html_entity_decode(strip_tags($content))));
if($strlen)
{
$content = cut_str($content, $strlen, '...');
}
-
+
return escape($content);
}
@@ -641,12 +641,12 @@ class DocumentItem extends BaseObject
{
return;
}
-
+
if(!$this->isAccessible())
{
return lang('msg_is_secret');
}
-
+
$content = $this->get('content');
$content = preg_replace_callback('/<(object|param|embed)[^>]*/is', array($this, '_checkAllowScriptAccess'), $content);
$content = preg_replace_callback('/