mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-03 01:03:28 +09:00
Add option to display module title in board list
This commit is contained in:
parent
e8b6db01fc
commit
46ac583a83
6 changed files with 80 additions and 7 deletions
|
|
@ -453,8 +453,10 @@ class boardView extends board
|
|||
|
||||
$args = new stdClass();
|
||||
$args->module_srl = $this->include_modules ?: $this->module_srl;
|
||||
$notice_output = DocumentModel::getNoticeList($args, $this->columnList);
|
||||
Context::set('notice_list', $notice_output->data);
|
||||
$output = DocumentModel::getNoticeList($args, $this->columnList);
|
||||
$notice_list = $output->data;
|
||||
$this->_fillModuleTitles($notice_list);
|
||||
Context::set('notice_list', $notice_list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -569,6 +571,7 @@ class boardView extends board
|
|||
|
||||
// setup document list variables on context
|
||||
$output = DocumentModel::getDocumentList($args, $this->except_notice, TRUE, $this->columnList);
|
||||
$this->_fillModuleTitles($output->data);
|
||||
Context::set('document_list', $output->data);
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
|
|
@ -576,6 +579,46 @@ class boardView extends board
|
|||
Context::set('page_navigation', $output->page_navigation);
|
||||
}
|
||||
|
||||
public function _fillModuleTitles(&$document_list)
|
||||
{
|
||||
static $map = null;
|
||||
|
||||
if ($this->include_modules)
|
||||
{
|
||||
if ($map === null)
|
||||
{
|
||||
$map = [];
|
||||
$module_titles = ModuleModel::getModulesInfo($this->include_modules, ['module_srl', 'mid', 'browser_title']);
|
||||
foreach ($module_titles as $module_info)
|
||||
{
|
||||
$map[$module_info->module_srl] = $module_info;
|
||||
}
|
||||
}
|
||||
foreach ($document_list as $document)
|
||||
{
|
||||
$module_srl = $document->get('module_srl');
|
||||
if (isset($map[$module_srl]))
|
||||
{
|
||||
$document->add('module_title', $map[$module_srl]->browser_title);
|
||||
$document->add('mid', $map[$module_srl]->mid);
|
||||
}
|
||||
else
|
||||
{
|
||||
$document->add('module_title', $this->module_info->browser_title);
|
||||
$document->add('mid', $this->module_info->mid);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($document_list as $document)
|
||||
{
|
||||
$document->add('module_title', $this->module_info->browser_title);
|
||||
$document->add('mid', $this->module_info->mid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _makeListColumnList()
|
||||
{
|
||||
$configColumList = array_keys($this->listConfig);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue