Code Duplication    Length = 15-15 lines in 2 locations

src/Action.php 2 locations

@@ 175-189 (lines=15) @@
172
     * @param $element
173
     * @param string $label
174
     */
175
    public static function editHLBlockElement($template, $element, $label = 'Изменить элемент')
176
    {
177
        if (!$GLOBALS['APPLICATION']->GetShowIncludeAreas()) {
178
            return;
179
        }
180
181
        if (!$element["HLBLOCK_ID"] || !$element['ID']) {
182
            throw new InvalidArgumentException('Element must include ID and HLBLOCK_ID');
183
        }
184
185
        $linkTemplate = '/bitrix/admin/highloadblock_row_edit.php?ENTITY_ID=%s&ID=%s&lang=ru&bxpublic=Y';
186
        $link = sprintf($linkTemplate, (int) $element["HLBLOCK_ID"], (int) $element["ID"]);
187
188
        $template->AddEditAction('hlblock_element_' . $element['ID'], $link, $label);
189
    }
190
    
191
    /**
192
     * @param CBitrixComponentTemplate $template
@@ 197-211 (lines=15) @@
194
     * @param string $label
195
     * @param string $confirm
196
     */
197
    public static function deleteHLBlockElement($template, $element, $label = 'Удалить элемент', $confirm = 'Вы уверены, что хотите удалить элемент?')
198
    {
199
        if (!$GLOBALS['APPLICATION']->GetShowIncludeAreas()) {
200
            return;
201
        }
202
        
203
        if (!$element["HLBLOCK_ID"] || !$element['ID']) {
204
            throw new InvalidArgumentException('Element must include ID and HLBLOCK_ID');
205
        }
206
207
        $linkTemplate = '/bitrix/admin/highloadblock_row_edit.php?action=delete&ENTITY_ID=%s&ID=%s&lang=ru';
208
        $link = sprintf($linkTemplate, (int) $element["HLBLOCK_ID"], (int) $element["ID"]);
209
    
210
        $template->AddDeleteAction('hlblock_element_' . $element['ID'], $link, $label, array("CONFIRM" => $confirm));
211
    }
212
213
    /**
214
     * @param CBitrixComponentTemplate $template