diff --git a/src/controllers/DomainController.php b/src/controllers/DomainController.php index cf95d4f7..1b6e999f 100644 --- a/src/controllers/DomainController.php +++ b/src/controllers/DomainController.php @@ -316,11 +316,19 @@ public function actions() ], 'enable-freeze' => [ 'class' => SmartPerformAction::class, - 'success' => Yii::t('app', 'Freeze was enabled'), + 'success' => Yii::t('hipanel/domain', 'Freeze was enabled'), ], 'disable-freeze' => [ 'class' => SmartPerformAction::class, - 'success' => Yii::t('app', 'Freeze was disabled'), + 'success' => Yii::t('hipanel/domain', 'Freeze was disabled'), + ], + 'enable-freeze-w-p' => [ + 'class' => SmartPerformAction::class, + 'success' => Yii::t('hipanel/domain', 'WP freeze was enabled'), + ], + 'disable-freeze-w-p' => [ + 'class' => SmartPerformAction::class, + 'success' => Yii::t('hipanel/domain', 'WP freeze was disabled'), ], 'OLD-set-ns' => [ 'class' => RenderAction::class, diff --git a/src/views/domain/_freezeButtons.php b/src/views/domain/_freezeButtons.php new file mode 100644 index 00000000..8dfe5642 --- /dev/null +++ b/src/views/domain/_freezeButtons.php @@ -0,0 +1,103 @@ + +isFreezed() && Yii::$app->user->can('freeze')) : ?> +
  • + $model, + 'scenario' => 'enable-freeze', + 'button' => [ + 'label' => '' . Yii::t('hipanel/domain', 'Freeze domain'), + ], + 'modal' => [ + 'header' => Html::tag('h4', Yii::t('hipanel/domain', 'Confirm domain freezing')), + 'headerOptions' => ['class' => 'label-info'], + 'footer' => [ + 'label' => Yii::t('hipanel/domain', 'Freeze domain'), + 'data-loading-text' => Yii::t('hipanel/domain', 'Freezing domain...'), + 'class' => 'btn btn-danger', + ], + ], + 'body' => Yii::t('hipanel/domain', + 'Are you sure, that you want to freeze domain {domain}?', + ['domain' => $model->domain] + ) + ]) ?> +
  • + +isFreezed() && Yii::$app->user->can('unfreeze')) : ?> +
  • + $model, + 'scenario' => 'disable-freeze', + 'button' => [ + 'label' => '' . Yii::t('hipanel/domain', 'Unfreeze domain'), + ], + 'modal' => [ + 'header' => Html::tag('h4', Yii::t('hipanel/domain', 'Confirm domain unfreezing')), + 'headerOptions' => ['class' => 'label-info'], + 'footer' => [ + 'label' => Yii::t('hipanel/domain', 'Unfreeze domain'), + 'data-loading-text' => Yii::t('hipanel/domain', 'Unfreezing domain...'), + 'class' => 'btn btn-danger', + ], + ], + 'body' => Yii::t('hipanel/domain', + 'Are you sure, that you want to unfreeze domain {domain}?', + ['domain' => $model->domain] + ) + ]) ?> +
  • + +isWPFreezed() && Yii::$app->user->can('freeze')) : ?> +
  • + $model, + 'scenario' => 'enable-freeze-w-p', + 'button' => [ + 'label' => '' . Yii::t('hipanel/domain', 'Freeze WHOIS-protect'), + ], + 'modal' => [ + 'header' => Html::tag('h4', Yii::t('hipanel/domain', 'Confirm freezing WHOIS-protect')), + 'headerOptions' => ['class' => 'label-info'], + 'footer' => [ + 'label' => Yii::t('hipanel/domain', 'Freeze WHOIS-protect'), + 'data-loading-text' => Yii::t('hipanel/domain', 'Freezing WHOIS-protect...'), + 'class' => 'btn btn-danger', + ], + ], + 'body' => Yii::t('hipanel/domain', + 'Are you sure, that you want to freeze WHOIS-protect {domain}?', + ['domain' => $model->domain] + ) + ]) ?> +
  • + +isWPFreezed() && Yii::$app->user->can('unfreeze')) : ?> +
  • + $model, + 'scenario' => 'disable-freeze-w-p', + 'button' => [ + 'label' => '' . Yii::t('hipanel/domain', 'Unfreeze WHOIS-protect'), + ], + 'modal' => [ + 'header' => Html::tag('h4', Yii::t('hipanel/domain', 'Confirm unfreezing WHOIS-protect')), + 'headerOptions' => ['class' => 'label-info'], + 'footer' => [ + 'label' => Yii::t('hipanel/domain', 'Unfreeze WHOIS-protect'), + 'data-loading-text' => Yii::t('hipanel/domain', 'Unfreezing WHOIS-protect...'), + 'class' => 'btn btn-danger', + ], + ], + 'body' => Yii::t('hipanel/domain', + 'Are you sure, that you want to unfreeze WHOIS-protect for domain {domain}?', + ['domain' => $model->domain] + ) + ]) ?> +
  • + diff --git a/src/views/domain/_sync_button.php b/src/views/domain/_syncButton.php similarity index 100% rename from src/views/domain/_sync_button.php rename to src/views/domain/_syncButton.php diff --git a/src/views/domain/view.php b/src/views/domain/view.php index ab490064..184d5999 100644 --- a/src/views/domain/view.php +++ b/src/views/domain/view.php @@ -7,7 +7,6 @@ use hipanel\widgets\AjaxModal; use hipanel\widgets\Box; use hipanel\widgets\ClientSellerLink; -use hipanel\widgets\ModalButton; use hipanel\widgets\Pjax; use hiqdev\bootstrap_switch\BootstrapSwitchColumn; use hiqdev\xeditable\widgets\XEditable; @@ -57,7 +56,7 @@