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