You are here

function _course_outline_overview_form_cmp_function in Course 7

Same name and namespace in other branches
  1. 6 includes/course.outline.inc \_course_outline_overview_form_cmp_function()
  2. 7.2 includes/course.outline.inc \_course_outline_overview_form_cmp_function()

Comparator function for course outline weights.

2 string references to '_course_outline_overview_form_cmp_function'
course_outline_overview_form in includes/course.outline.inc
Form constructor for course outline form.
course_outline_overview_form_submit in includes/course.outline.inc
Submit handler.

File

includes/course.outline.inc, line 334
course_outline.inc

Code

function _course_outline_overview_form_cmp_function($a, $b) {
  if (is_object($a)) {
    if (isset($a->weight) && isset($b->weight)) {
      return $a->weight - $b->weight;
    }
  }
  else {
    if (isset($a['weight']) && isset($b['weight'])) {
      return $a['weight'] - $b['weight'];
    }
  }
}