. */
/**
* Embed facebook javascript onto any page
* @license GNU General Public License 3
* @author Marvin Thomas Rabe
*/
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_facebooklike extends DokuWiki_Action_Plugin {
/**
* General information about the plugin.
*/
function getInfo(){
return array(
'author' => 'Marvin Thomas Rabe',
'email' => 'mrabe@marvinrabe.de',
'date' => '2012-06-06',
'name' => 'Facebook Like-Button',
'desc' => 'Adds Facebook like-buttons',
'url' => 'https://github.com/marvinrabe/dokuwiki-facebook',
);
}
/**
* Register its handlers.
*/
function register(&$controller) {
$controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, '_addHeaders');
}
/**
* Adds the FBML JavaScript file to the header.
*/
function _addHeaders (&$event, $param) {
global $lang;
$event->data["script"][] = array (
"type" => "text/javascript",
"src" => '//connect.facebook.net/'.$this->getLang('fbml_language').'/all.js#xfbml=1',
);
}
}