mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-27 22:33:10 +09:00
Merge pull request #1624 from shydah/pr/manage-document-popup
Resolve #1595 - 게시물 관리 사용 시 게시판이 기본 선택되도록 개선
This commit is contained in:
commit
80afa6720c
4 changed files with 38 additions and 6 deletions
|
|
@ -104,11 +104,40 @@ class documentView extends document
|
|||
Context::set('document_list', array());
|
||||
}
|
||||
|
||||
// Set target module info
|
||||
$target_mid = Context::getRequestVars()->mid ?? '';
|
||||
$module_srl = intval(Context::get('module_srl'));
|
||||
Context::set('module_srl',$module_srl);
|
||||
$module_info = ModuleModel::getModuleInfoByModuleSrl($module_srl);
|
||||
Context::set('mid',$module_info->mid);
|
||||
Context::set('browser_title',$module_info->browser_title);
|
||||
|
||||
// if target mid is provided
|
||||
if($target_mid && $target_mid === Context::get('mid'))
|
||||
{
|
||||
$module_info = ModuleModel::getModuleInfoByMid($target_mid);
|
||||
$module_srl = $module_info ? $module_info->module_srl : 0;
|
||||
}
|
||||
// if module_srl is provided instead of target_mid (legacy)
|
||||
elseif($module_srl > 0)
|
||||
{
|
||||
$module_info = ModuleModel::getModuleInfoByModuleSrl($module_srl);
|
||||
$module_srl = $module_info ? $module_info->module_srl : 0;
|
||||
}
|
||||
// if no module info is provided
|
||||
else
|
||||
{
|
||||
// set module_srl if all documents has one common module_srl
|
||||
$document_module_srl_list = array_unique(array_map(function($document) {
|
||||
return $document->get('module_srl');
|
||||
}, $document_list));
|
||||
if(count($document_module_srl_list) == 1)
|
||||
{
|
||||
$module_srl = array_first($document_module_srl_list);
|
||||
}
|
||||
$module_info = ModuleModel::getModuleInfoByModuleSrl($module_srl);
|
||||
$module_srl = $module_info ? $module_info->module_srl : 0;
|
||||
}
|
||||
|
||||
Context::set('module_srl', $module_srl);
|
||||
Context::set('mid', $module_info ? $module_info->mid : '');
|
||||
Context::set('browser_title', $module_info ? $module_info->browser_title : '');
|
||||
|
||||
// Select Pop-up layout
|
||||
$this->setLayoutPath('./common/tpl');
|
||||
|
|
|
|||
|
|
@ -71,5 +71,8 @@ jQuery(function($){
|
|||
message_content_area.prop("disabled", false);
|
||||
}
|
||||
});
|
||||
<!--@if($module_srl > 0)-->
|
||||
doGetCategoryFromModule({$module_srl});
|
||||
<!--@end-->
|
||||
});
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue