public function get_content_for_external($output) {
        $bc = new stdClass;
        $bc->title = null;
        $bc->content = null;
        $bc->contentformat = FORMAT_HTML;
        $bc->footer = null;
        $bc->files = [];

        if ($this->instance->visible) {
            $bc->content = $this->formatted_contents($output);
            if (!empty($this->content->footer)) {
                $bc->footer = $this->content->footer;
            }
        }

        if (!$this->hide_header()) {
            $bc->title = $this->title;
        }

        return $bc;
    }