fml fix update

This commit is contained in:
Steffen Schröder 2013-12-14 23:28:04 +01:00
parent 7f4b45286a
commit fd3a3056f1
2 changed files with 22 additions and 12 deletions

View File

@ -97,13 +97,18 @@ class Pages implements Constants, Globals, Includes, Labels, ScriptFeature {
} }
$constant .= '"__FML__Pages__Id__" => ["' . $page[2] . '"], '; $constant .= '"__FML__Pages__Id__" => ["' . $page[2] . '"], ';
$constant .= '"__FML__Pages__Ids__" => ['; $constant .= '"__FML__Pages__Ids__" => [';
$subIndex = 0; if (count($page[1]) <= 0) {
foreach ($page[1] as $pageId) { $constant .= '""';
$constant .= '"' . $pageId . '"'; }
if ($subIndex < count($page[1]) - 1) { else {
$constant .= ', '; $subIndex = 0;
foreach ($page[1] as $pageId) {
$constant .= '"' . $pageId . '"';
if ($subIndex < count($page[1]) - 1) {
$constant .= ', ';
}
$subIndex++;
} }
$subIndex++;
} }
$constant .= ']]'; $constant .= ']]';
if ($index < count($this->pages) - 1) { if ($index < count($this->pages) - 1) {

View File

@ -47,13 +47,18 @@ class Tooltips implements Constants, Labels, ScriptFeature {
*/ */
public function getConstants() { public function getConstants() {
$constant = '['; $constant = '[';
$index = 0; if (count($this->tooltips) <= 0) {
foreach ($this->tooltips as $hoverId => $tooltipId) { $constant .= '"" => ""';
$constant .= '"' . $hoverId . '" => "' . $tooltipId . '"'; }
if ($index < count($this->tooltips) - 1) { else {
$constant .= ','; $index = 0;
foreach ($this->tooltips as $hoverId => $tooltipId) {
$constant .= '"' . $hoverId . '" => "' . $tooltipId . '"';
if ($index < count($this->tooltips) - 1) {
$constant .= ',';
}
$index++;
} }
$index++;
} }
$constant .= ']'; $constant .= ']';
$constants = array(); $constants = array();