Code Duplication    Length = 9-9 lines in 4 locations

main/auth/courses_controller.php 4 locations

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