public function showBody() { $table = new base_html_model_Table(); $table->setCssClass('form ' . strtolower(get_class($this->model->getObj()))); $obj = $this->model->getObj(); $lkLabel = $obj->getFieldinfo('LK')->getFieldLabel(); $hiddenInputs = []; foreach ($this->model->getFormElements() as $label => $element) { if ($element->getDisplayMode() == DisplayClass::HIDE && $label != $lkLabel) { continue; } if ($label == $lkLabel) { $hiddenInputs[] = $element; continue; } $row = new base_html_model_table_Row(); $labelCell = new base_html_model_table_Cell(); $labelCell->setCssClass('label'); $labelCell->setContent($label); $valueCell = new base_html_model_table_Cell(); $valueCell->setCssClass('content'); $valueCell->setContent($element->display()); $row->addCell($labelCell); $row->addCell($valueCell); $table->addRow($row); } $output = $table->toString(); /** @var base_form_element_Hidden $hiddenInput */ foreach ($hiddenInputs as $hiddenInput) { $output .= $hiddenInput->display(); } return $output; }
private function _setTableRow(base_html_model_Table $table, BaseObject $obj) { // $user = Flat::user(); // if (!$user->isEntitled($obj->getPermissionForViewMode(DisplayClass::VIEW))) { // return; // } $row = new base_html_model_table_Row(); $row->setId(strtolower(get_class($obj)) . '_' . $obj->getLogicalKey()); foreach ($this->showColumns as $colName => $colLabel) { $cell = new base_html_model_table_Cell(); $cell->setCssClass($colName); $cell->setContent($obj->getField($colName)); $row->addCell($cell); } $objClass = get_class($obj); $taskLinks = Html::url($_SERVER['SCRIPT_NAME'] . '?controller=base_pages_input_controller_BaseObject&class=' . $objClass . '&LK=' . $obj->getLogicalKey() . '&mode=view', Html::pictogram('view'), ['title' => 'Anzeigen']); $taskLinks .= Html::url($_SERVER['SCRIPT_NAME'] . '?controller=base_pages_input_controller_BaseObject&class=' . $objClass . '&LK=' . $obj->getLogicalKey() . '&mode=edit', Html::pictogram('edit'), ['title' => 'Bearbeiten']); $taskLinks .= Html::url(HTML_ROOT . '/de/ajax.php?controller=base_ajax_delete_Controller&class=' . $objClass . '&LK=' . $obj->getLogicalKey(), Html::pictogram('delete'), ['class' => 'ajaxOnClick', 'title' => 'Löschen']); $cell = new base_html_model_table_Cell(); $cell->setCssClass('task'); $cell->setContent($taskLinks); $row->addCell($cell); $table->addRow($row); }
/** * implements the content of the viewed page * * @param OutputDevice $od */ protected function addPageContent(OutputDevice $od) { $table = new base_html_model_Table(); $form = new base_html_model_Form(); $cellUsernameLabel = new base_html_model_table_Cell(); $cellUsernameLabel->setContent($form->label('Benutzername', 'userName')); $cellUsernameInput = new base_html_model_table_Cell(); $cellUsernameInput->setContent($form->textInput('userName')); $cellPasswordLabel = new base_html_model_table_Cell(); $cellPasswordLabel->setContent($form->label('Passwort', 'password')); $cellPasswordInput = new base_html_model_table_Cell(); $cellPasswordInput->setContent($form->passwordInput('password')); $row = new base_html_model_table_Row(); $row->addCell($cellUsernameLabel); $row->addCell($cellUsernameInput); $row1 = new base_html_model_table_Row(); $row1->addCell($cellPasswordLabel); $row1->addCell($cellPasswordInput); $table->addRow($row); $table->addRow($row1); $od->addContent($form->start(HTML_ROOT . '/de/ajax.php?class=base_login_ajax_DoLogin', 'post', array('class' => 'ajaxForm', 'id' => 'login'))); $od->addContent($table->toString()); $od->addContent($form->submitButton('login', 'Einloggen')); $od->addContent($form->end()); }
/** * @param $news * @param $table * @return base_html_model_table_Row * @throws base_html_model_Exception */ private function _createContentRow(News $news, base_html_model_Table $table) { $content = $news['content']; if (strlen($content) > 400) { $content = $this->_shortenContent($content); } $row = new base_html_model_table_Row(); $contentCell = new base_html_model_table_Cell(); $contentCell->setCssClass('content'); $contentCell->setContent($content); $contentCell->setColSpan(2); $row->addCell($contentCell); $table->addRow($row); return $row; }
public function toString() { $htmlTable = new base_html_model_Table(); $htmlTable->setId('searchTable'); $headRow = $this->createHeadRow(); $htmlTable->addHeadRow($headRow); foreach ($this->rowContent as $obj) { $row = new base_html_model_table_Row(); foreach ($this->cols as $columnName) { $cell = new base_html_model_table_Cell(); $cell->setContent($obj->getField($columnName)); $row->addCell($cell); } $htmlTable->addRow($row); } return $htmlTable->toString(); }
$formElement->setValue(0); $formElement->setDisplayMode(DisplayClass::EDIT); $content = $formElement->display(); $formElement = new base_form_element_Hidden($obj->getFieldinfo('LK')); $formElement->setMultiline(); $formElement->setName('LK'); $value = $obj['LK']; $formElement->setValue($value); $content .= " " . $formElement->display(); $cell->setContent($content); $row->addCell($cell); $table->addRow($row); } $od->addContent($table->toString()); $table = new base_html_model_Table(); $table->setId('orderTable'); $row = new base_html_model_table_Row(); $row->setRowType(base_html_model_table_Row::ROWTAG_HEAD); $titlesForOrderTable = array('Artikel', 'NettoPreis', 'Menge', 'Gesamt'); foreach ($titlesForOrderTable as $title) { $cell = new base_html_model_table_Cell(); $cell->setContent($title); $row->addCell($cell); } $table->addHeadRow($row); $orderBox = Html::startTag('div', array('id' => 'order')); $orderBox .= Html::startTag('p', array('id' => 'orderHeadline')) . 'Warenkorb' . Html::endTag('p'); $orderBox .= Html::startTag('div', array('id' => 'orderNoContent'))
} if (!in_array($nodeName, $nodeNames)) { $nodeNames[] = $nodeName; } $startTimeString = $startTime->display('d.m.Y'); if (!in_array($startTimeString, array_keys($times))) { $times[$startTimeString] = $startTime; } $sortedObjects[$startTimeString][$nodeName] = $obj; } $table = new base_html_model_Table(); $headRow = new base_html_model_table_Row(); $cell = new base_html_model_table_Cell(); $cell->setContent('Node'); $headRow->addCell($cell); foreach (array_values($times) as $time) { $cell = new base_html_model_table_Cell(); $cell->setContent($time->display('d')); $headRow->addCell($cell); } $table->addHeadRow($headRow); foreach ($nodeNames as $nodeName) { $row = new base_html_model_table_Row(); $cell = new base_html_model_table_Cell(); $cell->setContent($nodeName); $row->addCell($cell);
} if (!in_array($nodeName, $nodeNames)) { $nodeNames[] = $nodeName; } $startTimeString = $startTime->display('d.m.Y'); if (!in_array($startTimeString, array_keys($times))) { $times[$startTimeString] = $startTime; } $sortedObjects[$startTimeString][$nodeName] = $obj; } $table = new base_html_model_Table(); $table->setId('searchTable'); $headRow = new base_html_model_table_Row(); $cell = new base_html_model_table_Cell(); $cell->setContent('Node'); $headRow->addCell($cell); foreach (array_values($times) as $time) { $cell = new base_html_model_table_Cell(); $cell->setContent($time->display('d')); $headRow->addCell($cell); } $table->addHeadRow($headRow); foreach ($nodeNames as $nodeName) { $row = new base_html_model_table_Row(); $cell = new base_html_model_table_Cell(); $cell->setContent($nodeName);
base_ui_Site::displayNavigation($od); base_ui_Site::startMainContent($od); $od->addContent(Html::startTag('h3')); $od->addContent('Benutzer LogIn'); $od->addContent(Html::endTag('h3')); print $od->toString(); $od->flush(); if (User::isLoggedIn()) { $od->addContent('Zum Ausloggen bitte ' . Html::url(HTML_ROOT . '/' . Flat::language() . '/logout.php', 'hier') . "klicken\n"); } else { $od->addContent("<form method='post' action='ajax.php?controller=base_ajax_login_Controller&redirect=index.php' class='ajaxForm' >\n"); $table = new base_html_model_Table(); $labelCell = new base_html_model_table_Cell(); $labelCell->setContent('Benutzername'); $valueCell = new base_html_model_table_Cell(); $obj = Factory::createObject('user'); $inputUserName = base_form_element_Factory::createElement($obj->getFieldinfo('userid')); $inputUserName->setName('userid'); $inputUserName->setDisplayMode(DisplayClass::EDIT); $valueCell->setContent($inputUserName->display()); $rowUserId = new base_html_model_table_Row(); $rowUserId->addCell($labelCell); $rowUserId->addCell($valueCell); $table->addRow($rowUserId); $labelCell = new base_html_model_table_Cell();
$gridScript = new base_js_JqGrid(); $gridScript->setGetParams($requestHelper->getAllParams())->setRowNum(10); $gridScript->setGetParam('controller', 'base_ajax_search_Controller'); $gridScript->setRowNum(25); $width = 0; foreach ($columnNames as $columnName) { $fi = $object->getFieldinfo($columnName); $width += $fi->getDisplayedLength(); $dtObj = $fi->getDatatypeObject(); $gridScript->setColModels($dtObj->getJSColModelElement()); $colNames[] = $fi->getFieldLabel(); } $gridScript->setColNames($colNames); $gridScript->setSortname('LK'); $gridScript->setCaption($object->getDisplayName()); $od->addContent($gridScript->toString()); $table = new base_html_model_Table(); $table->setId('searchTable'); $od->addContent($table->toString()); $od->addContent(Html::startTag('div', array('id' => 'navGrid')), Html::endTag('div')); } base_ui_Site::endMainContent($od); base_ui_Site::displayBottom($od); print $od->toString();