Exemple #1
0
 /**
  * display the content of this View
  *
  * @param OutputDevice $od
  */
 public function display(OutputDevice $od)
 {
     $od->addContent(Html::startTag('div', ['class' => 'news']));
     /** @var News $news */
     foreach ($this->controller->getModelData() as $news) {
         /** @var base_date_model_DateTime $firstEditTime */
         $firstEditTime = $news['firstEditTime'];
         $table = new base_html_model_Table();
         $table->setCssClass('news');
         $table->setId(get_class($news) . '_' . $news->getLogicalKey());
         $row = new base_html_model_table_Row();
         $row->setRowType(base_html_model_table_Row::ROWTAG_HEAD);
         $timeCell = new base_html_model_table_Cell();
         $timeCell->setCssClass('firstEditorTime');
         $timeCell->setContent($firstEditTime->display('d.m.y'));
         $titleCell = new base_html_model_table_Cell();
         $titleCell->setCssClass('title');
         $titleCell->setContent($news['title']);
         $row->addCell($timeCell);
         $row->addCell($titleCell);
         $table->addHeadRow($row);
         $this->_createContentRow($news, $table);
         $od->addContent($table->toString());
     }
     $od->addContent(Html::endTag('div'));
 }
Exemple #2
0
 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;
 }
Exemple #3
0
 /**
  * manages all page subelements and is defined in the different views
  *
  * @param OutputDevice $od
  */
 public function display(OutputDevice $od)
 {
     $this->data = $this->controller->getModelData();
     $this->showColumns = $this->controller->getColLabelNamesConnection();
     $od->addContent($this->_setFilterOptions());
     $table = new base_html_model_Table();
     $table->setCssClass('search');
     $this->_setTableHead($table);
     foreach ($this->data as $obj) {
         $this->_setTableRow($table, $obj);
     }
     $od->addContent($table->toString());
 }
Exemple #4
0
$od->addContent(Html::endTag('h3'));

if (!User::isLoggedIn()) {
    $od->addContent('Sie sind nicht eingeloggt');
} else {
    /** @var MedOffer $obj */
    $obj = Factory::createObject('medOffer');
    $table = DB::table($obj->getTable());
    $where = DB::where($table->getColumn('offerAmount'), DB::intTerm(0), base_database_Where::GREATER);
    /** @var BaseObject[] $objs */
    $objs = Finder::create('medOffer')->setWhere($where)->find();
    if (empty($objs)) {
        $od->addContent('Keine Datensätze gefunden');
    } else {
        $table = new base_html_model_Table();
        $table->setCssClass('offerTable');

        $headRow = new base_html_model_table_Row();
        $headRow->setRowType(base_html_model_table_Row::ROWTAG_HEAD);
        /** @var Fieldinfo[] $fis */
        $fis = [];
        foreach ($obj->getFieldsForOfferPage() as $field) {
            $fi = $obj->getFieldinfo($field);
            $cell = new base_html_model_table_Cell();
            $cell->setCssId($fi->getFieldName());
            $cell->setContent($fi->getFieldLabel());
            $headRow->addCell($cell);
            $fis[] = $fi;
        }

        $cell = new base_html_model_table_Cell();