--- source/IMS Enterprise/enrol.php	2008-09-04 10:51:58.000000000 +0200
+++ workspace/ce19/moodle/enrol/imsenterprise/enrol.php	2008-09-02 08:59:16.000000000 +0200
@@ -4,9 +4,11 @@
 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
 * @package enrol_imsenterprise
 */
 
 // The following flags are set in the configuration
 // $CFG->enrol_imsfilelocation:        where is the file we are looking for?
@@ -23,7 +25,15 @@ require_once($CFG->libdir.'/eventslib.ph
 // $CFG->enrol_createnewcategories:    should this script create a (hidden) category if Moodle doesn't have one by the same name as the desired one?
 // $CFG->enrol_imssourcedidfallback:   some systems don't output a <userid> element (contrary to the specifications). If this is the case, activating this setting will cause us to use the <sourcedid><id> element instead as the userid. This may or may not be desirable in your situation.
 // $CFG->enrol_includephoto:           Process IMS <photo> tag to create user photo. Be warned that this may add significant server load.

+// $CFG->enrol_imsnumsections		   Define number section when create new course

 /*
 

 
 
@@ -101,10 +109,10 @@ function determine_default_rolemapping($
 function config_form($frm) {
     global $CFG, $imsroles;

+ ,'enrol_imsnumsections',

             'enrol_imse_imsrolemap05','enrol_imse_imsrolemap06','enrol_imse_imsrolemap07','enrol_imse_imsrolemap08');
     foreach ($vars as $var) {
         if (!isset($frm->$var)) {
@@ -194,7 +202,50 @@ function process_config($config) {
     }
     set_config('enrol_imsrestricttarget', $config->enrol_imsrestricttarget);
 
+    if (!isset($config->enrol_imsnumsections)) {
+                    $config->imsnumsections = 1;
+    }
+    set_config('enrol_imsnumsections', $config->enrol_imsnumsections);

 
-        /* -----------Course aliasing is DEACTIVATED until a more general method is in place---------------
-
-       // Second, look in the course alias table to see if the code should be translated to something else
-        if($aliases = $DB->get_field('enrol_coursealias', 'toids', array('fromid'=>$group->coursecode))){
-            $this->log_line("Found alias of course code: Translated $group->coursecode to $aliases");
-            // Alias is allowed to be a comma-separated list, so let's split it
-            $group->coursecode = explode(',', $aliases);
-        }
-       */
-
 
@@ -521,55 +553,82 @@ function process_group_tag($tagcontents)

                 $course->visible = 0;
-                $course->numsections = 1;
+	                $course->numsections = $CFG->enrol_imsnumsections;
+
                 // Insert default names for teachers/students, from the current language
                 $site = get_site();
                 if (current_language() == $CFG->lang) {

                 }





--- source/IMS Enterprise/config.html	2008-09-04 10:51:58.000000000 +0200
+++ workspace/ce19/moodle/enrol/imsenterprise/config.html	2008-09-02 08:59:16.000000000 +0200

    <?php helpbutton('createnewcourses', 'More detail about this option', 'enrol/imsenterprise'); ?>
    </td>
 </tr>

+<tr valign="top">
+    <td align="right"><?php  print_string('numsections', 'enrol_imsenterprise') ?>:</td>
+    <td>
+    	<?php
+    		for ($i=1; $i<=52; $i++) {
+          		$sectionmenu[$i] = "$i";
+        	}
+
+			choose_from_menu($sectionmenu, 'enrol_imsnumsections', $frm->enrol_imsnumsections, '');
+    	?>
+    </td>
+    <td>
+    <?php helpbutton('numsections', 'More detail about this option', 'enrol/imsenterprise'); ?>
+    </td>
+</tr>


--- source/IMS Enterprise/en_utf8.php	2008-09-04 10:51:58.000000000 +0200
+++ workspace/ce19/moodle/enrol/imsenterprise/en_utf8.php	2008-09-02 08:59:16.000000000 +0200

+ $string['numsections'] = 'Number sections when create new course';
