dolibarr
16.0.5
Main Page
Related Pages
Modules
Classes
Files
Examples
File List
File Members
dolibarr_16.0
htdocs
core
modules
printing
modules_printing.php
Go to the documentation of this file.
1
<?php
2
/*
3
* Copyright (C) 2014-2018 Frederic France <frederic.france@netlogic.fr>
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
* or see https://www.gnu.org/
18
*/
19
25
require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions.lib.php'
;
26
require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php'
;
27
28
32
class
PrintingDriver
33
{
37
public
$db;
38
42
public
$error =
''
;
43
44
50
public
function
__construct
($db)
51
{
52
$this->
db
= $db;
53
}
54
62
public
static
function
listDrivers
($db, $maxfilenamelength = 0)
63
{
64
global $conf;
65
66
$type =
'printing'
;
67
$list = array();
68
69
$listoffiles = array();
70
if
(!empty($conf->modules_parts[
'printing'
])) {
71
$dirmodels = array_merge(array(
'/core/modules/printing/'
), (array) $conf->modules_parts[
'printing'
]);
72
}
else
{
73
$dirmodels = array(
'/core/modules/printing/'
);
74
}
75
foreach
($dirmodels as $dir) {
76
$tmpfiles =
dol_dir_list
(
dol_buildpath
($dir, 0),
'all'
, 0,
'\.modules.php'
,
''
,
'name'
, SORT_ASC, 0);
77
if
(!empty($tmpfiles)) {
78
$listoffiles = array_merge($listoffiles, $tmpfiles);
79
}
80
}
81
foreach
($listoffiles as $record) {
82
$list[$record[
'fullname'
]] = str_replace(
'.modules.php'
,
''
, $record[
'name'
]);
83
}
84
return
$list;
85
}
86
92
public
function
getDesc
()
93
{
94
global $langs;
95
$langs->load(
"printing"
);
96
$transstring =
"PrintingModuleDesc"
.$this->name;
97
if
($langs->trans($transstring) != $transstring) {
98
return
$langs->trans($transstring);
99
}
else
{
100
return
$this->desc;
101
}
102
}
103
}
db
$conf db
API class for accounts.
Definition:
inc.php:41
dol_buildpath
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
Definition:
functions.lib.php:1062
dol_dir_list
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
Definition:
files.lib.php:60
PrintingDriver\listDrivers
static listDrivers($db, $maxfilenamelength=0)
Return list of printing driver.
Definition:
modules_printing.php:62
PrintingDriver\__construct
__construct($db)
Constructor.
Definition:
modules_printing.php:50
PrintingDriver
Parent class of emailing target selectors modules.
Definition:
modules_printing.php:32
PrintingDriver\getDesc
getDesc()
Return description of Printing Module.
Definition:
modules_printing.php:92
Generated on Sat Nov 4 2023 01:01:35 for
dolibarr
by Doxygen 1.8.17