Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
chamilo-lms/tests/datafiller/fill_courses.php

29 lines
927 B

<?php
/**
* This script contains a data filling procedure for users
* @author Yannick Warnier <yannick.warnier@beeznest.com>
*
*/
/**
* Initialisation section
*/
/**
* Loads the data and injects it into the Chamilo database, using the Chamilo
* internal functions.
* @return array List of user IDs for the users that have just been inserted
*/
function fill_courses() {
$eol = PHP_EOL;
$courses = array(); //declare only to avoid parsing notice
require_once 'data_courses.php'; //fill the $users array
$output = array();
$output[] = array('title'=>'Courses Filling Report: ');
$i = 1;
foreach ($courses as $i => $course) {
//first check that the first item doesn't exist already
$output[$i]['line-init'] = $course['title'];
$output[$i]['line-info'] = ($res = CourseManager::create_course($course)? $res: get_lang('NotInserted'));
$i++;
}
return $output;
}