protected static function get_cartridge_parameters($toolid) {
        global $PAGE, $SITE;
        $PAGE->set_context(\context_system::instance());

        // Get the tool.
        $tool = self::get_lti_tool($toolid);

        // Work out the name of the tool.
        $title = self::get_name($tool);
        $launchurl = self::get_launch_url($toolid);
        $launchurl = $launchurl->out();
        $icon = self::get_icon($tool);
        $securelaunchurl = null;
        $secureicon = null;
        $vendorurl = new \moodle_url('/');
        $vendorurl = $vendorurl->out();
        $description = self::get_description($tool);

        // If we are a https site, we can add the launch url and icon urls as secure equivalents.
        if (\is_https()) {
            $securelaunchurl = $launchurl;
            $secureicon = $icon;
        }

        return array(
                "/cc:cartridge_basiclti_link" => array(
                    "/blti:title" => $title,
                    "/blti:description" => $description,
                    "/blti:extensions" => array(
                            "/lticm:property[@name='icon_url']" => $icon,
                            "/lticm:property[@name='secure_icon_url']" => $secureicon
                        ),
                    "/blti:launch_url" => $launchurl,
                    "/blti:secure_launch_url" => $securelaunchurl,
                    "/blti:icon" => $icon,
                    "/blti:secure_icon" => $secureicon,
                    "/blti:vendor" => array(
                            "/lticp:code" => $SITE->shortname,
                            "/lticp:name" => $SITE->fullname,
                            "/lticp:description" => trim(html_to_text($SITE->summary)),
                            "/lticp:url" => $vendorurl
                        )
                )
            );
    }