1<?php 2/** 3 * HCalendar Action Plugin: Register HCalendar to the toolbar 4 * 5 * @author Jürgen A.Lamers <jaloma.ac@googlemail.com> 6 */ 7 8if (!defined('DOKU_INC')) die (); 9if (!defined('DOKU_PLUGIN'))define('DOKU_PLUGIN', DOKU_INC.'lib/plugins/'); 10require_once (DOKU_PLUGIN.'action.php'); 11 12class action_plugin_hcalendar extends DokuWiki_Action_Plugin 13{ 14 15 /** 16 * return some info 17 */ 18 function getInfo() 19 { 20 return array ( 21 'author'=>'Jürgen A.Lamers', 22 'email'=>'jaloma.ac@googlemail.com', 23 'date'=>@file_get_contents(DOKU_PLUGIN.'hcalendar/VERSION'), 24 'name'=>'HCalendar (toolbar action plugin component)', 25 'desc'=>'HCalendar toolbar action functions.', 26 'url'=>'http://www.dokuwiki.org/plugin:hcalendar', 27 ); 28 } 29 30 function register( & $controller) 31 { 32 $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button', array ()); 33 } 34 35 /** 36 * Inserts a toolbar button 37 */ 38 function insert_button( & $event, $param) 39 { 40 $event->data[] = array ( 41 'type'=>'format', 42 'title'=>$this->getLang('hcalendar'), 43 'icon'=>'../../plugins/hcalendar/toolbar/hcalendar.png', 44 'open'=>'<hcal start_date=\'yyyy/mm/dd\' '. 45 'start_time=\'hh:mm\' '. 46 'end_date=\'yyyy/mm/dd\' '. 47 'end_time=\'hh:mm\' '. 48 'summary=\'off\' location=\'off\' '. 49 'inline=\'off\''. 50 '>', 51 'close'=>'</hcal>', 52 ); 53 } 54} // class 55