Changeset - 758f11033eb1
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 14 years ago 2011-04-10 00:34:54
ohnobinki@ohnopublishing.net
When crawling, use `course' instead of `class' in the JSON output.
1 file changed with 7 insertions and 2 deletions:
0 comments (0 inline, 0 general)
inc/class.course.inc
Show inline comments
 
@@ -207,7 +207,7 @@ class Course implements IteratorAggregat
 
    $recursion_trace[$this->getName()] = TRUE;
 

	
 
    $json_array = array(
 
			'class' => $this->getName(),
 
			'course' => $this->getName(),
 
			'title' => $this->title_get(),
 
			'sections' => array(),
 
			'dependencies' => array(),
 
@@ -244,7 +244,12 @@ class Course implements IteratorAggregat
 
    $title = NULL;
 
    if (!empty($json['title']))
 
      $title = $json['title'];
 
    $course = new Course($json['class'], $title);
 
    if (!empty($json['class']))
 
      {
 
	$json['course'] = $json['class'];
 
	unset($json['class']);
 
      }
 
    $course = new Course($json['course'], $title);
 

	
 
    if (!empty($json['sections']))
 
      $course->section_add(Section::from_json_arrays($json['sections']));
0 comments (0 inline, 0 general)