ecm.lib.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?php
  2. /* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. * or see http://www.gnu.org/
  17. */
  18. /**
  19. * \file htdocs/core/lib/ecm.lib.php
  20. * \brief Ensemble de fonctions de base pour le module ecm
  21. * \ingroup ecm
  22. */
  23. /**
  24. * Prepare array with list of different ecm main dashboard
  25. *
  26. * @param object $object Object related to tabs
  27. * @return array Array of tabs to show
  28. */
  29. function ecm_prepare_dasboard_head($object)
  30. {
  31. global $langs, $conf, $user, $form;
  32. global $helptext1, $helptext2;
  33. $h = 0;
  34. $head = array();
  35. $helptext =$langs->trans("ECMAreaDesc").'<br>';
  36. $helptext.=$langs->trans("ECMAreaDesc2");
  37. $head[$h][0] = DOL_URL_ROOT.'/ecm/index.php';
  38. $head[$h][1] = $langs->trans("ECMSectionsManual").$form->textwithpicto('', $helptext, 1, 'info', '', 0, 3);
  39. $head[$h][2] = 'index';
  40. $h++;
  41. if (! empty($conf->global->ECM_AUTO_TREE_ENABLED))
  42. {
  43. $head[$h][0] = DOL_URL_ROOT.'/ecm/index_auto.php';
  44. $head[$h][1] = $langs->trans("ECMSectionsAuto").$form->textwithpicto('', $helptext, 1, 'info', '', 0, 3);
  45. $head[$h][2] = 'index_auto';
  46. $h++;
  47. }
  48. // Show more tabs from modules
  49. // Entries must be declared in modules descriptor with line
  50. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  51. // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
  52. complete_head_from_modules($conf,$langs,$object,$head,$h,'ecm');
  53. complete_head_from_modules($conf,$langs,$object,$head,$h,'ecm','remove');
  54. return $head;
  55. }
  56. /**
  57. * Prepare array with list of tabs
  58. *
  59. * @param object $object Object related to tabs
  60. * @return array Array of tabs to show
  61. */
  62. function ecm_prepare_head($object)
  63. {
  64. global $langs, $conf, $user;
  65. $h = 0;
  66. $head = array();
  67. $head[$h][0] = DOL_URL_ROOT.'/ecm/docmine.php?section='.$object->id;
  68. $head[$h][1] = $langs->trans("Card");
  69. $head[$h][2] = 'card';
  70. $h++;
  71. return $head;
  72. }
  73. /**
  74. * Prepare array with list of tabs
  75. *
  76. * @param Object $object Object related to tabs
  77. * @return array Array of tabs to show
  78. */
  79. function ecm_file_prepare_head($object)
  80. {
  81. global $langs, $conf, $user;
  82. $h = 0;
  83. $head = array();
  84. $head[$h][0] = DOL_URL_ROOT.'/ecm/docfile.php?section='.$object->section_id.'&urlfile='.urlencode($object->label);
  85. $head[$h][1] = $langs->trans("Card");
  86. $head[$h][2] = 'card';
  87. $h++;
  88. return $head;
  89. }
  90. /**
  91. * Prepare array with list of tabs
  92. *
  93. * @param object $object Object related to tabs
  94. * @return array Array of tabs to show
  95. */
  96. function ecm_prepare_head_fm($object)
  97. {
  98. global $langs, $conf;
  99. $h = 0;
  100. $head = array();
  101. $head[$h][0] = DOL_URL_ROOT.'/ecm/index.php?action=file_manager';
  102. $head[$h][1] = $langs->trans('ECMFileManager');
  103. $head[$h][2] = 'file_manager';
  104. $h++;
  105. $head[$h][0] = DOL_URL_ROOT.'/ecm/search.php';
  106. $head[$h][1] = $langs->trans('Search');
  107. $head[$h][2] = 'search_form';
  108. $h++;
  109. return $head;
  110. }