Exemple #1
0
/**
 * Main calendar hook for settinging f2f calendar filters
 *
 * @uses $SESSION->calendarfacetofacefilter - initialises assoc array of filter fieldids and vals
 *
 * @return void
 */
function facetoface_calendar_set_filter() {
    global $SESSION;

    $fields = facetoface_get_customfield_filters();

    $SESSION->calendarfacetofacefilter = array();
    foreach ($fields as $f) {
        $SESSION->calendarfacetofacefilter[$f->shortname] = optional_param("field_{$f->shortname}", '', PARAM_TEXT);
    }
}
    /**
     * Main calendar hook function for rendering the f2f filter controls
     *
     * @return string html
     */
    public function calendar_filter_controls() {
        global $SESSION;

        $fields = facetoface_get_customfield_filters();

        $output = '';
        foreach ($fields as $f) {
            $currentval = !empty($SESSION->calendarfacetofacefilter[$f->shortname]) ? $SESSION->calendarfacetofacefilter[$f->shortname] : '';
            $output .= $this->custom_field_chooser($f, $currentval);
        }

        return $output;
    }