[dokuwiki] Re: How to add a drop-down list to the edit toolbar?

On Mon, 24 Sep 2007 14:40:58 +0200, "Gunther Pilz"
<dokuwiki@xxxxxxxxxxxxxx> said:
> 
> The options I'll need for my select aren't static values. I'll have to
> generate them by a php function.

The TPL_METAHEADER_OUTPUT action event lets you insert scripts into the
HTML header. Create an action plugin (which can have the same name as
your syntax plugin) 

    function handle_event(&$event, $param) {
      global $ACT;
      if ($ACT=='edit') {
        $scripts =& $event->data['script'];
        $js = $this->_create_script();
        $scripts[] = array( 'type'=>'text/javascript',
                            'charset'=>'utf-8',
                            '_data'=>$js );
      }
    }

See http://wiki.splitbrain.org/plugin:action_tutorial
-- tom
telliamed@xxxxxxxxxxx

-- 
http://www.fastmail.fm - A fast, anti-spam email service.

-- 
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: