Code Duplication    Length = 16-16 lines in 2 locations

src/widgets/ActionBox.php 1 location

@@ 135-150 (lines=16) @@
132
        return ob_get_clean();
133
    }
134
135
    public function renderPerPage()
136
    {
137
        return ButtonDropdown::widget([
138
            'label' => Yii::t('hipanel', 'Per page') . ': ' . (Yii::$app->request->get('per_page') ?: 25),
139
            'options' => ['class' => 'btn-default btn-sm'],
140
            'dropdown' => [
141
                'items' => [
142
                    ['label' => '25',  'url' => Url::current(['per_page' => null])],
143
                    ['label' => '50',  'url' => Url::current(['per_page' => 50])],
144
                    ['label' => '100', 'url' => Url::current(['per_page' => 100])],
145
                    ['label' => '200', 'url' => Url::current(['per_page' => 200])],
146
                    ['label' => '500', 'url' => Url::current(['per_page' => 500])],
147
                ],
148
            ],
149
        ]);
150
    }
151
152
    public function renderSorter(array $options)
153
    {

src/widgets/IndexPage.php 1 location

@@ 204-219 (lines=16) @@
201
        return AdvancedSearch::renderButton() . "\n";
202
    }
203
204
    public function renderPerPage()
205
    {
206
        return ButtonDropdown::widget([
207
            'label' => Yii::t('hipanel', 'Per page') . ': ' . (Yii::$app->request->get('per_page') ?: 25),
208
            'options' => ['class' => 'btn-default btn-sm'],
209
            'dropdown' => [
210
                'items' => [
211
                    ['label' => '25',  'url' => Url::current(['per_page' => null])],
212
                    ['label' => '50',  'url' => Url::current(['per_page' => 50])],
213
                    ['label' => '100', 'url' => Url::current(['per_page' => 100])],
214
                    ['label' => '200', 'url' => Url::current(['per_page' => 200])],
215
                    ['label' => '500', 'url' => Url::current(['per_page' => 500])],
216
                ],
217
            ],
218
        ]);
219
    }
220
221
    /**
222
     * Renders button to choose representation.