1<?php
2/**
3 * Facebook Script Action Plugin
4 *
5 * @author     Greatedays@gmail.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_fbcomments extends DokuWiki_Action_Plugin {
13
14    // Plugin Info
15    function getInfo(){
16        return array(
17                      'author' => 'Greatdays',
18                      'email'  => 'greatedays@gmail.com',
19                      'date'   => '2011-04-03',
20                      'name'   => 'Facebook Script',
21                      'desc'   => 'Add Facebook script',
22                      'url'    => 'http://juice.linuxstudy.pe.kr/wiki/facebook_comments_for_dokuwiki',
23                    );
24    }
25
26    function register(&$controller) {
27        $controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this,'_addHeader');
28    }
29    function _addHeader(&$event, $param){
30        $event->data['meta'][] = array(
31                                    'property'    => 'fb:app_id',
32                                    'content' => $this->getConf('FB_AppID'),
33                                    );
34
35        $event->data['meta'][] = array(
36                                     'property'    => 'fb:admins',
37                                     'content' => $this->getConf('FB_UserID'),
38                                    );
39
40//        $event->data['div'][] = array(
41//                                      'id' => 'fb-root',
42//                                    );
43
44//        $event->data['script'][] = array(
45//                                          "type" => "text/javascript",
46//                                            'src'=> 'http://connect.facebook.net/'. $this->getLang('fb_langs')
47//                                                 .'/all.js#appId='. $this->getConf('FB_AppID')
48//                                                 .'&amp;xfbml=1',
49//                                    );
50    }
51
52}