Fixing a documentation and error mistake that weren't fixed through our sesarch/repla...
[isso.git] / PrinterElementLabel.php
1 <?php
2 /*=====================================================================*
3 || ###################################################################
4 || # Blue Static ISSO Framework
5 || # Copyright (c)2005-2008 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 2 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 (PrinterElementLabel.php)
24 *
25 * @package ISSO
26 */
27
28 require_once(ISSO . '/PrinterAbstract.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)2005 - 2008, Blue Static
38 * @package ISSO
39 *
40 */
41 class BSPrinterElementLabel extends BSPrinterAbstract
42 {
43 /**
44 * The value to print
45 * @var string
46 */
47 private $string = '';
48
49 // ###################################################################
50 /**
51 * Constructor
52 *
53 * @param string String to display
54 */
55 function __construct($string)
56 {
57 $this->string = $string;
58 $this->setCssClass(null);
59 }
60
61 /**
62 * Makes a new instance of the object in a static fashion
63 *
64 * @return object
65 */
66 public static function make()
67 {
68 $obj = new ReflectionClass(__CLASS__);
69 $args = func_get_args();
70 return $obj->newInstanceArgs($args);
71 }
72
73 // ###################################################################
74 /**
75 * Prints the string
76 *
77 * @return string The string; wrapped in a <span> if it has styling
78 */
79 public function paint()
80 {
81 if ($this->_prepareStyle())
82 {
83 return '<span' . $this->_prepareStyle() . '>' . $this->string . '</span>';
84 }
85 return $this->string;
86 }
87 }
88
89 ?>