This commit is contained in:
Steffen Schröder 2014-01-03 17:26:55 +01:00
parent 985feb398e
commit 3e7083d377

View File

@ -325,23 +325,33 @@ class Script {
*/ */
private function buildTooltipConstants() { private function buildTooltipConstants() {
if (!$this->tooltips) return; if (!$this->tooltips) return;
$constantText = "["; $constantText = '[';
$index = 0; $index = 0;
$count = count($this->tooltipTexts); $count = count($this->tooltipTexts);
if ($count > 0) {
foreach ($this->tooltipTexts as $tooltipId => $tooltipTexts) { foreach ($this->tooltipTexts as $tooltipId => $tooltipTexts) {
$constantText .= "\"{$tooltipId}\" => ["; $constantText .= '"' . $tooltipId . '"=>[';
$subIndex = 0; $subIndex = 0;
$subCount = count($tooltipTexts); $subCount = count($tooltipTexts);
if ($subCount > 0) {
foreach ($tooltipTexts as $hoverId => $text) { foreach ($tooltipTexts as $hoverId => $text) {
$constantText .= "\"{$hoverId}\" => \"{$text}\""; $constantText .= '"' . $hoverId . '"=>"' . $text . '"';
if ($subIndex < $subCount - 1) $constantText .= ", "; if ($subIndex < $subCount - 1) $constantText .= ',';
$subIndex++; $subIndex++;
} }
$constantText .= "]"; }
if ($index < $count - 1) $constantText .= ", "; else {
$constantText .= '""';
}
$constantText .= ']';
if ($index < $count - 1) $constantText .= ',';
$index++; $index++;
} }
$constantText .= "]"; }
else {
$constantText .= '""=>[""=>""]';
}
$constantText .= ']';
$this->setConstant(self::CONSTANT_TOOLTIPTEXTS, $constantText); $this->setConstant(self::CONSTANT_TOOLTIPTEXTS, $constantText);
} }