Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #2804 [baserCMS4系]サブサイトのドメイン設定ができない問題を解決 #2805

Open
wants to merge 4 commits into
base: dev-4
Choose a base branch
from
Open
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
16 changes: 16 additions & 0 deletions app/webroot/theme/admin-third/Elements/admin/sites/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,22 @@ class="helptext"><?php echo __d('baser', 'サブサイトのテンプレート
<?php echo $this->BcForm->error('Site.theme') ?>
</td>
</tr>
<tr>
<th class="bca-form-table__label"><?php echo $this->BcForm->label('Site.use_subdomain', __d('baser', 'ドメイン設定')) ?></th>
<td class=" bca-form-table__input">
<?php echo $this->BcForm->input('Site.use_subdomain', ['type' => 'radio', 'options' => [0 => __d('baser', '主となるドメインと同じドメイン'), 1 => __d('baser', '主となるドメインとは異なるドメイン')], 'default' => 0]) ?>
<?php echo $this->BcForm->error('Site.use_subdomain') ?>
<div class="domain_type">
<small><?php echo $this->BcForm->label('Site.domain_type', __d('baser', 'ドメインタイプ')) ?></small> 
<?php echo $this->BcForm->input('Site.domain_type', ['type' => 'radio', 'options' => [1 => __d('baser', 'サブドメイン'), 2 => __d('baser', '別ドメイン')], 'default' => 1]) ?>
<i class="bca-icon--question-circle btn help bca-help"></i>
<?php echo $this->BcForm->error('Site.domain_type') ?>
<div class="helptext">
<?php echo __d('baser', 'サブドメインの場合は、主となるドメインを除いたサブドメインの文字列をエイリアスに入力します。別ドメインの場合は、別ドメインをそのままエイリアスに入力します。') ?>
</div>
</div>
</td>
</tr>
<tr>
<th class="bca-form-table__label"><?php echo $this->BcForm->label('Site.status', __d('baser', '公開状態')) ?></th>
<td class=" bca-form-table__input">
Expand Down
18 changes: 18 additions & 0 deletions app/webroot/theme/admin-third/js/admin/sites/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,22 @@ $(function () {
}
}

// サブサイトにドメイン(サブドメイン)を使用するかどうかの表示
chengeUseDomein($("input[name='data[Site][use_subdomain]']:checked").val());
$("input[name='data[Site][use_subdomain]']").click(function() {
//変数valueにcheckedされたradioボタンのvalue値を取得する
use_subdomain = $("input[name='data[Site][use_subdomain]']:checked").val();
chengeUseDomein(use_subdomain);
});
function chengeUseDomein(use_subdomain) {
if (use_subdomain == 0) {
//ドメインを利用しない場合は、ドメインタイプは利用しない
$(".domain_type").hide('slow');
$("#SiteDomainType0").prop("checked", true);
} else {
//ドメインを利用する場合は、ドメインタイプのラジオボタンを表示
$(".domain_type").show('slow');
}
}

});
Loading