Changeset 25872 for extensions/ContactForm/main.inc.php
- Timestamp:
- Dec 9, 2013, 5:34:37 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ContactForm/main.inc.php
r24347 r25872 31 31 add_event_handler('loc_end_section_init', 'contact_form_section_init'); 32 32 add_event_handler('loc_end_index', 'contact_form_page'); 33 add_event_handler('blockmanager_apply', 'contact_form_applymenu', EVENT_HANDLER_PRIORITY_NEUTRAL+10);34 33 } 34 35 add_event_handler('blockmanager_apply', 'contact_form_applymenu', EVENT_HANDLER_PRIORITY_NEUTRAL+10); 36 add_event_handler('before_parse_mail_template', 'contact_form_mail_template', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 35 37 36 38 include(CONTACT_FORM_PATH . 'include/functions.inc.php'); … … 43 45 { 44 46 global $conf, $template, $pwg_loaded_plugins; 45 46 if ( 47 CONTACT_FORM_VERSION == 'auto' or 48 $pwg_loaded_plugins[CONTACT_FORM_ID]['version'] == 'auto' or 49 version_compare($pwg_loaded_plugins[CONTACT_FORM_ID]['version'], CONTACT_FORM_VERSION, '<') 50 ) 51 { 52 include_once(CONTACT_FORM_PATH . 'include/install.inc.php'); 53 contact_form_install(); 54 55 if ( $pwg_loaded_plugins[CONTACT_FORM_ID]['version'] != 'auto' and CONTACT_FORM_VERSION != 'auto' ) 56 { 57 $query = ' 58 UPDATE '. PLUGINS_TABLE .' 59 SET version = "'. CONTACT_FORM_VERSION .'" 60 WHERE id = "'. CONTACT_FORM_ID .'"'; 61 pwg_query($query); 62 63 $pwg_loaded_plugins[CONTACT_FORM_ID]['version'] = CONTACT_FORM_VERSION; 64 65 if (defined('IN_ADMIN')) 66 { 67 $_SESSION['page_infos'][] = 'ContactForm updated to version '. CONTACT_FORM_VERSION; 68 } 69 } 70 } 71 47 48 include_once(CONTACT_FORM_PATH . 'maintain.inc.php'); 49 $maintain = new ContactForm_maintain(CONTACT_FORM_ID); 50 $maintain->autoUpdate(CONTACT_FORM_VERSION, 'install'); 51 72 52 $conf['ContactForm'] = unserialize($conf['ContactForm']); 73 53 load_language('plugin.lang', CONTACT_FORM_PATH); 74 54 load_language('lang', PHPWG_ROOT_PATH.PWG_LOCAL_DIR, array('no_fallback'=>true, 'local'=>true)); 75 55 76 56 if ($conf['ContactForm']['cf_must_initialize']) 77 57 { 78 58 contact_form_initialize_emails(); 79 59 } 80 81 $conf['ContactForm ']['cf_ready'] = count(get_contact_emails());82 83 if ($conf['ContactForm ']['cf_ready'] && (!is_a_guest() || $conf['ContactForm']['cf_allow_guest']))60 61 $conf['ContactForm_ready'] = count(get_contact_emails()); 62 63 if ($conf['ContactForm_ready'] && (!is_a_guest() || $conf['ContactForm']['cf_allow_guest'])) 84 64 { 85 $template->assign('CONTACT_MAIL', true); 65 $template->assign(array( 66 'CONTACT_MAIL' => true, 67 'CONTACT_FORM_PUBLIC' => CONTACT_FORM_PUBLIC, 68 )); 86 69 $template->set_prefilter('tail', 'contact_form_footer_link'); 87 70 } … … 89 72 90 73 /** 91 * admin plugins menu link 74 * admin plugins menu link 92 75 */ 93 function contact_form_admin_menu($menu) 76 function contact_form_admin_menu($menu) 94 77 { 95 array_push($menu,array(78 $menu[] = array( 96 79 'URL' => CONTACT_FORM_ADMIN, 97 80 'NAME' => 'Contact Form', 98 ) );81 ); 99 82 return $menu; 100 83 } 101 102 ?>
Note: See TracChangeset
for help on using the changeset viewer.