Example #1
0
    /**
     * 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());
    }
Example #2
0
File: View.php Project: kafruhs/fws
 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;
 }
Example #3
0
    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);
    }
Example #4
0
 /**
  * @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;
 }
Example #5
0
 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();
 }
Example #6
0
            $formElement = base_form_element_Factory::createElement($fi);
            $formElement->setClass($formElement->getClass() . ' orderAmount');
            $formElement->setMultiline();
            $formElement->setName('orderAmount');
            $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);
Example #7
0
} 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();
    $labelCell->setContent('Passwort');
    $valueCell = new base_html_model_table_Cell();
    $inputPassword = base_form_element_Factory::createElement($obj->getFieldinfo('password'));
    $inputPassword->setName('password');
    $inputPassword->setDisplayMode(DisplayClass::EDIT);
    $valueCell->setContent($inputPassword->display());
    $rowPassword = new base_html_model_table_Row();
    $rowPassword->addCell($labelCell);
    $rowPassword->addCell($valueCell);
    $table->addRow($rowPassword);
    
    $od->addContent( $table->toString());