ISSO is no longer a product regularly released so we'll remove the issoversion tag...
[isso.git] / PrinterLabelElement.php
1 <?php
2 /*=====================================================================*
3 || ###################################################################
4 || # Blue Static ISSO Framework
5 || # Copyright ©2002-[#]year[#] Blue Static
6 || #
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
10 || #
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 || # more details.
15 || #
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
21
22 /**
23 * Printer Label Element (PrinterLabelElement.php)
24 *
25 * @package ISSO
26 */
27
28 require_once('ISSO/PrinterElement.php');
29
30 /**
31 * Printer Label Element
32 *
33 * This element is a wrapper for a PHP string to be displayed in the
34 * standard printer
35 *
36 * @author Blue Static
37 * @copyright Copyright (c)2002 - [#]year[#], Blue Static
38 * @version $Revision$
39 * @package ISSO
40 *
41 */
42 class BSPrinterLabelElement extends BSPrinterElement
43 {
44 /**
45 * The value to print
46 * @var string
47 */
48 private $string = '';
49
50 // ###################################################################
51 /**
52 * Constructor
53 *
54 * @param string String to display
55 */
56 function __construct($string)
57 {
58 $this->string = $string;
59 $this->setCssClass(null);
60 }
61
62 // ###################################################################
63 /**
64 * Prints the string
65 *
66 * @return string The string; wrapped in a <span> if it has styling
67 */
68 public function paint()
69 {
70 if ($this->_prepareStyle())
71 {
72 return '<span' . $this->_prepareStyle() . '>' . $this->string . '</span>';
73 }
74 return $this->string;
75 }
76 }
77
78 /*=====================================================================*
79 || ###################################################################
80 || # $HeadURL$
81 || # $Id$
82 || ###################################################################
83 \*=====================================================================*/
84 ?>