diff options
Diffstat (limited to 'actions/plugins/settings')
-rw-r--r-- | actions/plugins/settings/save.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/actions/plugins/settings/save.php b/actions/plugins/settings/save.php new file mode 100644 index 000000000..0a8991641 --- /dev/null +++ b/actions/plugins/settings/save.php @@ -0,0 +1,36 @@ +<?php + /** + * Elgg plugin settings save action. + * + * @package Elgg + * @subpackage Core + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Marcus Povey + * @copyright Curverider Ltd 2008 + * @link http://elgg.org/ + */ + + $params = get_input('params'); + $plugin = get_input('plugin'); + + $result = false; + + foreach ($params as $k => $v) + { + // Save + $result = set_plugin_setting($k, $v, $plugin); + + // Error? + if (!$result) + { + system_message(sprintf(elgg_echo('plugins:settings:save:fail'), $plugin)); + + forward($_SERVER['HTTP_REFERER']); + + exit; + } + } + + system_message(sprintf(elgg_echo('plugins:settings:save:ok'), $plugin)); + forward($_SERVER['HTTP_REFERER']); +?>
\ No newline at end of file |