Merge branch 'rhymix:master' into master

This commit is contained in:
Lastorder 2025-03-10 17:04:17 +09:00 committed by GitHub
commit a40502885e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 259 additions and 140 deletions

View file

@ -281,8 +281,7 @@ class BoardView extends Board
public function dispBoardContentView()
{
// get the variable value
$document_srl = Context::get('document_srl');
$page = Context::get('page');
$document_srl = (int)Context::get('document_srl');
/**
* if the document exists, then get the document information
@ -541,7 +540,7 @@ class BoardView extends Board
return;
}
// setup module_srl/page number/ list number/ page count
// Setup basic parameters such as module and page.
$args = new stdClass();
$args->module_srl = $this->include_modules ?: $this->module_srl;
$args->page = intval(Context::get('page')) ?: null;
@ -553,48 +552,78 @@ class BoardView extends Board
$args->start_regdate = date('YmdHis', time() - ($this->module_info->include_days * 86400));
}
// get the search target and keyword
// Filter by search target and keyword.
if ($this->grant->view)
{
$args->search_target = Context::get('search_target');
$args->search_keyword = Context::get('search_keyword');
$args->search_target = (string)Context::get('search_target');
$args->search_keyword = (string)Context::get('search_keyword');
// Remove unsupported search target
$search_option = Context::get('search_option') ?: $this->search_option;
if ($args->search_target !== '' && !isset($search_option[$args->search_target]))
{
$args->search_target = '';
$args->search_keyword = '';
}
}
if(!$search_option = Context::get('search_option'))
// Filter by category.
if ($this->module_info->use_category === 'Y')
{
$search_option = $this->search_option;
}
if(!isset($search_option[$args->search_target]))
{
$args->search_target = '';
$args->category_srl = (string)Context::get('category') ?: null;
// Support comma-separated categories #2519
if ($args->category_srl)
{
$args->category_srl = array_map('intval', explode(',', $args->category_srl));
if (count($args->category_srl) === 1)
{
$args->category_srl = $args->category_srl[0];
}
}
}
// set member_srl for view particular member's document
if($this->module_info->use_anonymous !== 'Y')
// Filter by consultation member_srl, or the member_srl parameter if given.
if ($this->consultation)
{
$args->member_srl = abs(Context::get('member_srl') ?? 0) ?: null;
if ($this->module_info->use_anonymous === 'Y')
{
$args->member_srl = [$this->user->member_srl, $this->user->member_srl * -1];
}
else
{
$args->member_srl = $this->user->member_srl;
}
}
else
{
if ($this->module_info->use_anonymous !== 'Y')
{
$args->member_srl = abs(intval(Context::get('member_srl'))) ?: null;
}
}
// if the category is enabled, then get the category
if($this->module_info->use_category=='Y')
// If we are filtering by category or search keyword, use search_list_count instead of list_count.
if (!empty($args->category_srl) || !empty($args->search_keyword))
{
$args->category_srl = Context::get('category');
$args->list_count = $this->search_list_count;
}
// setup the sort index and order index
$args->sort_index = Context::get('sort_index');
$args->order_type = Context::get('order_type');
if(!in_array($args->sort_index, $this->order_target))
// Setup sorting.
$args->sort_index = (string)Context::get('sort_index');
$args->order_type = (string)Context::get('order_type');
if (!in_array($args->sort_index, $this->order_target ?? []))
{
$args->sort_index = $this->module_info->order_target?$this->module_info->order_target:'list_order';
$args->sort_index = $this->module_info->order_target ?: 'list_order';
}
if(!in_array($args->order_type, array('asc','desc')))
if (!in_array($args->order_type, ['asc', 'desc']))
{
$args->order_type = $this->module_info->order_type?$this->module_info->order_type:'asc';
$args->order_type = $this->module_info->order_type ?: 'asc';
}
// set the current page of documents
$document_srl = Context::get('document_srl');
// Find the page on which the current document is located.
// This is very resource-intensive, so we only do it when necessary.
$document_srl = (int)Context::get('document_srl') ?: null;
if($document_srl && $this->module_info->skip_bottom_list_for_robot !== 'N' && isCrawler())
{
Context::set('page', $args->page = null);
@ -618,27 +647,6 @@ class BoardView extends Board
}
}
// setup the list count to be serach list count, if the category or search keyword has been set
if($args->category_srl ?? null || $args->search_keyword ?? null)
{
$args->list_count = $this->search_list_count;
}
// if the consultation function is enabled, the get the logged user information
if($this->consultation)
{
$logged_info = Context::get('logged_info');
if($this->module_info->use_anonymous === 'Y')
{
$args->member_srl = array($logged_info->member_srl, $logged_info->member_srl * -1);
}
else
{
$args->member_srl = $logged_info->member_srl;
}
}
// setup the list config variable on context
Context::set('list_config', $this->listConfig);

View file

@ -52,13 +52,13 @@
<div class="x_control-group">
<label class="x_control-label" for="lang_meta_keywords">{$lang->meta_keywords}</label>
<div class="x_controls">
<input type="text" name="meta_keywords" id="meta_keywords" value="{$module_info->meta_keywords}" class="lang_code" />
<input type="text" name="meta_keywords" id="meta_keywords" value="{$module_info->meta_keywords}" class="x_full-width lang_code" />
</div>
</div>
<div class="x_control-group">
<label class="x_control-label" for="lang_meta_description">{$lang->meta_description}</label>
<div class="x_controls">
<input type="text" name="meta_description" id="meta_description" value="{$module_info->meta_description}" class="lang_code" />
<input type="text" name="meta_description" id="meta_description" value="{$module_info->meta_description}" class="x_full-width lang_code" />
</div>
</div>
<div class="x_control-group">
@ -104,14 +104,14 @@
<div class="x_control-group">
<label class="x_control-label" for="lang_header_text">{$lang->header_text}</label>
<div class="x_controls">
<textarea name="header_text" id="header_text" class="lang_code" rows="8" cols="42">{$module_info->header_text}</textarea>
<textarea name="header_text" id="header_text" class="x_full-width lang_code" rows="8" cols="42">{$module_info->header_text}</textarea>
<p id="header_text_help" class="x_help-block">{$lang->about_header_text}</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label" for="lang_footer_text">{$lang->footer_text}</label>
<div class="x_controls">
<textarea name="footer_text" id="footer_text" class="lang_code" rows="8" cols="42">{$module_info->footer_text}</textarea>
<textarea name="footer_text" id="footer_text" class="x_full-width lang_code" rows="8" cols="42">{$module_info->footer_text}</textarea>
<p id="footer_text_help" class="x_help-block">{$lang->about_footer_text}</p>
</div>
</div>
@ -121,9 +121,18 @@
<div class="x_control-group">
<label class="x_control-label">{$lang->mobile_view}</label>
<div class="x_controls">
<label class="x_inline" for="use_mobile"><input type="checkbox" name="use_mobile" id="use_mobile" value="Y" checked="checked"|cond="$module_info->use_mobile == 'Y'" /> {$lang->about_mobile_view}</label>
<label for="use_mobile_y" class="x_inline">
<input type="radio" name="use_mobile" id="use_mobile_y" value="Y" checked="checked"|cond="$module_info->use_mobile === 'Y'" />
{$lang->cmd_yes}
</label>
<label for="use_mobile_n" class="x_inline">
<input type="radio" name="use_mobile" id="use_mobile_n" value="N" checked="checked"|cond="$module_info->use_mobile !== 'Y'" />
{$lang->cmd_no}
</label>
<p class="x_help-block">{$lang->about_mobile_view}</p>
</div>
</div>
<div class="hide-if-not-mobile-view">
<div class="x_control-group">
<label class="x_control-label" for="mlayout_srl">{$lang->mobile_layout}</label>
<div class="x_controls">
@ -169,17 +178,18 @@
<div class="x_control-group">
<label class="x_control-label" for="lang_mobile_header_text">{$lang->mobile_header_text}</label>
<div class="x_controls">
<textarea name="mobile_header_text" id="mobile_header_text" class="lang_code" rows="8" cols="42">{$module_info->mobile_header_text}</textarea>
<textarea name="mobile_header_text" id="mobile_header_text" class="x_full-width lang_code" rows="8" cols="42">{$module_info->mobile_header_text}</textarea>
<p id="mobile_header_text_help" class="x_help-block">{$lang->about_mobile_header_text}</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label" for="lang_mobile_footer_text">{$lang->mobile_footer_text}</label>
<div class="x_controls">
<textarea name="mobile_footer_text" id="mobile_footer_text" class="lang_code" rows="8" cols="42">{$module_info->mobile_footer_text}</textarea>
<textarea name="mobile_footer_text" id="mobile_footer_text" class="x_full-width lang_code" rows="8" cols="42">{$module_info->mobile_footer_text}</textarea>
<p id="mobile_footer_text_help" class="x_help-block">{$lang->about_mobile_footer_text}</p>
</div>
</div>
</div>
</section>
<section class="section">
<h1>{$lang->cmd_list_setting}</h1>
@ -260,6 +270,13 @@
</section>
<section class="section">
<h1>{$lang->subtitle_advanced}</h1>
<div class="x_control-group">
<label class="x_control-label">{$lang->consultation}</label>
<div class="x_controls">
<label class="x_inline" for="consultation"><input type="checkbox" name="consultation" id="consultation" value="Y" checked="checked"|cond="$module_info->consultation == 'Y'" /> {$lang->use_consultation}</label>
<p class="x_help-block">{$lang->about_consultation}</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->use_anonymous}</label>
<div class="x_controls">
@ -301,13 +318,6 @@
<p class="x_help-block">{$lang->about_inline_data_url_limit}</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->consultation}</label>
<div class="x_controls">
<label class="x_inline" for="consultation"><input type="checkbox" name="consultation" id="consultation" value="Y" checked="checked"|cond="$module_info->consultation == 'Y'" /> {$lang->use_consultation}</label>
<p class="x_help-block">{$lang->about_consultation}</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->update_log}</label>
<div class="x_controls">

View file

@ -147,3 +147,18 @@ function doSaveListConfig(module_srl)
exec_json('board.procBoardAdminInsertListConfig', params, function() { location.reload(); });
}
$(function() {
$('#use_mobile_y,#use_mobile_n').on('change', function() {
if ($(this).is(':checked')) {
if ($(this).val() == 'Y') {
$('.hide-if-not-mobile-view').show();
} else {
$('.hide-if-not-mobile-view').hide();
}
}
});
if ($('#use_mobile_n').is(':checked')) {
$('.hide-if-not-mobile-view').hide();
}
});