ecm.lib.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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 shoc
  28. */
  29. function ecm_prepare_dasboard_head($object)
  30. {
  31. global $langs, $conf, $user;
  32. $h = 0;
  33. $head = array();
  34. $head[$h][0] = DOL_URL_ROOT.'/ecm/index.php';
  35. $head[$h][1] = $langs->trans("ECMSectionsManual").img_help(1,$helptext1);
  36. $head[$h][2] = 'index';
  37. $h++;
  38. if (! empty($conf->global->ECM_AUTO_TREE_ENABLED))
  39. {
  40. $head[$h][0] = DOL_URL_ROOT.'/ecm/index_auto.php';
  41. $head[$h][1] = $langs->trans("ECMSectionsAuto").img_help(1,$helptext2);
  42. $head[$h][2] = 'index_auto';
  43. $h++;
  44. }
  45. // Show more tabs from modules
  46. // Entries must be declared in modules descriptor with line
  47. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  48. // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
  49. complete_head_from_modules($conf,$langs,$object,$head,$h,'ecm');
  50. complete_head_from_modules($conf,$langs,$object,$head,$h,'ecm','remove');
  51. return $head;
  52. }
  53. /**
  54. * Prepare array with list of tabs
  55. *
  56. * @param object $object Object related to tabs
  57. * @return array Array of tabs to shoc
  58. */
  59. function ecm_prepare_head($object)
  60. {
  61. global $langs, $conf, $user;
  62. $h = 0;
  63. $head = array();
  64. $head[$h][0] = DOL_URL_ROOT.'/ecm/docmine.php?section='.$object->id;
  65. $head[$h][1] = $langs->trans("Card");
  66. $head[$h][2] = 'card';
  67. $h++;
  68. return $head;
  69. }
  70. /**
  71. * Prepare array with list of tabs
  72. *
  73. * @param Object $object Object related to tabs
  74. * @return array Array of tabs to shoc
  75. */
  76. function ecm_file_prepare_head($object)
  77. {
  78. global $langs, $conf, $user;
  79. $h = 0;
  80. $head = array();
  81. $head[$h][0] = DOL_URL_ROOT.'/ecm/docfile.php?section='.$object->section_id.'&urlfile='.urlencode($object->label);
  82. $head[$h][1] = $langs->trans("Card");
  83. $head[$h][2] = 'card';
  84. $h++;
  85. return $head;
  86. }
  87. /**
  88. * Prepare array with list of tabs
  89. *
  90. * @param object $object Object related to tabs
  91. * @return array Array of tabs to shoc
  92. */
  93. function ecm_prepare_head_fm($object)
  94. {
  95. global $langs, $conf;
  96. $h = 0;
  97. $head = array();
  98. $head[$h][0] = DOL_URL_ROOT.'/ecm/index.php?action=file_manager';
  99. $head[$h][1] = $langs->trans('ECMFileManager');
  100. $head[$h][2] = 'file_manager';
  101. $h++;
  102. $head[$h][0] = DOL_URL_ROOT.'/ecm/search.php';
  103. $head[$h][1] = $langs->trans('Search');
  104. $head[$h][2] = 'search_form';
  105. $h++;
  106. return $head;
  107. }