Elgg  Version 3.0
owner_block.php
Go to the documentation of this file.
1 <?php
12 // groups and other users get owner block
14 if (!($owner instanceof ElggGroup || $owner instanceof ElggUser)) {
15  return;
16 }
17 
18 elgg_push_context('owner_block');
19 
21  'item_view' => 'object/elements/chip',
22 ]);
23 
25 $body = '';
26 if (elgg_extract('show_owner_block_menu', $vars, true)) {
27  $body .= elgg_view_menu('owner_block', ['entity' => $owner]);
28 } else {
29  $extra_class = 'elgg-owner-block-empty';
30 }
31 
32 if (elgg_view_exists('page/elements/owner_block/extend')) {
33  $body .= elgg_view('page/elements/owner_block/extend', $vars);
34 }
35 
36 echo elgg_view_module('info', '', $body, [
37  'header' => $header,
38  'class' => ['elgg-owner-block', $extra_class],
39 ]);
40 
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
Definition: views.php:205
$extra_class
Definition: owner_block.php:24
$body
Definition: owner_block.php:25
elgg_view_menu($menu, array $vars=[])
Render a menu.
Definition: views.php:755
$owner
Definition: owner_block.php:13
elgg_view_entity(\ElggEntity $entity, array $vars=[])
Returns a string of a rendered entity.
Definition: views.php:842
elgg_view_module($type, $title, $body, array $vars=[])
Wrapper function for the module display pattern.
Definition: views.php:1198
elgg_pop_context()
Removes and returns the top context string from the stack.
Definition: pageowner.php:222
elgg echo
Translates a string.
Definition: languages.js:43
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
Definition: pageowner.php:65
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:1131
elgg_push_context($context)
Push a context onto the top of the stack.
Definition: pageowner.php:212
$vars['type']
Definition: save.php:11
$header
Definition: owner_block.php:20
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246