setup.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /* <one line to give the program's name and a brief idea of what it does.>
  3. * Copyright (C) <year> <name of author>
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /**
  19. * \file htdocs/modulebuilder/template/admin/setup.php
  20. * \ingroup mymodule
  21. * \brief Example module setup page.
  22. *
  23. * Put detailed description here.
  24. */
  25. // Load Dolibarr environment
  26. if (false === (@include '../../main.inc.php')) { // From htdocs directory
  27. require '../../../main.inc.php'; // From "custom" directory
  28. }
  29. global $langs, $user;
  30. // Libraries
  31. require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php";
  32. require_once '../lib/mymodule.lib.php';
  33. //require_once "../class/myclass.class.php";
  34. // Translations
  35. $langs->load("mymodule@mymodule");
  36. // Access control
  37. if (! $user->admin) {
  38. accessforbidden();
  39. }
  40. // Parameters
  41. $action = GETPOST('action', 'alpha');
  42. /*
  43. * Actions
  44. */
  45. /*
  46. * View
  47. */
  48. $page_name = "MyModuleSetup";
  49. llxHeader('', $langs->trans($page_name));
  50. // Subheader
  51. $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
  52. print load_fiche_titre($langs->trans($page_name), $linkback);
  53. // Configuration header
  54. $head = mymoduleAdminPrepareHead();
  55. dol_fiche_head(
  56. $head,
  57. 'settings',
  58. $langs->trans("Module500000Name"),
  59. 0,
  60. "mymodule@mymodule"
  61. );
  62. // Setup page goes here
  63. echo $langs->trans("MyModuleSetupPage");
  64. // Page end
  65. dol_fiche_end();
  66. llxFooter();