Elgg  Version master
header.php
Go to the documentation of this file.
1 <?php
8 $widget = elgg_extract('entity', $vars);
9 if (!$widget instanceof \ElggWidget) {
10  return;
11 }
12 
13 $title_text = $widget->getDisplayName();
14 $url = $widget->getURL();
15 if (!empty($url)) {
17 }
18 
19 $title = elgg_format_element('h2', ['class' => 'elgg-widget-title'], $title_text);
20 
21 echo elgg_format_element('div', ['class' => 'elgg-widget-handle'], $title);
22 
23 echo elgg_view('object/widget/elements/controls', [
24  'widget' => $widget,
25  'show_edit' => elgg_extract('show_edit', $vars, $widget->canEdit()),
26  'show_access' => elgg_extract('show_access', $vars),
27 ]);
$url
Definition: header.php:14
if(!$widget instanceof\ElggWidget) $title_text
Definition: header.php:13
$widget
Widget object header.
Definition: header.php:8
if(!empty($url)) $title
Definition: header.php:19
$vars
Definition: header.php:13
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:254
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
elgg_view_url(string $href, string $text=null, array $options=[])
Helper function for outputting urls.
Definition: views.php:1427
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
Definition: output.php:145