2017 © Pedro Peláez
 

elgg-plugin menus_api

Menus API

image

hypejunction/menus_api

Menus API

  • Wednesday, February 10, 2016
  • by hypeJunction
  • Repository
  • 1 Watchers
  • 0 Stars
  • 36 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Menus API

Elgg 2.0, (*1)

Various convenient functions and views for working with menus, (*2)

Title Menu, (*3)

Usage

Combine menus

$menu_items = menus_api_combine_menus([
    'entity',
    'owner_block',
    'user_hover'
], [
    'entity' => $user,
]);

Get menu items

$params = menus_api_prepare_params('user_hover', ['entity' => 'user]);
$items = menus_api_get_menu('user_hover', $params);

Add icon and indicator

$item = ElggMenuItem::factory([
    'name' => 'messages',
    'text' => 'New messages',
    'href' => '/messages',
    'data' => [
        'indicator' => 5,
        'icon' => 'envelope',
        'require' => ['js/menu/module'],
    ]
]);

Only show certain menu sections

echo menus_api_view_menu('user_hover', [
    'entity' => $user,
    'sections' => ['admin', 'action'],
    'sort_by' => 'priority',
]);

Child menu subsections

You can break down child menus into subsections, and list them in a predefined order., (*4)

$parent = ElggMenuItem::factory([
    'name' => 'parent',
    'text' => 'Parent',
    'data' => [
        'subsections' => ['actions', 'admin']
    ]
]);


$item = ElggMenuItem::factory([
    'name' => 'action',
    'parent_name' => 'parent',
    'text' => 'Action',
    'data' => [
        'subsection' => 'actions'
    ]
]);

Note

  • This plugin replaces the default menu, section and item views

The Versions

10/02 2016

dev-master

9999999-dev http://hypejunction.com

Menus API

  Sources   Download

GPL-2.0

The Development Requires

by Ismayil Khayredinov

plugin menus elgg

10/02 2016

1.1.1

1.1.1.0 http://hypejunction.com

Menus API

  Sources   Download

GPL-2.0

The Development Requires

by Ismayil Khayredinov

plugin menus elgg

27/01 2016

1.1.0

1.1.0.0 http://hypejunction.com

Menus API

  Sources   Download

GPL-2.0

The Development Requires

by Ismayil Khayredinov

plugin menus elgg

26/01 2016

1.0.3

1.0.3.0 http://hypejunction.com

Menus API

  Sources   Download

GPL-2.0

The Development Requires

by Ismayil Khayredinov

plugin menus elgg

21/01 2016

1.0.2

1.0.2.0 http://hypejunction.com

Menus API

  Sources   Download

GPL-2.0

The Development Requires

by Ismayil Khayredinov

plugin menus elgg