1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
class CourseHolder extends Calendar {
  static $has_many = array (
    'Courses' => 'Course'
  );

  static $allowed_children = array (
    'Course'
  );

  public function getFilterFields() {
    $fields = parent::getFilterFields(); // returns a CalendarFilterFieldSet

    $cities = DB::query('SELECT DISTINCT "City" FROM "CourseDateTime"')->column();
    $newCities = array_combine($cities, $cities);
    $CityDropDownField = new DropdownField('City', 'By', $newCities);
    $CityDropDownField->sethasEmptyDefault(true); 

    //$fields->addFilterField($CityDropDownField);

    //$fields->addFilterField(new DropdownField('Course_Title','Title', singleton('Course')->dbObject('Title')->enumValues()));
    return $fields;
  }
}

class CourseHolder_Controller extends Calendar_Controller {
}
?>