예제 #1
0
파일: Extended.php 프로젝트: kafruhs/fws
    /**
     * 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());
    }
예제 #2
0
파일: View.php 프로젝트: 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;
 }
예제 #3
0
파일: TableList.php 프로젝트: kafruhs/fws
    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);
    }
예제 #4
0
파일: MainPage.php 프로젝트: kafruhs/fws
 /**
  * @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;
 }
예제 #5
0
파일: Table.php 프로젝트: kafruhs/fws
    public function toString()
    {
        $this->attributes['class'] = $this->cssClass;

        if (isset($this->cssID)) {
            $this->attributes['id'] = $this->cssID;
        }

        $table  = Html::startTag('table', $this->attributes);

        if (isset($this->headRow)) {
            $table .= Html::startTag('thead') . $this->headRow->toString() . Html::endTag('thead');
        }

        if (!empty($this->rows)) {
            $table .= Html::startTag('tbody');
            foreach ($this->rows as $row) {
                $table .= $row->toString();
            }
            $table .= Html::endTag('tbody');
        }

        $table .= Html::endTag('table');
        return $table;
    }
예제 #6
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;
 }
예제 #7
0
파일: offer.php 프로젝트: kafruhs/fws
            $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'))
            . 'Es wurden noch keine Waren ausgewählt'
            . Html::endTag('div');
예제 #8
0
파일: showHistory.php 프로젝트: kafruhs/fws
}

$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);
    foreach ($times as $time => $timeObj) {
        if (!isset($sortedObjects[$time][$nodeName])) {
            $cell = new base_html_model_table_Cell();
            $cell->setContent(' ');
            $cell->setCssClass('noData');
            $row->addCell($cell);
            continue;
        }
        $obj = $sortedObjects[$time][$nodeName];
        $cell = new base_html_model_table_Cell();
        $cell->setContent(' ');
        switch ($obj['successful']) {
예제 #9
0
파일: login.php 프로젝트: kafruhs/fws
    $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());


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