public function get_subscribe_options($courseid) {
        global $CFG;

        $url = new \moodle_url($CFG->wwwroot. '/admin/tool/monitor/index.php', array(
            'courseid' => $courseid,
            'ruleid' => $this->id,
            'action' => 'subscribe',
            'sesskey' => sesskey()
        ));

        if (strpos($this->plugin, 'mod_') !== 0) {
            return $url;

        } else {
            // Single select when the plugin is an activity.
            $options = array();
            $options[0] = get_string('allmodules', 'tool_monitor');

            if ($courseid == 0) {
                // They need to be in a course to select module instance.
                return get_string('selectcourse', 'tool_monitor');
            }

            // Let them select an instance.
            $cms = get_fast_modinfo($courseid);
            $instances = $cms->get_instances_of(str_replace('mod_', '',  $this->plugin));
            foreach ($instances as $cminfo) {
                // Don't list instances that are not visible or available to the user.
                if ($cminfo->uservisible && $cminfo->available) {
                    $options[$cminfo->id] = $cminfo->get_formatted_name();
                }
            }

            return new \single_select($url, 'cmid', $options);
        }
    }