Elgg  Version 4.x
placeholder.php
Go to the documentation of this file.
1 <?php
2 
3 $user = elgg_extract('entity', $vars);
4 if (!$user instanceof ElggUser) {
5  return;
6 }
7 
8 $guid = (int) $user->guid;
11 $input = (array) elgg_get_config('input');
12 
13 // generate MAC so we don't have to trust the client's choice of contexts
15 $mac = elgg_build_hmac($data)->getToken();
16 
18  'rel' => $mac,
19  'class' => 'elgg-menu elgg-menu-hover',
20  'data-menu-placeholder' => '1', // flag for the JS to know this menu isn't fully loaded yet
21  'data-elgg-menu-data' => json_encode([
22  'g' => $guid,
23  'pog' => $page_owner_guid,
24  'c' => $contexts,
25  'm' => $mac,
26  'i' => $input,
27  ]),
28 ]);
$page_owner_guid
Definition: placeholder.php:9
$data
Definition: placeholder.php:14
$contexts
Definition: placeholder.php:10
elgg_get_page_owner_guid()
Elgg page owner library.
Definition: pageowner.php:12
$input
Definition: placeholder.php:11
$user
Definition: placeholder.php:3
elgg_format_element($tag_name, array $attributes=[], $text= '', array $options=[])
Format an HTML element.
Definition: output.php:134
if(!$user instanceof ElggUser) $guid
Definition: placeholder.php:8
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:686
elgg echo
Translates a string.
Definition: deprecated.js:530
$vars['head']
Definition: html.php:24
elgg_build_hmac($data)
Get an HMAC token builder/validator object.
Definition: actions.php:54
$mac
Definition: placeholder.php:15
elgg_get_context_stack()
Get the entire context stack (e.g.
Definition: context.php:88
elgg_get_config($name, $default=null)
Get an Elgg configuration value.