dolibarr  13.0.2
ecm.lib.php
Go to the documentation of this file.
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 <https://www.gnu.org/licenses/>.
16  * or see https://www.gnu.org/
17  */
18 
32 function ecm_prepare_dasboard_head($object)
33 {
34  global $langs, $conf, $user, $form;
35  global $helptext1, $helptext2;
36 
37  $h = 0;
38  $head = array();
39  $helptext = $langs->trans("ECMAreaDesc").'<br>';
40  $helptext .= $langs->trans("ECMAreaDesc2");
41 
42  $head[$h][0] = DOL_URL_ROOT.'/ecm/index.php';
43  $head[$h][1] = $langs->trans("ECMSectionsManual").$form->textwithpicto('', $helptext, 1, 'info', '', 0, 3);
44  $head[$h][2] = 'index';
45  $h++;
46 
47  if (!empty($conf->global->ECM_AUTO_TREE_ENABLED))
48  {
49  $head[$h][0] = DOL_URL_ROOT.'/ecm/index_auto.php';
50  $head[$h][1] = $langs->trans("ECMSectionsAuto").$form->textwithpicto('', $helptext, 1, 'info', '', 0, 3);
51  $head[$h][2] = 'index_auto';
52  $h++;
53  }
54 
55  // Show more tabs from modules
56  // Entries must be declared in modules descriptor with line
57  // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
58  // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
59  complete_head_from_modules($conf, $langs, $object, $head, $h, 'ecm');
60 
61  complete_head_from_modules($conf, $langs, $object, $head, $h, 'ecm', 'remove');
62 
63  return $head;
64 }
65 
66 
75 function ecm_prepare_head($object, $module = 'ecm', $section = '')
76 {
77  global $langs, $conf, $user;
78  $h = 0;
79  $head = array();
80 
81  if ($module == 'ecm')
82  {
83  $head[$h][0] = DOL_URL_ROOT.'/ecm/dir_card.php?section='.$object->id;
84  $head[$h][1] = $langs->trans("Directory");
85  $head[$h][2] = 'card';
86  $h++;
87  } else {
88  $head[$h][0] = DOL_URL_ROOT.'/ecm/dir_card.php?section='.$section.'&module='.$module;
89  $head[$h][1] = $langs->trans("Directory");
90  $head[$h][2] = 'card';
91  $h++;
92  }
93 
94  return $head;
95 }
96 
103 function ecm_file_prepare_head($object)
104 {
105  global $langs, $conf, $user;
106  $h = 0;
107  $head = array();
108 
109  $head[$h][0] = DOL_URL_ROOT.'/ecm/file_card.php?section='.$object->section_id.'&urlfile='.urlencode($object->label);
110  $head[$h][1] = $langs->trans("File");
111  $head[$h][2] = 'card';
112  $h++;
113 
114  return $head;
115 }
116 
123 function ecm_prepare_head_fm($object)
124 {
125  global $langs, $conf;
126  $h = 0;
127  $head = array();
128 
129  $head[$h][0] = DOL_URL_ROOT.'/ecm/index.php?action=file_manager';
130  $head[$h][1] = $langs->trans('ECMFileManager');
131  $head[$h][2] = 'file_manager';
132  $h++;
133 
134  $head[$h][0] = DOL_URL_ROOT.'/ecm/search.php';
135  $head[$h][1] = $langs->trans('Search');
136  $head[$h][2] = 'search_form';
137  $h++;
138 
139  return $head;
140 }
141 
148 {
149  global $langs, $conf;
150  $langs->load("ecm");
151 
152  $h = 0;
153  $head = array();
154 
155  $head[$h][0] = DOL_URL_ROOT."/admin/ecm.php";
156  $head[$h][1] = $langs->trans("Setup");
157  $head[$h][2] = 'ecm';
158  $h++;
159 
160  $head[$h][0] = DOL_URL_ROOT.'/admin/ecm_files_extrafields.php';
161  $head[$h][1] = $langs->trans("ExtraFieldsEcmFiles");
162  $head[$h][2] = 'attributes_ecm_files';
163  $h++;
164 
165  $head[$h][0] = DOL_URL_ROOT.'/admin/ecm_directories_extrafields.php';
166  $head[$h][1] = $langs->trans("ExtraFieldsEcmDirectories");
167  $head[$h][2] = 'attributes_ecm_directories';
168  $h++;
169 
170  complete_head_from_modules($conf, $langs, null, $head, $h, 'ecm_admin');
171 
172  complete_head_from_modules($conf, $langs, null, $head, $h, 'ecm_admin', 'remove');
173 
174  return $head;
175 }
ecm_prepare_dasboard_head($object)
Prepare array with list of different ecm main dashboard.
Definition: ecm.lib.php:32
ecm_file_prepare_head($object)
Prepare array with list of tabs.
Definition: ecm.lib.php:103
ecm_admin_prepare_head()
Return array head with list of tabs to view object informations.
Definition: ecm.lib.php:147
ecm_prepare_head_fm($object)
Prepare array with list of tabs.
Definition: ecm.lib.php:123
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode= 'add')
Complete or removed entries into a head array (used to build tabs).
ecm_prepare_head($object, $module= 'ecm', $section= '')
Prepare array with list of tabs.
Definition: ecm.lib.php:75