From e311d086ccb9f4c5dca95500a2543f2bb7a38c32 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 28 Nov 2016 17:30:27 +0100 Subject: [PATCH] BpNode: add id helper --- library/Businessprocess/BpNode.php | 5 +++++ library/Businessprocess/Html/BaseElement.php | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/library/Businessprocess/BpNode.php b/library/Businessprocess/BpNode.php index 52086e6..f57e2f5 100644 --- a/library/Businessprocess/BpNode.php +++ b/library/Businessprocess/BpNode.php @@ -286,6 +286,11 @@ class BpNode extends Node return $this->state; } + public function getHtmlId() + { + return 'businessprocess-' . preg_replace('/[\r\n\t\s]/', '_', (string) $this); + } + protected function invertSortingState($state) { return self::$sortStateInversionMap[$state >> self::SHIFT_FLAGS] << self::SHIFT_FLAGS; diff --git a/library/Businessprocess/Html/BaseElement.php b/library/Businessprocess/Html/BaseElement.php index 8fefed4..7043b24 100644 --- a/library/Businessprocess/Html/BaseElement.php +++ b/library/Businessprocess/Html/BaseElement.php @@ -27,7 +27,6 @@ abstract class BaseElement extends Html } else { $this->attributes = Attributes::wantAttributes($default); } - } return $this->attributes;