Code Duplication    Length = 15-15 lines in 2 locations

src/Action.php 2 locations

@@ 156-170 (lines=15) @@
153
     * @param $element
154
     * @param string $label
155
     */
156
    public static function editHLBlockElement($template, $element, $label = 'Изменить элемент')
157
    {
158
        if (!$GLOBALS['APPLICATION']->GetShowIncludeAreas()) {
159
            return;
160
        }
161
162
        if (!$element["HLBLOCK_ID"] || !$element['ID']) {
163
            throw new InvalidArgumentException('Element must include ID and HLBLOCK_ID');
164
        }
165
166
        $linkTemplate = '/bitrix/admin/highloadblock_row_edit.php?ENTITY_ID=%s&ID=%s&lang=ru&bxpublic=Y';
167
        $link = sprintf($linkTemplate, (int) $element["HLBLOCK_ID"], (int) $element["ID"]);
168
169
        $template->AddEditAction('hlblock_element_' . $element['ID'], $link, $label);
170
    }
171
    
172
    /**
173
     * @param CBitrixComponentTemplate $template
@@ 178-192 (lines=15) @@
175
     * @param string $label
176
     * @param string $confirm
177
     */
178
    public static function deleteHLBlockElement($template, $element, $label = 'Удалить элемент', $confirm = 'Вы уверены, что хотите удалить элемент?')
179
    {
180
        if (!$GLOBALS['APPLICATION']->GetShowIncludeAreas()) {
181
            return;
182
        }
183
        
184
        if (!$element["HLBLOCK_ID"] || !$element['ID']) {
185
            throw new InvalidArgumentException('Element must include ID and HLBLOCK_ID');
186
        }
187
188
        $linkTemplate = '/bitrix/admin/highloadblock_row_edit.php?action=delete&ENTITY_ID=%s&ID=%s&lang=ru';
189
        $link = sprintf($linkTemplate, (int) $element["HLBLOCK_ID"], (int) $element["ID"]);
190
    
191
        $template->AddDeleteAction('hlblock_element_' . $element['ID'], $link, $label, array("CONFIRM" => $confirm));
192
    }
193
194
    /**
195
     * @param CBitrixComponentTemplate $template