<?php

class MImageButton extends MImageLink
{
    public function generateLink()
    {
        parent::generateLink();

        $this->target = '';
        // if $this->href is a "normal" url, prefix it with "BTN:" to generate a doLinkButton
        $href = ( substr(strtoupper($this->href), 0, 7) == 'HTTP://' ? 'BTN:'.$this->href : $this->href);
        $onclick = $this->getOnClick($href);

        if ($onclick != '')
        {
            $this->addAttribute('onclick', $onclick);
        }
    }
}

?>