dolibarr 21.0.0-beta
knowledgemanagement.lib.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2021 SuperAdmin
3 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
31{
32 global $langs, $conf, $db;
33
34 $langs->load("knowledgemanagement");
35
36 $extrafields = new ExtraFields($db);
37 $extrafields->fetch_name_optionals_label('knowledgemanagement_knowledgerecord');
38
39 $h = 0;
40 $head = array();
41
42 $head[$h][0] = DOL_URL_ROOT.'/admin/knowledgemanagement.php';
43 $head[$h][1] = $langs->trans("Setup");
44 $head[$h][2] = 'setup';
45 $h++;
46
47
48 $head[$h][0] = DOL_URL_ROOT.'/admin/knowledgerecord_extrafields.php';
49 $head[$h][1] = $langs->trans("ExtraFields");
50 $nbExtrafields = $extrafields->attributes['knowledgemanagement_knowledgerecord']['count'];
51 if ($nbExtrafields > 0) {
52 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
53 }
54 $head[$h][2] = 'extra';
55 $h++;
56
57 // Show more tabs from modules
58 // Entries must be declared in modules descriptor with line
59 //$this->tabs = array(
60 // 'entity:+tabname:Title:@knowledgemanagement:/knowledgemanagement/mypage.php?id=__ID__'
61 //); // to add new tab
62 //$this->tabs = array(
63 // 'entity:-tabname:Title:@knowledgemanagement:/knowledgemanagement/mypage.php?id=__ID__'
64 //); // to remove a tab
65 complete_head_from_modules($conf, $langs, null, $head, $h, 'knowledgemanagement');
66
67 complete_head_from_modules($conf, $langs, null, $head, $h, 'knowledgemanagement', 'remove');
68
69 return $head;
70}
Class to manage standard extra fields.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add', $filterorigmodule='')
Complete or removed entries into a head array (used to build tabs).
knowledgemanagementAdminPrepareHead()
Prepare admin pages header.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79