1<?php 2/** 3 * PhotoWidget Action Plugin: Register PhotoWidget to the toolbar 4 * 5 * @author Jonathan Tsai <tryweb@ichiayi.com> 6 * @date 11:41 2012/4/13 7 */ 8 9if(!defined('DOKU_INC')) die(); 10if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); 11require_once(DOKU_PLUGIN.'action.php'); 12 13class action_plugin_photowidget extends DokuWiki_Action_Plugin { 14 15 /** 16 * return some info 17 */ 18 function getInfo(){ 19 return array( 20 'author' => 'Jonathan Tsai', 21 'email' => 'tryweb@ichiayi.com', 22 'date' => '2012-04-13', 23 'name' => 'photowidget (toolbar action plugin component)', 24 'desc' => 'photowidget toolbar action functions.', 25 'url' => 'http://www.dokuwiki.org/plugin:photowidget', 26 ); 27 } 28 29 function register(&$controller) { 30 $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button', array ()); 31 } 32 33 34/** 35 * Inserts a toolbar button 36 */ 37function insert_button(& $event, $param) { 38 $event->data[] = array ( 39 'type' => 'format', 40 'title' => $this->getLang('photowidget'), 41 'icon' => '../../plugins/photowidget/toolbar/PhotoWidget.png', 42 'open' =>'<photowidget feed="" width="300" height="300">', 43 'close' => '</photowidget>', 44 ); 45} 46} // class