Index: blocks/filtered_course_list/lang/en_utf8/block_filtered_course_list.php
===================================================================
--- blocks/filtered_course_list/lang/en_utf8/block_filtered_course_list.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/filtered_course_list/lang/en_utf8/block_filtered_course_list.php	(.../branches/1.9.5-LAE1.0/FilteredCourseList)	(revision 139)
@@ -0,0 +1,16 @@
+<?PHP 
+
+$string['allcourses']               = 'Admin user sees all courses';
+$string['blockname']                = 'Current Courses List';
+$string['configadminview']          = 'What should the admin see in the course list block?';
+$string['confighideallcourseslink'] = 'Hide \"All courses\" link at the bottom of the block. <br>Link hiding does not affects Admin\'s view';
+$string['owncourses']               = 'Admin user sees own courses';
+$string['configfiltertype']         = 'Select the type of course filter you\'d like to use.';
+$string['filterterm']               = 'By Term';
+$string['filtercategories']         = 'By Categories';
+$string['filtercustom']             = 'Custom';
+$string['configtermcurrent']        = 'Enter the string that designates the current term. <br>This must be part of the course shortname.';
+$string['configtermfuture']         = 'Enter the string that designates the next term. <br>This must be part of the course shortname.'; 
+$string['configcategories']         = 'Select the category you want to display as current.'; 
+
+?>
Index: blocks/filtered_course_list/config_global.html
===================================================================
--- blocks/filtered_course_list/config_global.html	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/filtered_course_list/config_global.html	(.../branches/1.9.5-LAE1.0/FilteredCourseList)	(revision 139)
@@ -0,0 +1,240 @@
+<script type="text/JavaScript">
+    function showDiv(divID) {
+        // Hide all 3 DIVs to clean up the UI
+        var categories = document.getElementById("categories");
+        var term       = document.getElementById("term");
+        var custom     = document.getElementById("custom");
+
+        categories.style.display = "none";
+        term.style.display       = "none";
+        custom.style.display     = "none";
+
+        // Now we can show the specified section.
+        var e = document.getElementById(divID);
+
+        if (e.style.display == "block") {
+            e.style.display = "none";
+        } else {
+            e.style.display = "block";
+        }
+    }
+</script>
+
+<table cellpadding="9" cellspacing="0">
+<?php /* This setting does not work, so I am commenting it out. I think it should not even be an option. -CKM 20090729  
+    <tr valign="top">
+        <td align="right">block_filtered_course_list_adminview:</td>
+        <td>
+            <input name="block" type="hidden" value="<?php echo intval($_REQUEST['block']); ?>" />
+            <select name="block_filtered_course_list_adminview">
+                <option value="all"
+                    <?php
+                        if (isset($CFG->block_filtered_course_list_adminview)) { 
+                            if ($CFG->block_filtered_course_list_adminview == "all") {
+                                echo " selected";
+                            }
+                        } else {
+                            echo " selected";
+                        }
+                    ?>>
+                    <?php
+                        p(get_string('allcourses', 'block_filtered_course_list'))
+                    ?>
+                </option>
+                <option value="own"
+                    <?php
+                        if (isset($CFG->block_filtered_course_list_adminview)) { 
+                            if ($CFG->block_filtered_course_list_adminview == "own") {
+                                echo " selected";
+                            }
+                        }
+                    ?>>
+                    <?php
+                        p(get_string('owncourses', 'block_filtered_course_list'))
+                    ?>
+                </option>
+            </select>
+        </td>
+       <td>
+            <?php print_string("configadminview", "block_filtered_course_list") ?>
+        </td>
+    </tr>
+*/ ?>
+    <tr valign="top">
+        <td align="right">
+            <?php print_string("confighideallcourseslink", "block_filtered_course_list") ?> </td> 
+        <td>
+            <select name="block_filtered_course_list_hideallcourseslink">
+                <option value="1"
+                    <?php
+                        if (isset($CFG->block_filtered_course_list_allcourseslink)) { 
+                            if ($CFG->block_filtered_course_list_hideallcourseslink) {
+                                echo " selected";
+                            }
+                        }
+                    ?>>
+                    <?php p(get_string('yes')) ?>
+                </option>
+                <option value="0"
+                    <?php
+                        if (isset($CFG->block_filtered_course_list_hideallcourseslink)) { 
+                            if (!$CFG->block_filtered_course_list_hideallcourseslink) {
+                                echo " selected";
+                            }
+                        } else {
+                            echo " selected";
+                        }
+                    ?>>
+                    <?php p(get_string('no')) ?>
+                </option>
+            </select>
+        </td>
+    </tr>
+    <tr valign="top">
+        <td align="right"> 
+            <?php print_string("configfiltertype", "block_filtered_course_list") ?>
+	</td>
+        <td>
+            <select name="block_filtered_course_list_filtertype" onClick="showDiv(this.value);">
+                <option value="term"
+                    <?php
+                        if (isset($CFG->block_filtered_course_list_filtertype)) { 
+                            if ($CFG->block_filtered_course_list_filtertype == "term") {
+                                echo " selected";
+                            }
+                        } else {
+                            // If nothing is set, let's assume that "By Term" is the default
+                            echo " selected";
+                        }
+                    ?>>
+                    <?php p(get_string('filterterm', 'block_filtered_course_list')) ?>
+                </option>
+                <option value="categories"
+                    <?php
+                        if (isset($CFG->block_filtered_course_list_filtertype)) { 
+                            if ($CFG->block_filtered_course_list_filtertype == "categories") {
+                                echo " selected";
+                            }
+                        }
+                    ?>>
+                    <?php p(get_string('filtercategories', 'block_filtered_course_list')) ?> 
+                </option>
+                <option value="custom"
+                    <?php
+                        if (isset($CFG->block_filtered_course_list_filtertype)) { 
+                            if (!$CFG->block_filtered_course_list_filtertype) {
+                                echo " selected";
+                            }
+                        }
+                    ?>>
+                    <?php p(get_string('filtercustom', 'block_filtered_course_list')) ?>
+                </option>
+            </select>
+        </td>
+    </tr>
+    <tr><td align="center">
+
+<div id="term" style="background-color:#EFEFEF; width=60%; margin-left:auto; margin-right:auto; padding:3px;
+    <?php
+        if (isset($CFG->block_filtered_course_list_filtertype)) {
+            if ($CFG->block_filtered_course_list_filtertype == 'term') {
+                echo "display:block;";
+            } else {
+                echo "display:none;";
+            }
+        } else {
+            // If nothing is set, let's assume that "By Term" is the default
+            echo "display:block;";
+        }
+    ?>">
+
+        <p><?php print_string("configtermcurrent", "block_filtered_course_list") ?>  
+
+            <input name="block_filtered_course_list_termcurrent"
+                <?php
+                    if (isset($CFG->block_filtered_course_list_termcurrent)) {
+                        echo "value=\"$CFG->block_filtered_course_list_termcurrent\"";
+                    } else {
+                        echo "value=\"F08\"";
+                    }
+                ?>> 
+        </p>
+        <p>
+            <?php print_string("configtermfuture", "block_filtered_course_list") ?> 
+            <input name="block_filtered_course_list_termfuture"
+                <?php
+                    if (isset($CFG->block_filtered_course_list_termfuture)) {
+                        echo "value=\"$CFG->block_filtered_course_list_termfuture\"";
+                    } else {
+                        echo "value=\"S09\"";
+                    }
+                ?>> &nbsp; &nbsp;
+        </p>
+</div>
+
+<div id="categories" style="background-color:#EFEFEF; width:90%; margin-left:auto; margin-right:auto; padding:
+3px;
+    <?php
+        if (isset($CFG->block_filtered_course_list_filtertype)) {
+            if ($CFG->block_filtered_course_list_filtertype == 'categories') {
+                echo "display:block;";
+            } else {
+                echo "display:none;";
+            }
+        } else {
+            echo "display:none;";
+        }
+    ?>">
+        <p><?php print_string("configcategories", "block_filtered_course_list") ?> &nbsp; 
+            <select name="block_filtered_course_list_categories" multiple size = 5>
+                <?php
+                    // Obtain a list of all categories in this Moodle instance
+                    $categories = get_categories('none', 'cc.name ASC');
+
+                    // See if we have already set a category list
+                    $selected_cat_ids = '';
+                    if (isset($CFG->block_filtered_course_list_categories)) {
+                        $selected_cat_ids = explode(',', $CFG->block_filtered_course_list_categories);
+                    }
+
+                    foreach ($categories as $category) {
+                        echo "<option value=\"$category->id\"";
+
+                        // Now look to see if this category has been selected already
+                        if ($selected_cat_ids) {
+                            foreach ($selected_cat_ids as $category_id) {
+                                if ($category->id == $category_id) {
+                                    echo " selected";
+                                    break;
+                                }
+                            }
+                        }
+
+                        echo ">$category->name";
+                    }
+                ?>
+            </select>
+        &nbsp; &nbsp;
+        </p>
+</div>
+
+<div id="custom" style="background-color:#EFEFEF; width:90%; margin-left:auto; margin-right:auto; padding:3px;
+    <?php
+        if (isset($CFG->block_filtered_course_list_filtertype)) {
+            if ($CFG->block_filtered_course_list_filtertype == 'custom') {
+                echo "display:block;";
+            } else {
+                echo "display:none;";
+            }
+        } else {
+            echo "display:none;";
+        }
+    ?>">
+        <p>&nbsp; &nbsp; block_filtered_course_list_custom:
+            We'll get to this one pretty soon. For now, this will just be a placeholder.
+        </p>
+</div>
+</td></tr></table>
+<p align="center">
+    <input type="submit" value="<?php print_string("savechanges") ?>" />
+</p>
Index: blocks/filtered_course_list/block_filtered_course_list.php
===================================================================
--- blocks/filtered_course_list/block_filtered_course_list.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/filtered_course_list/block_filtered_course_list.php	(.../branches/1.9.5-LAE1.0/FilteredCourseList)	(revision 139)
@@ -0,0 +1,230 @@
+<?PHP 
+
+include_once($CFG->dirroot . '/course/lib.php');
+
+class block_filtered_course_list extends block_list {
+    function init() {
+        $this->title   = get_string('blockname', 'block_filtered_course_list');
+        $this->version = 20080116;
+    }
+
+    function has_config() {
+        return true;
+    }
+
+    function get_content() {
+        global $THEME, $CFG, $USER;
+
+        if ($this->content !== NULL) {
+            return $this->content;
+        }
+
+        $this->content         = new stdClass;
+        $this->content->items  = array();
+        $this->content->icons  = array();
+        $this->content->footer = '';
+        $icon         = "<img src=\"$CFG->pixpath/i/course.gif\"" .
+                        " class=\"icon\" alt=\"" .
+                        get_string("course") .
+                        "\" />";
+
+        // Obtain values from our config settings
+        $filter_type = 'term';
+        if (isset($CFG->block_filtered_course_list_filtertype)) {
+            $filter_type = $CFG->block_filtered_course_list_filtertype;
+        }
+
+        $term_current = ' ';
+        if (isset($CFG->block_filtered_course_list_termcurrent)) {
+            $term_current = $CFG->block_filtered_course_list_termcurrent;
+        }
+
+        $term_future = ' ';
+        if (isset($CFG->block_filtered_course_list_termfuture)) {
+            $term_future = $CFG->block_filtered_course_list_termfuture;
+        }
+
+        $category_ids = ' ';
+        if (isset($CFG->block_filtered_course_list_categories)) {
+            $category_ids = $CFG->block_filtered_course_list_categories;
+        }
+
+        $adminseesall = true;
+        if (isset($CFG->block_filtered_course_list_adminview)) {
+            if ($CFG->block_filtered_course_list_adminview == 'own'){
+                $adminseesall = false;
+            }
+        }
+
+        if (empty($CFG->disablemycourses) and
+            !empty($USER->id) and
+            !(has_capability('moodle/course:view', get_context_instance(CONTEXT_SYSTEM))) and 
+            !isguest()) {
+            // If user can't view all courses, just print My Courses
+            $all_courses = get_my_courses($USER->id);
+
+            if ($all_courses) {
+                switch ($filter_type) {
+                    case 'term':
+                        $filtered_courses = $this->_filter_by_term($all_courses,
+                                                                   $term_current,
+                                                                   $term_future);
+                        break;
+
+                    case 'categories':
+			$filtered_courses = $this->_filter_by_category($all_courses,
+                                                                       $category_ids);
+                        break;
+
+                    case 'custom':
+                        //$filtered_courses = $this->_filter_by_custom($all_courses,
+                        //                                             $category_ids);
+                        break;
+
+                    default:
+                        // This is unexpected
+                        break;
+                }
+
+                foreach ($filtered_courses as $section => $course_list) {
+                    if (count($course_list) == 0) {
+                        continue;
+                    }
+
+                    $this->content->items[]= "<center>$section</center>";
+                    $this->content->icons[]= '';
+
+                    foreach ($course_list as $course) {
+                        $linkcss = $course->visible ? "" : " class=\"dimmed\" ";
+                        $this->content->items[]= "<a $linkcss title=\"" .
+                                                 format_string($course->shortname) .
+                                                 "\" " .
+                                                 "href=\"$CFG->wwwroot/course/view.php?id=$course->id\">" .
+                                                 format_string($course->fullname) .
+                                                 "</a>";
+                        $this->content->icons[]= $icon;
+                    }
+
+                    $this->content->items[]="<hr width=\"50%\">";
+                    $this->content->icons[]="";
+
+                    // If we can update any course of the view all isn't hidden,
+                    // show the view all courses link
+                    if (has_capability('moodle/course:update', get_context_instance(CONTEXT_SYSTEM)) || 
+                        empty($CFG->block_filtered_course_list_hideallcourseslink)) {
+                        $this->content->footer = "<a href=\"$CFG->wwwroot/course/index.php\">" .
+                                                 get_string("fulllistofcourses") .
+                                                 "</a> ...";
+                    }
+                }
+            }
+        } else {
+            // Parent = 0   ie top-level categories only
+            $categories = get_categories("0");  
+
+            //Check we have categories
+            if ($categories) {
+                // Just print top level category links
+                if (count($categories) > 1 ||
+                   (count($categories) == 1 &&
+                    count($course_list) > 100)) {
+                    foreach ($categories as $category) {
+                        $linkcss = $category->visible ? "" : " class=\"dimmed\" ";
+                        $this->content->items[] = "<a $linkcss href=\"$CFG->wwwroot/course/category.php?id=$category->id\">" .
+                                                  format_string($category->name) .
+                                                  "</a>";
+                        $this->content->icons[] = $icon;
+                    }
+
+                    $this->content->footer .= "<br><a href=\"$CFG->wwwroot/course/index.php\">" .
+                                              get_string('searchcourses') .
+                                              '</a> ...<br />';
+
+                    // If we can update any course of the view all isn't hidden,
+                    // show the view all courses link
+                    if (has_capability('moodle/course:update', get_context_instance(CONTEXT_SYSTEM)) ||
+                        empty($CFG->block_filtered_course_list_hideallcourseslink)) {
+                        $this->content->footer .= "<a href=\"$CFG->wwwroot/course/index.php\">" .
+                                                  get_string('fulllistofcourses') .
+                                                  '</a> ...<br>';
+                    }
+
+                    $this->title = get_string('blockname', 'block_filtered_course_list');
+                } else {
+                    // Just print course names of single category
+                    $category = array_shift($categories);
+                    $courses = get_courses($category->id);
+
+                    if ($courses) {
+                        foreach ($courses as $course) {
+                            $linkcss = $course->visible ? "" : " class=\"dimmed\" ";
+
+                            $this->content->items[] = "<a $linkcss title=\"" .
+                                                      format_string($course->shortname) .
+                                                      "\" " .
+                                                      "href=\"$CFG->wwwroot/course/view.php?id=$course->id\">" .
+                                                      format_string($course->fullname) .
+                                                      "</a>";
+                            $this->content->icons[]=$icon;
+                        }
+
+                        // If we can update any course of the view all isn't hidden,
+                        // show the view all courses link
+                        if (has_capability('moodle/course:update', get_context_instance(CONTEXT_SYSTEM)) ||
+                            empty($CFG->block_filtered_course_list_hideallcourseslink)) {
+                            $this->content->footer .= "<a href=\"$CFG->wwwroot/course/index.php\">" .
+                                                      get_string('fulllistofcourses') .
+                                                      '</a> ...';
+                        }
+                    }
+                }
+            }
+        }
+        return $this->content;
+    }
+
+  
+    function _filter_by_term($courses, $term_current, $term_future) {
+        $results = array('Current Courses' => array(),
+                         'Future Courses'  => array(),
+                         'Old Courses'     => array());
+
+        foreach ($courses as $course) {
+            if ($course->id == SITEID) {
+                continue;
+            }
+
+            if (stristr($course->shortname, $term_current)) {
+                $results['Current Courses'] []= $course;
+            } else if (stristr($course->shortname, $term_future)) {
+                $results['Future Courses']  []= $course;
+            } else {
+                $results['Old Courses']     []= $course;
+            }
+        }
+
+        return $results;
+    }
+
+    function _filter_by_category($courses, $cat_ids) {
+        $filter_categories = explode(',', $cat_ids);
+        $results           = array('Course List' => array());
+
+        foreach ($courses as $course) {
+            if ($course->id == SITEID) {
+                continue;
+            }
+
+            foreach ($filter_categories as $filter_category) {
+                if ($course->category == $filter_category) {
+                    $results['Course List'] []= $course;
+                    break;
+                }
+            }
+        }
+
+        return $results;
+    }
+}
+
+?>
Index: blocks/filtered_course_list/readme.txt
===================================================================
--- blocks/filtered_course_list/readme.txt	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/filtered_course_list/readme.txt	(.../branches/1.9.5-LAE1.0/FilteredCourseList)	(revision 139)
@@ -0,0 +1,25 @@
+README for Simple File Upload
+developed by the Collaborative Liberal Arts Moodle Project ( clamp-it.org )
+version: 1.0 2009-07-29
+
+Installation: 
+
+Unzip files into your Moodle blocks directory. This will create a folder called filtered_course_list. 
+
+Go to the admin Notifications page to complete installation.
+
+
+Configuration: 
+
+To configure the block, go to Site Administration > Modules > Blocks > Current Courses List
+
+On this page, you can choose to filter by Terms or by Categories. 
+
+Choose "terms" if you organize courses by including a certain string within the course shortname (e.g. BIO101-01S09 = the S09 at the end indicates the term). 
+
+Choose "categories" if you organize your courses into categories by term.  
+
+
+Plans for Future Development: 
+
+We will be adding the ability to choose multiple categories or substrings to be shown as "current" or "future" for both categories and terms.  
