1<?php
2
3$type = elgg_extract('expage', $vars);
4$type = strtolower($type);
5
6// admin edit menu item
7if (elgg_is_admin_logged_in()) {
8	elgg_register_menu_item('title', [
9		'name' => 'edit',
10		'text' => elgg_echo('edit'),
11		'href' => "admin/configure_utilities/expages?type=$type",
12		'link_class' => 'elgg-button elgg-button-action',
13	]);
14}
15
16$object = elgg_get_entities([
17	'type' => 'object',
18	'subtype' => $type,
19	'limit' => 1,
20]);
21
22$description = $object ? $object[0]->description : elgg_echo('expages:notset');
23$description = elgg_view('output/longtext', ['value' => $description]);
24
25// build page
26$shell = 'default';
27if (elgg_get_config('walled_garden') && !elgg_is_logged_in()) {
28	$shell = 'walled_garden';
29}
30
31// draw page
32echo elgg_view_page(elgg_echo("expages:{$type}"), [
33	'content' => elgg_view('expages/wrapper', [
34		'content' => $description,
35	]),
36	'sidebar' => false,
37], $shell);
38