| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 33 | 
| Code Lines | 22 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 0 | 
| CRAP Score | 2 | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php  | 
            ||
| 14 | public function items()  | 
            ||
| 15 |     { | 
            ||
| 16 | $actions = IpActionsMenu::create(['model' => $this->model])->items();  | 
            ||
| 17 | $items = array_merge($actions, [  | 
            ||
| 18 | [  | 
            ||
| 19 | 'label' => ModalButton::widget([  | 
            ||
| 20 | 'model' => $this->model,  | 
            ||
| 21 | 'scenario' => 'delete',  | 
            ||
| 22 | 'button' => [  | 
            ||
| 23 |                         'label' => '<i class="fa fa-fw fa-trash-o"></i> ' . Yii::t('hipanel', 'Delete'), | 
            ||
| 24 | ],  | 
            ||
| 25 | 'modal' => [  | 
            ||
| 26 |                         'header' => Html::tag('h4', Yii::t('hipanel:hosting', 'Confirm IP address deleting')), | 
            ||
| 27 | 'headerOptions' => ['class' => 'label-danger'],  | 
            ||
| 28 | 'footer' => [  | 
            ||
| 29 |                             'label' => Yii::t('hipanel:hosting', 'Delete IP address'), | 
            ||
| 30 |                             'data-loading-text' => Yii::t('hipanel:hosting', 'Deleting IP address...'), | 
            ||
| 31 | 'class' => 'btn btn-danger',  | 
            ||
| 32 | ]  | 
            ||
| 33 | ],  | 
            ||
| 34 |                     'body' => Yii::t('hipanel:hosting', | 
            ||
| 35 |                         'Are you sure, that you want to delete IP address {ip}? All related objects might be deleted too!', | 
            ||
| 36 |                         ['ip' => Html::tag('b', $this->model->ip)] | 
            ||
| 37 | )  | 
            ||
| 38 | ]),  | 
            ||
| 39 | 'encode' => false,  | 
            ||
| 40 |                 'visible' => Yii::$app->user->can('admin'), | 
            ||
| 41 | ],  | 
            ||
| 42 | ]);  | 
            ||
| 43 | unset($items['view']);  | 
            ||
| 44 | |||
| 45 | return $items;  | 
            ||
| 46 | }  | 
            ||
| 47 | }  | 
            ||
| 48 |