| @@ 407-420 (lines=14) @@ | ||
| 404 | 'class' => RedirectAction::class, |
|
| 405 | ], |
|
| 406 | ], |
|
| 407 | 'on beforeSave' => function (Event $event) { |
|
| 408 | /** @var \hipanel\actions\Action $action */ |
|
| 409 | $action = $event->sender; |
|
| 410 | $type = Yii::$app->request->post('type'); |
|
| 411 | $comment = Yii::$app->request->post('comment'); |
|
| 412 | if (!empty($type)) { |
|
| 413 | foreach ($action->collection->models as $model) { |
|
| 414 | $model->setAttributes([ |
|
| 415 | 'type' => $type, |
|
| 416 | 'comment' => $comment, |
|
| 417 | ]); |
|
| 418 | } |
|
| 419 | } |
|
| 420 | }, |
|
| 421 | ], |
|
| 422 | 'bulk-enable-block-modal' => [ |
|
| 423 | 'class' => PrepareBulkAction::class, |
|
| @@ 441-454 (lines=14) @@ | ||
| 438 | 'class' => RedirectAction::class, |
|
| 439 | ], |
|
| 440 | ], |
|
| 441 | 'on beforeSave' => function (Event $event) { |
|
| 442 | /** @var \hipanel\actions\Action $action */ |
|
| 443 | $action = $event->sender; |
|
| 444 | $type = Yii::$app->request->post('type'); |
|
| 445 | $comment = Yii::$app->request->post('comment'); |
|
| 446 | if (!empty($type)) { |
|
| 447 | foreach ($action->collection->models as $model) { |
|
| 448 | $model->setAttributes([ |
|
| 449 | 'comment' => $comment, |
|
| 450 | 'type' => $type, |
|
| 451 | ]); |
|
| 452 | } |
|
| 453 | } |
|
| 454 | }, |
|
| 455 | ], |
|
| 456 | 'bulk-disable-block-modal' => [ |
|
| 457 | 'class' => PrepareBulkAction::class, |
|