Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/Plugins/Manage/SiteManage/SiteManage.php
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,13 @@ public function saveMeta($request, $page_id = null, $errors = array())
);
}

// 機能拡張用meta設定の保存
Configs::updateOrCreate(
['name' => 'expose_login_userid_meta'],
['category' => 'meta',
'value' => $request->expose_login_userid_meta ?? '0']
);

// メタ情報の更新完了メッセージ
session()->flash('flash_message', 'メタ情報を更新しました。');

Expand Down
6 changes: 6 additions & 0 deletions resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@
@endif
{{-- CSRF Token --}}
<meta name="csrf-token" content="{{csrf_token()}}">
{{-- ログインユーザID。未ログイン時 or 機能無効時は出力しない --}}
@auth
@if (Configs::getConfigsValue($cc_configs, 'expose_login_userid_meta') == '1')
<meta name="cc-login-userid" content="{{ Auth::user()->userid }}">
@endif
@endauth
{{-- cc_configsのセット場所は、app\Http\Middleware\ConnectInit::handle(). 管理画面・一般画面全てのviewで参照できる --}}
<title>@if(isset($page)){{$page->page_name}} | @endif{{$site_name}}</title>

Expand Down
37 changes: 37 additions & 0 deletions resources/views/plugins/manage/site/meta.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,43 @@
<small class="form-text text-muted">ページのタイプを指定(例:website, article, blog, video.movie等)※初期値:website</small>
</div>

{{-- 機能拡張用meta --}}
<hr class="mt-4 mb-3">
<h5 id="expose_meta_settings">機能拡張用meta</h5>
<div class="alert alert-info mb-3">
<small>
<strong><i class="fas fa-info-circle"></i> 機能拡張用metaとは</strong><br>
JavaScript等のフロントエンド拡張から参照する目的で、Connect-CMSのHTMLヘッダにmetaタグを追加出力する設定です。<br>
<strong>※ HTMLソースに出力されるため、組織のセキュリティポリシーに合わせて有効化してください。</strong>
</small>
</div>
<div class="form-group">
<label class="col-form-label">ログインIDをmetaタグに出力 <small class="text-muted">(cc-login-userid)</small></label>
<div class="row">
<div class="col-md-3">
<div class="custom-control custom-radio custom-control-inline">
@if(Configs::getConfigsValueAndOld($configs, "expose_login_userid_meta", "0") == "0")
<input type="radio" value="0" id="expose_login_userid_meta_off" name="expose_login_userid_meta" class="custom-control-input" checked="checked">
@else
<input type="radio" value="0" id="expose_login_userid_meta_off" name="expose_login_userid_meta" class="custom-control-input">
@endif
<label class="custom-control-label" for="expose_login_userid_meta_off">出力しない</label>
</div>
</div>
<div class="col-md-3">
<div class="custom-control custom-radio custom-control-inline">
@if(Configs::getConfigsValueAndOld($configs, "expose_login_userid_meta", "0") == "1")
<input type="radio" value="1" id="expose_login_userid_meta_on" name="expose_login_userid_meta" class="custom-control-input" checked="checked">
@else
<input type="radio" value="1" id="expose_login_userid_meta_on" name="expose_login_userid_meta" class="custom-control-input">
@endif
<label class="custom-control-label" for="expose_login_userid_meta_on">出力する</label>
</div>
</div>
</div>
<small class="form-text text-muted">ログイン中のみ &lt;meta name="cc-login-userid" content="{ログインID}"&gt; を出力します。</small>
</div>

{{-- Submitボタン --}}
<div class="form-group text-center">
<div class="row">
Expand Down
Loading