Changeset 17483 for extensions/ContactForm/main.inc.php
- Timestamp:
- Aug 9, 2012, 12:10:04 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ContactForm/main.inc.php
r16549 r17483 5 5 Description: Add a "Contact" item in the Menu block to offer a contact form to users 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=304 7 Author: Criss, Gotcha8 Author URI: http://piwigo.org /7 Author: Piwigo Team 8 Author URI: http://piwigo.org 9 9 */ 10 10 11 11 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 12 12 13 define('CF_PATH', PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 14 define('CF_ROOT', dirname(__FILE__).'/'); 15 include_once(CF_PATH . 'include/cf_common.inc.php'); 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__))); 16 15 17 $cf_plugin = new CF_Plugin($plugin['id']); 18 add_event_handler('loc_begin_index', 19 array(&$cf_plugin, 'loc_begin_index')); 20 add_event_handler('loc_begin_page_tail', 21 array(&$cf_plugin, 'loc_begin_page_header')); 22 add_event_handler('blockmanager_apply', 23 array(&$cf_plugin, 'blockmanager_apply'), 24 EVENT_HANDLER_PRIORITY_NEUTRAL+10); 25 add_event_handler('loc_end_index', 26 array(&$cf_plugin, 'loc_end_index')); 27 add_event_handler('loc_end_page_tail', 28 array(&$cf_plugin, 'loc_end_page_tail')); 29 if(defined('IN_ADMIN')) { 30 add_event_handler('get_admin_plugin_menu_links', 31 array(&$cf_plugin, 'get_admin_plugin_menu_links')); 16 17 add_event_handler('init', 'contact_form_init'); 18 add_event_handler('loc_end_section_init', 'contact_form_section_init'); 19 add_event_handler('loc_end_index', 'contact_form_page'); 20 add_event_handler('blockmanager_apply', 'contact_form_applymenu', EVENT_HANDLER_PRIORITY_NEUTRAL+10); 21 if (defined('IN_ADMIN')) 22 { 23 add_event_handler('get_admin_plugin_menu_links', 'contact_form_admin_menu'); 32 24 } 33 set_plugin_data($plugin['id'], $cf_plugin); 25 26 include(CONTACT_FORM_PATH . 'include/functions.inc.php'); 27 28 29 function contact_form_init() 30 { 31 global $conf; 32 $conf['ContactForm'] = unserialize($conf['ContactForm']); 33 34 load_language('plugin.lang', CONTACT_FORM_PATH); 35 36 if ($conf['ContactForm']['cf_must_initialize']) 37 { 38 contact_form_initialize_emails(); 39 } 40 } 41 34 42 ?>
Note: See TracChangeset
for help on using the changeset viewer.