Code Duplication    Length = 9-10 lines in 2 locations

answer.php 2 locations

@@ 148-156 (lines=9) @@
145
                $faqObj->sendNotifications(array(_SF_NOT_FAQ_PUBLISHED));
146
                break;
147
148
            case 2:
149
                // Answer for an open question submitted, auto-approved; became Q&A, need approbation
150
                if (isset($_POST['notifypub']) && $_POST['notifypub'] == 1) {
151
                    include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
152
                    $notificationHandler->subscribe('faq', $faqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
153
                }
154
                // Send notifications
155
                $faqObj->sendNotifications(array(_SF_NOT_FAQ_SUBMITTED));
156
                break;
157
158
            case 3:
159
                // Answer submitted, needs approbation
@@ 172-181 (lines=10) @@
169
                // TODO...
170
                break;
171
172
            case 5:
173
                // New answer submitted for a published Q&A, need approbation
174
                // Send notifications
175
                if (isset($_POST['notifypub']) && $_POST['notifypub'] == 1) {
176
                    include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
177
                    $notificationHandler->subscribe('faq', $newAnswerObj->answerid(), 'answer_approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
178
                }
179
180
                $faqObj->sendNotifications(array(_SF_NOT_NEW_ANSWER_PROPOSED));
181
                break;
182
        }
183
184
        //redirect_header("javascript:history.go(-1)", 3, $redirect_msg);