Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

admin_mymodule.php 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 admin/mymodule.php
  20. * \ingroup mymodule
  21. * \brief This file is an example module setup page
  22. * Put some comments here
  23. */
  24. // Dolibarr environment
  25. $res = @include("../../main.inc.php"); // From htdocs directory
  26. if (! $res) {
  27. $res = @include("../../../main.inc.php"); // From "custom" directory
  28. }
  29. // Libraries
  30. require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php";
  31. require_once '../lib/mymodule.lib.php';
  32. //require_once "../class/myclass.class.php";
  33. // Translations
  34. $langs->load("mymodule@mymodule");
  35. // Access control
  36. if (! $user->admin) {
  37. accessforbidden();
  38. }
  39. // Parameters
  40. $action = GETPOST('action', 'alpha');
  41. /*
  42. * Actions
  43. */
  44. /*
  45. * View
  46. */
  47. $page_name = "MyModuleSetup";
  48. llxHeader('', $langs->trans($page_name));
  49. // Subheader
  50. $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">'
  51. . $langs->trans("BackToModuleList") . '</a>';
  52. print_fiche_titre($langs->trans($page_name), $linkback);
  53. // Configuration header
  54. $head = mymoduleAdminPrepareHead();
  55. dol_fiche_head(
  56. $head,
  57. 'settings',
  58. $langs->trans("Module10000Name"),
  59. 0,
  60. "mymodule@mymodule"
  61. );
  62. // Setup page goes here
  63. echo $langs->trans("MyModuleSetupPage");
  64. llxFooter();
  65. $db->close();