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