public function getEditHTML() { if (BPS::getProperty($this->className . "GUI", "edit") == "ok") { return $this->getEditTableHTML(); } ################################################################################ if ($this->name == null) { $this->name = $this->className; } if ($this->attributes == null) { $this->attributes = PMReflector::getAttributesArrayAnyObject($this->object->getA()); } $widths = Aspect::joinPoint("changeWidths", $this, __METHOD__); if ($widths == null) { $widths = array(700, 132, 218); } $tab = new HTMLTable(2); $tab->setTableStyle("width:{$widths['0']}px;margin-left:10px;"); $tab->setColWidth(1, "50%"); $tab->setColWidth(2, "50%"); $A = $this->object->getA(); $TSub = new HTMLTable(2); $TSub->setColWidth(1, 120); $TSub->setColClass(1, ""); $TSub->setColClass(2, ""); $TC = clone $TSub; $row = array(); foreach ($this->attributes as $k => $v) { if (isset($this->types[$v]) and $this->types[$v] == "hidden") { continue; } if (isset($this->parsers[$v])) { $A->{$v} = $this->invokeParser($this->parsers[$v], $A->{$v}, $this->object); } if (isset($this->types[$v]) and $this->types[$v] == "select") { if (isset($this->options[$v]) and isset($this->options[$v][$A->{$v}])) { $A->{$v} = $this->options[$v][$A->{$v}]; } } if (isset($this->spaces[$v]) and $this->spaces[$v] != "") { if ($k > 0) { $row[] = $TC; } if ($this->forceNewRow[$v]) { $row[] = ""; $tab->addRow($row); $tab->addRowClass("backgroundColor0"); $tab->addRowStyle("vertical-align:top;"); $row = array(); } if (count($row) == 2) { $tab->addRow($row); $tab->addRowClass("backgroundColor0"); $tab->addRowStyle("vertical-align:top;"); $row = array(); } $TC = clone $TSub; if (trim($this->spaces[$v]) != "") { $TC->addRow(array($this->spaces[$v])); $TC->addRowClass("backgroundColor2"); $TC->addRowColspan(1, 2); } } if ($A->{$v} != "") { $B = ""; if (isset($this->fieldButtons[$v])) { $B = $this->fieldButtons[$v]; $B->style("float:right;"); } $TC->addLV($this->labels($v) . ":", $B . nl2br($A->{$v})); $TC->addRowStyle("vertical-align:top;"); } /* $label = isset($this->labels[$v]) ? $this->labels[$v] : $v; $row[] = "<label>".($label != "" ? ucfirst($label).":" : "")."</label>"; $row[] = nl2br($A->$v);*/ /*if(count($row) == 4){ $tab->addRow($row); $row = array(); }*/ } $row[] = $TC; if (count($row) == 1) { $row[] = ""; } if (count($row) == 2) { $tab->addRow($row); $tab->addRowClass("backgroundColor0"); $tab->addRowStyle("vertical-align:top;"); } $BE = new Button("Eintrag\nbearbeiten", "edit"); $BE->onclick(str_replace(array("%CLASSNAME", "%CLASSID"), array($this->className, $this->object->getID()), $this->functionEdit)); $BE->style("float:left;margin-left:10px;"); $BD = new Button("Eintrag\nlöschen", "trash"); $BD->onclick(str_replace(array("%CLASSNAME", "%CLASSID"), array($this->className, $this->object->getID()), $this->functionDelete)); $BD->style("float:left;margin-left:10px;"); $options = "<div style=\"width:{$widths['0']}px;\">" . $BE . $BD . implode("", $this->topButtons) . "</div><div style=\"clear:left;height:10px;width:{$widths['0']}px;\"></div>"; $appended = ""; if (count($this->appended) > 0) { foreach ($this->appended as $k => $v) { $appended .= $v->getHTML(); } } $prepended = ""; if (count($this->prepended) > 0) { foreach ($this->prepended as $k => $v) { $prepended .= $v->getHTML(); } } /* if(count($this->CRMGUIappendedElements) > 0) foreach($this->CRMGUIappendedElements as $k => $v) $appended .= $v->getHTML();*/ return $options . $prepended . $tab . $appended; }
public function getHTML($id) { #$_SESSION["BPS"]->unregisterClass(get_class($this)); $defaultAnsicht = "monat"; if (Applications::activeApplication() == "personalKartei") { $defaultAnsicht = "jahr"; } $ansicht = mUserdata::getUDValueS("KalenderAnsicht", $defaultAnsicht); #$ansicht = $ansicht->getUDValue("KalenderAnsicht"); #if($ansicht == null) $ansicht = "monat"; $display = mUserdata::getUDValueS("KalenderDisplay" . ucfirst($ansicht), "0"); $BThis = new Button("", "arrow_down", "iconicG"); $BThis->style("float:left;margin-top:-6px;margin-right:5px;"); $Calendars = ""; Registry::reset("Kalender"); while ($C = Registry::callNext("Kalender", "categories")) { if (!$C) { continue; } foreach ($C as $tab) { $Calendars .= "<div onclick=\"{$tab->onclick}\">" . ($tab->isCurrent ? $BThis : "") . " {$tab->label}</div>"; } } // <editor-fold defaultstate="collapsed" desc="styles"> $html = "\n\t\t\n\t\t<style type=\"text/css\">\n\t\t.Day {\n\t\t\t-moz-user-select:none;\n\t\t\tborder-left:1px solid #EEE;\n\t\t\tborder-bottom:1px solid #EEE;\n\t\t}\n\t\t\n\t\t/*.Day:hover {\n\t\t\tborder-style:solid;\n\t\t\tborder-width:1px;\n\t\t\tpadding:2px;\n\t\t}*/\n\n\t\t.dayOptions {\n\t\t\tdisplay:none;\n\t\t}\n\n\t\t.Day:hover .dayOptions {\n\t\t\tdisplay:inline;\n\t\t}\n\n\t\t.Termin {\n\t\t\tposition:relative;\n\t\t\tleft:44px;\n\t\t\tcursor:pointer;\n\t\t\twidth:150px;\n\t\t\tfloat:left;\n\t\t\tborder-style:solid;\n\t\t\tborder-width:1px;\n\t\t\tmargin-right:3px;\n\t\t}\n\t\t\n\t\t.KalenderButton {\n\t\t\topacity:0.5;\n\t\t}\n\t\t\n\t\t.KalenderButton:hover {\n\t\t\topacity:1;\n\t\t}\n\t\t\n\t\t.KalenderUser {\n\t\t\tmargin-left:10px;\n\t\t}\n\t\t\n\t\t.KalenderUser div {\n\t\t\tpadding:10px;\n\t\t\tpadding-top:10px;\n\t\t\tpadding-bottom:5px;\n\t\t\tdisplay:inline-block;\n\t\t\tmargin-right:20px;\n\t\t\tcursor:pointer;\n\t\t\tmin-width:150px;\n\t\t}\n\t\t\n\t\t.cellHeight {\n\t\t}\n\t\t\n\t\t.ui-datepicker {\n\t\t\twidth: auto;\n\t\t}\n\n\t\t#contentScreen tr:hover {\n\t\t\tbackground-color:inherit;\n\t\t}\n\n\t\t#calendar1stMonth .ui-datepicker-prev, #calendar1stMonth .ui-datepicker-next/*,\n\t\t#calendar2ndMonth .ui-datepicker-prev, #calendar2ndMonth .ui-datepicker-next */{\n\t\t\tdisplay:none;\n\t\t}\n\t\t\n\t\t#calendar1stMonth .ui-widget-content,\n\t\t#calendar2ndMonth .ui-widget-content, \n\t\t#calendar2ndMonth .ui-widget-content .ui-state-default,\n\t\t#calendar1stMonth .ui-widget-content .ui-state-default {\n\t\t\tborder:0px;\n\t\t}\n\t\t\n\t\t#calendar1stMonth .ui-datepicker-header,\n\t\t#calendar2ndMonth .ui-datepicker-header {\n\t\t\tborder:0px;\n\t\t}\n\t\t\n\t\t/*@media only screen and (max-height: 820px) {\n\t\t\t.cellHeight {\n\t\t\t\theight:55px;\n\t\t\t}\n\t\t}*/\n\t\t</style>"; // </editor-fold> $BLeft = new Button("Zurück", "back", "icon"); $BLeft->rmePCR("mKalender", "", "setDisplay", $display - 1, "contentManager.loadFrame('contentScreen','mKalender');"); $BLeft->style("margin-right:10px;"); $BRight = new Button("Weiter", "navigation", "icon"); $BRight->rmePCR("mKalender", "", "setDisplay", $display + 1, "contentManager.loadFrame('contentScreen','mKalender');"); $BRight->style("margin-right:10px;"); $BToday = new Button("Aktuelles Datum", "down", "icon"); $BToday->rmePCR("mKalender", "", "setToday", '', "contentManager.loadFrame('contentScreen','mKalender');"); $BToday->style("margin-right:10px;"); $BJahr = new Button("Jahr", "./ubiquitous/Kalender/month.png", "icon"); $BJahr->rmePCR("mKalender", "", "setView", "jahr", "contentManager.loadFrame('contentScreen','mKalender');"); $BJahr->style("margin-right:10px;" . ($ansicht != "jahr" ? "opacity:0.5;" : "")); $BJahr->id("jahrButton"); $BMonat = new Button("Monat", "./ubiquitous/Kalender/month.png", "icon"); $BMonat->rmePCR("mKalender", "", "setView", "monat", "contentManager.loadFrame('contentScreen','mKalender');"); $BMonat->style("margin-right:10px;" . ($ansicht != "monat" ? "opacity:0.5;" : "")); $BMonat->id("monatButton"); $BWoche = new Button("Woche", "./ubiquitous/Kalender/workweek.png", "icon"); $BWoche->rmePCR("mKalender", "", "setView", "woche", "contentManager.loadFrame('contentScreen','mKalender');"); $BWoche->style("margin-right:10px;" . ($ansicht != "woche" ? "opacity:0.5;" : "")); $BWoche->id("wocheButton"); $BTag = new Button("Tag", "./ubiquitous/Kalender/day.png", "icon"); $BTag->rmePCR("mKalender", "", "setView", "tag", "contentManager.loadFrame('contentScreen','mKalender');"); $BTag->style("margin-right:10px;" . ($ansicht != "tag" ? "opacity:0.5;" : "")); $BTag->id("tagButton"); if (Applications::activeApplication() == "personalKartei") { $BTag = ""; $BWoche = ""; $BMonat = ""; } if (Applications::activeApplication() != "personalKartei") { $BJahr = ""; } $ST = new HTMLTable(1); $ST->setColClass(1, ""); #$ST->setTableStyle("width:40px;margin:0px;margin-right:-215px;float:right;/*margin-right:-50px;margin-top:95px;*/"); $newWindow = new Button("Kalender in neuem Fenster öffnen", "new_window", "iconicL"); $newWindow->style("margin-right:10px;"); $newWindow->newSession("Mail", Applications::activeApplication(), "mKalender", "Kalender"); if (Session::physion()) { $newWindow = ""; } $reminder = ""; if (Session::isPluginLoaded("mReminder")) { $reminder = Reminder::getButton(); $reminder->style("margin-right:10px;"); } $ST->addRow("<div id=\"calendar1stMonth\"></div>"); $ST->addRow("<div id=\"calendar2ndMonth\"></div>"); $TC = "KalenderView" . ucfirst($ansicht); $TC = new $TC(); $TCalendars = "<div>"; if (trim($Calendars) != "") { $TCalendars .= "<div class=\"KalenderUser\">" . $Calendars . "</div>"; } $TCalendars .= "</div>"; $pCalButton = ""; if (Session::isPluginLoaded("mpCal")) { $pCalButton = pCal::getTBButton(); $pCalButton->type("icon"); $pCalButton->style("margin-right:10px;"); } $GoogleButton = ""; $GoogleDLButton = ""; if (Session::isPluginLoaded("mGoogle")) { $GoogleButton = LoginData::getButtonU("GoogleAccountUserPass", "Google-Daten bearbeiten", "./ubiquitous/Google/google.png"); $GoogleButton->type("icon"); $GoogleButton->style("margin-right:10px;"); $GoogleDLButton = new Button("Daten herunterladen", "./ubiquitous/Google/googleDL.png", "icon"); $GoogleDLButton->popup("", "Daten herunterladen", "Google", "-1", "syncByDateRange", array("'" . date("Y-m-d", $TC->getFirst()) . "'", "'" . date("Y-m-d", $TC->getLast()) . "'")); $GoogleDLButton->style("margin-right:10px;"); } $xCalButton = ""; if (Session::isPluginLoaded("mxCal")) { $xCalButton = xCal::getButton(); $xCalButton->style("margin-right:10px;"); } $BShare = new Button("Kalender teilen", "fork", "iconicL"); $BShare->popup("", "Kalender teilen", "mKalender", "-1", "share"); $BShare->style("margin-right:10px;"); #$AWVButton = new Button("Müllabfuhr-Daten herunterladen", "trash_stroke", "iconicL"); #$AWVButton->popup("", "Müllabfuhr-Daten", "mKalender", "-1", "downloadTrashData"); $AWVButton = ""; $ST->addRow($pCalButton . $GoogleButton . $GoogleDLButton); $html .= "\n\t\t<div style=\"width:205px;float:right;margin-right:40px;\">\n\t\t\t\t<div style=\"padding-top:30px;padding-bottom:15px;padding-left:0px;\">\n\t\t\t\t\t{$newWindow}{$BShare}{$AWVButton}{$xCalButton}{$reminder}\n\t\t\t\t</div>\n\t\t</div>\n\t\t\n\t\t<div style=\"margin-right:270px;\">\n\t\t<div id=\"KalenderTitle\" class=\"prettyTitle\">\n\t\t\t\n\t\t\t<span style=\"float:right;\">\n\t\t\t\t{$BLeft}{$BToday}{$BRight}\n\t\t\t</span>\n\t\t\t<div style=\"float:right;margin-right:100px;\">{$BTag}{$BWoche}{$BMonat}{$BJahr}</div>\n\t\t\t" . $TC->getTitle() . "\n\t\t</div>\n\t\t</div>\n\t\t<div id=\"KalenderAuswahl\">\n\t\t\t{$TCalendars}\n\t\t</div>\n\t\t" . $TC->getHeader() . "\n\t\t<div id=\"KalenderWrapper\" style=\"overflow:auto;\">\n\t\t\t" . ($ansicht != "jahr" ? "\n\t\t\t<div style=\"width:205px;float:right;margin-right:40px;\">\n\t\t\t\t<div style=\"height:23px;\"></div>{$ST}\n\t\t\t</div>" : "") . "\n\t\t\t<div style=\"" . ($ansicht != "jahr" ? "margin-right:270px;" : "") . "\">\n\n\t\t\t" . $TC->getTable($this) . "\n\t\t\t</div>\n\t\t</div>"; $nextMonths = new Datum(); $nextMonths->setToMonth1st(); $thisMonth = $nextMonths->time(); $nextMonths->addMonth(); $nextMonth = $nextMonths->time(); $html .= OnEvent::script("\$j(function() {\n\t\t\$j('#calendar1stMonth').datepicker({ minDate: '" . date("d.m.Y", $thisMonth) . "'" . ($TC->getCurrent()->time() < $nextMonth ? ",defaultDate: '" . date("d.m.Y", $TC->getCurrent()->time()) . "'" : "") . ", showWeek: true, showOtherMonths: true, onSelect: function(dateText, inst) { var day = Math.round(+new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay, 0, 1, 0)/1000); " . OnEvent::rme($this, "setView", array("'tag'", "day"), "function(){ " . OnEvent::reload("Screen") . " }") . " } });\n\t\t\t\n\t\t\$j('.KalenderUser div[class!=backgroundColor1]').hover(function(){ \$j(this).addClass('backgroundColor2'); }, function(){ \$j(this).removeClass('backgroundColor2'); });\n\t\tfitKalender();\n\t\t\t\n\t\t\$j(window).resize(function() {\n\t\t\tfitKalender();\n\t\t});\n\t\t\n\t\t});\n\t\t\n\t\tfunction fitKalender(){\n\t\t\tif(!\$j('#KalenderTitle').length)\n\t\t\t\treturn;\n\t\t\t\n\t\t\t//console.log(\$j('#KalenderTitle').outerHeight());\n\t\t\t//console.log(\$j('#KalenderAuswahl').outerHeight());\n\t\t\tvar height = (contentManager.maxHeight() - \$j('#KalenderAuswahl').outerHeight() - \$j('#KalenderTitle').outerHeight() - \$j('#KalenderHeader').outerHeight()) + 4;\n\t\t\tvar width = contentManager.maxWidth();\n\t\t\t\n\t\t\t\$j('#KalenderWrapper').css('height', height);\n\t\t\t\$j('#KalenderWrapper').css('width', width);\n\n\t\t\tvar cellHeight = (height - \$j('#KalenderTable tr:first th').parent().outerHeight()) / (\$j('#KalenderTable tr').length - " . (($ansicht == "monat" or $ansicht == "jahr") ? "1" : "0") . ") - 1;\n\t\t\t\$j('.cellHeight').css('height', cellHeight+'px');\n\t\t\t\$j('.innerCellHeight').css('height', (cellHeight - \$j('.innerCellTitle:visible').outerHeight())+'px');\n\t\t\t\n\t\t\tif(\$j('#KalenderHeader').length > 0){\n\t\t\t\t//console.log(\$j('#KalenderHeader tr:first th'));\n\t\t\t\t\$j('#KalenderTable tr:first td').each(function(k, v){\n\t\t\t\t\t\n\t\t\t\t\t\$j(\$j('#KalenderHeader tr:first th')[k]).css('width', \$j(v).width());\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\tif(\$j('#tagDiv').length) {\n\t\t\t\t\$j('#tagDiv').css('width', \$j('#KalenderTable tr').width()+'px');\n\t\t\t\t\$j('#tagDiv').animate({scrollTop: 7*40}, 0);\n\t\t\t\tvar pos = \$j('#tagDiv').offset();\n\t\t\t\tpos.position = 'absolute';\n\n\t\t\t\t\$j('#tagDiv').css(pos)\n\t\t\t}\n\t\t}") . "\n\t\t<style type=\"text/css\">\n\t\t\t" . ($TC->getCurrent()->time() < $thisMonth ? "#calendar1stMonth .ui-state-default { border: 1px solid #D3D3D3; background-color:transparent; }" : "") . "\n\t\t\t" . ($TC->getCurrent()->time() < $nextMonth ? "#calendar2ndMonth .ui-state-default { border: 1px solid #D3D3D3; background-color:transparent; }" : "") . "\n\t\t\t.ui-datepicker-week-col { color:grey; text-align:left; }\n\t\t\ttr td.ui-datepicker-week-col {text-align:left;font-size:10px; }\n\t\t\t/*.ui-datepicker-week-end { background-color:#DDD; }*/\n\t\t</style>"; $html .= OnEvent::script("\$j(function() {\n\t\t\$j('#calendar2ndMonth').datepicker({ minDate: '" . date("d.m.Y", $nextMonth) . "'" . ($TC->getCurrent()->time() >= $nextMonth ? ", defaultDate: '" . date("d.m.Y", $TC->getCurrent()->time()) . "'" : "") . ", showWeek: true, showOtherMonths: true, onSelect: function(dateText, inst) { var day = Math.round(+new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay, 0, 1, 0)/1000); " . OnEvent::rme($this, "setView", array("'tag'", "day"), "function(){ " . OnEvent::reload("Screen") . " }") . " } });\n\t});"); return $html; }
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<img class=\"mouseoverFade\" 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?"]) . "');\" src=\"./images/i2/delete.gif\" />"; } 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"); if ($this->JSOnEdit == null) { $EB->onclick("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->onlyDisplayMode ? $singularLanguageClass == null ? "Bitte " . $this->name . " auswählen:" : $singularLanguageClass->getBrowserCaption() . ":" : ($singularLanguageClass == null ? $this->name : $singularLanguageClass->getPlural()) . ":" : null); 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("backgroundColor2"); } 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');\"> << </a> "; else $pageLinks = " << "; if($this->multiPageMode[1] != 0) $pageLinks .= "<a href=\"javascript:contentManager.backwardOnePage('$defaultTarget');\"> < </a> "; else $pageLinks .= " < "; if($this->multiPageMode[1] != $pages - 1) $pageLinks .= "<a href=\"javascript:contentManager.forwardOnePage('$defaultTarget');\"> > </a> "; else $pageLinks .= " > "; if($this->multiPageMode[1] != $pages - 1) $pageLinks .= "<a href=\"javascript:contentManager.loadPage('$defaultTarget',".($pages-1).");\"> >> </a> | "; else $pageLinks .= " >> | "; $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 = $IPage . $this->multiPageMode[0] . " " . ($this->multiPageMode[0] == 1 ? $this->texts["Eintrag"] : $this->texts["Einträge"]) . ""; 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("backgroundColor3"); $valuesTab->addRow(array($pageLinks)); $valuesTab->addRowColspan(1, $cols); $valuesTab->addRowClass("backgroundColor2"); } } 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>";*/ $valuesTab->addRow(array("<img src=\"./images/i2/note.png\" />", $dB . $this->texts["Anzeige wurde gefiltert"])); $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 ($lineWithId == -1 and $isMultiPageMode) { 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("backgroundColor2"); $valuesTab->addRow(array($pageLinks)); $valuesTab->addRowColspan(1, $cols); $valuesTab->addRowClass("backgroundColor3"); } 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 : ""); }