Elgg  Version 4.3
owner_block.php
Go to the documentation of this file.
1 <?php
10 if (!elgg_extract('show_owner_block', $vars, true)) {
11  return;
12 }
13 
14 // groups and other users get owner block
16 if (!($owner instanceof ElggGroup || $owner instanceof ElggUser)) {
17  return;
18 }
19 
20 elgg_push_context('owner_block');
21 
23  'item_view' => 'object/elements/chip',
24 ]);
25 
27 $body = '';
28 if (elgg_extract('show_owner_block_menu', $vars, true)) {
29  $menu_params = elgg_extract('owner_block_menu_params', $vars, []);
30  $menu_params['entity'] = $owner;
31  $menu_params['prepare_vertical'] = true;
32 
33  $body .= elgg_view_menu('owner_block', $menu_params);
34 } else {
35  $extra_class = 'elgg-owner-block-empty';
36 }
37 
38 if (elgg_view_exists('page/elements/owner_block/extend')) {
39  $body .= elgg_view('page/elements/owner_block/extend', $vars);
40 }
41 
42 if (!empty($body)) {
43  echo elgg_view_module('info', '', $body, [
44  'header' => $header,
45  'class' => ['elgg-owner-block', $extra_class],
46  ]);
47 }
48 
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
Definition: views.php:152
elgg_push_context($context)
Push a context onto the top of the stack.
Definition: context.php:52
$extra_class
Definition: owner_block.php:26
if(!elgg_extract('show_owner_block', $vars, true)) $owner
Elgg owner block Displays page ownership information.
Definition: owner_block.php:15
$body
Definition: owner_block.php:27
elgg_pop_context()
Removes and returns the top context string from the stack.
Definition: context.php:62
elgg_view_menu($menu, array $vars=[])
Render a menu.
Definition: views.php:468
elgg_view_entity(\ElggEntity $entity, array $vars=[])
Returns a string of a rendered entity.
Definition: views.php:518
elgg_view_module($type, $title, $body, array $vars=[])
Wrapper function for the module display pattern.
Definition: views.php:944
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
Definition: pageowner.php:23
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
$vars['head']
Definition: html.php:24
$header
Definition: owner_block.php:22
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:179