Changeset 18824 for extensions
- Timestamp:
- Oct 31, 2012, 3:27:46 PM (12 years ago)
- Location:
- extensions/Contact1menu
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Contact1menu/initadmin.php
r18772 r18824 1 1 <?php 2 2 add_event_handler('loc_begin_admin_page', 'C1M_admin_menu' ); 3 3 4 4 function C1M_admin_menu() 5 5 { 6 6 global $page,$conf; 7 7 8 8 load_language('plugin.lang', C1M_PATH); 9 $page['errors'][] = l10n(' Plugin Contact form must be installe and activate for use Contact 1menu');9 $page['errors'][] = l10n('The plugin ContactForm must be installed and activated in order to use Contact1menu'); 10 10 11 11 } -
extensions/Contact1menu/main.inc.php
r18822 r18824 17 17 18 18 if($desacc['state'] != 'active') 19 {20 if (script_basename() == 'admin')21 19 { 22 include_once(dirname(__FILE__).'/initadmin.php'); 20 if (script_basename() == 'admin') 21 { 22 include_once(dirname(__FILE__).'/initadmin.php'); 23 } 23 24 } 24 }25 25 else 26 { 26 { 27 add_event_handler('blockmanager_register_blocks', 'register_c1m_menubar_blocks'); 28 add_event_handler('blockmanager_apply', 'c1m_apply'); 27 29 28 add_event_handler('blockmanager_register_blocks', 'register_c1m_menubar_blocks'); 29 add_event_handler('blockmanager_apply', 'c1m_apply'); 30 function register_c1m_menubar_blocks( $menu_ref_arr ) 31 { 32 $menu = & $menu_ref_arr[0]; 33 if ($menu->get_id() != 'menubar') 34 return; 35 $menu->register_block( new RegisteredBlock( 'mbContact', 'Contact', 'C1M')); 36 } 30 37 31 function register_c1m_menubar_blocks( $menu_ref_arr ) 32 { 33 $menu = & $menu_ref_arr[0]; 34 if ($menu->get_id() != 'menubar') 35 return; 36 $menu->register_block( new RegisteredBlock( 'mbContact', 'Contact', 'C1M')); 38 function c1m_apply($menu_ref_arr) 39 { 40 global $template; 41 42 $menu = & $menu_ref_arr[0]; 43 44 load_language('plugin.lang', CONTACT_FORM_PATH); 45 load_language('lang', PHPWG_ROOT_PATH.PWG_LOCAL_DIR, array('no_fallback'=>true, 'local'=>true) ); 46 // Envoi des données au template 47 $template->assign(array( 48 'C1MTITLE' => l10n('Contact'), 49 'C1MNAME' => l10n('Contact'), 50 'C1MURL' => CONTACT_FORM_PUBLIC, 51 )); 52 53 54 if (($block = $menu->get_block( 'mbContact' )) != null) 55 { 56 $template->set_template_dir(C1M_PATH.'template/'); 57 $block->template = 'menubar_contact.tpl'; 58 } 59 } 37 60 } 38 61 39 function c1m_apply($menu_ref_arr)40 {41 global $template;42 43 $menu = & $menu_ref_arr[0];44 45 load_language('plugin.lang', CF_PATH);46 load_language('lang', PHPWG_ROOT_PATH.PWG_LOCAL_DIR, array('no_fallback'=>true, 'local'=>true) );47 // Envoi des données au template48 $template->assign (49 array (50 'C1MTITLE' => l10n('contact_form_title'),51 'C1MNAME' => l10n('contact_form'),52 'C1MURL' => get_root_url().'index.php?/contact',53 ) );54 55 56 if (($block = $menu->get_block( 'mbContact' )) != null) {57 $template->set_template_dir(C1M_PATH.'template/');58 $block->template = 'menubar_contact.tpl';59 }60 }61 }62 63 62 ?>
Note: See TracChangeset
for help on using the changeset viewer.