示例#1
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;
 }
示例#2
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);
    }
示例#3
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;
 }
示例#4
0
文件: offer.php 项目: kafruhs/fws
                $formElement->setMultiline();
                $formElement->setName($fi->getFieldName());
                $formElement->setValue($obj->getField($fi->getFieldName()));
                $displayClassName = 'base_displayclass_' . ucfirst($fi->getDisplayClass());
                /** @var DisplayClass $dpC */
//                $dpC = new $displayClassName($obj);
//                $displayMode = $dpC->getDisplayMode(DisplayClass::VIEW);
                $formElement->setDisplayMode(DisplayClass::VIEW);
                $cell = new base_html_model_table_Cell();
                $cell->setCssID($fi->getFieldName());
                $cell->setCssClass($formElement->getClass());
                $cell->setContent($formElement->display());
                $row->addCell($cell);
            }
            $cell = new base_html_model_table_Cell();
            $cell->setCssClass('orderAmount');
            $medOrder = Factory::createObject('MedOrder');
            $fi = $medOrder->getFieldinfo('amount');
            $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();
示例#5
0
    $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']) {
            case 0:
                $cell->setCssClass('success');
                break;
            case 1:
                $cell->setCssClass('missedFiles');
                break;
            case 3:
                $cell->setCssClass('missed');
                break;
            default:
                $cell->setCssClass('failed');
                break;
        }
        $row->addCell($cell);
    }
    $table->addRow($row);