Remove trailing whitespace

This commit is contained in:
Kijin Sung 2023-01-30 21:37:41 +09:00
parent c881e73c1d
commit c5267b42fd
26 changed files with 873 additions and 873 deletions

View file

@ -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'))
{

View file

@ -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');
}

View file

@ -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
*/

View file

@ -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 : <a href=\"%s\">%s</a><br/>\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

View file

@ -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

View file

@ -1,138 +1,138 @@
<?php
/* Copyright (C) NAVER <http://www.navercorp.com> */
/**
* @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 .= "<b>".$oComment->getNickName()."</b> (".$oComment->getRegdate("Y-m-d").")<br>\r\n".$oComment->getContent(false,false)."<br>\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('<p>','<br>&nbsp;&nbsp;&nbsp;',$oDocument->getContent(false,false,false)),'<br><b><i><u><em><small><strong><big>');
// setup content information(include the comments link)
$content = lang('replies').' : <a href="'.getUrl('act','dispBoardContentCommentList').'">'.$oDocument->getCommentCount().'</a><br>'."\r\n".$content;
$content = '<b>'.$oDocument->getNickName().'</b> ('.$oDocument->getRegdate("Y-m-d").")<br>\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;
}
}
<?php
/* Copyright (C) NAVER <http://www.navercorp.com> */
/**
* @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 .= "<b>".$oComment->getNickName()."</b> (".$oComment->getRegdate("Y-m-d").")<br>\r\n".$oComment->getContent(false,false)."<br>\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('<p>','<br>&nbsp;&nbsp;&nbsp;',$oDocument->getContent(false,false,false)),'<br><b><i><u><em><small><strong><big>');
// setup content information(include the comments link)
$content = lang('replies').' : <a href="'.getUrl('act','dispBoardContentCommentList').'">'.$oDocument->getCommentCount().'</a><br>'."\r\n".$content;
$content = '<b>'.$oDocument->getNickName().'</b> ('.$oDocument->getRegdate("Y-m-d").")<br>\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;
}
}