get_id() != 'menubar') return; $menu->register_block( new RegisteredBlock( 'mbContact', 'Contact', 'C1M')); } function c1m_apply($menu_ref_arr) { global $template, $user; //var_dump($user); $menu = & $menu_ref_arr[0]; load_language('plugin.lang', CONTACT_FORM_PATH); load_language('lang', PHPWG_ROOT_PATH.PWG_LOCAL_DIR, array('no_fallback'=>true, 'local'=>true) ); // Envoi des données au template $template->assign(array( 'C1MTITLE' => l10n('Contact'), 'C1MNAME' => l10n('Contact'), 'C1MURL' => CONTACT_FORM_PUBLIC, )); if (($block = $menu->get_block( 'mbContact' )) != null) { $template->set_template_dir(C1M_PATH.'template/'); if ($user['theme'] == 'bootstrapdefault'){ $block->template = 'menubar_contact_Bootstrap_Default.tpl'; }else if ($user['theme'] == 'smartpocket'){ $block->template = 'menubar_contact_smartpocket.tpl'; }else{ $block->template = 'menubar_contact.tpl'; } } } } ?>