public function items()
 {
     $actions = DomainActionsMenu::create(['model' => $this->model])->items();
     $items = array_merge($actions, [['label' => AjaxModal::widget(['id' => 'push-modal-link', 'header' => Html::tag('h4', Yii::t('hipanel:domain', 'Push domain') . ': ' . Html::tag('b', $this->title), ['class' => 'modal-title']), 'scenario' => 'push', 'actionUrl' => ['domain-push-modal', 'id' => $this->model->id], 'size' => Modal::SIZE_DEFAULT, 'toggleButton' => ['label' => '<i class="fa fa-fw fa-exchange"></i>' . Yii::t('hipanel:domain', 'Push domain'), 'class' => 'clickable', 'data-pjax' => 0, 'tag' => 'a']]), 'encode' => false, 'visible' => $this->model->isPushable()], ['visible' => $this->model->canRenew() && Yii::$app->user->can('domain.pay'), 'label' => Yii::t('hipanel:domain', 'Renew domain'), 'icon' => 'fa-forward', 'url' => ['add-to-cart-renewal', 'model_id' => $this->model->id], 'linkOptions' => ['data-pjax' => 0]], ['label' => Yii::t('hipanel', 'Delete'), 'icon' => 'fa-trash', 'url' => ['@domain/delete', 'id' => $this->model->id], 'linkOptions' => ['data' => ['confirm' => Yii::t('hipanel:domain', 'Are you sure you want to delete domain {domain}?', ['domain' => $this->model->domain]), 'method' => 'post', 'pjax' => '0']], 'visible' => !$this->model->isRussianZones()]]);
     unset($items['view']);
     return $items;
 }
 public function init()
 {
     $this->header = Html::tag('h4', $this->title, ['class' => 'modal-title']);
     $this->actionUrl = [$this->scenario, 'id' => $this->model->id];
     $this->toggleButton = array_merge(['tag' => 'a', 'label' => FontIcon::i($this->icon) . $this->title, 'class' => 'clickable'], is_array($this->toggleButton) ? $this->toggleButton : []);
     parent::init();
 }
 public function items()
 {
     return [['label' => '
                 <div class="dropdown" style="display: inline-block">
                     <button type="button" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                         ' . Yii::t('hipanel', 'Basic actions') . '
                         <span class="caret"></span>
                     </button>
                     ' . DomainBulkBasicActionsMenu::create()->render(['class' => Dropdown::class, 'encodeLabels' => false]) . '
                 </div>
             '], ['label' => AjaxModal::widget(['id' => 'bulk-domain-push-modal', 'bulkPage' => true, 'header' => Html::tag('h4', Yii::t('hipanel:domain', 'Push'), ['class' => 'modal-title']), 'scenario' => 'domain-push-modal', 'actionUrl' => ['domain-push-modal'], 'size' => Modal::SIZE_LARGE, 'toggleButton' => false])], ['label' => AjaxModal::widget(['id' => 'bulk-set-note-modal', 'bulkPage' => true, 'header' => Html::tag('h4', Yii::t('hipanel:domain', 'Set notes'), ['class' => 'modal-title']), 'scenario' => 'bulk-set-note', 'actionUrl' => ['bulk-set-note'], 'size' => Modal::SIZE_LARGE, 'toggleButton' => ['label' => Yii::t('hipanel:domain', 'Set notes'), 'class' => 'btn btn-sm btn-default']])], ['label' => AjaxModal::widget(['id' => 'bulk-set-nss-modal', 'bulkPage' => true, 'header' => Html::tag('h4', Yii::t('hipanel:domain', 'Set NS'), ['class' => 'modal-title']), 'scenario' => 'bulk-set-nss', 'actionUrl' => ['bulk-set-nss'], 'size' => Modal::SIZE_LARGE, 'toggleButton' => ['label' => Yii::t('hipanel:domain', 'Set NS'), 'class' => 'btn btn-sm btn-default']])], ['label' => AjaxModal::widget(['id' => 'bulk-change-contacts-modal', 'bulkPage' => true, 'header' => Html::tag('h4', Yii::t('hipanel:domain', 'Change contacts'), ['class' => 'modal-title']), 'scenario' => 'bulk-set-contacts', 'actionUrl' => ['bulk-set-contacts-modal'], 'size' => Modal::SIZE_LARGE, 'toggleButton' => ['label' => Yii::t('hipanel:domain', 'Change contacts'), 'class' => 'btn btn-sm btn-default']])]];
 }
?>
    <?php 
if ($model->isRelationPopulated('answers')) {
    ?>
        <hr class="no-panel-padding-h panel-wide padding-bottom">
        <div class="widget-article-comments tab-pane panel no-padding no-border fade in active">
            <?php 
    echo $this->render('_comments', ['model' => $model, 'client' => $client]);
    ?>
        </div>
        <?php 
    if ($model->isRelationPopulated('answers')) {
        ?>
            <hr class="no-panel-padding-h panel-wide padding-bottom md-mb-0">
            <?php 
        echo Html::button(Yii::t('hipanel:ticket', 'Answer'), ['class' => 'message-block-move-btn btn btn-default']);
        ?>
        <?php 
    }
    ?>
    <?php 
}
?>

    <?php 
$actionUrl = Json::encode(Url::to(['update-answer-modal']));
echo AjaxModal::widget(['id' => 'update-answer-modal', 'header' => Html::tag('h4', Yii::t('hipanel:ticket', 'Message editing'), ['class' => 'modal-title']), 'scenario' => 'update-answer', 'actionUrl' => ['update-answer-modal'], 'size' => Modal::SIZE_LARGE, 'toggleButton' => false, 'clientEvents' => ['show.bs.modal' => new JsExpression("function(e) {\n                var button = e.relatedTarget;\n                var id = \$(button).attr('data-thread-id');\n                var answer_id = \$(button).attr('data-answer-id');\n                \$.ajax({\n                    url: {$actionUrl},\n                    data: {id: id, answer_id: answer_id},\n                    success: function (data) {\n                        \$('#update-answer-modal .modal-body').html(data);\n                    }\n                });\n            }")]]);
?>

<?php 
$box->end();
            <button type="button" class="btn btn-default dropdown-toggle btn-sm" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <?php 
echo Yii::t('hipanel:stock', 'Bulk actions');
?>
&nbsp;
                <span class="caret"></span>
            </button>
            <?php 
echo Dropdown::widget(['encodeLabels' => false, 'items' => [['label' => Yii::t('hipanel:stock', 'Repair'), 'url' => '#', 'linkOptions' => ['data-action' => 'repair']], ['label' => Yii::t('hipanel:stock', 'Copy'), 'url' => '#', 'linkOptions' => ['data-action' => 'copy']], ['label' => Yii::t('hipanel:stock', 'Replace'), 'url' => '#', 'linkOptions' => ['data-action' => 'replace']], ['label' => Yii::t('hipanel:stock', 'Reserve'), 'url' => '#', 'linkOptions' => ['data-action' => 'reserve']], ['label' => Yii::t('hipanel:stock', 'Unreserve'), 'url' => '#', 'linkOptions' => ['data-action' => 'unreserve']], ['label' => Yii::t('hipanel:stock', 'RMA'), 'url' => '#', 'linkOptions' => ['data-action' => 'rma']], '<li role="presentation" class="divider"></li>', ['label' => Yii::t('hipanel:stock', 'Update'), 'url' => '#', 'linkOptions' => ['data-action' => 'update']], ['label' => Yii::t('hipanel:stock', 'Move'), 'url' => '#', 'linkOptions' => ['data-action' => 'move']], ['label' => Yii::t('hipanel:stock', 'Move by one'), 'url' => '#', 'linkOptions' => ['data-action' => 'move-by-one']]]]);
?>
        </div>
        <?php 
echo AjaxModal::widget(['bulkPage' => true, 'id' => 'set-serial-modal', 'scenario' => 'set-serial', 'actionUrl' => ['bulk-set-serial'], 'handleSubmit' => Url::toRoute('set-serial'), 'size' => Modal::SIZE_LARGE, 'header' => Html::tag('h4', Yii::t('hipanel:stock', 'Set serial'), ['class' => 'modal-title']), 'toggleButton' => ['label' => Yii::t('hipanel:stock', 'Set serial'), 'class' => 'btn btn-default btn-sm']]);
?>
        <?php 
echo AjaxModal::widget(['bulkPage' => true, 'id' => 'bulk-set-price-modal', 'scenario' => 'bulk-set-price', 'actionUrl' => ['bulk-set-price'], 'size' => Modal::SIZE_LARGE, 'header' => Html::tag('h4', Yii::t('hipanel:stock', 'Set price'), ['class' => 'modal-title']), 'toggleButton' => ['label' => Yii::t('hipanel:stock', 'Set price'), 'class' => 'btn btn-default btn-sm']]);
?>
        <?php 
echo $page->renderBulkButton(Yii::t('hipanel:stock', 'Trash'), 'trash', 'danger');
?>
    <?php 
$page->endContent();
?>

    <?php 
$page->beginContent('table');
?>
        <?php 
$page->beginBulkForm();
?>
            <?php 
            <div class="dropdown" style="display: inline-block">
                <button type="button" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    <?php 
    echo Yii::t('hipanel', 'Block');
    ?>
                    <span class="caret"></span>
                </button>
                <?php 
    echo Dropdown::widget(['encodeLabels' => false, 'options' => ['class' => 'pull-right'], 'items' => [['label' => '<i class="fa fa-toggle-on"></i> ' . Yii::t('hipanel', 'Enable'), 'linkOptions' => ['data-toggle' => 'modal'], 'url' => '#bulk-enable-block-modal'], ['label' => '<i class="fa fa-toggle-off"></i> ' . Yii::t('hipanel', 'Disable'), 'url' => '#bulk-disable-block-modal', 'linkOptions' => ['data-toggle' => 'modal']]]]);
    ?>
                <div class="text-left">
                    <?php 
    echo AjaxModal::widget(['id' => 'bulk-enable-block-modal', 'bulkPage' => true, 'header' => Html::tag('h4', Yii::t('hipanel:client', 'Block clients'), ['class' => 'modal-title']), 'scenario' => 'bulk-enable-block', 'actionUrl' => ['bulk-enable-block-modal'], 'size' => Modal::SIZE_LARGE, 'handleSubmit' => false, 'toggleButton' => false]);
    ?>
                    <?php 
    echo AjaxModal::widget(['id' => 'bulk-disable-block-modal', 'bulkPage' => true, 'header' => Html::tag('h4', Yii::t('hipanel:client', 'Unblock clients'), ['class' => 'modal-title']), 'scenario' => 'bulk-disable-block', 'actionUrl' => ['bulk-disable-block-modal'], 'size' => Modal::SIZE_LARGE, 'handleSubmit' => false, 'toggleButton' => false]);
    ?>
                </div>
            </div>
        <?php 
}
?>
        <?php 
if (Yii::$app->user->can('manage')) {
    ?>
            <?php 
    echo $page->renderBulkButton(Yii::t('hipanel', 'Delete'), 'delete', 'danger');
    ?>
        <?php 
}
?>
?>
        <?php 
echo $page->renderSorter(['attributes' => ['host', 'domain', 'ip', 'client', 'seller']]);
?>
        <?php 
echo $page->renderPerPage();
?>
    <?php 
$page->endContent();
?>

    <?php 
$page->beginContent('bulk-actions');
?>
        <?php 
echo AjaxModal::widget(['id' => 'bulk-set-ips-modal', 'bulkPage' => true, 'header' => Html::tag('h4', Yii::t('hipanel:domain', 'Set IPs'), ['class' => 'modal-title']), 'scenario' => 'bulk-set-ips', 'actionUrl' => ['bulk-set-ips'], 'size' => Modal::SIZE_LARGE, 'toggleButton' => ['label' => Yii::t('hipanel:domain', 'Set IPs'), 'class' => 'btn btn-sm btn-default']]);
?>
        <?php 
echo $page->renderBulkButton(Yii::t('hipanel', 'Delete'), 'delete', 'danger');
?>
    <?php 
$page->endContent('bulk-actions');
?>

    <?php 
$page->beginContent('table');
?>
        <?php 
$page->beginBulkForm();
?>
            <?php