public function add_button($p, $container)
    {
        if ($this->api->output->type == 'html') {
            // fix relative paths
            foreach (array('imagepas', 'imageact', 'imagesel') as $key) {
                if ($p[$key]) {
                    $p[$key] = $this->api->url . $this->resource_url($p[$key]);
                }
            }

            $this->api->add_content($this->api->output->button($p), $container);
        }
    }