/** * Rearrange menu items */ function aalborg_theme_pagesetup() { elgg_unextend_view('page/elements/header', 'search/header'); if (elgg_is_logged_in()) { elgg_extend_view('page/elements/sidebar', 'search/header', 0); } if (elgg_is_logged_in()) { elgg_register_menu_item('topbar', array('name' => 'account', 'text' => elgg_echo('account'), 'href' => "#", 'priority' => 100, 'section' => 'alt', 'link_class' => 'elgg-topbar-dropdown')); if (elgg_is_active_plugin('dashboard')) { $item = elgg_unregister_menu_item('topbar', 'dashboard'); if ($item) { $item->setText(elgg_echo('dashboard')); $item->setSection('default'); elgg_register_menu_item('site', $item); } } $item = elgg_get_menu_item('topbar', 'usersettings'); if ($item) { $item->setParentName('account'); $item->setText(elgg_echo('settings')); $item->setPriority(103); } $item = elgg_get_menu_item('topbar', 'logout'); if ($item) { $item->setParentName('account'); $item->setText(elgg_echo('logout')); $item->setPriority(104); } $item = elgg_get_menu_item('topbar', 'administration'); if ($item) { $item->setParentName('account'); $item->setText(elgg_echo('admin')); $item->setPriority(101); } if (elgg_is_active_plugin('site_notifications')) { $item = elgg_get_menu_item('topbar', 'site_notifications'); if ($item) { $item->setParentName('account'); $item->setText(elgg_echo('site_notifications:topbar')); $item->setPriority(102); } } if (elgg_is_active_plugin('reportedcontent')) { $item = elgg_unregister_menu_item('footer', 'report_this'); if ($item) { $item->setText(elgg_view_icon('report-this')); $item->setPriority(500); $item->setSection('default'); elgg_register_menu_item('extras', $item); } } } }
* The standard elgg top toolbar */ $site_url = elgg_get_site_url(); $user = get_loggedin_user()->username; $user_avatar = get_loggedin_user()->geticonURL('small'); $item = elgg_get_menu_item('topbar', 'profile'); if ($item) { $item->setText(elgg_echo('profile')); $item->setLinkClass('profile-avatar'); } $item = elgg_get_menu_item('topbar', 'friends'); if ($item) { $item->setText(elgg_echo('friends')); $item->setLinkClass('friend-icon'); } $item = elgg_get_menu_item('topbar', 'messages'); if ($item) { $item->setText(elgg_echo('messages')); $item->setItemClass('msg-icon'); } elgg_register_menu_item('user_menu_subMenu', array('name' => 'Dashboard', 'href' => 'dashboard', 'text' => 'Dashboard', 'title' => 'My Dashboard', 'class' => 'brdr-bttm')); elgg_register_menu_item('user_menu_subMenu', array('name' => 'Account Settings', 'href' => 'settings', 'text' => 'Account Settings', 'title' => 'Account Settings', 'class' => 'brdr-bttm mrgn-bttm-sm')); elgg_register_menu_item('user_menu_subMenu', array('name' => 'Log out', 'href' => $site_url . 'action/logout', 'text' => 'Log out', 'title' => 'Log out')); $dropdown = elgg_view_menu('user_menu_subMenu', array('class' => 'dropdown-menu pull-right subMenu')); elgg_register_menu_item('topbar', array('name' => 'Settings', 'text' => 'Settings' . $dropdown, 'title' => 'My Settings Dropdown', 'item_class' => 'dropdown', 'data-toggle' => 'dropdown', 'class' => ' dropdown-toggle settings-icon dropdownToggle', 'priority' => '800')); // Elgg logo echo elgg_view_menu('topbar', array('sort_by' => 'priority', 'class' => 'list-inline')); // elgg tools menu // need to echo this empty view for backward compatibility. echo elgg_view_deprecated("navigation/topbar_tools", array(), "Extend the topbar menus or the page/elements/topbar view directly", 1.8); //we are styling
/** * Rearrange menu items */ function time_theme_pagesetup() { elgg_unextend_view('page/elements/sidebar', 'search/header'); //elgg_extend_view('page/elements/topbar', 'search/header', 0); elgg_register_menu_item('topbar', array('name' => 'sidebar', 'href' => "#", 'text' => '<i class="sb-toggle-left fa fa-bars fa-lg"></i>', 'priority' => 50, 'link_class' => '')); elgg_unregister_menu_item('footer', 'powered'); if (elgg_is_logged_in()) { $user = elgg_get_logged_in_user_entity(); $username = $user->username; elgg_unregister_menu_item('topbar', 'messages'); $text = "<i class=\"fa fa-envelope fa-lg\"></i>"; $tooltip = elgg_echo("messages"); // get unread messages $num_messages = (int) messages_count_unread(); if ($num_messages != 0) { $text .= "<span class=\"elgg-topbar-new\">{$num_messages}</span>"; $tooltip .= ": " . elgg_echo("messages:unreadcount", array($num_messages)); } elgg_register_menu_item('topbar', array('name' => 'messages', 'href' => "messages/inbox/{$username}", 'text' => $text, 'section' => 'alt', 'priority' => 100, 'title' => $tooltip)); elgg_register_menu_item('topbar', array('href' => false, 'name' => 'search', 'text' => '<i class="fa fa-search fa-lg"></i>' . elgg_view('search/header'), 'priority' => 0, 'section' => 'alt')); $text = '<i class="fa fa-users fa-lg"></i>'; $tooltip = elgg_echo("friends"); $href = "/friends/" . $username; if (elgg_is_active_plugin('friend_request')) { elgg_unregister_menu_item('topbar', 'friend_request'); $options = array("type" => "user", "count" => true, "relationship" => "friendrequest", "relationship_guid" => $user->getGUID(), "inverse_relationship" => true); $count = elgg_get_entities_from_relationship($options); if (!empty($count)) { $text .= "<span class=\"elgg-topbar-new\">{$count}</span>"; $tooltip = elgg_echo("friend_request:menu") . ": " . $count; $href = "friend_request/" . $username; } } elgg_unregister_menu_item('topbar', 'friends'); elgg_register_menu_item('topbar', array('href' => $href, 'name' => 'friends', 'text' => $text, 'section' => 'alt', 'priority' => 200, 'title' => $tooltip)); $viewer = elgg_get_logged_in_user_entity(); elgg_unregister_menu_item('topbar', 'profile'); elgg_register_menu_item('topbar', array('name' => 'profile', 'href' => $viewer->getURL(), 'text' => elgg_view('output/img', array('src' => $viewer->getIconURL('small'), 'alt' => $viewer->name, 'title' => elgg_echo('profile'), 'class' => 'elgg-border-plain elgg-transition')) . '<span class="profile-text">' . elgg_get_excerpt($viewer->name, 20) . '</span>', 'priority' => 500, 'link_class' => 'elgg-topbar-avatar', 'item_class' => 'elgg-avatar elgg-avatar-topbar')); elgg_register_menu_item('topbar', array('name' => 'home', 'text' => '<i class="fa fa-home fa-lg"></i> ', 'href' => "/", 'priority' => 90, 'section' => 'alt')); elgg_register_menu_item('topbar', array('name' => 'account', 'text' => '<i class="fa fa-cog fa-lg"></i> ', 'href' => "#", 'priority' => 300, 'section' => 'alt', 'link_class' => 'elgg-topbar-dropdown')); if (elgg_is_active_plugin('dashboard')) { $item = elgg_unregister_menu_item('topbar', 'dashboard'); if ($item) { $item->setText(elgg_echo('dashboard')); $item->setSection('default'); elgg_register_menu_item('site', $item); } } $item = elgg_unregister_menu_item('extras', 'bookmark'); if ($item) { $item->setText('<i class="fa fa-bookmark fa-lg"></i>'); elgg_register_menu_item('extras', $item); } elgg_unregister_menu_item('extras', 'rss'); /*if ($item) { $item->setText('<i class="fa fa-rss fa-lg"></i>'); elgg_register_menu_item('extras', $item); }*/ $url = elgg_format_url($url); elgg_register_menu_item('extras', array('name' => 'rss', 'text' => '<i class="fa fa-rss fa-lg"></i>', 'href' => $url, 'title' => elgg_echo('feed:rss'))); $item = elgg_get_menu_item('topbar', 'usersettings'); if ($item) { $item->setParentName('account'); $item->setText(elgg_echo('settings')); $item->setPriority(103); } $item = elgg_get_menu_item('topbar', 'logout'); if ($item) { $item->setParentName('account'); $item->setText(elgg_echo('logout')); $item->setPriority(104); } $item = elgg_get_menu_item('topbar', 'administration'); if ($item) { $item->setParentName('account'); $item->setText(elgg_echo('admin')); $item->setPriority(101); } if (elgg_is_active_plugin('site_notifications')) { $item = elgg_get_menu_item('topbar', 'site_notifications'); if ($item) { $item->setParentName('account'); $item->setText(elgg_echo('site_notifications:topbar')); $item->setPriority(102); } } if (elgg_is_active_plugin('reportedcontent')) { $item = elgg_unregister_menu_item('footer', 'report_this'); if ($item) { $item->setText('<i class="fa fa-flag fa-lg"></i>'); $item->setPriority(500); $item->setSection('default'); elgg_register_menu_item('extras', $item); } } } }
/** * Rearrange menu items * Reorganizar los elementos del menu. */ function podemos_theme19_pagesetup() { /* //DESXTENDER LA VISTA search/header DE LA DE page/elements/header //¿QUE ESTARÁ EXTENDIDA POR EL CORE? elgg_unextend_view('page/elements/header', 'search/header'); //SOLO SE EXTIENDE A LOS USUARIOS LOGUEADOS. if (elgg_is_logged_in()) { elgg_extend_view('page/elements/topbar', 'search/header', 0); } */ if (elgg_is_logged_in()) { /*CAMBIAMOS EL TEXTO (TEXT) POR UNA IMAGEN (antes elgg_echo('account'))*/ elgg_register_menu_item('topbar', array('name' => 'account', 'text' => "<img src='" . elgg_get_site_url() . "/mod/podemos_theme19/graphics/cuenta.png'/>", 'href' => "#", 'priority' => 100, 'section' => 'alt', 'link_class' => 'elgg-topbar-dropdown')); if (elgg_is_active_plugin('dashboard')) { $item = elgg_unregister_menu_item('topbar', 'dashboard'); if ($item) { $item->setText(elgg_echo('dashboard')); $item->setSection('default'); elgg_register_menu_item('site', $item); } } $item = elgg_get_menu_item('topbar', 'usersettings'); if ($item) { $item->setParentName('account'); $item->setText(elgg_echo('settings')); $item->setPriority(103); } $item = elgg_get_menu_item('topbar', 'logout'); if ($item) { $item->setParentName('account'); $item->setText(elgg_echo('logout')); $item->setPriority(104); } $item = elgg_get_menu_item('topbar', 'administration'); if ($item) { $item->setParentName('account'); $item->setText(elgg_echo('admin')); $item->setPriority(101); } if (elgg_is_active_plugin('site_notifications')) { $item = elgg_get_menu_item('topbar', 'site_notifications'); if ($item) { $item->setParentName('account'); $item->setText(elgg_echo('site_notifications:topbar')); $item->setPriority(102); } } if (elgg_is_active_plugin('reportedcontent')) { $item = elgg_unregister_menu_item('footer', 'report_this'); if ($item) { $item->setText(elgg_view_icon('report-this')); $item->setPriority(500); $item->setSection('default'); elgg_register_menu_item('extras', $item); } } } }
/** * Rearrange menu items */ function wet4_theme_pagesetup() { if (elgg_is_logged_in()) { elgg_register_menu_item('topbar', array('name' => 'account', 'text' => elgg_echo('account'), 'href' => "#", 'priority' => 100, 'section' => 'alt', 'link_class' => 'elgg-topbar-dropdown')); if (elgg_is_active_plugin('dashboard')) { $item = elgg_unregister_menu_item('topbar', 'dashboard'); if ($item) { $item->setText(elgg_echo('dashboard')); $item->setSection('default'); elgg_register_menu_item('site', $item); } } $item = elgg_get_menu_item('topbar', 'usersettings'); if ($item) { $item->setParentName('account'); $item->setText(elgg_echo('settings')); $item->setPriority(103); } $item = elgg_get_menu_item('topbar', 'logout'); if ($item) { $item->setParentName('account'); $item->setText(elgg_echo('logout')); $item->setPriority(104); } $item = elgg_get_menu_item('topbar', 'administration'); if ($item) { $item->setParentName('account'); $item->setText(elgg_echo('admin')); $item->setPriority(101); } if (elgg_is_active_plugin('site_notifications')) { $item = elgg_get_menu_item('topbar', 'site_notifications'); if ($item) { $item->setParentName('account'); $item->setText(elgg_echo('site_notifications:topbar')); $item->setPriority(102); } } if (elgg_is_active_plugin('reportedcontent')) { $item = elgg_unregister_menu_item('footer', 'report_this'); if ($item) { $item->setText(elgg_view_icon('report-this')); $item->setPriority(500); $item->setSection('default'); elgg_register_menu_item('extras', $item); } } //style colleague requests tab $context = elgg_get_context(); $page_owner = elgg_get_page_owner_entity(); if (elgg_is_logged_in()) { $user = elgg_get_logged_in_user_guid(); } if ($page_owner->guid == $user) { // Show menu link in the correct context if (in_array($context, array("friends", "friendsof", "collections"))) { $options = array("type" => "user", "count" => true, "relationship" => "friendrequest", "relationship_guid" => $page_owner->getGUID(), "inverse_relationship" => true); $count = elgg_get_entities_from_relationship($options); $extra = ""; if (!empty($count)) { if ($count >= 10) { //$count = '9+'; } $extra = '<span class="notif-badge">' . $count . '</span>'; } // add menu item $menu_item = array("name" => "friend_request", "text" => elgg_echo("friend_request:menu") . $extra, "href" => "friend_request/" . $page_owner->username, "contexts" => array("friends", "friendsof", "collections")); elgg_register_menu_item("page", $menu_item); } } if (elgg_in_context('messages')) { elgg_unregister_menu_item("page", "friend_request"); } } /* * Control colleague requests in topbar menu * taken from friend_request module * edited to place badge on colleagues instead of creating new icon */ $user = elgg_get_logged_in_user_entity(); $params = array("name" => "Colleagues", "href" => "friends/" . $user->username, "text" => '<i class="fa fa-users mrgn-rght-sm mrgn-tp-sm fa-lg"></i><span class="hidden-xs">' . elgg_echo("friends") . '</span>', "title" => elgg_echo('friends'), "class" => '', 'item_class' => '', 'priority' => '1'); elgg_register_menu_item("user_menu", $params); $context = elgg_get_context(); $page_owner = elgg_get_page_owner_entity(); // Remove link to friendsof elgg_unregister_menu_item("page", "friends:of"); //Settings notifications stuff elgg_unregister_menu_item('page', '2_a_user_notify'); $params = array("name" => "2_a_user_notify", "href" => "/settings/plugins/" . $user->username . "/cp_notifications", "text" => elgg_echo('notifications:subscriptions:changesettings'), 'section' => 'configure', "class" => 'TESTING', 'item_class' => '', 'priority' => '100', 'context' => 'settings'); elgg_register_menu_item("page", $params); if (!empty($user)) { $options = array("type" => "user", "count" => true, "relationship" => "friendrequest", "relationship_guid" => $user->getGUID(), "inverse_relationship" => true); $count = elgg_get_entities_from_relationship($options); if (!empty($count)) { //user menu $countTitle = $count; //display 9+ instead of huge numbers in notif badge if ($count >= 10) { $count = '9+'; } $params = array("name" => "Colleagues", "href" => "friends/" . $user->username, "text" => '<i class="fa fa-users mrgn-rght-sm mrgn-tp-sm fa-lg"></i><span class="hidden-xs">' . elgg_echo("friends") . "</span><span class='notif-badge'>" . $count . "</span>", "title" => elgg_echo('userMenu:colleagues') . ' - ' . $countTitle . ' ' . elgg_echo('friend_request') . '(s)', "class" => '', 'item_class' => '', 'priority' => '1'); elgg_register_menu_item("user_menu", $params); //topbar $params = array("name" => "friends", "href" => "friends/" . $user->username, "text" => elgg_echo("friends") . "<span class='badge'>" . $count . "</span>", "title" => elgg_echo('friends') . ' - Requests(' . $count . ')', "class" => 'friend-icon'); elgg_register_menu_item("topbar", $params); } } //likes and stuff yo $item = elgg_get_menu_item('entity', 'likes'); if ($item) { $item->setText('likes'); $item->setItemClass('msg-icon'); } $item = elgg_get_menu_item('entity', 'delete'); if ($item) { echo '<div> What that mean?</div>'; } if (elgg_is_logged_in() && elgg_get_config('allow_registration')) { $params = array('name' => 'invite', 'text' => elgg_echo('friends:invite'), 'href' => "invite/" . $user->username, 'contexts' => array('friends'), 'priority' => 300); elgg_register_menu_item('page', $params); } //new folder button for files if (elgg_is_logged_in()) { $user = elgg_get_logged_in_user_entity(); if ($user->canEdit()) { $params = array('name' => 'new_folder', 'text' => elgg_echo("file_tools:new:title"), 'href' => "#", "id" => "file_tools_list_new_folder_toggle", 'item_class' => 'mrgn-lft-sm', 'context' => 'file'); elgg_register_menu_item('title2', $params); } } }
/** * Rearrange menu items */ function wet4_theme_pagesetup() { //elgg_load_js('elgg/dev'); //elgg_load_js('elgg/reportedcontent'); if (elgg_is_logged_in()) { elgg_register_menu_item('topbar', array('name' => 'account', 'text' => elgg_echo('account'), 'href' => "#", 'priority' => 100, 'section' => 'alt', 'link_class' => 'elgg-topbar-dropdown')); if (elgg_is_active_plugin('dashboard')) { $item = elgg_unregister_menu_item('topbar', 'dashboard'); if ($item) { $item->setText(elgg_echo('dashboard')); $item->setSection('default'); elgg_register_menu_item('site', $item); } } $item = elgg_get_menu_item('topbar', 'usersettings'); if ($item) { $item->setParentName('account'); $item->setText(elgg_echo('settings')); $item->setPriority(103); } $item = elgg_get_menu_item('topbar', 'logout'); if ($item) { $item->setParentName('account'); $item->setText(elgg_echo('logout')); $item->setPriority(104); } $item = elgg_get_menu_item('topbar', 'administration'); if ($item) { $item->setParentName('account'); $item->setText(elgg_echo('admin')); $item->setPriority(101); } if (elgg_is_active_plugin('site_notifications')) { $item = elgg_get_menu_item('topbar', 'site_notifications'); if ($item) { $item->setParentName('account'); $item->setText(elgg_echo('site_notifications:topbar')); $item->setPriority(102); } } if (elgg_is_active_plugin('reportedcontent')) { $item = elgg_unregister_menu_item('footer', 'report_this'); if ($item) { $item->setText(elgg_view_icon('report-this')); $item->setPriority(500); $item->setSection('default'); elgg_register_menu_item('extras', $item); } } /* if ($item->canEdit()) { $control = elgg_view("output/url",array( 'href' => elgg_get_site_url() . "action/plugin_name/delete?guid=" . $entity->guid, 'text' => 'Delete ME!', 'is_action' => true, 'is_trusted' => true, 'confirm' => elgg_echo('deleteconfirm'), 'class' => 'testing', )); }*/ } /* * Control colleague requests in topbar menu * taken from friend_request module * edited to place badge on colleagues instead of creating new icon */ $user = elgg_get_logged_in_user_entity(); $params = array("name" => "Colleagues", "href" => "friends/" . $user->username, "text" => '<i class="fa fa-users mrgn-rght-sm mrgn-tp-sm fa-lg"></i><span class="hidden-xs">' . elgg_echo("friends") . '</span>', "title" => elgg_echo('friends'), "class" => '', 'item_class' => '', 'priority' => '1'); elgg_register_menu_item("user_menu", $params); $context = elgg_get_context(); $page_owner = elgg_get_page_owner_entity(); // Remove link to friendsof elgg_unregister_menu_item("page", "friends:of"); if (!empty($user)) { $options = array("type" => "user", "count" => true, "relationship" => "friendrequest", "relationship_guid" => $user->getGUID(), "inverse_relationship" => true); $count = elgg_get_entities_from_relationship($options); if (!empty($count)) { //user menu $countTitle = $count; //display 9+ instead of huge numbers in notif badge if ($count >= 10) { $count = '9+'; } $params = array("name" => "Colleagues", "href" => "friends/" . $user->username, "text" => '<i class="fa fa-users mrgn-rght-sm mrgn-tp-sm fa-lg"></i><span class="hidden-xs">' . elgg_echo("friends") . "</span><span class='notif-badge'>" . $count . "</span>", "title" => elgg_echo('userMenu:colleagues') . ' - ' . $countTitle . ' ' . elgg_echo('friend_request') . '(s)', "class" => '', 'item_class' => '', 'priority' => '1'); elgg_register_menu_item("user_menu", $params); //topbar $params = array("name" => "friends", "href" => "friends/" . $user->username, "text" => elgg_echo("friends") . "<span class='badge'>" . $count . "</span>", "title" => elgg_echo('friends') . ' - Requests(' . $count . ')', "class" => 'friend-icon'); elgg_register_menu_item("topbar", $params); } } //likes and stuff yo $item = elgg_get_menu_item('entity', 'likes'); if ($item) { $item->setText('likes'); $item->setItemClass('msg-icon'); } $item = elgg_get_menu_item('entity', 'delete'); if ($item) { echo '<div> What that mean?</div>'; } if (elgg_is_logged_in() && elgg_get_config('allow_registration')) { $params = array('name' => 'invite', 'text' => elgg_echo('friends:invite'), 'href' => "invite", 'contexts' => array('friends'), 'priority' => 300); elgg_register_menu_item('page', $params); } }