aboutsummaryrefslogtreecommitdiff
path: root/mod/defaultwidgets/actions/update.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-19 02:12:32 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-19 02:12:32 +0000
commit373ff03a2b6315eea13a97065774972ad3713ab6 (patch)
treedf051d2a4c1d150fd75b2f3db2d4647a5e1ebda9 /mod/defaultwidgets/actions/update.php
parent06f0e7b1aa5f6fd393d9a0b580f94709e29e10df (diff)
downloadelgg-373ff03a2b6315eea13a97065774972ad3713ab6.tar.gz
elgg-373ff03a2b6315eea13a97065774972ad3713ab6.tar.bz2
Fixes #2753: Default widgets merged into core as extensible admin section and updated to work with new widgets. Will need an upgrade for users running the old default widgets in 1.7.
git-svn-id: http://code.elgg.org/elgg/trunk@8302 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/defaultwidgets/actions/update.php')
-rw-r--r--mod/defaultwidgets/actions/update.php55
1 files changed, 0 insertions, 55 deletions
diff --git a/mod/defaultwidgets/actions/update.php b/mod/defaultwidgets/actions/update.php
deleted file mode 100644
index 9b34c228c..000000000
--- a/mod/defaultwidgets/actions/update.php
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-/**
- * Elgg default_widgets plugin.
- *
- * @package DefaultWidgets
- *
- **/
-
-// get parameters
-$context = get_input ( 'context' );
-$leftbar = str_replace ( '::0', '', get_input ( 'debugField1' ) );
-$middlebar = str_replace ( '::0', '', get_input ( 'debugField2' ) );
-$rightbar = str_replace ( '::0', '', get_input ( 'debugField3' ) );
-
-// make sure enough parameters are set
-if ($context && isset ( $leftbar ) && isset ( $middlebar ) && isset ( $rightbar )) {
-
- // join widgets into a single string
- $widgets = $leftbar . '%%' . $middlebar . '%%' . $rightbar;
-
- // get the elgg object that contains our settings
- $entities = elgg_get_entities (array('type' => 'object', 'subtype' => 'moddefaultwidgets', 'limit' => 9999));
-
- // create new object unless one already exists
- if (! isset ( $entities [0] )) {
- $entity = new ElggObject ( );
- $entity->subtype = 'moddefaultwidgets';
- $entity->owner_guid = $_SESSION ['user']->getGUID ();
- } else {
- $entity = $entities [0];
- }
-
- // store the default widgets for each context
- $entity->$context = $widgets;
-
- // make sure this object is public.
- $entity->access_id = 2;
-
- // save the object or report error
- if ($entity->save ()) {
- system_message ( elgg_echo ( 'defaultwidgets:update:success' ) );
- $entity->state = "active";
- forward ( 'pg/admin' );
- } else {
- register_error ( elgg_echo ( 'defaultwidgets:update:failed' ) );
- forward("pg/admin/appearance/default_{$context}_widgets");
- }
-
-} else {
-
- // report incorrect parameters error
- register_error ( elgg_echo ( 'defaultwidgets:update:noparams' ) );
- forward("pg/admin/appearance/default_{$context}_widgets");
-
-}