Add option to block robots in integration search module

This commit is contained in:
Kijin Sung 2022-12-20 03:08:38 +09:00
parent afdc450b00
commit 49e76b4643
5 changed files with 22 additions and 1 deletions

View file

@ -30,6 +30,7 @@ class integration_searchAdminController extends integration_search
$config->skin = Context::get('skin');
$config->mskin = Context::get('mskin');
$config->block_robots = Context::get('block_robots') === 'N' ? false : true;
$config->target = Context::get('target');
$config->target_module_srl = Context::get('target_module_srl');
if(!$config->target_module_srl) $config->target_module_srl = '';

View file

@ -54,8 +54,17 @@ class integration_searchView extends integration_search
throw new Rhymix\Framework\Exceptions\NotPermitted;
}
// Set skin path
// Block robots
$config = $oModuleModel->getModuleConfig('integration_search') ?: new stdClass;
if (!isset($config->block_robots) || $config->block_robots !== false)
{
if (isCrawler())
{
throw new Rhymix\Framework\Exceptions\NotPermitted;
}
}
// Set skin path
if(ends_with('Mobile', get_class($this), false))
{
if(!$config->mskin || $config->mskin === '/USE_RESPONSIVE/')

View file

@ -9,6 +9,7 @@ $lang->msg_not_enabled = 'The integrated search is not available.';
$lang->msg_admin_not_enabled = 'The integrated search is not available. Please select a target module in integrated search settings.';
$lang->is_result_text = 'There are <strong>%d</strong> result(s) for <strong>\'%s\'</strong>';
$lang->multimedia = 'Images/Video';
$lang->integration_search_block_robots = 'Block Robots';
$lang->include_search_target = 'Search for selected modules';
$lang->exclude_search_target = 'Exclude selected modules from search';
$lang->is_search_option['document']['title_content'] = 'Subject+Content';

View file

@ -9,6 +9,7 @@ $lang->msg_not_enabled = '통합 검색을 사용할 수 없습니다.';
$lang->msg_admin_not_enabled = '통합 검색을 사용할 수 없습니다. 통합검색 설정에서 대상 모듈을 선택하세요.';
$lang->is_result_text = '<strong>\'%s\'</strong>에 대한 검색결과 <strong>%d</strong>건';
$lang->multimedia = '이미지/동영상';
$lang->integration_search_block_robots = '로봇 접근 차단';
$lang->include_search_target = '선택된 대상만 검색';
$lang->exclude_search_target = '선택된 대상을 검색에서 제외';
$lang->is_search_option['document']['title_content'] = '제목+내용';

View file

@ -33,6 +33,15 @@
</select>
</div>
</div>
<div class="x_control-group">
<label for="block_robots" class="x_control-label">{$lang->integration_search_block_robots}</label>
<div class="x_controls">
<select name="block_robots" id="block_robots">
<option value="Y" selected="selected"|cond="!isset($config->block_robots) || $config->block_robots">{$lang->cmd_yes}</option>
<option value="N" selected="selected"|cond="isset($config->block_robots) && !$config->block_robots">{$lang->cmd_no}</option>
</select>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->target}</label>
<div class="x_controls">