Changeset 17945 for extensions/ContactForm/main.inc.php
- Timestamp:
- Sep 16, 2012, 5:20:39 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ContactForm/main.inc.php
r17658 r17945 11 11 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 12 12 13 define('CONTACT_FORM_PATH', PHPWG_PLUGINS_PATH . 'ContactForm/'); 14 define('CONTACT_FORM_ADMIN', get_root_url() . 'admin.php?page=plugin-ContactForm'); 15 define('CONTACT_FORM_PUBLIC', get_absolute_root_url() . make_index_url(array('section' => 'contact')) . '/'); 16 define('CONTACT_FORM_VERSION', '2.4.d'); 13 global $prefixeTable; 14 15 defined('CONTACT_FORM_ID') or define('CONTACT_FORM_ID', basename(dirname(__FILE__))); 16 define('CONTACT_FORM_PATH', PHPWG_PLUGINS_PATH . CONTACT_FORM_ID . '/'); 17 define('CONTACT_FORM_ADMIN', get_root_url() . 'admin.php?page=plugin-' . CONTACT_FORM_ID); 18 define('CONTACT_FORM_PUBLIC', get_absolute_root_url() . make_index_url(array('section' => 'contact')) . '/'); 19 define('CONTACT_FORM_TABLE', $prefixeTable .'contact_form'); 20 define('CONTACT_FORM_VERSION', '2.5.0'); 17 21 18 22 19 23 add_event_handler('init', 'contact_form_init'); 20 24 21 add_event_handler('loc_end_section_init', 'contact_form_section_init');22 add_event_handler('loc_end_index', 'contact_form_page');23 add_event_handler('blockmanager_apply', 'contact_form_applymenu', EVENT_HANDLER_PRIORITY_NEUTRAL+10);24 25 25 if (defined('IN_ADMIN')) 26 26 { 27 27 add_event_handler('get_admin_plugin_menu_links', 'contact_form_admin_menu'); 28 } 29 else 30 { 31 add_event_handler('loc_end_section_init', 'contact_form_section_init'); 32 add_event_handler('loc_end_index', 'contact_form_page'); 33 add_event_handler('blockmanager_apply', 'contact_form_applymenu', EVENT_HANDLER_PRIORITY_NEUTRAL+10); 28 34 } 29 35 … … 39 45 40 46 if ( 41 $pwg_loaded_plugins[ 'ContactForm']['version'] == 'auto' or42 version_compare($pwg_loaded_plugins[ 'ContactForm']['version'], CONTACT_FORM_VERSION, '<')47 $pwg_loaded_plugins[CONTACT_FORM_ID]['version'] == 'auto' or 48 version_compare($pwg_loaded_plugins[CONTACT_FORM_ID]['version'], CONTACT_FORM_VERSION, '<') 43 49 ) 44 50 { … … 46 52 contact_form_install(); 47 53 48 if ($pwg_loaded_plugins[ 'ContactForm']['version'] != 'auto')54 if ($pwg_loaded_plugins[CONTACT_FORM_ID]['version'] != 'auto') 49 55 { 50 56 $query = ' 51 57 UPDATE '. PLUGINS_TABLE .' 52 58 SET version = "'. CONTACT_FORM_VERSION .'" 53 WHERE id = " ContactForm"';59 WHERE id = "'. CONTACT_FORM_ID .'"'; 54 60 pwg_query($query); 55 61 56 $pwg_loaded_plugins[ 'ContactForm']['version'] = CONTACT_FORM_VERSION;62 $pwg_loaded_plugins[CONTACT_FORM_ID]['version'] = CONTACT_FORM_VERSION; 57 63 58 64 if (defined('IN_ADMIN'))
Note: See TracChangeset
for help on using the changeset viewer.