Elgg  Version 4.3
submit.php
Go to the documentation of this file.
1 <?php
8 $item = elgg_extract('item', $vars);
9 if (!$item instanceof \ElggMenuItem) {
10  return;
11 }
12 
13 unset($vars['item']);
14 
15 $vars = array_merge($item->getValues(), $vars);
16 $vars['class'] = elgg_extract_class($vars, ['elgg-menu-content']);
17 
18 if ($item->getLinkClass()) {
19  $vars['class'] = array_merge($vars['class'], explode(' ', $item->getLinkClass()));
20 }
21 
23 if (!elgg_is_empty($href)) {
24  // the href of the menu item is used as the custom formaction for the button
25  $vars['formaction'] = $href;
26 }
27 unset($vars['href']);
28 
29 if ($item->getConfirmText()) {
30  $vars['confirm'] = $item->getConfirmText();
31 }
32 
33 echo elgg_view('input/submit', $vars);
$vars['type']
Renders a <button type="submit">
Definition: submit.php:10
elgg_extract_class(array $array, $existing=[], $extract_key= 'class')
Extract class names from an array, optionally merging into a preexisting set.
Definition: elgglib.php:569
elgg_is_empty($value)
Check if a value isn&#39;t empty, but allow 0 and &#39;0&#39;.
Definition: input.php:179
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:547
elgg echo
Translates a string.
Definition: deprecated.js:530
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:179