settings.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /*
  3. *
  4. * OGP - Open Game Panel
  5. * Copyright (C) 2008 - 2018 The OGP Development Team
  6. *
  7. * http://www.opengamepanel.org/
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  22. *
  23. */
  24. require_once(MODULES."/litefm/functions.php");
  25. function exec_ogp_module()
  26. {
  27. require_once('includes/form_table_class.php');
  28. global $db;
  29. echo "<h2>".get_lang('litefm_settings')."</h2>";
  30. // Get File Operations Keys
  31. $fo_keys = get_file_operations_keys();
  32. if ( isset($_REQUEST['update_settings']) )
  33. {
  34. $file_operations = array();
  35. foreach($fo_keys as $key)
  36. {
  37. $file_operations[$key] = $_POST[$key];
  38. }
  39. $lfm_file_operations = json_encode($file_operations);
  40. $litefm_settings = array(
  41. "lfm_file_operations" => $lfm_file_operations,
  42. );
  43. $db->setSettings($litefm_settings);
  44. print_success(get_lang('settings_updated'));
  45. }
  46. $settings = $db->getSettings();
  47. // Get File Operations Settings
  48. $fo = get_fo_settings($settings,$fo_keys);
  49. $ft = new FormTable();
  50. $ft->start_form("?m=litefm&amp;p=litefm_settings", "post", "autocomplete=\"off\"");
  51. $ft->start_table();
  52. foreach($fo_keys as $key)
  53. {
  54. $ft->add_field('on_off',$key,$fo[$key]);
  55. }
  56. $ft->end_table();
  57. $ft->add_button("submit","update_settings",get_lang('update_settings'));
  58. $ft->end_form();
  59. }
  60. ?>