* PrinterAbstract.php: New id ivar
(BSPrinterAbstract::setId): New method
(BSPrinterAbstract::_prepareStyle): Add the id attribute if it's present
===================
- Change: BSPrinterElementTable:__construct() can now take straight strings and convert them into BSPrinterElementLabel's
- New: BSPrinterRootPage::setHeaderCode() allows injecting in between the <head> tag of the root page element (creates BSPrinterRootPage::$headerCode)
-
+- New: BSPrinterAbstract::setId() allows all elements to have an id attribute added in _prepareStyle()
*/
protected $cssClass = ':swap:';
+ /**
+ * DOM ID of the element
+ * @var string
+ */
+ protected $id;
+
/**
* Fluent object instantiation
*/
return $this;
}
+ /**
+ * Sets the DOM/CSS ID of the element
+ *
+ * @param string The ID
+ */
+ public function setId($id)
+ {
+ $this->id = $id;
+ return $this;
+ }
+
/**
* Returns a string of CSS style attributes
*
*/
protected function _prepareStyle()
{
- if (empty($this->style) && empty($this->cssClass))
+ if (empty($this->style) && empty($this->cssClass) && empty($this->id))
{
return;
}
{
$string .= ' style="' . $style . '"';
}
+ if ($this->id)
+ {
+ $string .= ' id="' . $this->id . '"';
+ }
return $string;
}