Ejemplo n.º 1
0
 /**
  * set all form elements identified by fieldinfo
  */
 public function setFormElements()
 {
     $fieldinfos = $this->getFieldsForInput();
     foreach ($fieldinfos as $fieldinfo) {
         $input = base_form_element_Factory::createElement($fieldinfo);
         $value = '';
         $defaultValue = $fieldinfo->getDefaultValue();
         if (!empty($defaultValue)) {
             $value = $defaultValue;
         }
         if (isset($this->obj[$fieldinfo->getFieldName()])) {
             $value = $this->obj->getField($fieldinfo->getFieldName());
         }
         $input->setValue($value);
         $input->setDisplayedLength($fieldinfo->getDisplayedLength());
         $input->setName($fieldinfo->getFieldName());
         $dClName = 'base_displayclass_' . ucfirst($fieldinfo->getDisplayClass());
         /** @var DisplayClass $dCl */
         $dCl = new $dClName($this->obj);
         $displaymode = $dCl->getDisplayMode($this->getDisplayMode());
         $input->setDisplayMode($displaymode);
         $this->_addFormElement($input, $fieldinfo->getFieldLabel());
     }
 }
Ejemplo n.º 2
0
                $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();
            $cell->setContent($content);
            $row->addCell($cell);
            $table->addRow($row);
Ejemplo n.º 3
0
    $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());


    $submit = new base_form_element_Submit(new Fieldinfo('BaseObject'));
    $submit->setName('submit');
    $submit->setValue('Einloggen');