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