get_id() != 'menubar') return; $menu->register_block( new RegisteredBlock( 'mbContact', 'Contact', 'C1M')); } function c1m_apply($menu_ref_arr) { global $template, $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) ); $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'; } } } } add_event_handler('blockmanager_apply' , 'remove_item_contact', EVENT_HANDLER_PRIORITY_NEUTRAL+50); function remove_item_contact($menu_ref_arr){ if (($block = $menu_ref_arr[0]->get_block('mbMenu')) != null){ unset($block->data['contact']); } } ?>