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() {
if (!$this->tooltips) return;
$constantText = "[";
$constantText = '[';
$index = 0;
$count = count($this->tooltipTexts);
if ($count > 0) {
foreach ($this->tooltipTexts as $tooltipId => $tooltipTexts) {
$constantText .= "\"{$tooltipId}\" => [";
$constantText .= '"' . $tooltipId . '"=>[';
$subIndex = 0;
$subCount = count($tooltipTexts);
if ($subCount > 0) {
foreach ($tooltipTexts as $hoverId => $text) {
$constantText .= "\"{$hoverId}\" => \"{$text}\"";
if ($subIndex < $subCount - 1) $constantText .= ", ";
$constantText .= '"' . $hoverId . '"=>"' . $text . '"';
if ($subIndex < $subCount - 1) $constantText .= ',';
$subIndex++;
}
$constantText .= "]";
if ($index < $count - 1) $constantText .= ", ";
}
else {
$constantText .= '""';
}
$constantText .= ']';
if ($index < $count - 1) $constantText .= ',';
$index++;
}
$constantText .= "]";
}
else {
$constantText .= '""=>[""=>""]';
}
$constantText .= ']';
$this->setConstant(self::CONSTANT_TOOLTIPTEXTS, $constantText);
}