You are here

function course_editing_start in Course 3.x

Same name and namespace in other branches
  1. 8.3 course.module \course_editing_start()
  2. 8.2 course.module \course_editing_start()
  3. 6 course.module \course_editing_start()
  4. 7.2 course.module \course_editing_start()
  5. 7 course.module \course_editing_start()

Start an editing session for this course. Populate the session from persistent storage.

Parameters

Course $course: A Course.

2 calls to course_editing_start()
CourseObject::optionsSubmit in src/Entity/CourseObject.php
Save object configs to cache.
CourseOutlineForm::addObject in src/Form/CourseOutlineForm.php

File

./course.module, line 125
course.module Core functionality for Courses.

Code

function course_editing_start($course) {
  if (empty($_SESSION['course'][$course
    ->id()]['editing'])) {

    // Start editing cache from what we have in DB.
    foreach ($course
      ->getObjects() as $courseObject) {
      $_SESSION['course'][$course
        ->id()]['editing'][$courseObject
        ->id()] = $courseObject
        ->getOptions();
    }
  }
}