Example #1
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 #2
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 #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
 /**
  * @return base_html_model_table_Row
  */
 protected function createHeadRow()
 {
     $headRow = new base_html_model_table_Row();
     $headRow->setClass('headerRow');
     foreach ($this->cols as $columnName) {
         $cell = new base_html_model_table_Cell();
         $cell->setContent($this->obj->getFieldinfo($columnName)->getFieldLabel());
         $headRow->addCell($cell);
     }
     return $headRow;
 }
Example #6
0
            $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'))
            . 'Es wurden noch keine Waren ausgewählt'
            . Html::endTag('div');
        $orderBox .= Html::startTag('div', array('id' => 'orderContent'));
        $form = new base_html_model_Form();
        $orderBox .= $form->start('ajax.php?controller=medexchange_ajax_save_medorder_Controller', 'post', array('class' => 'ajaxForm'));
        $orderBox .= $table->toString();
        $orderBox .= Html::startTag('div', array('id' => 'totalAmount'))
            . "Gesamt:\t" . Html::startTag('span') . Html::endTag('span') . " €"
            . Html::endTag('div') . "<br />";
Example #7
0
    $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());


    $submit = new base_form_element_Submit(new Fieldinfo('BaseObject'));
    $submit->setName('submit');
    $submit->setValue('Einloggen');
    
    $od->addContent($submit->display());
    $od->addContent("</form>\n");
}

base_ui_Site::endMainContent($od);