source: extensions/bbcode_bar/main.inc.php @ 9765

Last change on this file since 9765 was 9765, checked in by mistic100, 13 years ago

[extentions] BBCode Bar

  • active for admin in the comments page
File size: 1.1 KB
Line 
1<?php 
2/*
3Plugin Name: BBCode Bar
4Version: 2.2.a
5Description: Allow use BBCode for comments and descriptions.
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=140
7Author: Atadilo & P@t & Mistic
8*/
9
10if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
11
12define('BBcode_DIR' , basename(dirname(__FILE__)));
13define('BBcode_PATH' , PHPWG_PLUGINS_PATH . BBcode_DIR . '/');
14
15include_once(BBcode_PATH.'bbcode_bar.inc.php');
16add_event_handler('init', 'init_bbcode_bar');
17
18function init_bbcode_bar()
19{
20        remove_event_handler('render_comment_content', 'render_comment_content');
21        add_event_handler('render_comment_content', 'BBCodeParse');
22        add_event_handler('loc_after_page_header', 'add_bbcode_bar');
23}
24
25function add_bbcode_bar() {
26        global $page;
27        if ($page['body_id'] == 'theCommentsPage' OR $page['body_id'] == 'thePicturePage') {
28                set_bbcode_bar();
29        }
30}
31
32if (script_basename() == 'admin')
33{
34        add_event_handler('get_admin_plugin_menu_links', 'bbcode_bar_admin_menu');
35        function bbcode_bar_admin_menu($menu)
36        {
37                array_push($menu, array(
38                        'NAME' => 'BBCode Bar',
39                        'URL' => get_root_url().'admin.php?page=plugin-' . BBcode_DIR
40                ));
41                return $menu;
42        }
43}
44
45?>
Note: See TracBrowser for help on using the repository browser.