Completed
Branch develop (edb367)
by
unknown
28:40
created

printing.lib.php ➔ printingAdminPrepareHead()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 45

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
nc 4
nop 1
dl 0
loc 45
rs 9.2
c 0
b 0
f 0
1
<?php
2
/* Copyright (C) 2015       Laurent Destailleur     <[email protected]>
3
 * Copyright (C) 2018       Frédéric France         <[email protected]>
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 <http://www.gnu.org/licenses/>.
17
 */
18
19
/**
20
 *  \file           htdocs/printing/lib/printing.lib.php
21
 *  \ingroup        printing
22
 *  \brief          Library for printing functions
23
 */
24
25
26
27
/**
28
 *  Define head array for tabs of printing tools setup pages
29
 *
30
 *  @param  string  $mode       Mode
31
 *  @return array               Array of head
32
 */
33
function printingAdminPrepareHead($mode)
34
{
35
    global $langs, $conf;
36
37
    $h = 0;
38
    $head = array();
39
40
    $head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=config";
41
    $head[$h][1] = $langs->trans("ListDrivers");
42
    $head[$h][2] = 'config';
43
    $h++;
44
45
    if ($mode == 'setup') {
46
        $head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=setup&driver=".GETPOST('driver','alpha');
47
        $head[$h][1] = $langs->trans("SetupDriver");
48
        $head[$h][2] = 'setup';
49
        $h++;
50
    }
51
52
    if ($mode == 'test') {
53
        $head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=test&driver=".GETPOST('driver','alpha');
54
        $head[$h][1] = $langs->trans("TargetedPrinter");
55
        $head[$h][2] = 'test';
56
        $h++;
57
    }
58
59
    /** TODO This feature seem to be not ready yet.
60
    $head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=userconf";
61
    $head[$h][1] = $langs->trans("UserConf");
62
    $head[$h][2] = 'userconf';
63
    $h++;
64
    */
65
66
    //$object=new stdClass();
67
68
    // Show more tabs from modules
69
    // Entries must be declared in modules descriptor with line
70
    // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
71
    // $this->tabs = array('entity:-tabname);                                                   to remove a tab
72
    //complete_head_from_modules($conf,$langs,$object,$head,$h,'printingadmin');
73
74
    //complete_head_from_modules($conf,$langs,$object,$head,$h,'printing','remove');
75
76
    return $head;
77
}
78