Code Duplication    Length = 6-11 lines in 4 locations

backend/views/post/index.php 2 locations

@@ 101-106 (lines=6) @@
98
            [
99
                'class' => 'yii\grid\ActionColumn',
100
                'buttons' => [
101
                    'view' => function ($url, $model) {
102
                        return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $model->url, [
103
                            'title' => Yii::t('yii', 'View'),
104
                            'data-pjax' => '0',
105
                        ]);
106
                    },
107
                    'update' => function ($url, $model) {
108
                        /* @var $model \common\models\search\Post */
109
                        if ($model->getPermission()) {
@@ 107-117 (lines=11) @@
104
                            'data-pjax' => '0',
105
                        ]);
106
                    },
107
                    'update' => function ($url, $model) {
108
                        /* @var $model \common\models\search\Post */
109
                        if ($model->getPermission()) {
110
                            return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [
111
                                'title' => Yii::t('yii', 'Update'),
112
                                'data-pjax' => '0',
113
                            ]);
114
                        }
115
116
                        return '';
117
                    },
118
                    'delete' => function ($url, $model) {
119
                        /* @var $model \common\models\search\Post */
120
                        if ($model->getPermission()) {

backend/views/user/index.php 1 location

@@ 106-116 (lines=11) @@
103
            [
104
                'class' => 'yii\grid\ActionColumn',
105
                'buttons' => [
106
                    'update' => function ($url, $model) {
107
                        /* @var $model \common\models\User */
108
                        if ($model->checkPermission()) {
109
                            return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [
110
                                'title' => Yii::t('writesdown', 'Update'),
111
                                'data-pjax' => '0',
112
                            ]);
113
                        }
114
115
                        return '';
116
                    },
117
                    'delete' => function ($url, $model) {
118
                        /* @var $model \common\models\User */
119
                        if ($model->checkPermission()) {

backend/views/media/index.php 1 location

@@ 104-109 (lines=6) @@
101
            [
102
                'class' => 'yii\grid\ActionColumn',
103
                'buttons' => [
104
                    'view' => function ($url, $model) {
105
                        return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $model->url, [
106
                            'title' => Yii::t('yii', 'View'),
107
                            'data-pjax' => '0',
108
                        ]);
109
                    },
110
                    'update' => function ($url, $model) {
111
                        if (!Yii::$app->user->can('editor') && $model->author !== Yii::$app->user->id) {
112
                            return '';