[6547] | 1 | <?php |
---|
| 2 | /* |
---|
[7135] | 3 | Plugin Name: Contact Form |
---|
[8909] | 4 | Version: auto |
---|
[7135] | 5 | Description: Add a "Contact" item in the Menu block to offer a contact form to users |
---|
| 6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=304 |
---|
[17483] | 7 | Author: Piwigo Team |
---|
| 8 | Author URI: http://piwigo.org |
---|
[6547] | 9 | */ |
---|
| 10 | |
---|
| 11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 12 | |
---|
[17518] | 13 | define('CONTACT_FORM_PATH', PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/'); |
---|
| 14 | define('CONTACT_FORM_ADMIN', get_root_url() . 'admin.php?page=plugin-' . basename(dirname(__FILE__))); |
---|
| 15 | define('CONTACT_FORM_PUBLIC', get_absolute_root_url() . make_index_url(array('section' => 'contact')) . '/'); |
---|
[6547] | 16 | |
---|
[17483] | 17 | |
---|
| 18 | add_event_handler('init', 'contact_form_init'); |
---|
| 19 | add_event_handler('loc_end_section_init', 'contact_form_section_init'); |
---|
| 20 | add_event_handler('loc_end_index', 'contact_form_page'); |
---|
| 21 | add_event_handler('blockmanager_apply', 'contact_form_applymenu', EVENT_HANDLER_PRIORITY_NEUTRAL+10); |
---|
| 22 | if (defined('IN_ADMIN')) |
---|
| 23 | { |
---|
| 24 | add_event_handler('get_admin_plugin_menu_links', 'contact_form_admin_menu'); |
---|
[6547] | 25 | } |
---|
[17483] | 26 | |
---|
| 27 | include(CONTACT_FORM_PATH . 'include/functions.inc.php'); |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | function contact_form_init() |
---|
| 31 | { |
---|
[17491] | 32 | global $conf, $template; |
---|
[17483] | 33 | $conf['ContactForm'] = unserialize($conf['ContactForm']); |
---|
| 34 | |
---|
| 35 | load_language('plugin.lang', CONTACT_FORM_PATH); |
---|
| 36 | |
---|
| 37 | if ($conf['ContactForm']['cf_must_initialize']) |
---|
| 38 | { |
---|
| 39 | contact_form_initialize_emails(); |
---|
| 40 | } |
---|
[17491] | 41 | |
---|
| 42 | $template->set_prefilter('tail', 'contact_form_footer_link'); |
---|
[17483] | 43 | } |
---|
| 44 | |
---|
[6547] | 45 | ?> |
---|