about.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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/about.php
  20. * \ingroup mymodule
  21. * \brief About page of module MyModule.
  22. *
  23. * MyModuleDescription.
  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. // Libraries
  30. require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
  31. require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
  32. require_once '../lib/mymodule.lib.php';
  33. // Translations
  34. $langs->load("errors");
  35. $langs->load("admin");
  36. $langs->load("mymodule@mymodule");
  37. // Access control
  38. if (! $user->admin) {
  39. accessforbidden();
  40. }
  41. // Parameters
  42. $action = GETPOST('action', 'alpha');
  43. /*
  44. * Actions
  45. */
  46. // None
  47. /*
  48. * View
  49. */
  50. $form = new Form($db);
  51. $page_name = "MyModuleAbout";
  52. llxHeader('', $langs->trans($page_name));
  53. // Subheader
  54. $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">'
  55. . $langs->trans("BackToModuleList") . '</a>';
  56. print load_fiche_titre($langs->trans($page_name), $linkback);
  57. // Configuration header
  58. $head = mymoduleAdminPrepareHead();
  59. dol_fiche_head(
  60. $head,
  61. 'about',
  62. $langs->trans("MyModuleName"),
  63. 0,
  64. 'mymodule@mymodule'
  65. );
  66. // About page goes here
  67. echo $langs->trans("MyModuleAboutPage");
  68. echo '<br>';
  69. require_once '../core/modulebuilder/mymodule/core/modules/modMyModule.class.php';
  70. $tmpmodule = new MyModule($db);
  71. print $tmpmodule->getDescLong();
  72. // Page end
  73. dol_fiche_end();
  74. llxFooter();
  75. $db->close();