/** * Register title menu items */ function hj_inbox_title_menu_setup($entity = null) { $user = elgg_get_page_owner_entity(); if (!elgg_instanceof($entity)) { $outtypes = hj_inbox_get_outgoing_message_types($user); if ($outtypes) { foreach ($outtypes as $type) { elgg_register_menu_item('title', array('name' => "compose:{$type}", 'text' => '<i class="inbox-icon-message-plus icon-small"></i><span>' . elgg_echo("item:object:message:{$type}:singular") . '</span>', 'href' => elgg_http_add_url_query_elements("messages/compose", array('message_type' => $type, 'send_to' => get_input('send_to', null))), 'class' => 'elgg-button elgg-button-action')); } } } }
<?php $message_type = elgg_extract('message_type', $vars, 'all'); $user = elgg_get_page_owner_entity(); $i = 100; $tabs = array(); $message_types = hj_inbox_get_outgoing_message_types($user); if ($message_types) { foreach ($message_types as $type) { $text = elgg_echo("item:object:message:{$type}:plural"); $tabs[$type] = array('text' => $text, 'href' => "messages/sent/{$user->username}?message_type={$type}", 'priority' => $i++, 'class' => 'inbox-load'); } } foreach ($tabs as $name => $tab) { if ($tab) { $tab['name'] = $name; $tab['selected'] = $message_type == $name; elgg_register_menu_item('filter', $tab); } } echo elgg_view_menu('filter', array('sort_by' => 'priority', 'class' => 'elgg-menu-hz'));