dolibarr  7.0.0-beta
modules_printing.php
1 <?php
2 /*
3  * Copyright (C) 2014-2015 Frederic France <frederic.france@free.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 <http://www.gnu.org/licenses/>.
17  * or see http://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 
33 {
34  var $db;
35  var $error;
36 
37 
43  function __construct($db)
44  {
45  $this->db = $db;
46  }
47 
55  static function listDrivers($db,$maxfilenamelength=0)
56  {
57  global $conf;
58 
59  $type = 'printing';
60  $list = array();
61 
62  $moduledir=DOL_DOCUMENT_ROOT."/core/modules/printing/";
63  $tmpfiles=dol_dir_list($moduledir,'all',0,'\modules.php','','name',SORT_ASC,0);
64  foreach($tmpfiles as $record) {
65  $list[$record['fullname']]=str_replace('.modules.php', '',$record['name']);
66  }
67 
68  return $list;
69  }
70 
76  function getDesc()
77  {
78  global $langs;
79  $langs->load("printing");
80  $transstring="PrintingModuleDesc".$this->name;
81  if ($langs->trans($transstring) != $transstring) return $langs->trans($transstring);
82  else return $this->desc;
83  }
84 
85 }
86 
__construct($db)
Constructor.
Parent class of emailing target selectors modules.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="")
Scan a directory and return a list of files/directories.
Definition: files.lib.php:58
static listDrivers($db, $maxfilenamelength=0)
Return list of printing driver.
getDesc()
Return description of Printing Module.