joomla/plg_hotlink_btn/hotlinkbtn.php

<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.plugin.plugin' );
class plgButtonHotlinkbtn extends JPlugin {
    function __construct( &$subject, $config) {
        parent::__construct($subject, $config);
    }
    function onDisplay($name)
    {
        wkTrace('hotlink button');
        $doc = JFactory::getDocument();
        $css = ".hotlink {
            background:transparent 
                       url(../plugins/editors-xtd/hotlinkbtn/hotlinkbtn.png) 
                       no-repeat scroll 100% 0;
        }";
        $doc->addStyleDeclaration($css);
        $button = new JObject();
        $button->set('onclick', 
                'jInsertEditorText(\'{hotlink=1 name=name}\', \''.$name.'\');return false;');

        $button->set('text', 'Hotlink');
        $button->set('name', 'hotlink');
        $button->set('link', '#');
        return $button;
    }
}
?>