Index: section_links/block_section_links.php
===================================================================
--- section_links/block_section_links.php	(revision 7095)
+++ section_links/block_section_links.php	(working copy)
@@ -4,7 +4,7 @@
 
     function init() {
         $this->title = get_string('blockname', 'block_section_links');
-        $this->version = 2007101509;
+        $this->version = 2007101510;
     }
 
     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,13 +65,21 @@
             $sectionname = 'topic';
         }
         $inc = 1;
-        if ($course->numsections > 22) {
-            $inc = 2;
-        }
-        if ($course->numsections > 40) {
-            $inc = 5;
-        }
 
+        if(isset($config->numsections1) && $config->numsections1 != 0){
+        	if ($course->numsections > $config->numsections2 && $config->numsections2 != 0) {
+            	$inc = $config->incby2;
+        	} else if ($course->numsections > $config->numsections1) {
+            	$inc = $config->incby1;
+        	}
+		} else {
+			if ($course->numsections > 40) {
+            	$inc = 5;
+        	} else if ($course->numsections > 22) {
+            	$inc = 2;
+        	}
+		}
+
         if (!empty($USER->id)) {
             $display = get_field('course_display', 'display', 'course', $this->instance->pageid, 'userid', $USER->id);
         }
@@ -112,6 +125,14 @@
         $this->content->text = $text;
         return $this->content;
     }
+	/**
+     * Has instance config
+     *
+     * @return boolean
+     **/
+    function instance_allow_config() {
+        return true;
+    }
 }
 
 ?>
Index: section_links/settings.php
===================================================================
--- section_links/settings.php	(revision 0)
+++ section_links/settings.php	(revision 0)
@@ -0,0 +1,30 @@
+<?php
+$configs = array();
+
+$options = array();
+
+for ($i = 1; $i < 53; $i++){
+	$options[$i] = $i;
+}
+$options2 = array();
+
+for ($i = 1; $i < 11; $i++){
+	$options2[$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], $options);
+
+$configs[] = new admin_setting_configselect('incby'.$i, get_string('incby'.$i, 'block_section_links'), 
+                                            get_string('incbydesc'.$i, 'block_section_links'), $selected[$i][1], $options2);
+}
+                                          
+foreach ($configs as $config) {
+    $config->plugin = 'blocks/section_links';
+    $settings->add($config);
+}
+
+?>
\ No newline at end of file
Index: section_links/config_instance.html
===================================================================
--- section_links/config_instance.html	(revision 0)
+++ section_links/config_instance.html	(revision 0)
@@ -0,0 +1,62 @@
+<?php
+global $CFG;
+
+for ($i = 1; $i < 53; $i++){
+	$options[$i] = $i;
+}
+$options2 = array();
+
+for ($i = 1; $i < 11; $i++){
+	$options2[$i] = $i;
+}
+if(isset($this->config)){
+	$config = $this->config;
+} else{
+	$config = get_config('blocks/section_links');
+}
+
+if(isset($config->numsections1)){
+	$selected = array(1 => array($config->numsections1,$config->incby1), 
+		              2 => array($config->numsections2,$config->incby2));
+} else {
+	$selected = array(1 => array(22,2), 
+	                  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($options, '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($options2, '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>
\ No newline at end of file

