2024-03-21 14:01:44 +08:00
|
|
|
<?php
|
2024-03-29 16:38:18 +08:00
|
|
|
|
2024-03-31 16:37:36 +08:00
|
|
|
use app\assets\FontAwesomeAsset;
|
|
|
|
use yii\bootstrap5\BootstrapAsset;
|
2024-03-30 14:48:55 +08:00
|
|
|
use yii\helpers\Html;
|
|
|
|
use yii\web\JqueryAsset;
|
|
|
|
use yii\web\View;
|
|
|
|
use yii\widgets\ActiveForm;
|
2024-03-29 16:38:18 +08:00
|
|
|
|
2024-03-30 14:48:55 +08:00
|
|
|
/* @var $this yii\web\View */
|
|
|
|
/* @var $siteConfig app\models\SiteConfig */
|
|
|
|
JqueryAsset::register($this);
|
2024-03-31 16:37:36 +08:00
|
|
|
FontAwesomeAsset::register($this);
|
|
|
|
$this->registerCssFile('@web/css/admin-system.css', ['depends' => [BootstrapAsset::class]]);
|
2024-03-29 16:38:18 +08:00
|
|
|
$this->title = '系统设置';
|
2024-03-21 14:01:44 +08:00
|
|
|
?>
|
2024-03-30 14:48:55 +08:00
|
|
|
<div class="admin-system">
|
|
|
|
|
|
|
|
<h1><?= Html::encode($this->title) ?></h1>
|
2024-03-21 14:01:44 +08:00
|
|
|
|
2024-03-30 14:48:55 +08:00
|
|
|
<br>
|
2024-03-29 16:38:18 +08:00
|
|
|
|
2024-03-30 14:48:55 +08:00
|
|
|
<?php $form = ActiveForm::begin(); ?>
|
2024-03-29 16:38:18 +08:00
|
|
|
|
2024-03-30 14:48:55 +08:00
|
|
|
<table>
|
|
|
|
<?php
|
|
|
|
$attributes = array_keys(get_object_vars($siteConfig));
|
|
|
|
foreach ($attributes as $attribute) {
|
2024-03-31 16:37:36 +08:00
|
|
|
echo '<tr id="tr-' . $attribute . '">';
|
2024-03-30 14:48:55 +08:00
|
|
|
echo '<th style="width: 200px"><p>' . $siteConfig->attributeLabels()[$attribute] . '</p></th>';
|
2024-04-01 14:08:01 +08:00
|
|
|
if ($attribute == 'registrationEnabled' || $attribute == 'enableIpinfo' || $attribute == 'clarityEnabled' || $attribute == 'gaEnabled') {
|
2024-03-30 14:48:55 +08:00
|
|
|
echo '<td>' . $form->field($siteConfig, $attribute)->checkbox(['class' => 'form-check-input'], false)->label(false) . '</td>';
|
|
|
|
} elseif ($attribute == 'verifyProvider') {
|
|
|
|
echo '<td>' . $form->field($siteConfig, $attribute)->dropDownList(['None' => 'None', 'reCAPTCHA' => 'reCAPTCHA', 'hCaptcha' => 'hCaptcha', 'Turnstile' => 'Turnstile'], ['class' => 'form-select form-select-sm', 'style' => 'width:25em'])->label(false) . '</td>';
|
|
|
|
} else {
|
|
|
|
echo '<td>' . $form->field($siteConfig, $attribute)->textInput(['class' => 'form-control form-control-sm', 'style' => 'width:25em'])->label(false) . '</td>';
|
|
|
|
}
|
2024-03-31 16:37:36 +08:00
|
|
|
echo '<td><button type="button" class="btn btn-sm btn-light" data-bs-toggle="popover" data-bs-custom-class="custom-popover" data-bs-title="help" data-bs-html="true" data-bs-content="'.$siteConfig->attributeHelpTexts()[$attribute].'" style="margin-bottom: 14px;"><i class="fa-solid fa-circle-question"></i></button></td>';
|
2024-03-30 14:48:55 +08:00
|
|
|
echo '</tr>';
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</table>
|
2024-03-29 16:38:18 +08:00
|
|
|
|
2024-03-30 14:48:55 +08:00
|
|
|
<div class="form-group">
|
|
|
|
<?= Html::submitButton('保存', ['class' => 'btn btn-success']) ?>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php ActiveForm::end(); ?>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
$this->registerJsFile('@web/js/admin-system.js', ['depends' => [JqueryAsset::class], 'position' => View::POS_END]);
|
2024-03-31 16:37:36 +08:00
|
|
|
$this->registerJs('
|
|
|
|
$(function () {
|
|
|
|
$("[data-bs-toggle=\'popover\']").popover();
|
|
|
|
});
|
|
|
|
');
|
2024-03-30 14:48:55 +08:00
|
|
|
?>
|