| @@ 401-414 (lines=14) @@ | ||
| 398 | 'class' => RedirectAction::class, |
|
| 399 | ], |
|
| 400 | ], |
|
| 401 | 'on beforeSave' => function (Event $event) { |
|
| 402 | /** @var \hipanel\actions\Action $action */ |
|
| 403 | $action = $event->sender; |
|
| 404 | $type = Yii::$app->request->post('type'); |
|
| 405 | $comment = Yii::$app->request->post('comment'); |
|
| 406 | if (!empty($type)) { |
|
| 407 | foreach ($action->collection->models as $model) { |
|
| 408 | $model->setAttributes([ |
|
| 409 | 'type' => $type, |
|
| 410 | 'comment' => $comment, |
|
| 411 | ]); |
|
| 412 | } |
|
| 413 | } |
|
| 414 | }, |
|
| 415 | ], |
|
| 416 | 'bulk-enable-block-modal' => [ |
|
| 417 | 'class' => PrepareBulkAction::class, |
|
| @@ 435-448 (lines=14) @@ | ||
| 432 | 'class' => RedirectAction::class, |
|
| 433 | ], |
|
| 434 | ], |
|
| 435 | 'on beforeSave' => function (Event $event) { |
|
| 436 | /** @var \hipanel\actions\Action $action */ |
|
| 437 | $action = $event->sender; |
|
| 438 | $type = Yii::$app->request->post('type'); |
|
| 439 | $comment = Yii::$app->request->post('comment'); |
|
| 440 | if (!empty($type)) { |
|
| 441 | foreach ($action->collection->models as $model) { |
|
| 442 | $model->setAttributes([ |
|
| 443 | 'comment' => $comment, |
|
| 444 | 'type' => $type |
|
| 445 | ]); |
|
| 446 | } |
|
| 447 | } |
|
| 448 | }, |
|
| 449 | ], |
|
| 450 | 'bulk-disable-block-modal' => [ |
|
| 451 | 'class' => PrepareBulkAction::class, |
|