Elgg  Version 6.1
add_button.php
Go to the documentation of this file.
1 <?php
6 $href = elgg_generate_url('widgets:add_panel', [
7  'context' => elgg_get_context(),
8  'context_stack' => elgg_get_context_stack(),
9  'show_access' => elgg_extract('show_access', $vars, true),
10  'owner_guid' => elgg_extract('owner_guid', $vars, elgg_get_page_owner_guid()),
11  'new_widget_column' => elgg_extract('new_widget_column', $vars),
12  'new_widget_position' => elgg_extract('new_widget_position', $vars),
13 ]);
14 
15 echo elgg_view_menu('title:widgets', [
16  'items' => [
17  [
18  'name' => 'widgets_add',
19  'href' => false,
20  'text' => elgg_echo('widgets:add'),
21  'icon' => 'cog',
22  'link_class' => 'elgg-lightbox elgg-more',
23  'data-colorbox-opts' => json_encode([
24  'href' => $href,
25  'maxWidth' => '900px',
26  'maxHeight' => '90%',
27  ]),
28  ],
29  ],
30  'class' => 'elgg-menu-hz',
31 ]);
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
elgg_get_context()
Get the current context.
Definition: context.php:41
elgg_get_page_owner_guid()
Elgg page owner library.
Definition: pageowner.php:12
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:256
elgg_view_menu($menu, array $vars=[])
Render a menu.
Definition: views.php:441
$href
Button area for showing the add widgets panel.
Definition: add_button.php:6
$vars
Definition: theme.php:5
elgg_generate_url(string $name, array $parameters=[])
Generate a URL for named route.
elgg_get_context_stack()
Get the entire context stack (e.g.
Definition: context.php:88