/**
  * Call getBrowserHTML() if you want a table containing all the elements of a collection-class
  * When called with an id, only one row is returned to easily replace an old one with JavaScript
  * 
  * @param int $lineWithId 
  */
 function getBrowserHTML($lineWithId = -1)
 {
     $string = "";
     $top = "";
     $this->texts = $this->languageClass->getBrowserTexts();
     $singularLanguageClass = $this->loadLanguageClass($this->singularClass);
     if (isset($_SESSION["phynx_errors"]) and (!isset($_SESSION["HideErrors"]) or $_SESSION["HideErrors"] == false) and $lineWithId == -1 and ($_SERVER["HTTP_HOST"] == "dev.furtmeier.lan" or strpos(__FILE__, "nemiah") !== false)) {
         $top .= "\n\t\t<table>\n\t\t\t<colgroup>\n\t\t\t\t<col class=\"backgroundColor3\" />\n\t\t\t</colgroup>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<img style=\"float:left;margin-right:10px;\" src=\"./images/navi/warning.png\" />\n\t\t\t\t\t<b>Es " . (count($_SESSION["phynx_errors"]) != 1 ? "liegen" : "liegt") . " " . count($_SESSION["phynx_errors"]) . " PHP-Fehler vor:</b><br />\n\t\t\t\t\t<a href=\"javascript:windowWithRme('Util','','showPHPErrors','');\">Fehler anzeigen</a>,<br />\n\t\t\t\t\t<a href=\"javascript:rme('Util','','deletePHPErrors','','contentManager.reloadFrameRight();');\">Fehler löschen</a></td>\n\t\t\t</tr>\n\t\t</table>";
     }
     $userCanDelete = mUserdata::isDisallowedTo("cantDelete" . $this->singularClass);
     $userCanCreate = mUserdata::isDisallowedTo("cantCreate" . $this->singularClass);
     $userHiddenFields = mUserdata::getHides($this->singularClass);
     if ($this->singularClass == "none") {
         echo "collectionOf is not set. See message log for further details.";
         throw new CollectionOfNotSetException();
     }
     if ($this->name == "Noname") {
         $_SESSION["messages"]->addMessage("There is no name set. You might use setName of HTMLGUI to do that.");
     }
     #$firstKey = null;
     $colspan = 0;
     $oldValueForDisplayGroup = "";
     #if($this->attributes != null)
     #foreach($this->attributes AS $ei => $vi) {
     for ($i = 0; $i < count($this->attributes); $i++) {
         #if($firstKey == null) $firstKey = $ei;
         #$i = $ei;
         $aid = $this->attributes[$i]->getID();
         // get the id of an object separately
         $sc = $this->attributes[$i]->getA();
         // get the attributes-object from the object
         $as = PMReflector::getAttributesArray($sc);
         // get an array of attribute-names from the object
         if (count($this->addedCols) != 0) {
             // adding specified new columns which are not in $as
             foreach ($as as $key => $value) {
                 if (isset($this->addedCols[$value])) {
                     $_SESSION["messages"]->addMessage("adding col " . $this->addedCols[$value] . " right of {$value}");
                     array_splice($as, $key + 1, 0, $this->addedCols[$value]);
                     $_SESSION["messages"]->addMessage("new attributes list: " . implode(", ", $as));
                 }
             }
         }
         if ($this->displayGroupBy != null) {
             $f = $this->displayGroupBy;
             #if($i == 0) $_SESSION["messages"]->addMessage("displayGroupBy activated. Using value of ".$f.": ".$sc->$f);
             if ($oldValueForDisplayGroup != $sc->{$f}) {
                 if ($lineWithId == -1) {
                     $dgf = $sc->{$f} . "";
                     $kTv = isset($this->displayGroup[$dgf]) ? $this->displayGroup[$dgf] : " ";
                     #if($this->dgParser != "") eval("\$kTv = ".$this->dgParser."(\"".$sc->$f."\",\"load\",\"".implode("%§%",$this->dgParserParameters)."\");");
                     if ($this->dgParser != "") {
                         $kTv = $this->invokeParser($this->dgParser, $sc->{$f}, implode("%§%", $this->dgParserParameters));
                     }
                     $string .= "\n\t\t\t\t<tr class=\"kategorieTeiler\">\n\t\t\t\t\t<td colspan=\"%%COLSPAN%%\">" . $kTv . "</td>\n\t\t\t\t</tr>";
                 }
             }
         }
         if ($lineWithId == -1) {
             $string .= "\n\t\t\t\t<tr id=\"" . $this->RowIDPrefix . "" . ($this->onlyDisplayMode ? "D" : "") . "{$aid}\">";
         }
         if ($this->editInDisplayMode and $this->editInDisplayModeTarget == "contentLeft") {
             $string .= "\n\t\t\t\t\t" . $this->editIcon($aid);
         }
         if ($this->selectionRow == "" and !$this->onlyDisplayMode) {
             $string .= "\n\t\t\t\t\t<td><img onclick=\"contentManager.loadFrame('contentLeft','{$this->singularClass}','{$aid}'" . ($this->JSOnEdit != null ? "," . $this->JSOnEdit : "") . ");\" src=\"./images/i2/edit.png\" class=\"mouseoverFade editButton\" /></td>";
         }
         if ($this->selectionRow != "") {
             $string .= "" . str_replace("%%VALUE%%", "{$aid}", $this->selectionRow);
         }
         foreach ($this->parserParameters as $schluessel => $werte) {
             if (isset($sc->{$schluessel})) {
                 $sc->{$schluessel} = addslashes($sc->{$schluessel});
             }
         }
         if (count($this->showAttributes) == 0) {
             for ($j = 0; $j < count($as); $j++) {
                 if (isset($this->dontShow[$as[$j]])) {
                     continue;
                 }
                 if (isset($userHiddenFields[$as[$j]])) {
                     continue;
                 }
                 if ($i == 0) {
                     $this->shownCols[] = $as[$j];
                 }
                 if (isset($this->parsers[$as[$j]])) {
                     $parameters = $this->makeParameterStringFromArray($this->parserParameters[$as[$j]], $sc, $aid);
                     $t = $this->invokeParser($this->parsers[$as[$j]], $sc->{$as}[$j], $parameters);
                 } else {
                     $t = htmlspecialchars($sc->{$as}[$j]);
                 }
                 if ($this->multiEditMode != null and in_array($as[$j], $this->multiEditMode)) {
                     $string .= "\n\t\t\t\t\t<td><input onfocus=\"oldValue = this.value;\" onblur=\"if(oldValue != this.value) saveMultiEditInput('" . $this->singularClass . "','" . $aid . "','" . $as[$j] . "');\" onkeydown=\"if(event.keyCode == 13) saveMultiEditInput('" . $this->singularClass . "','{$aid}','" . $as[$j] . "');\" type=\"text\" id=\"" . $as[$j] . "ID{$aid}\" value=\"" . htmlspecialchars($t) . "\" class=\"multiEditInput2\" /></td>";
                 } else {
                     $string .= "\n\t\t\t\t\t<td " . (isset($this->colStyles[$as[$j]]) ? "style=\"" . $this->colStyles[$as[$j]] . "\"" : "") . " id=\"Browser" . $as[$j] . "{$aid}\">" . $t . "</td>";
                 }
             }
         } else {
             foreach ($this->showAttributes as $key => $value) {
                 if (isset($userHiddenFields[$value])) {
                     continue;
                 }
                 if ($i == 0) {
                     $this->shownCols[] = $value;
                 }
                 if (isset($this->parsers[$value])) {
                     $parameters = $this->makeParameterStringFromArray($this->parserParameters[$value], $sc, $aid);
                     $t = $this->invokeParser($this->parsers[$value], $sc->{$value}, $parameters);
                 } else {
                     $t = htmlspecialchars($sc->{$value});
                 }
                 $string .= "\n\t\t\t\t\t<td id=\"Browser" . $value . "{$aid}\" " . (isset($this->colStyles[$value]) ? "style=\"" . $this->colStyles[$value] . "\"" : "") . ">" . $t . "</td>";
             }
         }
         if ((!$this->onlyDisplayMode or $this->deleteInDisplayMode) and $userCanDelete) {
             $string .= "\n\t\t\t\t<td><img class=\"mouseoverFade\" onclick=\"deleteClass('" . $this->singularClass . "','{$aid}', " . ($this->JSOnDelete == null ? "function() { /*\$('BrowserMain" . ($this->onlyDisplayMode ? "D" : "") . "{$aid}').style.display='none';*/ contentManager.reloadFrameRight(); if(typeof lastLoadedLeft != 'undefined' && lastLoadedLeft == '{$aid}') \$('contentLeft').update(''); }" : $this->JSOnDelete) . ",'" . str_replace("%1", $this->singularName, $this->texts["%1 wirklich löschen?"]) . "');\" src=\"./images/i2/delete.gif\" /></td>";
         } elseif (!$userCanDelete) {
             $string .= "<td><img src=\"./images/i2/empty.png\" /></td>";
         }
         if ($this->editInDisplayMode and $this->editInDisplayModeTarget != "contentLeft") {
             $string .= "\n\t\t\t\t\t" . $this->editIcon($aid);
         }
         if ($lineWithId == -1) {
             $string .= "\t\n\t\t\t\t</tr>";
         }
         if ($this->displayGroupBy != null) {
             $oldValueForDisplayGroup = $sc->{$f};
         }
     }
     if ($this->attributes == null) {
         $colspan = 1;
     } else {
         $colspan = count($this->shownCols);
     }
     if ($this->editInDisplayMode) {
         $colspan++;
     }
     $cols = "";
     $c = 0;
     if ($this->selectionRow != "") {
         $c++;
     }
     foreach ($this->shownCols as $key => $value) {
         $cols .= "<col class=\"backgroundColor" . (++$c % 2 + 2) . " " . (isset($this->colClasses[$value]) ? $this->colClasses[$value] : "") . "\" " . (isset($this->colStyles[$value]) ? "style=\"" . $this->colStyles[$value] . "\"" : "") . " />\n";
     }
     if (count($this->attributes) == 0) {
         $cols .= "<col class=\"backgroundColor3\" />\n";
     }
     if ($this->onlyDisplayMode) {
         if ($this->editInDisplayMode) {
             if ($this->editInDisplayModeTarget == "contentLeft") {
                 $cols = "<col class=\"backgroundColor2\" style=\"width:20px;\" />\n" . $cols;
             } else {
                 $cols .= "<col style=\"width:20px;\" />\n";
             }
         }
         if ($this->deleteInDisplayMode) {
             $cols .= "<col style=\"width:20px\" />\n";
         }
     } else {
         if (!$this->selectionRow) {
             $cols = "<col class=\"backgroundColor2\" style=\"width:20px;\" />\n" . $cols;
         }
         $cols .= "<col style=\"width:20px;\" />\n";
     }
     $determinedNumberofCols = substr_count($cols, "\n");
     if ($this->displayGroupBy != null) {
         $string = str_replace("%%COLSPAN%%", $this->selectionRow == "" ? $colspan + 2 : $colspan + 1, $string);
     }
     $multiPageRow = "";
     $separator = "";
     if (count($this->multiPageMode) != 0) {
         $userDefinedEntriesPerPage = false;
         if ($this->multiPageMode[2] == 0) {
             $userDefinedEntriesPerPage = true;
             $mU = new mUserdata();
             $this->multiPageMode[2] = $mU->getUDValue("entriesPerPage{$this->multiPageMode[4]}");
             if ($this->multiPageMode[2] == null) {
                 $this->multiPageMode[2] = 20;
             }
         }
         if ($this->multiPageMode[1] == "undefined") {
             $this->multiPageMode[1] = 0;
         }
         $pages = ceil($this->multiPageMode[0] / $this->multiPageMode[2]);
         if ($this->multiPageMode[1] != 0) {
             $pageLinks = "<a href=\"javascript:contentManager.loadFrame('" . $this->multiPageMode[3] . "','" . $this->multiPageMode[4] . "', -1, 0, '');\">&nbsp;&lt;&lt;&nbsp;</a> ";
         } else {
             $pageLinks = "&nbsp;&lt;&lt;&nbsp; ";
         }
         if ($this->multiPageMode[1] != 0) {
             $pageLinks .= "<a href=\"javascript:contentManager.loadFrame('" . $this->multiPageMode[3] . "','" . $this->multiPageMode[4] . "',-1,'" . ($this->multiPageMode[1] - 1) . "');\">&nbsp;&lt;&nbsp;</a> ";
         } else {
             $pageLinks .= "&nbsp;&lt;&nbsp; ";
         }
         if ($this->multiPageMode[1] != $pages - 1) {
             $pageLinks .= "<a href=\"javascript:contentManager.loadFrame('" . $this->multiPageMode[3] . "','" . $this->multiPageMode[4] . "',-1,'" . ($this->multiPageMode[1] + 1) . "');\">&nbsp;&gt;&nbsp;</a> ";
         } else {
             $pageLinks .= "&nbsp;&gt;&nbsp; ";
         }
         if ($this->multiPageMode[1] != $pages - 1) {
             $pageLinks .= "<a href=\"javascript:contentManager.loadFrame('" . $this->multiPageMode[3] . "','" . $this->multiPageMode[4] . "',-1,'" . ($pages - 1) . "');\">&nbsp;&gt;&gt;&nbsp;</a> | ";
         } else {
             $pageLinks .= "&nbsp;&gt;&gt;&nbsp; | ";
         }
         $start = $this->multiPageMode[1] - 3;
         if ($start < 0) {
             $start = 0;
         }
         $end = $this->multiPageMode[1] + 3;
         if ($end > $pages - 1) {
             $end = $pages - 1;
         }
         for ($i = $start; $i <= $end; $i++) {
             if ($this->multiPageMode[1] != "{$i}") {
                 $pageLinks .= "<a href=\"javascript:contentManager.loadFrame('" . $this->multiPageMode[3] . "','" . $this->multiPageMode[4] . "',-1,'" . $i . "');\">" . ($i + 1) . "</a> ";
             } else {
                 $pageLinks .= $i + 1 . " ";
             }
         }
         if ($lineWithId == -1) {
             $multiPageRow = "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t" . ($userDefinedEntriesPerPage ? "<td><img class=\"mouseoverFade settingsButtonBrowser\" src=\"./images/i2/settings.png\" onclick=\"phynxContextMenu.start(this, 'HTML','multiPageSettings:{$this->multiPageMode[4]}','" . $this->texts["Einstellungen"] . ":');\" /></td>" : "") . "\n\t\t\t\t\t\t<td colspan=\"" . ($colspan + 1 + ($userDefinedEntriesPerPage ? 0 : 1)) . "\"><input type=\"text\"onkeydown=\"if(event.keyCode == 13) contentManager.loadFrame('" . $this->multiPageMode[3] . "','" . $this->multiPageMode[4] . "',-1,this.value - 1);\" style=\"width:30px;float:right;text-align:right;\" value=\"" . ($this->multiPageMode[1] + 1) . "\" onfocus=\"focusMe(this);\" onblur=\"blurMe(this);\" />" . $this->multiPageMode[0] . " " . ($this->multiPageMode[0] == 1 ? $this->texts["Eintrag"] : $this->texts["Einträge"]) . "<!--, " . $pages . " " . ($pages != 1 ? $this->texts["Seiten"] : $this->texts["Seite"]) . "--></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td colspan=\"{$determinedNumberofCols}\">" . ($pages == 0 ? 1 : $pages) . " " . (($pages == 0 ? 1 : $pages) != 1 ? $this->texts["Seiten"] : $this->texts["Seite"]) . ": {$pageLinks}</td>\n\t\t\t\t\t</tr>";
         }
         if ($lineWithId == -1 and $this->showFilteredCategoriesWarning) {
             #<img src=\"./images/i2/delete.gif\" style=\"float:right;\" class=\"mouseoverFade\" onclick=\"rme('mUserdata','','delUserdata',Array('filteredCategoriesInHTMLGUI{$this->showFilteredCategoriesWarning[1]}'),'contentManager.reloadFrameRight();');\" alt=\"".$this->texts["Filter löschen"]."\" title=\"".$this->texts["Filter löschen"]."\" />
             $dB = new Button($this->texts["Filter löschen"], "./images/i2/delete.gif");
             $dB->style("float:right;");
             $dB->type("icon");
             $dB->rme("HTML", "", "saveContextMenu", array("'deleteFilters'", "'{$this->showFilteredCategoriesWarning[1]}'"), "if(checkResponse(transport)) contentManager.reloadFrameRight();");
             $separator = "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"backgroundColor0\">" . ((isset($this->showFilteredCategoriesWarning[0]) and $this->showFilteredCategoriesWarning[0] == true) ? "<img src=\"./images/i2/note.png\" /></td><td class=\"backgroundColor0\" colspan=\"" . ($determinedNumberofCols - 2) . "\" style=\"color:grey;\" >" . $this->texts["Anzeige wurde gefiltert"] . "</td><td class=\"backgroundColor0\">{$dB}</td>" : " >") . "</td>\n\t\t\t\t\t</tr>";
         }
     }
     #" : "")."\" ".(isset($this->autoCompletion[$as]) ? "onkeyup=\"updateAutoComplete(event.keyCode, this, '".$this->autoCompletion[$as]."');\"" : "")."
     $quickSearchRow = "";
     if ($this->quickSearchPlugin != "") {
         $B = new Button("Suche als Filter anwenden", "./images/i2/searchFilter.png");
         $B->type("icon");
         $B->style("float:right;");
         $B->rme("HTML", "", "saveContextMenu", array("'searchFilter'", "'{$this->quickSearchPlugin};:;'+\$('quickSearch{$this->quickSearchPlugin}').value"), "if(checkResponse(transport)) contentManager.reloadFrameRight();");
         $showSF = PMReflector::implementsInterface($this->quickSearchPlugin . "GUI", "iSearchFilter");
         if ($showSF) {
             $mU = new mUserdata();
             $K = $mU->getUDValue("searchFilterInHTMLGUI" . $this->quickSearchPlugin);
         } else {
             $K = null;
         }
         $quickSearchRow = "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><img onclick=\"phynxContextMenu.start(this, '{$this->quickSearchPlugin}','searchHelp','" . $this->texts["Suche"] . ":','left');\" class=\"mouseoverFade\" style=\"cursor:help;\" src=\"./images/i2/search.png\" /></td>\n\t\t\t\t\t\t<td colspan=\"" . ($colspan + 1) . "\">\n\t\t\t\t\t\t\t" . ($showSF ? $B : "") . "\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t\t\t\tonfocus=\"focusMe(this); ACInputHasFocus=true; AC.start(this); if(this.value != '') AC.update('10', this, '{$this->quickSearchPlugin}', 'quickSearchLoadFrame');\"\n\t\t\t\t\t\t\t\tonblur=\"blurMe(this); ACInputHasFocus=false; AC.end(this);\"\n\t\t\t\t\t\t\t\tid=\"quickSearch{$this->quickSearchPlugin}\"\n\t\t\t\t\t\t\t\tonkeyup=\"AC.update(event.keyCode, this, '{$this->quickSearchPlugin}','quickSearchLoadFrame');\"\n\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\tvalue=\"" . ($K != null ? $K : "") . "\"\n\t\t\t\t\t\t\t\t" . ($showSF ? "style=\"width:90%;\"" : "") . "\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>";
     }
     if ($lineWithId == -1) {
         $top .= "{$this->tip}\n\t\t\t\t<div class=\"backgroundColor1 Tab\">\n\t\t\t\t\t<p>" . (!$this->onlyDisplayMode ? $singularLanguageClass == null ? "Bitte " . $this->name . " auswählen:" : $singularLanguageClass->getBrowserCaption() . ":" : ($singularLanguageClass == null ? $this->name : $singularLanguageClass->getPlural()) . ":") . "</p>\n\t\t\t\t</div>\n\t\t\t\t<table>\n\t\t\t\t\t<colgroup>\n\t\t\t\t\t\t{$cols}\n\t\t\t\t\t</colgroup>\n\t\t\t\t\t{$quickSearchRow}\n\t\t\t\t\t{$multiPageRow}{$separator}\n\t\t\t\t\t" . ((!$this->onlyDisplayMode and $this->selectionRow == "" and $userCanCreate) ? "\n\t\t\t\t\t<tr id=\"addNewRow\">\n\t\t\t\t\t\t<td><img class=\"mouseoverFade\" onclick=\"contentManager.newClassButton('{$this->singularClass}'," . ($this->JSOnNew != null ? $this->JSOnNew : "''") . ");\" src=\"./images/i2/new.gif\" id=\"buttonNewEntry{$this->singularClass}\" /></td>\n\t\t\t\t\t\t<td colspan=\"" . ($colspan + 1) . "\" style=\"font-weight:bold;\">" . ($singularLanguageClass == null ? $this->singularName . " neu anlegen" : $singularLanguageClass->getBrowserNewEntryLabel()) . "</td>\n\t\t\t\t\t</tr>" : "");
     }
     if (isset($top)) {
         foreach ($this->addedRows as $key => $value) {
             $top .= "<tr><td colspan=\"" . ($colspan + 1) . "\">" . $this->getInput($value) . "</td>";
         }
     }
     return (isset($top) ? $top : "") . $string . $separator . $multiPageRow . "</table>";
 }
Beispiel #2
0
 function getBrowserHTML($lineWithId = -1)
 {
     $this->texts = $this->languageClass->getBrowserTexts();
     $singularLanguageClass = $this->loadLanguageClass($this->singularClass);
     $userCanDelete = mUserdata::isDisallowedTo("cantDelete" . $this->singularClass);
     $userCanCreate = mUserdata::isDisallowedTo("cantCreate" . $this->singularClass);
     $userHiddenFields = mUserdata::getHides($this->singularClass);
     $defaultTarget = "contentRight";
     if ($this->displaySide != "default") {
         $defaultTarget = "content" . ucfirst($this->displaySide);
     }
     if ($this->singularClass == "none") {
         echo "collectionOf is not set. See message log for further details.";
         throw new CollectionOfNotSetException();
     }
     if ($this->name == "Noname") {
         $_SESSION["messages"]->addMessage("There is no name set. You might use setName of HTMLGUI to do that.");
     }
     /**
      * ERROR-TABLE
      */
     $errorTab = new HTMLTable(1);
     if (isset($_SESSION["phynx_errors"]) and $lineWithId == -1 and ($_SERVER["HTTP_HOST"] == "dev.furtmeier.lan" or strpos(__FILE__, "nemiah") !== false)) {
         $errorTab->addRow("\n\t\t\t\t\t<img style=\"float:left;margin-right:10px;\" src=\"./images/navi/warning.png\" />\n\t\t\t\t\t<b>Es " . (count($_SESSION["phynx_errors"]) != 1 ? "liegen" : "liegt") . " " . count($_SESSION["phynx_errors"]) . " PHP-Fehler vor:</b><br />\n\t\t\t\t\t<a href=\"javascript:windowWithRme('Util','','showPHPErrors','');\">Fehler anzeigen</a>,<br />\n\t\t\t\t\t<a href=\"javascript:rme('Util','','deletePHPErrors','','contentManager.reloadFrameRight();');\">Fehler löschen</a>");
     }
     /**
      * RETURN-BUTTON
      */
     $returnTab = new HTMLTable(1);
     if ($this->isSelection) {
         $BReturn = new Button("Auswahl\nbeenden", "back");
         $BReturn->onclick("contentManager.restoreFrame('content" . ucfirst($this->displaySide) . "','selectionOverlay');");
         #return "<input type=\"button\" value=\"zurück zu\n".$p2[$s[0]]."\" style=\"background-image:url(./images/navi/back.png);\" class=\"bigButton backgroundColor3\" onclick=\"loadFrameV2('contentRight','$s[0]');\" />";
         $returnTab->addRow($BReturn);
     }
     /**
      * DELETE-BUTTON
      */
     if ((!$this->onlyDisplayMode or $this->deleteInDisplayMode) and $userCanDelete and !$this->isSelection and $this->showDeleteButton) {
         $this->newColsRight["delete"] = "\n\t\t\t<span class=\"iconic trash_stroke\" onclick=\"deleteClass('" . $this->singularClass . "','%%VALUE%%', " . ($this->JSOnDelete == null ? "function() { " . ($this->displaySide == "left" ? "contentManager.reloadFrameLeft();" : "contentManager.reloadFrameRight(); if(typeof lastLoadedLeft != 'undefined' && lastLoadedLeft == '%%VALUE%%') \$('contentLeft').update('');") . " }" : $this->JSOnDelete) . ",'" . str_replace("%1", $this->singularName, $this->texts["%1 wirklich löschen?"]) . "');\"></span>";
     } elseif (!$userCanDelete) {
         $this->newColsRight["delete"] = "<img src=\"./images/i2/empty.png\" />";
     }
     /**
      * EDIT-BUTTON
      */
     if (!isset($this->newColsLeft["select"]) and (!$this->onlyDisplayMode or $this->editInDisplayMode) and $this->showEditButton) {
         $EB = new Button("", "./images/i2/edit.png");
         $EB->type("icon");
         $EB->className("editButton");
         if ($this->JSOnEdit == null) {
             $EB->onclick("contentManager.selectRow(this); contentManager.loadFrame('contentLeft','" . $this->singularClass . "','%%VALUE%%','0');");
         } else {
             $EB->onclick($this->JSOnEdit);
         }
         $this->newColsLeft["select"] = $EB;
     }
     $cols = count($this->showAttributes) + count($this->newColsLeft) + count($this->newColsRight);
     $valuesTab = new HTMLTable($cols, $lineWithId == -1 ? $this->displaySide == "left" ? $this->name : "" : null);
     $valuesTab->addTableClass("contentBrowser");
     /*if(isset($this->newColsRight["delete"]) AND ($this->displaySide == "default" OR $this->displaySide == "right"))
     			$valuesTab->setColClass($cols, "backgroundColor0");
     		if(isset($this->newColsRight["delete"]) AND $this->displaySide == "left")
     			$valuesTab->setColClass(1, "backgroundColor0");*/
     /**
      * QUICKSEARCH
      */
     #$quickSearchRow = "";
     if ($this->quickSearchPlugin != "" and $lineWithId == -1) {
         list($quickSearchRow, $BSearchInfo) = $this->getQuicksearchField();
         if ($this->displaySide == "left") {
             $insertRow = array($quickSearchRow);
             for ($i = 1; $i < $cols - 1; $i++) {
                 $insertRow[] = "";
             }
             $insertRow[] = $BSearchInfo;
             $valuesTab->addRow($insertRow);
             $valuesTab->addRowColspan(1, $cols - 1);
         } else {
             $valuesTab->addRow(array($BSearchInfo, $quickSearchRow));
             $valuesTab->addRowColspan(2, $cols - 1);
         }
         $valuesTab->addRowClass("backgroundColorHeader");
     }
     if ($this->headerRow != null) {
         $valuesTab->addHeaderRow($this->headerRow);
     }
     /**
      * PAGE-BROWSER
      */
     #$multiPageRow = "";
     $separator = "";
     $userDefinedEntriesPerPage = false;
     $isMultiPageMode = false;
     if (count($this->multiPageMode) > 0) {
         $isMultiPageMode = true;
         $this->multiPageMode[3] = $defaultTarget;
         if ($this->multiPageMode[2] == 0) {
             $userDefinedEntriesPerPage = true;
             #$mU = new mUserdata();
             #$this->multiPageMode[2] = $mU->getUDValue("entriesPerPage{$this->multiPageMode[4]}");
             #if($this->multiPageMode[2] == null) $this->multiPageMode[2] = 20;
         }
         /*
         
         if($this->multiPageMode[1] == "undefined") $this->multiPageMode[1] = 0;
         
         $pages = ceil($this->multiPageMode[0] / $this->multiPageMode[2]);
         
         if($this->multiPageMode[1] != 0) $pageLinks = "<a href=\"javascript:contentManager.loadPage('$defaultTarget', '0');\">&nbsp;&lt;&lt;&nbsp;</a> ";
         else $pageLinks = "&nbsp;&lt;&lt;&nbsp; ";
         
         if($this->multiPageMode[1] != 0) $pageLinks .= "<a href=\"javascript:contentManager.backwardOnePage('$defaultTarget');\">&nbsp;&lt;&nbsp;</a> ";
         else $pageLinks .= "&nbsp;&lt;&nbsp; ";
         
         if($this->multiPageMode[1] != $pages - 1) $pageLinks .= "<a href=\"javascript:contentManager.forwardOnePage('$defaultTarget');\">&nbsp;&gt;&nbsp;</a> ";
         else $pageLinks .= "&nbsp;&gt;&nbsp; ";
         
         if($this->multiPageMode[1] != $pages - 1) $pageLinks .= "<a href=\"javascript:contentManager.loadPage('$defaultTarget',".($pages-1).");\">&nbsp;&gt;&gt;&nbsp;</a> | ";
         else $pageLinks .= "&nbsp;&gt;&gt;&nbsp; | ";
         
         $start = $this->multiPageMode[1] - 3;
         if($start < 0) $start = 0;
         
         $end = $this->multiPageMode[1] + 3;
         if($end > $pages - 1) $end = $pages - 1;
         
         for($i=$start; $i<=$end; $i++)
         	if($this->multiPageMode[1] != "$i") $pageLinks .= "<a href=\"javascript:contentManager.loadPage('$defaultTarget','".$i."');\">".($i+1)."</a> ";
         	else $pageLinks .= ($i+1)." ";
         
         	$pageLinks = "".($pages == 0 ? 1 : $pages)." ".(($pages == 0 ? 1 : $pages) != 1 ? $this->texts["Seiten"] : $this->texts["Seite"]).": ".$pageLinks;
         */
         if ($this->displaySide == "left") {
             $pageLinks = "<span style=\"float:right;\">" . $this->getMultiPageButtons() . "</span>";
         } else {
             $pageLinks = $this->getMultiPageButtons();
         }
         /*if($lineWithId == -1) $multiPageRow = "
         					<tr>
         						".($userDefinedEntriesPerPage ? "<td><img class=\"mouseoverFade\" src=\"./images/i2/settings.png\" onclick=\"phynxContextMenu.start(this, 'HTML','multiPageSettings:{$this->multiPageMode[4]}','".$this->texts["Einstellungen"].":');\" /></td>" : "")."
         						<td colspan=\"".($colspan+1+($userDefinedEntriesPerPage ? 0 : 1))."\"><input type=\"text\"onkeydown=\"if(event.keyCode == 13) loadFrameV2('".$this->multiPageMode[3]."','".$this->multiPageMode[4]."','',this.value - 1);\" style=\"width:30px;float:right;text-align:right;\" value=\"".($this->multiPageMode[1]+1)."\" onfocus=\"focusMe(this);\" onblur=\"blurMe(this);\" />".$this->multiPageMode[0]." ".($this->multiPageMode[0] == 1 ? $this->texts["Eintrag"] : $this->texts["Einträge"])."<!--, ".$pages." ".($pages != 1 ? $this->texts["Seiten"] : $this->texts["Seite"])."--></td>
         					</tr>
         					<tr>
         						<td colspan=\"$determinedNumberofCols\">".($pages == 0 ? 1 : $pages)." ".(($pages == 0 ? 1 : $pages) != 1 ? $this->texts["Seiten"] : $this->texts["Seite"]).": $pageLinks</td>
         					</tr>";
         
         
         */
         if ($lineWithId == -1) {
             $BSettings = $this->getPageOptionsButton();
             #$IPage = $this->getPageSelectionField();
             #$IPage->style("width:30px;float:right;text-align:right;");
             $pageOptions = $this->multiPageMode[0] . " " . ($this->multiPageMode[0] == 1 ? $this->texts["Eintrag"] : $this->texts["Einträge"]) . ", {$pageLinks}";
             if (!$userDefinedEntriesPerPage) {
                 $valuesTab->addRow(array($pageOptions));
                 $valuesTab->addRowColspan(1, $cols);
             } else {
                 if ($this->displaySide == "left") {
                     $insertRow = array($pageOptions);
                     for ($i = 1; $i < $cols - 1; $i++) {
                         $insertRow[] = "";
                     }
                     $insertRow[] = $BSettings;
                     $valuesTab->addRow($insertRow);
                     #$valuesTab->addRow(array($pageOptions,$BSettings));
                     $valuesTab->addRowColspan(1, $cols - 1);
                 } else {
                     /*$insertRow = array($BSettings);
                     		for($i=1; $i<$cols-1; $i++)
                     			$insertRow[] = "";
                     		$insertRow[] = $pageOptions;
                     		$valuesTab->addRow($insertRow);*/
                     $valuesTab->addRow(array($BSettings, $pageOptions));
                     $valuesTab->addRowColspan(2, $cols - 1);
                 }
             }
             $valuesTab->addRowClass("backgroundColorHeader");
             #$valuesTab->addRow(array($pageLinks));
             #$valuesTab->addRowColspan(1, $cols);
             #$valuesTab->addRowClass("backgroundColorHeader");
             $valuesTab->addRow("");
             $valuesTab->addRowColspan(1, $cols);
             $valuesTab->addRowClass("backgroundColor0 browserSeparatorTop");
         }
     }
     $filteredCol = null;
     if ($lineWithId == -1 and $this->showFilteredCategoriesWarning != null and $this->showFilteredCategoriesWarning[0]) {
         $dB = new Button($this->texts["Filter löschen"], "./images/i2/delete.gif");
         $dB->style("float:right;");
         $dB->type("icon");
         $dB->rme("HTML", "", "saveContextMenu", array("'deleteFilters'", "'{$this->showFilteredCategoriesWarning[1]}'"), "if(checkResponse(transport)) contentManager.reloadFrameRight();");
         /*$separator = "
         		<tr>
         			<td class=\"backgroundColor0\"".((isset($this->showFilteredCategoriesWarning[0]) AND $this->showFilteredCategoriesWarning[0] == true) ? "<img src=\"./images/i2/note.png\" /></td><td class=\"backgroundColor0\" colspan=\"".($determinedNumberofCols - 2)."\" style=\"color:grey;\" >".$this->texts["Anzeige wurde gefiltert"]."</td><td class=\"backgroundColor0\">$dB</td>" : " >")."</td>
         		</tr>";*/
         $filteredCol = array("<img src=\"./images/i2/note.png\" />", $dB . $this->texts["Anzeige wurde gefiltert"]);
         $valuesTab->addRow($filteredCol);
         $valuesTab->addRowColspan(2, $cols - 1);
         $valuesTab->addRowClass("backgroundColor0");
         $valuesTab->addRowStyle("color:grey;");
     }
     /**
      * NEW-BUTTON
      */
     if (!$this->onlyDisplayMode and $userCanCreate and $this->showNewButton and $lineWithId == -1) {
         $BNew = new Button("", "./images/i2/new.gif");
         $BNew->type("icon");
         $BNew->id("buttonNewEntry{$this->singularClass}");
         #$BNew->onclick($this->JSOnNew == null ? "contentManager.newClassButton('$this->singularClass','');" : $this->JSOnNew);
         if ($this->displaySide == "left") {
             #$valuesTab->addRow(array("<b>$this->singularName neu anlegen</b>",$BNew));
             #$valuesTab->addRowColspan(1, $cols-1);
         } else {
             $valuesTab->addRow(array($BNew, "<b>{$this->singularName} neu anlegen</b>"));
             $valuesTab->addRowColspan(2, $cols - 1);
             $valuesTab->addRowEvent("click", $this->JSOnNew == null ? "contentManager.newClassButton('{$this->singularClass}','');" : $this->JSOnNew);
             $valuesTab->addRowStyle("cursor:pointer;");
         }
         #$valuesTab->addRowColspan(2, $cols-1);
     }
     /**
      * TABLE-CONTENT
      */
     $displayGroup = null;
     for ($i = 0; $i < count($this->attributes); $i++) {
         $aid = $this->attributes[$i]->getID();
         // get the id of an object separately
         $sc = $this->attributes[$i]->getA();
         // get the attributes-object from the object
         if ($this->displayGroupBy != null) {
             $displayGroupField = $this->displayGroupBy;
             if ($sc->{$displayGroupField} != $displayGroup and $i > 0) {
                 $valuesTab->addRow("");
                 $valuesTab->addRowClass("backgroundColor0");
             }
         }
         $row = array();
         $styles = array();
         if ($this->displaySide == "left") {
             $colsLeft = $this->newColsRight;
             $colsRight = $this->newColsLeft;
         } else {
             $colsLeft = $this->newColsLeft;
             $colsRight = $this->newColsRight;
         }
         if (count($colsLeft) > 0) {
             foreach ($colsLeft as $key => $value) {
                 $row[] = str_replace("%%VALUE%%", $aid, $value);
                 $valuesTab->setColWidth(count($row), "20px");
             }
         }
         foreach ($this->showAttributes as $key => $value) {
             if (isset($userHiddenFields[$value])) {
                 continue;
             }
             if (isset($this->parsers[$value])) {
                 $t = $this->invokeParser($this->parsers[$value], $sc->{$value}, $this->makeParameterStringFromArray($this->parserParameters[$value], $sc, $aid));
             } else {
                 $t = htmlspecialchars($sc->{$value});
             }
             if ($this->multiEditMode != null and in_array($value, $this->multiEditMode)) {
                 $posInArray = array_search($value, $this->multiEditMode);
                 if ($this->multiEditModeInputs[$posInArray] == null) {
                     $MI = new HTMLInput($value . "ID{$aid}", "multiInput", $sc->{$value}, array($this->singularClass, $aid, $value));
                     if ($this->multiEditModeStyle != null) {
                         $MI->style($this->multiEditModeStyle[$posInArray]);
                     }
                 } else {
                     $MI = clone $this->multiEditModeInputs[$posInArray];
                     $MI->setValue($sc->{$value});
                     $MI->activateMultiEdit($this->singularClass, $aid);
                 }
                 $t = $MI;
             }
             #<td id=\"Browser".$value."$aid\" ".(isset($this->colStyles[$value]) ? "style=\"".$this->colStyles[$value]."\"" : "").">".$t."</td>";
             $row[] = $t;
             if (isset($this->colStyles[$value])) {
                 $styles[count($row)] = $this->colStyles[$value];
             }
         }
         if (count($colsRight) > 0) {
             foreach ($colsRight as $key => $value) {
                 $row[] = str_replace("%%VALUE%%", $aid, $value);
                 $valuesTab->setColWidth(count($row), "20px");
             }
         }
         $valuesTab->addRow($row);
         if (count($styles) > 0) {
             foreach ($styles as $col => $s) {
                 $valuesTab->addColStyle($col, $s);
             }
         }
         $valuesTab->setRowID("BrowserMain{$aid}");
         #foreach($this->showAttributes as $key => $value) {
         #	$valuesTab->addCellID($cellNo, "Browser".$value."$aid");
         #}
         if ($this->displayGroupBy != null) {
             $displayGroup = $sc->{$displayGroupField};
         }
     }
     if ($filteredCol !== null) {
         $valuesTab->addRow($filteredCol);
         $valuesTab->addRowColspan(2, $cols - 1);
         $valuesTab->addRowClass("backgroundColor0");
         $valuesTab->addRowStyle("color:grey;");
     }
     if ($lineWithId == -1 and $isMultiPageMode) {
         $valuesTab->addRow("");
         $valuesTab->addRowColspan(1, $cols);
         $valuesTab->addRowClass("backgroundColor0 browserSeparatorBottom");
         if (!$userDefinedEntriesPerPage) {
             $valuesTab->addRow(array($pageOptions));
             $valuesTab->addRowColspan(1, $cols);
         } else {
             if ($this->displaySide == "left") {
                 $valuesTab->addRow(array($pageOptions, $BSettings));
                 $valuesTab->addRowColspan(1, $cols - 1);
             } else {
                 $valuesTab->addRow(array($BSettings, $pageOptions));
                 $valuesTab->addRowColspan(2, $cols - 1);
             }
         }
         $valuesTab->addRowClass("backgroundColorHeader");
         #$valuesTab->addRow(array($pageLinks));
         #$valuesTab->addRowColspan(1, $cols);
         #$valuesTab->addRowClass("backgroundColorHeader");
     }
     if (count($this->attributes) == 0) {
         $valuesTab->addRow(array("keine Einträge"));
         $valuesTab->addRowColspan(1, $cols);
     }
     if ($lineWithId != -1) {
         $valuesTab = $valuesTab->getHTMLForUpdate();
     }
     return $errorTab . $returnTab . $valuesTab . ($lineWithId == -1 ? $this->tip : "");
 }