refreshModule($identifier);
}
}
if (! function_exists('g7_plugin_settings')) {
/**
* 그누보드7 플러그인 환경설정 조회 헬퍼 함수
*
* @param string $identifier 플러그인 식별자 (예: 'sirsoft-daum_postcode')
* @param string|null $key 설정 키 (dot notation)
* @param mixed $default 기본값
* @return mixed 설정값
*
* @example
* // 다음 우편번호 플러그인의 표시 모드 조회
* $displayMode = g7_plugin_settings('sirsoft-daum_postcode', 'display_mode');
* @example
* // 플러그인 전체 설정 조회
* $allSettings = g7_plugin_settings('sirsoft-daum_postcode');
*/
function g7_plugin_settings(string $identifier, ?string $key = null, mixed $default = null): mixed
{
if ($key === null) {
return Config::get("g7_settings.plugins.{$identifier}", []);
}
return Config::get("g7_settings.plugins.{$identifier}.{$key}", $default);
}
}
if (! function_exists('g7_meta_generator_tag')) {
/**
* `` 태그 HTML을 생성합니다.
*
* 코어 SEO 설정(`seo.generator_enabled`, `seo.generator_content`)에 따라
* 메타 태그를 출력합니다. SEO 봇 페이지·SPA 셸·Admin 셸에서 공통 호출됩니다.
*
* - `seo.generator_enabled` 가 false 이면 빈 문자열 반환
* - `seo.generator_content` 가 빈 값이면 `"GnuBoard7 {버전}"` 자동 적용
* - content 는 e() 로 escape 처리되어 XSS 방어됨
*
* @return string `` 또는 빈 문자열
*/
function g7_meta_generator_tag(): string
{
if (! g7_core_settings('seo.generator_enabled', true)) {
return '';
}
$content = trim((string) g7_core_settings('seo.generator_content', ''));
if ($content === '') {
$content = trim('GnuBoard7 '.config('app.version', ''));
}
return '';
}
}