Elgg  Version 3.0
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)) {
16  $title_text = elgg_view('output/url', [
17  'text' => $title_text,
18  'href' => $url,
19  'is_trusted' => true,
20  ]);
21 }
22 
23 $title = "<h3 class='elgg-widget-title'>{$title_text}</h3>";
24 $controls = elgg_view('object/widget/elements/controls', [
25  'widget' => $widget,
26  'show_edit' => elgg_extract('show_edit', $vars, $widget->canEdit()),
27 ]);
28 
29 echo "<div class='elgg-widget-handle'>{$title}</div>{$controls}";
$url
Definition: header.php:14
$controls
Definition: header.php:24
$widget
Widget object header.
Definition: header.php:8
if(!empty($url)) $title
Definition: header.php:23
elgg echo
Translates a string.
Definition: languages.js:43
if(!($widget instanceof\ElggWidget)) $title_text
Definition: header.php:13
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
$vars['type']
Definition: save.php:11
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246