Commit f59447a78b02873a31517109c2a4ce1f806e2424
1 parent
a3a1f00a
test
Showing
4 changed files
with
28 additions
and
3 deletions
Show diff stats
composer.lock
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", |
5 | 5 | "This file is @generated automatically" |
6 | 6 | ], |
7 | - "hash": "ccb155d1fc69bc6d276c50f0990fa1d7", | |
7 | + "hash": "dfde859453134d35dc61fc6825917302", | |
8 | 8 | "content-hash": "ec129e7be083837c52b871f4c8ec7f56", |
9 | 9 | "packages": [ |
10 | 10 | { | ... | ... |
frontend/controllers/AccountsController.php
... | ... | @@ -63,6 +63,7 @@ |
63 | 63 | 'portfolio-delete' => [ 'POST' ], |
64 | 64 | 'projects-delete' => [ 'POST' ], |
65 | 65 | 'blog-delete' => [ 'POST' ], |
66 | + 'gallery' => [ 'POST' ], | |
66 | 67 | ], |
67 | 68 | ], |
68 | 69 | ]; |
... | ... | @@ -276,6 +277,13 @@ |
276 | 277 | } |
277 | 278 | } |
278 | 279 | |
280 | + public function actionGalleryDelete($id) | |
281 | + { | |
282 | + Gallery::findOne($id) | |
283 | + ->delete(); | |
284 | + $this->redirect('gallery'); | |
285 | + } | |
286 | + | |
279 | 287 | public function actionGeneral() |
280 | 288 | { |
281 | 289 | $user_info = UserInfo::find() | ... | ... |
frontend/views/accounts/gallery.php
... | ... | @@ -43,5 +43,23 @@ |
43 | 43 | 2 => 'Видео', |
44 | 44 | ] |
45 | 45 | ], |
46 | + [ | |
47 | + 'class' => 'yii\grid\ActionColumn', | |
48 | + 'buttons' => [ | |
49 | + 'update' => function($url, $model, $key) { | |
50 | + return Html::a('Update', ['gallery-update', 'id' => $model->gallery_id]); | |
51 | + }, | |
52 | + 'delete' => function($url, $model, $key) { | |
53 | + return Html::a('Delete', ['gallery-delete', 'id' => $model->gallery_id], [ | |
54 | + 'title' => 'Удалить', | |
55 | + 'aria-label' => 'Удалить', | |
56 | + 'data-confirm' => 'Вы уверены, что хотите удалить этот элемент?', | |
57 | + 'data-method' => 'post', | |
58 | + 'data-pjax' => '0', | |
59 | + ]); | |
60 | + }, | |
61 | + ], | |
62 | + 'template' => '{update} {delete}' | |
63 | + ], | |
46 | 64 | ], |
47 | 65 | ]) ?> | ... | ... |
frontend/views/accounts/setting.php
... | ... | @@ -2,11 +2,10 @@ |
2 | 2 | /** |
3 | 3 | * @var User $user |
4 | 4 | */ |
5 | - use common\models\Option; | |
5 | + | |
6 | 6 | use common\models\User; |
7 | 7 | use yii\helpers\Html; |
8 | 8 | use yii\widgets\ActiveForm; |
9 | - use \common\widgets\MultiLangForm; | |
10 | 9 | |
11 | 10 | $this->title = 'Настройки профиля'; |
12 | 11 | $this->params['breadcrumbs'][] = $this->title; | ... | ... |