35 lines
841 B
PHP
35 lines
841 B
PHP
<?php
|
|
|
|
use yii\helpers\Html;
|
|
|
|
/* @var string $collapseId */
|
|
/* @var array $refreshSelectors */
|
|
|
|
$payload = [
|
|
'source' => 'animal-inline-editor',
|
|
'type' => 'saved',
|
|
'collapseId' => (string)$collapseId,
|
|
'refreshSelectors' => array_values(array_map('strval', $refreshSelectors ?? [])),
|
|
];
|
|
|
|
$jsonPayload = json_encode($payload, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
|
|
?>
|
|
|
|
<div class="panel panel-success" style="margin:10px;">
|
|
<div class="panel-body" style="padding:12px;">
|
|
<?= Html::encode(Yii::t('AnimalManagementModule.base', 'Saved. Updating section...')) ?>
|
|
</div>
|
|
</div>
|
|
|
|
<?php
|
|
$this->registerJs(<<<JS
|
|
(function() {
|
|
var payload = {$jsonPayload};
|
|
if (window.parent && window.parent !== window) {
|
|
window.parent.postMessage(payload, '*');
|
|
}
|
|
})();
|
|
JS
|
|
, \yii\web\View::POS_END);
|
|
?>
|