Index: blocks/section_links/block_section_links.php
===================================================================
RCS file: /cvsroot/moodle/moodle/blocks/section_links/block_section_links.php,v
retrieving revision 1.25.2.2
diff -u -r1.25.2.2 block_section_links.php
--- blocks/section_links/block_section_links.php	3 Mar 2008 11:41:04 -0000	1.25.2.2
+++ blocks/section_links/block_section_links.php	8 Sep 2009 06:12:27 -0000
@@ -4,7 +4,7 @@
 
     function init() {
         $this->title = get_string('blockname', 'block_section_links');
-        $this->version = 2007101509;
+        $this->version = 2007101511;
     }
 
     function instance_config($instance) {
@@ -29,6 +29,11 @@
         global $CFG, $USER, $COURSE;
 
         $highlight = 0;
+        if(isset($this->config)){
+            $config = $this->config;
+        } else{
+            $config = get_config('blocks/section_links');
+        }
 
         if ($this->content !== NULL) {
             return $this->content;
@@ -60,11 +65,21 @@
             $sectionname = 'topic';
         }
         $inc = 1;
-        if ($course->numsections > 22) {
-            $inc = 2;
+
+        if(!empty($config->numsections1) and ($course->numsections > $config->numsections1)) {
+            $inc = $config->incby1;
+        } else {
+            if ($course->numsections > 22) {
+                $inc = 2;
+            }
         }
-        if ($course->numsections > 40) {
-            $inc = 5;
+
+        if(!empty($config->numsections2) and ($course->numsections > $config->numsections2)) {
+            $inc = $config->incby1;
+        } else {
+            if ($course->numsections > 40) {
+                $inc = 5;
+            }
         }
 
         if (!empty($USER->id)) {
@@ -112,6 +127,13 @@
         $this->content->text = $text;
         return $this->content;
     }
+    /**
+     * Has instance config
+     * @return boolean
+     **/
+    function instance_allow_config() {
+        return true;
+    }
 }
 
 ?>
Index: blocks/section_links/config_instance.html
===================================================================
RCS file: blocks/section_links/config_instance.html
diff -N blocks/section_links/config_instance.html
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ blocks/section_links/config_instance.html	8 Sep 2009 06:12:27 -0000
@@ -0,0 +1,73 @@
+<?php
+$numberofsections = array();
+for ($i = 1; $i < 53; $i++){
+	$numberofsections[$i] = $i;
+}
+
+$increments = array();
+
+for ($i = 1; $i < 11; $i++){
+	$increments[$i] = $i;
+}
+
+if(isset($this->config)){
+	$config = $this->config;
+} else{
+	$config = get_config('blocks/section_links');
+}
+
+$selected = array();
+if (!empty($config->numsections1)) {
+    if (!empty($config->incby1)) {
+        $config->incby1 = 2;
+    }
+    $selected[1] = array($config->numsections1, $config->incby1);
+} else {
+    $selected[1] = array(22, 2);
+}
+
+if (!empty($config->numsections2)) {
+    if (!empty($config->incby1)) {
+        $config->incby1 = 5;
+    }
+    $selected[2] = array($config->numsections2, $config->incby2);
+} else {
+    $selected[2] = array(40, 5);
+}
+
+?>
+<table cellpadding="9" cellspacing="0">
+<?php
+for($i = 1; $i < 3; $i++){
+?>
+	<tr valign="top">
+	    <td align="right">
+	        <?php print_string('numsections'.$i, 'block_section_links'); ?>:
+	    </td>
+	    <td>
+	        <?php choose_from_menu($numberofsections, 'numsections'.$i, $selected[$i][0]); ?>
+	    </td>
+	    <td>
+	        <?php print_string('numsectionsdesc'.$i, 'block_section_links'); ?>
+	    </td>
+	</tr>
+	<tr valign="top">
+	    <td align="right">
+	        <?php print_string('incby'.$i, 'block_section_links'); ?>:
+	    </td>
+	    <td>
+	        <?php choose_from_menu($increments, 'incby'.$i, $selected[$i][1]); ?>
+	    </td>
+	    <td>
+	        <?php print_string('incbydesc'.$i, 'block_section_links'); ?>
+	    </td>
+	</tr>	
+<?php }
+?>
+<tr>
+    <td colspan="3" align="center">
+        <input type="hidden" name="sesskey" value="<?php echo sesskey();?>">
+        <input type="submit" value="<?php print_string('savechanges') ?>" />
+    </td>
+</tr>
+</table>
Index: blocks/section_links/settings.php
===================================================================
RCS file: blocks/section_links/settings.php
diff -N blocks/section_links/settings.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ blocks/section_links/settings.php	8 Sep 2009 06:12:27 -0000
@@ -0,0 +1,33 @@
+<?php
+$configs = array();
+
+$numberofsections = array();
+
+for ($i = 1; $i < 53; $i++){
+	$numberofsections[$i] = $i;
+}
+$increments = array();
+
+for ($i = 1; $i < 11; $i++){
+	$increments[$i] = $i;
+}
+
+$selected = array(1 => array(22,2), 
+                  2 => array(40,5));
+
+for($i = 1; $i < 3; $i++){
+    $configs[] = new admin_setting_configselect('numsections'.$i, get_string('numsections'.$i, 'block_section_links'), 
+                        get_string('numsectionsdesc'.$i, 'block_section_links'),
+                        $selected[$i][0], $numberofsections);
+
+    $configs[] = new admin_setting_configselect('incby'.$i, get_string('incby'.$i, 'block_section_links'), 
+                        get_string('incbydesc'.$i, 'block_section_links'),
+                        $selected[$i][1], $increments);
+}
+                                          
+foreach ($configs as $config) {
+    $config->plugin = 'blocks/section_links';
+    $settings->add($config);
+}
+
+?>
Index: lang/en_utf8/block_section_links.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lang/en_utf8/block_section_links.php,v
retrieving revision 1.2
diff -u -r1.2 block_section_links.php
--- lang/en_utf8/block_section_links.php	1 Nov 2006 09:44:03 -0000	1.2
+++ lang/en_utf8/block_section_links.php	8 Sep 2009 06:12:27 -0000
@@ -3,8 +3,16 @@
 
 
 $string['blockname'] = 'Section Links';
+$string['incby1'] = 'Increase by ';
+$string['incbydesc1'] = 'This is the value the section is incremented each time a section link is displayed starting at 1.';
+$string['incby2'] = 'Alternative Increase by ';
+$string['incbydesc2'] = 'This is the value the section is incremented each time a section link is displayed starting at 1.';
 $string['jumptocurrenttopic'] = 'Jump to current topic';
 $string['jumptocurrentweek'] = 'Jump to current week';
+$string['numsections1'] = 'Number of Sections';
+$string['numsectionsdesc1'] = 'Once the number of sections in the course reaches this number then the increment by value is used.';
+$string['numsections2'] = 'Alternative Number of Sections';
+$string['numsectionsdesc2'] = 'Once the number of sections in the course reaches this number then the Alternative increment by value is used.';
 $string['topics'] = 'Topics';
 $string['weeks'] = 'Weeks';
 
