]>
src.bluestatic.org Git - isso.git/blob - PrinterLabelElement.php
2 /*=====================================================================*
3 || ###################################################################
4 || # Blue Static ISSO Framework
5 || # Copyright (c)2005-2008 Blue Static
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.
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
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 \*=====================================================================*/
23 * Printer Label Element (PrinterLabelElement.php)
28 require_once(ISSO
. '/PrinterElement.php');
31 * Printer Label Element
33 * This element is a wrapper for a PHP string to be displayed in the
37 * @copyright Copyright (c)2005 - 2008, Blue Static
41 class BSPrinterLabelElement
extends BSPrinterElement
49 // ###################################################################
53 * @param string String to display
55 function __construct($string)
57 $this->string = $string;
58 $this->setCssClass(null);
62 * Makes a new instance of the object in a static fashion
66 public static function make()
68 $obj = new ReflectionClass(__CLASS__
);
69 $args = func_get_args();
70 return $obj->newInstanceArgs($args);
73 // ###################################################################
77 * @return string The string; wrapped in a <span> if it has styling
79 public function paint()
81 if ($this->_prepareStyle())
83 return '<span' . $this->_prepareStyle() . '>' . $this->string . '</span>';