diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-12 17:57:25 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-12 17:57:25 +0000 |
commit | 683f50786a7aec4a936b7b5d59a8e6338b1c7071 (patch) | |
tree | c674bb5a47b3ac98837743d09991013a33232fb1 /actions/widgets | |
parent | d423fd2379171706c75c60600442a2dbdc12d87a (diff) | |
download | elgg-683f50786a7aec4a936b7b5d59a8e6338b1c7071.tar.gz elgg-683f50786a7aec4a936b7b5d59a8e6338b1c7071.tar.bz2 |
Widgets, including a test widget plugin
git-svn-id: https://code.elgg.org/elgg/trunk@900 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'actions/widgets')
-rw-r--r-- | actions/widgets/add.php | 43 | ||||
-rw-r--r-- | actions/widgets/save.php | 7 |
2 files changed, 47 insertions, 3 deletions
diff --git a/actions/widgets/add.php b/actions/widgets/add.php new file mode 100644 index 000000000..07e167a96 --- /dev/null +++ b/actions/widgets/add.php @@ -0,0 +1,43 @@ +<?php
+
+ /**
+ * Elgg widget add action
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @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.org/
+ */
+
+ $guid = get_input('user');
+ $handler = get_input('handler');
+ $context = get_input('context');
+ $column = get_input('column');
+
+ $result = false;
+
+ if (!empty($guid)) {
+
+ if ($user = get_entity($guid)) {
+
+ if ($user->canEdit()) {
+
+ $result = add_widget($user->getGUID(),$handler,$context,0,$column);
+
+ }
+
+ }
+
+ }
+
+ if ($result) {
+ system_message(elgg_echo('widgets:save:success'));
+ } else {
+ system_message(elgg_echo('widgets:save:failure'));
+ }
+
+ forward($_SERVER['HTTP_REFERER']);
+
+?>
\ No newline at end of file diff --git a/actions/widgets/save.php b/actions/widgets/save.php index b50010e6f..deb4bb911 100644 --- a/actions/widgets/save.php +++ b/actions/widgets/save.php @@ -11,8 +11,9 @@ * @link http://elgg.org/
*/
+
$guid = get_input('guid');
- $params = get_input('params');
+ $params = $_REQUEST['params'];
$pageurl = get_input('pageurl');
$result = false;
@@ -24,9 +25,9 @@ }
if ($result) {
- system_message('widgets:save:success');
+ system_message(elgg_echo('widgets:save:success'));
} else {
- system_message('widgets:save:failure');
+ system_message(elgg_echo('widgets:save:failure'));
}
forward($_SERVER['HTTP_REFERER']);
|