<?php
/**
 * Action Plugin: Inserts a button into the toolbar to add file tags
 *
 * @author F.Schonack
 */
 
if (!defined('DOKU_INC')) die();
if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/');
require_once (DOKU_PLUGIN . 'action.php');
 
class action_plugin_codebutton_ext extends DokuWiki_Action_Plugin {
 
    /**
     * Return some info
     */
    function getInfo() {
        return array (
            'author' => 'F.Schonack',
            'date' => '2010-09-29',
            'name' => 'Toolbar Code Button',
            'desc' => 'Inserts a code choice into the toolbar',
            'url' => 'http://shony.de/downloads/dokuwiki/plugins/codebutton_ext.zip',
        );
    }
 
    /**
     * Register the eventhandlers
     */
    function register(&$controller) {
        $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'handle_toolbar', array ());
    }
 
    /**
     * Inserts the toolbar button
     */


/**abap, actionscript-french, actionscript, actionscript3, ada, apache, applescript, asm, asp, autoit, avisynth, -bash, basic4gl,
 bf, bibtex, blitzbasic, bnf, boo, -c, c_mac, caddcl, cadlisp, cfdg, cfm, cil, cmake, cobol, cpp, cpp-qt, csharp, css, d, dcs, delphi,
 diff, div, dos, dot, eiffel, email, erlang, fo, fortran, freebasic, genero, glsl, gml, gnuplot, groovy, gettext, haskell, hq9plus, html,
 idl, ini, inno, intercal, io, java5, java, javascript, kixtart, klonec, klonecpp, latex, lisp, locobasic, lolcode, lotusformulas, lotusscript,
 lscript, lsl2, lua, m68k, make, matlab, mirc, modula3, mpasm, mxml, mysql, nsis, oberon2, objc, ocaml-brief, ocaml, oobas, oracle8, oracle11,
 pascal, perl, per, php-brief, php, pic16, pixelbender, plsql, povray, powershell, progress, prolog, properties, providex, python, qbasic, rails,
 rebol, reg, robots, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, tcl, teraterm, text, thinbasic, tsql, typoscript, vbnet,
 vb, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, winbatch, whois, xml, xorg_conf, xpp, z80**/

    function handle_toolbar(& $event, $param) {
        $event->data[] = array (
            'type' => 'picker',
            'title' => $this->getLang('insertcode'),
            'icon' => '../../plugins/codebutton_ext/pix/code_select.png',
	'list' => array(
                array(
                    'type'   => 'format',
                    'title'  => $this->getLang('bash'),
                    'icon'   => '../../plugins/codebutton_ext/pix/File-bash-32.png',
                    'open'   => '<code bash downloadname.sh>\n',
                    'close'  => '\n</code>',
                ),

                array(
                    'type'   => 'format',
                    'title'  => $this->getLang('ansi-C'),
                    'icon'   => '../../plugins/codebutton_ext/pix/File-c-32.png',
                    'open'   => '<code c downloadname.c>\n',
                    'close'  => '\n</code>',
                ),

                array(
                    'type'   => 'format',
                    'title'  => $this->getLang('css'),
                    'icon'   => '../../plugins/codebutton_ext/pix/File-css-32.png',
                    'open'   => '<code css downloadname.css>\n',
                    'close'  => '\n</code>',
                ),

			array(
                    'type'   => 'format',
                    'title'  => $this->getLang('html'),
                    'icon'   => '../../plugins/codebutton_ext/pix/File-html-32.png',
                    'open'   => '<code html downloadname.html>\n',
                    'close'  => '\n</code>',
                ),

			array(
                    'type'   => 'format',
                    'title'  => $this->getLang('xml'),
                    'icon'   => '../../plugins/codebutton_ext/pix/File-xml-32.png',
                    'open'   => '<code xml downloadname.xml>\n',
                    'close'  => '\n</code>',
		 ),

			array(
                    'type'   => 'format',
                    'title'  => $this->getLang('javascript'),
                    'icon'   => '../../plugins/codebutton_ext/pix/File-javascript-32.png',
                    'open'   => '<code javascript downloadname.js>\n',
                    'close'  => '\n</code>',
                ),

			array(
                    'type'   => 'format',
                    'title'  => $this->getLang('java'),
                    'icon'   => '../../plugins/codebutton_ext/pix/File-java-32.png',
                    'open'   => '<code java downloadname.java>\n',
                    'close'  => '\n</code>',
                ),

			array(
                    'type'   => 'format',
                    'title'  => $this->getLang('php'),
                    'icon'   => '../../plugins/codebutton_ext/pix/File-php-32.png',
                    'open'   => '<code php downloadname.php>\n',
                    'close'  => '\n</code>',
                ),
                
                
                	array(
                    'type'   => 'format',
                    'title'  => $this->getLang('perl'),
                    'icon'   => '../../plugins/codebutton_ext/pix/File-perl-32.png',
                    'open'   => '<code perl downloadname.pl>\n',
                    'close'  => '\n</code>',
                ),

        
			array(
                    'type'   => 'format',
                    'title'  => $this->getLang('latex'),
                    'icon'   => '../../plugins/codebutton_ext/pix/File-latex-32.png',
                    'open'   => '<code latex downloadname.tex>\n',
                    'close'  => '\n</code>',
                ),

			array(
                    'type'   => 'format',
                    'title'  => $this->getLang('winbatch'),
                    'icon'   => '../../plugins/codebutton_ext/pix/File-winbatch-32.png',
                    'open'   => '<code winbatch downloadname.bat>\n',
                    'close'  => '\n</code>',
                ),

			array(
                    'type'   => 'format',
                    'title'  => $this->getLang('sql'),
                    'icon'   => '../../plugins/codebutton_ext/pix/File-sql-32.png',
                    'open'   => '<code sql downloadname.sql>\n',
                    'close'  => '\n</code>',
                ),

			array(
                    'type'   => 'format',
                    'title'  => $this->getLang('vb'),
                    'icon'   => '../../plugins/codebutton_ext/pix/File-vb-32.png',
                    'open'   => '<code vb downloadname.vb>\n',
                    'close'  => '\n</code>',
                ),

			array(
                    'type'   => 'format',
                    'title'  => $this->getLang('vhdl'),
                    'icon'   => '../../plugins/codebutton_ext/pix/File-vhdl-32.png',
                    'open'   => '<code vhdl downloadname.vhdl>\n',
                    'close'  => '\n</code>',
                ),

		)

        );
    }
 
}
