Elgg  Version 4.3
deprecated-4.2.php
Go to the documentation of this file.
1 <?php
16 function elgg_view_menu_item(\ElggMenuItem $item, array $vars = []) {
17  elgg_deprecated_notice(__METHOD__ . ' has been deprecated use elgg_view("navigation/menu/elements/item/url")', '4.2');
18 
19  $vars = array_merge($item->getValues(), $vars);
20  $vars['class'] = elgg_extract_class($vars, ['elgg-menu-content']);
21 
22  if ($item->getLinkClass()) {
23  $vars['class'][] = $item->getLinkClass();
24  }
25 
26  if ($item->getHref() === false || $item->getHref() === null) {
27  $vars['class'][] = 'elgg-non-link';
28  }
29 
30  if (!isset($vars['rel']) && !isset($vars['is_trusted'])) {
31  $vars['is_trusted'] = true;
32  }
33 
34  if ($item->getConfirmText()) {
35  $vars['confirm'] = $item->getConfirmText();
36  }
37 
38  return elgg_view('output/url', $vars);
39 }
40 
50  elgg_deprecated_notice(__METHOD__ . ' has been deprecated use elgg_register_success_message()', '4.2');
51 
52  _elgg_services()->system_messages->addSuccessMessage($message);
53  return true;
54 }
55 
65  elgg_deprecated_notice(__METHOD__ . ' has been deprecated use elgg_register_error_message()', '4.2');
66 
67  _elgg_services()->system_messages->addErrorMessage($error);
68  return true;
69 }
70 
85  elgg_deprecated_notice(__METHOD__ . ' has been deprecated use elgg_get_entity_as_row()', '4.2');
86 
87  return _elgg_services()->entityTable->getRow($guid);
88 }
if(!$items) $item
Definition: delete.php:13
elgg_deprecated_notice(string $msg, string $dep_version)
Log a notice about deprecated use of a function, view, etc.
Definition: deprecation.php:52
getLinkClass()
Get the anchor classes as text.
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_view_menu_item(\ElggMenuItem $item, array $vars=[])
Bundle all functions which have been deprecated in Elgg 4.2.
getConfirmText()
Get the confirm text.
$error
Bad request error.
Definition: 400.php:6
register_error($error)
Display an error on next page load.
get_entity_as_row($guid)
Returns a database row from the entities table.
_elgg_services()
Get the global service provider.
Definition: elgglib.php:638
$vars['head']
Definition: html.php:24
system_message($message)
Display a system message on next page load.
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:179
getValues()
Get all the values for this menu item.
$guid
Reset an ElggUpgrade.
Definition: reset.php:6
getHref()
Get the URL of the menu item.