Code Duplication    Length = 7-7 lines in 3 locations

class/Category.php 3 locations

@@ 141-147 (lines=7) @@
138
        // Права на просмотр
139
        $groups_ids = [];
140
        // Если мы редактируем
141
        if (!$this->isNew()) {
142
            $groups_ids        = $gpermHandler->getGroupIds('instruction_view', $this->getVar('cid'), $GLOBALS['xoopsModule']->getVar('mid'));
143
            $groups_ids        = array_values($groups_ids);
144
            $groups_instr_view = new \XoopsFormCheckBox(_AM_INSTRUCTION_PERM_VIEW, 'groups_instr_view', $groups_ids);
145
        } else {
146
            $groups_instr_view = new \XoopsFormCheckBox(_AM_INSTRUCTION_PERM_VIEW, 'groups_instr_view', $full_list);
147
        }
148
        $groups_instr_view->addOptionArray($group_list);
149
        $form->addElement($groups_instr_view);
150
@@ 153-159 (lines=7) @@
150
151
        // Права на отправку
152
        $groups_ids = [];
153
        if (!$this->isNew()) {
154
            $groups_ids          = $gpermHandler->getGroupIds('instruction_submit', $this->getVar('cid'), $GLOBALS['xoopsModule']->getVar('mid'));
155
            $groups_ids          = array_values($groups_ids);
156
            $groups_instr_submit = new \XoopsFormCheckBox(_AM_INSTRUCTION_PERM_SUBMIT, 'groups_instr_submit', $groups_ids);
157
        } else {
158
            $groups_instr_submit = new \XoopsFormCheckBox(_AM_INSTRUCTION_PERM_SUBMIT, 'groups_instr_submit', $full_list);
159
        }
160
        $groups_instr_submit->addOptionArray($group_list);
161
        $form->addElement($groups_instr_submit);
162
@@ 165-171 (lines=7) @@
162
163
        // Права на редактирование
164
        $groups_ids = [];
165
        if (!$this->isNew()) {
166
            $groups_ids        = $gpermHandler->getGroupIds('instruction_edit', $this->getVar('cid'), $GLOBALS['xoopsModule']->getVar('mid'));
167
            $groups_ids        = array_values($groups_ids);
168
            $groups_instr_edit = new \XoopsFormCheckBox(_AM_INSTRUCTION_PERM_EDIT, 'groups_instr_edit', $groups_ids);
169
        } else {
170
            $groups_instr_edit = new \XoopsFormCheckBox(_AM_INSTRUCTION_PERM_EDIT, 'groups_instr_edit', $full_list);
171
        }
172
        $groups_instr_edit->addOptionArray($group_list);
173
        $form->addElement($groups_instr_edit);
174