Skip to content

Commit

Permalink
Fixed DB delete
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverFire committed May 26, 2015
1 parent e1e9f9d commit bf0bd61
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
12 changes: 4 additions & 8 deletions controllers/DbController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,19 @@ public function actions()
return [
'delete' => [
'class' => 'hipanel\actions\SwitchAction',
'addFlash' => true,
'success' => Yii::t('app', 'DB delete task has been created successfully'),
'error' => Yii::t('app', 'Error while deleting DB'),
'POST html' => [
'POST' => [
'save' => true,
'success' => [
'class' => 'hipanel\actions\RedirectAction',
'url' => ['index'],
],
'error' => [
'class' => 'hipanel\actions\RedirectAction',
'url' => [
'view',
function ($model) {
return ['id' => $model->id];
}
],
'url' => function ($action, $model) {
return ['view', 'id' => $model->id];
}
]
],
],
Expand Down
2 changes: 1 addition & 1 deletion grid/DbGridView.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

namespace hipanel\modules\hosting\grid;

use frontend\modules\server\grid\ServerColumn;
use hipanel\grid\ActionColumn;
use hipanel\grid\BoxedGridView;
use hipanel\grid\MainColumn;
use hipanel\grid\EditableColumn;
use hipanel\grid\RefColumn;
use hipanel\modules\hosting\widgets\db\State;
use hipanel\modules\server\grid\ServerColumn;
use Yii;

class DbGridView extends BoxedGridView
Expand Down
2 changes: 1 addition & 1 deletion views/db/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@

<?php
echo Html::beginForm(['delete'], "POST", ['data' => ['pjax' => 1, 'pjax-push' => 0], 'class' => 'inline']);
echo Html::hiddenInput('id', $model->id);
echo Html::activeHiddenInput($model, 'id');
Modal::begin([
'options' => [
'data-backdrop' => 0
Expand Down

0 comments on commit bf0bd61

Please sign in to comment.