aboutsummaryrefslogtreecommitdiff
path: root/mod/externalpages
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-01-12 16:15:16 +0100
committerSem <sembrestels@riseup.net>2012-01-12 16:15:16 +0100
commitcc544cfa2086e418318a899ffd550adfb744c7ba (patch)
tree6c04fbe2e3df67513aa76803cb8d05c105ba219b /mod/externalpages
parente7d64510ebd823f186282e2b80780295bcca1b79 (diff)
parent68e4829ac0959d86c651e7ed6dc255c39694c8af (diff)
downloadelgg-cc544cfa2086e418318a899ffd550adfb744c7ba.tar.gz
elgg-cc544cfa2086e418318a899ffd550adfb744c7ba.tar.bz2
Merge Elgg 1.8.3.
Diffstat (limited to 'mod/externalpages')
-rw-r--r--mod/externalpages/actions/edit.php24
-rw-r--r--mod/externalpages/views/default/expages/menu.php4
-rw-r--r--mod/externalpages/views/default/forms/expages/edit.php4
3 files changed, 21 insertions, 11 deletions
diff --git a/mod/externalpages/actions/edit.php b/mod/externalpages/actions/edit.php
index edfffe168..184aa3d82 100644
--- a/mod/externalpages/actions/edit.php
+++ b/mod/externalpages/actions/edit.php
@@ -1,18 +1,28 @@
<?php
/**
- * Elgg external pages: add/edit
+ * Elgg external pages: create or update
*
*/
-// Get input data
+// Get input data and don't filter the content
$contents = get_input('expagescontent', '', false);
$type = get_input('content_type');
-$previous_guid = get_input('expage_guid');
+$guid = get_input('guid');
-// create object to hold the page details
-$expages = new ElggObject();
-$expages->subtype = $type;
-$expages->owner_guid = get_loggedin_userid();
+if ($guid) {
+ // update
+ $expages = get_entity($guid);
+ if (!$expages) {
+ register_error(elgg_echo("expages:error"));
+ forward(REFERER);
+ }
+} else {
+ // create
+ $expages = new ElggObject();
+ $expages->subtype = $type;
+}
+
+$expages->owner_guid = elgg_get_logged_in_user_guid();
$expages->access_id = ACCESS_PUBLIC;
$expages->title = $type;
$expages->description = $contents;
diff --git a/mod/externalpages/views/default/expages/menu.php b/mod/externalpages/views/default/expages/menu.php
index 6ed521629..831be9125 100644
--- a/mod/externalpages/views/default/expages/menu.php
+++ b/mod/externalpages/views/default/expages/menu.php
@@ -7,8 +7,8 @@
$type = $vars['type'];
- //set the url
- $url = $vars['url'] . "admin/site/expages?type=";
+//set the url
+$url = $vars['url'] . "admin/site/expages?type=";
$pages = array('about', 'terms', 'privacy');
$tabs = array();
diff --git a/mod/externalpages/views/default/forms/expages/edit.php b/mod/externalpages/views/default/forms/expages/edit.php
index ca83ea7df..a15f2a7aa 100644
--- a/mod/externalpages/views/default/forms/expages/edit.php
+++ b/mod/externalpages/views/default/forms/expages/edit.php
@@ -50,9 +50,9 @@ echo <<<EOT
$input_area
</div>
<div class="elgg-foot">
-$hidden_value
+$hidden_guid
$hidden_type
$submit_input
-<div>
+</div>
EOT;