aboutsummaryrefslogtreecommitdiff
path: root/pages/event_connector/import.php
blob: e496bb9f81e15339e4cc37a7f3d256f800756664 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
 * Import an iCal
 *
 * @package ElggEventConnector
 */

gatekeeper();

$container_guid = (int) get_input('guid');
$container = get_entity($container_guid);
if (!$container) {
	forward(REFERER);
}

if (elgg_instanceof($container, 'group') && $container->event_calendar_enable == "no") {
	register_error(elgg_echo('event_connector:error:group_calendar'));
	forward(REFERER);
}

elgg_set_page_owner_guid($container->getGUID());

$title = elgg_echo('event_connector:upload');
elgg_push_breadcrumb($title);

$form_vars = array('enctype' => 'multipart/form-data');
$vars = array('container_guid' => $container_guid);
$content = elgg_view_form('event_connector/import', $form_vars, $vars);

$body = elgg_view_layout('content', array(
	'filter' => '',
	'content' => $content,
	'title' => $title,
));

echo elgg_view_page($title, $body);