source: extensions/ContactForm/main.inc.php @ 17634

Last change on this file since 17634 was 17518, checked in by mistic100, 12 years ago

clean definition of CONTACT_FORM_PUBLIC

File size: 1.4 KB
Line 
1<?php
2/*
3Plugin Name: Contact Form
4Version: auto
5Description: Add a "Contact" item in the Menu block to offer a contact form to users
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=304
7Author: Piwigo Team
8Author URI: http://piwigo.org
9*/
10
11if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
12
13define('CONTACT_FORM_PATH',   PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
14define('CONTACT_FORM_ADMIN',  get_root_url() . 'admin.php?page=plugin-' . basename(dirname(__FILE__)));
15define('CONTACT_FORM_PUBLIC', get_absolute_root_url() . make_index_url(array('section' => 'contact')) . '/');
16
17
18add_event_handler('init', 'contact_form_init');
19add_event_handler('loc_end_section_init', 'contact_form_section_init');
20add_event_handler('loc_end_index', 'contact_form_page');
21add_event_handler('blockmanager_apply', 'contact_form_applymenu', EVENT_HANDLER_PRIORITY_NEUTRAL+10);
22if (defined('IN_ADMIN'))
23{
24  add_event_handler('get_admin_plugin_menu_links', 'contact_form_admin_menu');
25}
26
27include(CONTACT_FORM_PATH . 'include/functions.inc.php');
28
29
30function contact_form_init()
31{
32  global $conf, $template;
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  }
41 
42  $template->set_prefilter('tail', 'contact_form_footer_link');
43}
44
45?>
Note: See TracBrowser for help on using the repository browser.