aboutsummaryrefslogtreecommitdiff
path: root/mod/externalpages/actions/edit.php
blob: edfffe168317275da75ddaedb9306ee98450a11e (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
<?php
/**
 * Elgg external pages: add/edit
 *
 */

// Get input data
$contents = get_input('expagescontent', '', false);
$type = get_input('content_type');
$previous_guid = get_input('expage_guid');

// create object to hold the page details
$expages = new ElggObject();
$expages->subtype = $type;
$expages->owner_guid = get_loggedin_userid();
$expages->access_id = ACCESS_PUBLIC;
$expages->title = $type;
$expages->description = $contents;
if (!$expages->save()) {
	register_error(elgg_echo("expages:error"));
	forward(REFERER);
}

system_message(elgg_echo("expages:posted"));
forward(REFERER);