aboutsummaryrefslogtreecommitdiff
path: root/mod/sitepages/actions
diff options
context:
space:
mode:
authordave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-24 10:27:53 +0000
committerdave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-24 10:27:53 +0000
commitfe236ea096f092f38ea4d3517fd25fd084d28c6f (patch)
tree4210535cd663daaef81aa9186ec2de5866ad33f2 /mod/sitepages/actions
parent3b970491b7bc84e8f7408b5858e49b75ae7a7d6c (diff)
downloadelgg-fe236ea096f092f38ea4d3517fd25fd084d28c6f.tar.gz
elgg-fe236ea096f092f38ea4d3517fd25fd084d28c6f.tar.bz2
a simple version of the sitepages index - we will need to turn this into a basic and advance selection for admins.
git-svn-id: http://code.elgg.org/elgg/trunk@6153 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/sitepages/actions')
-rw-r--r--mod/sitepages/actions/addfrontsimple.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/mod/sitepages/actions/addfrontsimple.php b/mod/sitepages/actions/addfrontsimple.php
new file mode 100644
index 000000000..ee26723e8
--- /dev/null
+++ b/mod/sitepages/actions/addfrontsimple.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * Site pages front page save/edit
+ *
+ * @package SitePages
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ *
+ */
+
+admin_gatekeeper();
+
+$logged_in_content = get_input('logged_in_content', '', FALSE);
+$logged_out_content = get_input('logged_out_content', '', FALSE);
+
+$welcometitle = get_input('welcometitle', '', FALSE);
+$welcomemessage = get_input('welcomemessage', '', FALSE);
+$sidebartitle = get_input('sidebartitle', '', FALSE);
+$sidebarmessage = get_input('sidebarmessage', '', FALSE);
+
+$loggedin_user_guid = get_loggedin_userid();
+
+// Cache to the session for sticky forms
+// @todo does nothing yet.
+$_SESSION['sitepages:content'] = $content;
+$_SESSION['sitepages:css'] = $css;
+
+if (!$sitepagesimple = sitepages_get_sitepage_object('frontsimple')) {
+ $sitepagesimple = sitepages_create_sitepage_object('frontsimple');
+}
+
+$sitepagesimple->welcometitle = $welcometitle;
+$sitepagesimple->welcomemessage = $welcomemessage;
+$sitepagesimple->sidebartitle = $sidebartitle;
+$sitepagesimple->sidebarmessage = $sidebarmessage;
+
+if ($sitepagesimple->save()) {
+ system_message(elgg_echo("sitepagessimple:posted"));
+} else {
+ register_error(elgg_echo("sitepages:error"));
+}
+
+forward($_SERVER['HTTP_REFERER']);