public function get_user_courses_select($choose = false) {
        $options = tool_monitor_get_user_courses();
        // If we have no options then don't create a select element.
        if (!$options) {
            return false;
        }
        $selected = $this->courseid;
        $nothing = array();
        if ($choose) {
            $selected = null;
            $nothing = array('choosedots');
        }
        $url = new \moodle_url('/admin/tool/monitor/index.php');
        $select = new \single_select($url, 'courseid', $options, $selected, $nothing);
        $select->set_label(get_string('selectacourse', 'tool_monitor'));
        return $select;
    }
public function get_user_courses_select($choose = false) {
        $options = tool_monitor_get_user_courses();
        // If we have no options then don't create a select element.
        if (!$options) {
            return false;
        }
        $selected = $this->courseid;
        $nothing = array();
        if ($choose) {
            $selected = null;
            $nothing = array('choosedots');
        }
        $url = new \moodle_url('/admin/tool/monitor/index.php');
        $select = new \single_select($url, 'courseid', $options, $selected, $nothing);
        $select->set_label(get_string('selectacourse', 'tool_monitor'));
        return $select;
    }
public function get_user_courses_select ( $ choose = false ) { $ options = tool_monitor_get_user_courses ( ) ; // If we have no options then don't create a select element. if ( ! $ options ) { return false ; } $ selected = $ this -> courseid ; $ nothing = array ( ) ; if ( $ choose ) { $ selected = null ; $ nothing = array ( 'choosedots' ) ; } $ url = new \ moodle_url ( '/admin/tool/monitor/index.php' ) ; $ select = new \ single_select ( $ url , 'courseid' , $ options , $ selected , $ nothing ) ; $ select -> set_label ( get_string ( 'selectacourse' , 'tool_monitor' ) ) ; return $ select ; }
Gets a list of courses where the current user can subscribe to rules as a dropdown.

@param bool $choose A flag for whether to show the 'choose...' option in the select box.
@return \single_select|bool returns the list of courses, or false if the select box
should not be displayed.
Gets a list of courses where the current user can subscribe to rules as a dropdown .