dolibarr  7.0.0-beta
categories.lib.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
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 categories_prepare_head($object,$type)
33 {
34  global $langs, $conf, $user;
35 
36  $langs->load("categories");
37  $langs->load("products");
38 
39  $h = 0;
40  $head = array();
41 
42  $head[$h][0] = DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&amp;type='.$type;
43  $head[$h][1] = $langs->trans("Card");
44  $head[$h][2] = 'card';
45  $h++;
46 
47  $head[$h][0] = DOL_URL_ROOT.'/categories/photos.php?id='.$object->id.'&amp;type='.$type;
48  $head[$h][1] = $langs->trans("Photos");
49  $head[$h][2] = 'photos';
50  $h++;
51 
52  if (! empty($conf->global->MAIN_MULTILANGS))
53  {
54  $head[$h][0] = DOL_URL_ROOT.'/categories/traduction.php?id='.$object->id.'&amp;type='.$type;
55  $head[$h][1] = $langs->trans("Translation");
56  $head[$h][2] = 'translation';
57  $h++;
58  }
59 
60  // Show more tabs from modules
61  // Entries must be declared in modules descriptor with line
62  // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
63  // $this->tabs = array('entity:-tabname); to remove a tab
64  complete_head_from_modules($conf,$langs,$object,$head,$h,'categories_'.$type);
65 
66  complete_head_from_modules($conf,$langs,$object,$head,$h,'categories_'.$type,'remove');
67 
68  return $head;
69 }
70 
71 
78 {
79  global $langs, $conf, $user;
80 
81  $langs->load("categories");
82 
83  $h = 0;
84  $head = array();
85 
86  $head[$h][0] = DOL_URL_ROOT.'/categories/admin/categorie.php';
87  $head[$h][1] = $langs->trans("Setup");
88  $head[$h][2] = 'setup';
89  $h++;
90 
91  $head[$h][0] = DOL_URL_ROOT.'/categories/admin/categorie_extrafields.php';
92  $head[$h][1] = $langs->trans("ExtraFieldsCategories");
93  $head[$h][2] = 'attributes_categories';
94  $h++;
95 
96  // Show more tabs from modules
97  // Entries must be declared in modules descriptor with line
98  // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
99  // $this->tabs = array('entity:-tabname); to remove a tab
100  complete_head_from_modules($conf,$langs,null,$head,$h,'categoriesadmin');
101 
102  complete_head_from_modules($conf,$langs,null,$head,$h,'categoriesadmin','remove');
103 
104  return $head;
105 }
106 
107 
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add')
Complete or removed entries into a head array (used to build tabs).
categoriesadmin_prepare_head()
Prepare array with list of tabs.
categories_prepare_head($object, $type)
Prepare array with list of tabs.