Code Duplication    Length = 9-9 lines in 4 locations

main/auth/courses_controller.php 4 locations

@@ 282-290 (lines=9) @@
279
     * @param string    Course code
280
     * @param int    Category id
281
     */
282
    public function move_course($move, $course_code, $category_id)
283
    {
284
        $result = $this->model->move_course($move, $course_code, $category_id);
285
        if ($result) {
286
            Display::addFlash(Display::return_message(get_lang('CourseSortingDone')));
287
        }
288
        $action = 'sortmycourses';
289
        $this->courses_list($action);
290
    }
291
292
    /**
293
     * Move up/down categories
@@ 298-306 (lines=9) @@
295
     * @param string    move to up or down
296
     * @param int    Category id
297
     */
298
    public function move_category($move, $category_id)
299
    {
300
        $result = $this->model->move_category($move, $category_id);
301
        if ($result) {
302
            Display::addFlash(Display::return_message(get_lang('CategorySortingDone')));
303
        }
304
        $action = 'sortmycourses';
305
        $this->courses_list($action);
306
    }
307
308
    /**
309
     * Edit course category
@@ 314-322 (lines=9) @@
311
     * @param string Category title
312
     * @param int    Category id
313
     */
314
    public function edit_course_category($title, $category)
315
    {
316
        $result = $this->model->store_edit_course_category($title, $category);
317
        if ($result) {
318
            Display::addFlash(Display::return_message(get_lang('CourseCategoryEditStored')));
319
        }
320
        $action = 'sortmycourses';
321
        $this->courses_list($action);
322
    }
323
324
    /**
325
     * Delete a course category
@@ 329-337 (lines=9) @@
326
     * render to listing view
327
     * @param int    Category id
328
     */
329
    public function delete_course_category($category_id)
330
    {
331
        $result = $this->model->delete_course_category($category_id);
332
        if ($result) {
333
            Display::addFlash(Display::return_message(get_lang('CourseCategoryDeleted')));
334
        }
335
        $action = 'sortmycourses';
336
        $this->courses_list($action);
337
    }
338
339
    /**
340
     * Unsubscribe user from a course