1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Extended Description |
---|
4 | Version: auto |
---|
5 | Description: Add multilinguale descriptions, banner, NMB, category name, etc... |
---|
6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=175 |
---|
7 | Author: P@t & Grum |
---|
8 | */ |
---|
9 | |
---|
10 | defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); |
---|
11 | |
---|
12 | define('EXTENDED_DESC_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/'); |
---|
13 | |
---|
14 | |
---|
15 | global $conf; |
---|
16 | |
---|
17 | $extdesc_conf = array( |
---|
18 | 'more' => '<!--more-->', |
---|
19 | 'complete' => '<!--complete-->', |
---|
20 | 'up-down' => '<!--up-down-->', |
---|
21 | 'not_visible' => '<!--hidden-->', |
---|
22 | 'mb_not_visible' => '<!--mb-hidden-->' |
---|
23 | ); |
---|
24 | |
---|
25 | $conf['ExtendedDescription'] = isset($conf['ExtendedDescription']) ? |
---|
26 | array_merge($extdesc_conf, $conf['ExtendedDescription']) : |
---|
27 | $extdesc_conf; |
---|
28 | |
---|
29 | |
---|
30 | include_once(EXTENDED_DESC_PATH . 'include/events.inc.php'); |
---|
31 | include_once(EXTENDED_DESC_PATH . 'include/functions.inc.php'); |
---|
32 | |
---|
33 | if (script_basename() == 'admin' or script_basename() == 'popuphelp') |
---|
34 | { |
---|
35 | include_once(EXTENDED_DESC_PATH . 'include/admin.inc.php'); |
---|
36 | |
---|
37 | add_event_handler('get_popup_help_content', 'extended_desc_popup', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
38 | add_event_handler('loc_begin_admin_page', 'add_ed_help'); |
---|
39 | add_event_handler('get_admin_plugin_menu_links', 'extdesc_admin_menu'); |
---|
40 | } |
---|
41 | |
---|
42 | |
---|
43 | // main |
---|
44 | add_event_handler ('get_extended_desc', 'get_extended_desc'); |
---|
45 | add_event_handler ('render_page_banner', 'get_extended_desc'); |
---|
46 | // categories |
---|
47 | add_event_handler ('render_category_name', 'parse_lang_tag'); |
---|
48 | add_event_handler ('render_category_description', 'get_extended_desc', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
49 | // tags |
---|
50 | add_event_handler ('render_tag_name', 'parse_lang_tag'); |
---|
51 | add_event_handler ('render_tag_url', 'get_user_language_tag_url', 40); |
---|
52 | add_event_handler ('get_tag_alt_names', 'ed_get_all_alt_names', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
53 | add_event_handler ('get_tag_name_like_where', 'ed_name_like_where'); |
---|
54 | // element |
---|
55 | add_event_handler ('render_element_name', 'parse_lang_tag'); |
---|
56 | add_event_handler ('render_element_description', 'get_extended_desc', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
57 | // mail/nbm |
---|
58 | add_event_handler ('nbm_render_user_customize_mail_content', 'get_extended_desc'); |
---|
59 | add_event_handler ('mail_group_assign_vars', 'extended_desc_mail_group_assign_vars'); |
---|
60 | // removals |
---|
61 | add_event_handler ('loc_end_index_category_thumbnails', 'ext_remove_cat', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
62 | add_event_handler ('loc_end_index_thumbnails', 'ext_remove_image', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
63 | add_event_handler ('get_categories_menu_sql_where', 'ext_remove_menubar_cats'); |
---|