dolibarr  7.0.0-beta
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 <http://www.gnu.org/licenses/>.
16  * or see http://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("Card");
85  $head[$h][2] = 'card';
86  $h++;
87  }
88  else
89  {
90  $head[$h][0] = DOL_URL_ROOT.'/ecm/dir_card.php?section='.$section.'&module='.$module;
91  $head[$h][1] = $langs->trans("Card");
92  $head[$h][2] = 'card';
93  $h++;
94  }
95 
96  return $head;
97 }
98 
105 function ecm_file_prepare_head($object)
106 {
107  global $langs, $conf, $user;
108  $h = 0;
109  $head = array();
110 
111  $head[$h][0] = DOL_URL_ROOT.'/ecm/file_card.php?section='.$object->section_id.'&urlfile='.urlencode($object->label);
112  $head[$h][1] = $langs->trans("Card");
113  $head[$h][2] = 'card';
114  $h++;
115 
116  return $head;
117 }
118 
125 function ecm_prepare_head_fm($object)
126 {
127  global $langs, $conf;
128  $h = 0;
129  $head = array();
130 
131  $head[$h][0] = DOL_URL_ROOT.'/ecm/index.php?action=file_manager';
132  $head[$h][1] = $langs->trans('ECMFileManager');
133  $head[$h][2] = 'file_manager';
134  $h++;
135 
136  $head[$h][0] = DOL_URL_ROOT.'/ecm/search.php';
137  $head[$h][1] = $langs->trans('Search');
138  $head[$h][2] = 'search_form';
139  $h++;
140 
141  return $head;
142 }
143 
ecm_prepare_head($object, $module='ecm', $section='')
Prepare array with list of tabs.
Definition: ecm.lib.php:75
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add')
Complete or removed entries into a head array (used to build tabs).
if(empty($reshook)) $form
View.
Definition: perms.php:103
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:105
ecm_prepare_head_fm($object)
Prepare array with list of tabs.
Definition: ecm.lib.php:125