aboutsummaryrefslogtreecommitdiff
path: root/mod/pages/actions/pages/edit.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-13 12:28:33 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-13 12:28:33 +0000
commit090f60fb6ace958748752e439548f1fa8673258f (patch)
treea39aa1cf7beeb1ae657feb00edd785fecae94fc4 /mod/pages/actions/pages/edit.php
parent55724ff6f6818f2c1b16d4bacd912ae2eb745fdb (diff)
downloadelgg-090f60fb6ace958748752e439548f1fa8673258f.tar.gz
elgg-090f60fb6ace958748752e439548f1fa8673258f.tar.bz2
Once again removing an accidentally committed plugin
git-svn-id: https://code.elgg.org/elgg/trunk@1896 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/pages/actions/pages/edit.php')
-rw-r--r--mod/pages/actions/pages/edit.php114
1 files changed, 0 insertions, 114 deletions
diff --git a/mod/pages/actions/pages/edit.php b/mod/pages/actions/pages/edit.php
deleted file mode 100644
index a34971173..000000000
--- a/mod/pages/actions/pages/edit.php
+++ /dev/null
@@ -1,114 +0,0 @@
-<?php
- /**
- * Elgg Pages
- *
- * @package ElggPages
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008
- * @link http://elgg.com/
- */
-
- // Load configuration
- global $CONFIG;
-
- gatekeeper();
- set_context('pages');
-
- // Get group fields
- $input = array();
- foreach($CONFIG->pages as $shortname => $valuetype) {
- $input[$shortname] = get_input($shortname);
- if ($valuetype == 'tags')
- $input[$shortname] = string_to_tag_array($input[$shortname]);
- }
-
- // Get parent
- $parent_guid = (int)get_input('parent_guid', 0);
-
- // New or old?
- $page = NULL;
- $pages_guid = (int)get_input('pages_guid');
- if ($pages_guid)
- {
- $page = get_entity($pages_guid);
- if (!$page->canEdit())
- $page = NULL; // if we can't edit it, go no further.
- }
- else
- {
- $page = new ElggObject();
- if (!$parent_guid)
- $page->subtype = 'page_top';
- else
- $page->subtype = 'page';
-
- // New instance, so set container_guid
- $container_guid = get_input('container_guid', $_SESSION['user']->getGUID());
- $page->container_guid = $container_guid;
- }
-
- // Have we got it? Can we edit it?
- if ($page instanceof ElggObject)
- {
- // Yes we have, and yes we can.
-
- // Save fields - note we always save latest description as both description and annotation
- if (sizeof($input) > 0)
- {
- foreach($input as $shortname => $value) {
- if ((!$pages_guid) || (($pages_guid) && ($shortname != 'title')))
- $page->$shortname = $value;
- }
- }
-
-
- // Validate create
- if (!$page->title)
- {
- register_error(elgg_echo("pages:notitle"));
-
- forward($_SERVER['HTTP_REFERER']);
- exit;
- }
-
- // Access ids
- $page->access_id = (int)get_input('access_id', 0);
-
- // Write access id
- $page->write_access_id = (int)get_input('write_access_id', 0);
-
- // Set parent
- $page->parent_guid = $parent_guid;
-
- // Ensure ultimate owner
- $page->owner_guid = ($page->owner_guid ? $page->owner_guid : $_SESSION['user']->guid);
-
- // finally save
- if ($page->save())
- {
-
- // Now save description as an annotation
- $page->annotate('page', $page->description, $page->access_id);
-
-
- system_message(elgg_echo("pages:saved"));
-
- // Forward to the user's profile
- forward($page->getUrl());
- exit;
- }
- else
- register_error(elgg_echo('pages:notsaved'));
-
- }
- else
- {
- register_error(elgg_echo("pages:noaccess"));
- }
-
-
- // Forward to the user's profile
- forward($page->getUrl());
- exit;
-?>