add_hook('toolbar_container_collect', 'plugin_name_collect'); /* * Plugin info function */ function plugin_name_info() { // some info } function plugin_name_activate() { } function plugin_name_deactivate() { } /** * The Hook Function * ----------------- * Function to fill the items attribute of the ItemCollector object * that declared on toolbar_contanier plugin. This function only executed * when Toolbar Container plugin is active. * * @param ItemCollector &$ic * @return void */ function plugin_name_collect(&$ic) { // the javascript callback function // called when button clicked $callback = " var ask_me = prompt('What do you think?', ''); if (ask_me == null) return; if (ask_me != '') { ask_me = '=' + ask_me; } // inject to editor clickableEditor.performInsert('[sometag' + ask_me + '][/sometag]', '', true, false); "; $toolbar = array( 'id' => 'plugin_name_v10', // make sure it's unique, add version number to make sure 'name' => 'plugin_name', 'image' => 'plugin-logo.png', 'callback' => $callback, 'title' => 'Some plugin description' ); $ic->collect_item($toolbar); } ?>