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

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

Add social plugin activity feed
Add convert function on admin page config
Add missing options on social plugins
Add activity tab sheet on admin config page

  • Property svn:eol-style set to LF
File size: 2.6 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
26function fbp_blockmanager_register_blocks( $menu_ref_arr )
27{
28  global $conf;
29 
30  $menu = & $menu_ref_arr[0];
31  if ($menu->get_id() != 'menubar')
32    return;
33
34  if ($conf['fbp']['social_plugin_activity_feed']['enabled'])
35  {
36    $menu->register_block(new RegisteredBlock('mbFBP_activity_feed', 'social.plugin.activity.feed', 'FacebookPlug'));
37  }
38  if ($conf['fbp']['social_plugin_like_box']['enabled'])
39  {
40    $menu->register_block(new RegisteredBlock('mbFBP_like_box', 'social.plugin.like.box', 'FacebookPlug'));
41  }
42}
43
44function fpt_blockmanager_apply($menu_ref_arr)
45{
46  global $template;
47
48  $menu = & $menu_ref_arr[0];
49
50  foreach (array('mbFBP_activity_feed', 'mbFBP_like_box') as $mbFBPId)
51  {
52    if ($block = $menu->get_block($mbFBPId))
53    {
54      $template->set_template_dir(FBP_DIR.'/tpl/');
55      $block->template = $block->get_block()->get_name().'.tpl';
56    }
57  }
58}
59
60
61if ($conf['fbp']['social_plugin_activity_feed']['enabled'] or $conf['fbp']['social_plugin_like_box']['enabled'])
62{
63  add_event_handler('blockmanager_register_blocks', 'fbp_blockmanager_register_blocks', EVENT_HANDLER_PRIORITY_NEUTRAL);
64  add_event_handler('blockmanager_apply', 'fpt_blockmanager_apply');
65}
66
67?>
Note: See TracBrowser for help on using the repository browser.