mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
#1624 보완
This commit is contained in:
parent
b483992c83
commit
b2af6eeed7
3 changed files with 23 additions and 25 deletions
|
|
@ -132,7 +132,7 @@
|
|||
</div>
|
||||
<div class="btnArea">
|
||||
<a href="{getUrl('act','dispBoardWrite','document_srl','')}" class="btn">{$lang->cmd_write}</a>
|
||||
<a cond="$grant->manager" href="{getUrl('','module','document','act','dispDocumentManageDocument','target_mid',$mid)}" class="btn" onclick="popopen(this.href,'manageDocument'); return false;">{$lang->cmd_manage_document}</a>
|
||||
<a cond="$grant->manager" href="{getUrl('','mid',$mid,'act','dispDocumentManageDocument')}" class="btn" onclick="popopen(this.href,'manageDocument'); return false;">{$lang->cmd_manage_document}</a>
|
||||
</div>
|
||||
<button type="button" class="bsToggle" title="{$lang->cmd_search}">{$lang->cmd_search}</button>
|
||||
<form cond="$grant->view" action="{getUrl()}" method="get" onsubmit="return procFilter(this, search)" id="board_search" class="board_search" no-error-return-url="true">
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@
|
|||
<a href="{getUrl('act','dispBoardWrite','document_srl','')}" class="btn"><i class="xi-pen"></i> {$lang->cmd_write}</a>
|
||||
<a href="{getUrl('act','dispBoardTagList')}" class="btn" title="{$lang->tag}"><i class="xi-tag"></i> {$lang->tag}</a>
|
||||
<a cond="$grant->manager" class="btn" href="{getUrl('act','dispBoardAdminBoardInfo')}" title="{$lang->cmd_setup}"><i class="xi-cog"></i> {$lang->cmd_setup}</a>
|
||||
<a cond="$grant->manager" href="{getUrl('','module','document','act','dispDocumentManageDocument','target_mid',$mid)}" class="btn" onclick="popopen(this.href,'manageDocument'); return false;">{$lang->cmd_manage_document}</a>
|
||||
<a cond="$grant->manager" href="{getUrl('','mid',$mid,'act','dispDocumentManageDocument')}" class="btn" onclick="popopen(this.href,'manageDocument'); return false;">{$lang->cmd_manage_document}</a>
|
||||
</div>
|
||||
|
||||
<form cond="$grant->view" action="{getUrl()}" method="get" onsubmit="return procFilter(this, search)" id="board_search" class="board_search" no-error-return-url="true">
|
||||
|
|
|
|||
|
|
@ -105,41 +105,39 @@ class documentView extends document
|
|||
}
|
||||
|
||||
// Set target module info
|
||||
$target_mid = Context::get('target_mid');
|
||||
$target_mid = Context::getRequestVars()->mid ?? '';
|
||||
$module_srl = intval(Context::get('module_srl'));
|
||||
|
||||
if(!is_null($target_mid)) {
|
||||
// if target_mid is provided
|
||||
|
||||
// if target mid is provided
|
||||
if($target_mid && $target_mid === Context::get('mid'))
|
||||
{
|
||||
$module_info = ModuleModel::getModuleInfoByMid($target_mid);
|
||||
if(!is_null($module_info)) {
|
||||
$module_srl = $module_info->module_srl;
|
||||
}
|
||||
$module_srl = $module_info ? $module_info->module_srl : 0;
|
||||
}
|
||||
else if($module_srl > 0) {
|
||||
// if module_srl is provided instead of target_mid (legacy)
|
||||
// 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
|
||||
{
|
||||
// if no module info is provided
|
||||
$document_module_srl_list = array();
|
||||
foreach($document_list as $key => $val) {
|
||||
$document_module_srl = $val->variables['module_srl'];
|
||||
if(!in_array($document_module_srl, $document_module_srl_list))
|
||||
{
|
||||
array_push($document_module_srl_list, $document_module_srl);
|
||||
}
|
||||
}
|
||||
// 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)
|
||||
{
|
||||
// set module_srl if all documents has one common module_srl
|
||||
$module_srl = $document_module_srl;
|
||||
$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->mid);
|
||||
Context::set('browser_title',$module_info->browser_title);
|
||||
|
||||
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');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue