settings.php 996 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * Save Tidypics plugin settings
  4. *
  5. * @author Cash Costello
  6. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
  7. */
  8. $plugin = elgg_get_plugin_from_id('tidypics');
  9. $params = get_input('params');
  10. foreach ($params as $k => $v) {
  11. if (!$plugin->setSetting($k, $v)) {
  12. register_error(elgg_echo('plugins:settings:save:fail', array('tidypics')));
  13. forward(REFERER);
  14. }
  15. }
  16. // image sizes
  17. $image_sizes = array();
  18. $image_sizes['large_image_width'] = get_input('large_image_width');
  19. $image_sizes['large_image_height'] = get_input('large_image_height');
  20. $image_sizes['small_image_width'] = get_input('small_image_width');
  21. $image_sizes['small_image_height'] = get_input('small_image_height');
  22. $image_sizes['tiny_image_width'] = get_input('tiny_image_width');
  23. $image_sizes['tiny_image_height'] = get_input('tiny_image_height');
  24. $plugin->setSetting('image_sizes', serialize($image_sizes));
  25. system_message(elgg_echo('tidypics:settings:save:ok'));
  26. forward(REFERER);