source: extensions/FacebookPlug/Plugin/include/index.inc.php @ 8275

Last change on this file since 8275 was 8275, checked in by rub, 13 years ago

Add css
Fix translations
Finish like box integration

  • Property svn:eol-style set to LF
File size: 3.0 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | FacebookPlug - a Piwigo Plugin                                        |
4// | Copyright (C) 2010 Ruben ARNAUD - rub@piwigo.org                      |
5// +-----------------------------------------------------------------------+
6// | This program is free software; you can redistribute it and/or modify  |
7// | it under the terms of the GNU General Public License as published by  |
8// | the Free Software Foundation                                          |
9// |                                                                       |
10// | This program is distributed in the hope that it will be useful, but   |
11// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
12// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
13// | General Public License for more details.                              |
14// |                                                                       |
15// | You should have received a copy of the GNU General Public License     |
16// | along with this program; if not, write to the Free Software           |
17// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
18// | USA.                                                                  |
19// +-----------------------------------------------------------------------+
20
21if (!defined('PHPWG_ROOT_PATH'))
22{
23  die('Hacking attempt!');
24}
25
26include_once(FBP_DIR.'/include/common.inc.php');
27include_once(FBP_DIR.'/include/header.inc.php');
28
29/*function fbp_loc_begin_index()
30{
31  global $template;
32
33  $template->set_filename('social.plugin.like.box', FBP_DIR.'/tpl/social.plugin.like.box.tpl');
34 
35  //~ $template->assign_var_from_handle('PLUGIN_INDEX_CONTENT_BEFORE', 'social.plugin.like.box');
36  //~ $template->assign_var_from_handle('PLUGIN_INDEX_CONTENT_BEGIN', 'social.plugin.like.box');
37  $template->assign_var_from_handle('PLUGIN_INDEX_CONTENT_END', 'social.plugin.like.box');
38  //~ $template->assign_var_from_handle('PLUGIN_INDEX_CONTENT_AFTER', 'social.plugin.like.box');
39
40  //~ $template->set_filename('social.plugin.like.box', FBP_DIR.'/tpl/social.plugin.like.box.tpl');
41    //~ $content .= $template->parse('social.plugin.like.box', true);
42}*/
43
44function fbp_blockmanager_register_blocks( $menu_ref_arr )
45{
46  $menu = & $menu_ref_arr[0];
47  if ($menu->get_id() != 'menubar')
48    return;
49  $menu->register_block( new RegisteredBlock( 'mbFBP', 'social.plugin.like.box', 'FacebookPlug'));
50}
51
52function fpt_blockmanager_apply($menu_ref_arr)
53{
54  global $template;
55
56  $menu = & $menu_ref_arr[0];
57   
58  if ($block = $menu->get_block('mbFBP'))
59  {
60    $template->set_template_dir(FBP_DIR.'/tpl/');
61    $block->template = 'social.plugin.like.box.tpl';
62  }
63}
64
65
66if ($conf['fbp']['social_plugin_like_box']['enabled'])
67{
68  //~ add_event_handler('loc_begin_index', 'fbp_loc_begin_index');
69  add_event_handler('blockmanager_register_blocks', 'fbp_blockmanager_register_blocks', EVENT_HANDLER_PRIORITY_NEUTRAL);
70  add_event_handler('blockmanager_apply', 'fpt_blockmanager_apply');
71}
72
73?>
Note: See TracBrowser for help on using the repository browser.