protected function createControls()
 {
     $this->setPostback('modView', 'endEditFeld', array('current' => $this->request->current, 'entity' => $this->request->entity, 'initPanel' => 2));
     $panel = new CaptionedPanelControl($this, 'panel');
     $panel->setCaption('Feld » bearbeiten');
     $inputName = new InputTextboxControl(null, 'name');
     $inputName->setValue($this->controller->feld->name);
     $inputName->addCssClass('required');
     $inputDescription = new InputTextboxControl(null, 'description');
     $inputDescription->setValue($this->controller->feld->description);
     $inputMax = new InputTextboxControl(null, 'maxLength');
     $inputMax->setValue($this->controller->feld->maxLength);
     $inputValidation = new InputTextboxControl(null, 'validation');
     $inputValidation->setValue($this->controller->feld->validation);
     $inputFormel = new InputTextboxControl(null, 'formula');
     $inputFormel->setValue($this->controller->feld->getFormula());
     $inputIndex = new InputCheckboxControl(null, 'index');
     $inputIndex->setValue(1);
     $inputIndex->setChecked($this->controller->feld->getIndex() == 1);
     $typ = new InputSelectControl(null, 'type');
     $typ->addOption(ModelField::TYPE_IMAGE, 'Bild')->addOption(ModelField::TYPE_BOOLEAN, 'Boolean')->addOption(ModelField::TYPE_DATE, 'Date')->addOption(ModelField::TYPE_DATETIME, 'Datetime')->addOption(ModelField::TYPE_FLOAT, 'Float')->addOption(ModelField::TYPE_HTML, 'Html')->addOption(ModelField::TYPE_INTEGER, 'Integer')->addOption(ModelField::TYPE_PASSWORD, 'Password')->addOption(ModelField::TYPE_STRING, 'String')->addOption(ModelField::TYPE_TEXT, 'Text')->addOption(ModelField::TYPE_TIME, 'Time')->addOption(ModelField::TYPE_FILE, 'Datei')->addOption(ModelField::TYPE_MARKDOWN, 'Markdown')->addOption(ModelField::TYPE_LABEL, 'Label')->preSelect($this->controller->feld->getType());
     $edit = new EditControl($panel, 'edit');
     $edit->setHeader('Stammdaten bearbeiten')->addRow('Name', $inputName)->addRow('Beschreibung', $inputDescription)->addRow('Datentyp', $typ)->addRow('Länge', $inputMax)->addRow('Validierung', $inputValidation)->addRow('Formel', $inputFormel)->addRow('Index', $inputIndex);
     $button = new ButtonControl($panel, 'button');
     $button->setCaption('Speichern')->setIsSubmit('true');
 }
 protected function createControls()
 {
     $this->setPostback('modView', 'endNewCRUD', array('current' => $this->request->current));
     $panel = new CaptionedPanelControl($this, 'panel');
     $panel->setCaption('Aktionen » CRUD anlegen');
     $edit = new EditControl($panel, 'edit');
     $edit->setHeader('Details angeben')->addRow('Entität (logisch)', new InputTextboxControl(null, 'entity'));
     $button = new ButtonControl($panel, 'button');
     $button->setCaption('Speichern')->setIsSubmit('true');
 }
 protected function createControls()
 {
     $this->setPostback('modView', 'endEditAktion', array('current' => $this->request->current, 'initPanel' => $this->request->initPanel));
     $panel = new CaptionedPanelControl($this, 'panel');
     $panel->setCaption('Aktion » bearbeiten');
     $inputName = new InputTextboxControl(null, 'name');
     $inputName->setValue($this->controller->action->name);
     $inputName->addCssClass('required');
     $inputDescription = new InputTextboxControl(null, 'description');
     $inputDescription->setValue($this->controller->action->description);
     $inputNextItem = new InputTextboxControl(null, 'nextItem');
     $inputNextItem->setValue($this->controller->action->nextItem);
     $addToMenu = new InputCheckboxControl(null, 'addToMenu');
     $addToMenu->setChecked($this->controller->action->addToMenu);
     $security = new InputSelectControl(null, 'securityLevel');
     $security->addOption(Action::LEVEL_ALL, 'Alle')->addOption(Action::LEVEL_LOGGEDIN, 'Angemeldete Benutzer')->addOption(Action::LEVEL_CONFIG, 'Rechtevergabe')->preSelect($this->controller->action->securityLevel);
     $next = new InputSelectControl(null, 'next');
     $next->addOption(Action::NEXT_NOTHING, 'Nichts')->addOption(Action::NEXT_ACTION, 'Aktion ausführen')->addOption(Action::NEXT_VIEW, 'View anzeigen')->preSelect($this->controller->action->next);
     $edit = new EditControl($panel, 'edit');
     $edit->setHeader('Stammdaten bearbeiten')->addRow('Name', $inputName)->addRow('Beschreibung', $inputDescription)->addRow('In Menü?', $addToMenu)->addRow('Berechtigung', $security)->addRow('Folgeaktion', $next)->addRow('Folgeelement', $inputNextItem);
     $button = new ButtonControl($panel, 'button');
     $button->setCaption('Speichern')->setIsSubmit('true');
 }
 protected function createControls()
 {
     $this->setPostback('modView', 'endEditModule', array('initPanel' => $this->request->initPanel));
     $panel = new CaptionedTabPanelControl($this, 'pnlStammdaten');
     $panel->setCaption('Details zu Modul ' . $this->controller->current->name);
     $tabStamm = $panel->tabs->addTab('Stammdaten');
     $tabAction = $panel->tabs->addTab('Actions');
     $tabEntity = $panel->tabs->addTab('Entitäten');
     $panel->tabs->setInitPanel($this->request->initPanel);
     $inputName = new InputTextboxControl(null, 'name');
     $inputName->setValue($this->controller->current->name)->setReadOnly(true);
     $inputQualifiedName = new InputTextboxControl(null, 'qualifiedName');
     $inputQualifiedName->setValue($this->controller->current->qualifiedName)->setReadOnly(true);
     $inputNamespace = new InputTextboxControl(null, 'name');
     $inputNamespace->setValue($this->controller->current->namespace)->setReadOnly(true);
     $inputDescription = new InputTextboxControl(null, 'description');
     $inputDescription->setValue($this->controller->current->description);
     $inputAuthor = new InputTextboxControl(null, 'author');
     $inputAuthor->setValue($this->controller->current->author);
     $inputVersion = new InputTextboxControl(null, 'version');
     $inputVersion->setValue($this->controller->current->version);
     $panel = $tabStamm;
     $btnGroup = new ButtonGroupControl($panel, 'btnGroup');
     $btnForward = new ButtonControl($btnGroup, 'btnInstall');
     $btnForward->setCaption('Installieren')->setButtonClass(ButtonControl::BUTTON_WARNING)->setLink('modView', 'install', array('id' => $this->request->id))->setIcon('arrow-right');
     $btnForward = new ButtonControl($btnGroup, 'btnBerechtigungen');
     $btnForward->setCaption('Berechtigungen')->setButtonClass(ButtonControl::BUTTON_DANGER)->setLink('modView', 'berechtigungen', array('id' => $this->request->id))->setIcon('lock');
     $edit = new EditControl($panel, 'edit');
     $edit->setHeader('Stammdaten bearbeiten')->addRow('Name', $inputName)->addRow('Namespace', $inputNamespace)->addRow('Qualified-Name', $inputQualifiedName)->addRow('Beschreibung', $inputDescription)->addRow('Autor', $inputAuthor)->addRow('Version', $inputVersion);
     $button = new ButtonControl($panel, 'button');
     $button->setCaption('Speichern')->setIsSubmit('true');
     // --------------------------------------------------------------------------------------------------
     $panel = $tabAction;
     $btnGroupAction = new ButtonGroupControl($panel, 'btnGroupAction');
     $btnNeu = new ButtonControl($btnGroupAction, 'btnNeu');
     $btnNeu->setCaption('Neue Aktion anlegen')->setIcon('plus')->setButtonClass(ButtonControl::BUTTON_PRIMARY)->setLink('modView', 'newAktion', array('current' => $this->request->id))->addCssClass('nfs-modal');
     $btnCRUD = new ButtonControl($btnGroupAction, 'btnCRUD');
     $btnCRUD->setCaption('CRUD Aktionen anlegen')->setIcon('plus')->setLink('modView', 'newCRUD', array('current' => $this->request->id))->addCssClass('nfs-modal');
     $listView = new ListViewControl($panel, 'lv');
     $listView->setSkinFile(__DIR__ . '/ModuleListView.skin');
     $listView->setItemSkinFile(__DIR__ . '/AktionListItem.skin');
     $listView->setVar('header', '<th>Name</th><th>Beschreibung</th><th>Menü</th><th>Sec-Level</th><th>Next-Typ</th><th>Next-Item</th><th>&nbsp;</th>');
     $listView->addItems($this->controller->aktionen);
     $panelEnt = $tabEntity;
     $panel = $panelEnt;
     $btnGroup = new ButtonGroupControl($panel, 'btnGroupEntity');
     $btnNeu = new ButtonControl($btnGroup, 'btnNeuEntity');
     $btnNeu->setCaption('Neue Entität anlegen')->setIcon('plus')->setButtonClass(ButtonControl::BUTTON_PRIMARY)->setLink('modView', 'newEntity', array('current' => $this->request->id))->addCssClass('nfs-modal');
     $btnForward = new ButtonControl($btnGroup, 'btnForward');
     $btnForward->setCaption('DB aktualisieren')->setLink('modView', 'forwardEngineerAll', array('id' => $this->request->id))->setIcon('arrow-right');
     foreach ($this->controller->entities as $name => $entity) {
         $btnEdit = new ButtonControl(null, 'btnEdit');
         $btnEdit->setLink('ModView', 'editEntity', ['current' => $this->request->id, 'id' => $name])->setIcon('pencil')->setCaption('Bearbeiten')->setSize(ButtonControl::SIZE_EXTRASMALL)->addCssClass('nfs-modal');
         $btnDelete = new ButtonControl(null, 'btnDelete');
         $btnDelete->setLink('ModView', 'deleteEntity', ['current' => $this->request->id, 'id' => $name])->setIcon('trash')->setCaption('Löschen')->setButtonClass(ButtonControl::BUTTON_DANGER)->setSize(ButtonControl::SIZE_EXTRASMALL);
         $panel = new CaptionedPanelControl($panelEnt, '');
         if ($this->request->hash == 'entity_' . $name) {
             $panel->setCaption('<a data-toggle="collapse" href="#entity_' . $name . '"><b>' . $name . '</b> ' . $entity['extends'] . '</a>
             <div class="pull-right">' . $btnEdit->toHtml() . $btnDelete->toHtml() . '</div>');
             $panel->setSkin('<div class="panel panel-default {css}">
               <div class="panel-heading">
                 <h3 class="panel-title">{caption}</h3>
               </div>
               <div id="entity_' . $name . '" class="panel-collapse collapse in">
                   <div class="panel-body">
                     {controls}
                   </div>
               </div>
             </div>');
         } else {
             $panel->setCaption('<a class="collapsed" data-toggle="collapse" href="#entity_' . $name . '"><b>' . $name . '</b> ' . $entity['extends'] . '</a>
             <div class="pull-right">' . $btnEdit->toHtml() . $btnDelete->toHtml() . '</div>');
             $panel->setSkin('<div class="panel panel-default {css}">
               <div class="panel-heading">
                 <h3 class="panel-title">{caption}</h3>
               </div>
               <div id="entity_' . $name . '" class="panel-collapse collapse">
                   <div class="panel-body">
                     {controls}
                   </div>
               </div>
             </div>');
         }
         $btnGroup = new ButtonGroupControl($panel, '');
         $btnNeu = new ButtonControl($btnGroup, 'btnNeu');
         $btnNeu->setCaption('Neues Feld')->setIcon('plus')->setLink('modView', 'newFeld', array('current' => $this->request->id, 'entity' => $name))->setButtonClass(ButtonControl::BUTTON_PRIMARY)->setSize(ButtonControl::SIZE_SMALL)->addCssClass('nfs-modal');
         $btnNeu = new ButtonControl($btnGroup, 'btnNeu2');
         $btnNeu->setCaption('Neue Relation')->setIcon('plus')->setLink('modView', 'newRelation', array('current' => $this->request->id, 'entity' => $name))->setSize(ButtonControl::SIZE_SMALL)->addCssClass('nfs-modal');
         $btnNeu = new ButtonControl($btnGroup, 'btnNeu3');
         $btnNeu->setCaption('Neues Lookup')->setIcon('plus')->setLink('modView', 'newLookup', array('current' => $this->request->id, 'entity' => $name))->setSize(ButtonControl::SIZE_SMALL)->addCssClass('nfs-modal');
         $btnNeu = new ButtonControl($btnGroup, 'btnForward');
         $btnNeu->setCaption('In DB anlegen')->setIcon('arrow-right')->setLink('modView', 'forwardEngineer', array('current' => $this->request->id, 'id' => $name))->setSize(ButtonControl::SIZE_SMALL);
         $btnCRUD = new ButtonControl($btnGroup, 'btnBackward');
         $btnCRUD->setCaption('XML erzeugen')->setIcon('arrow-left')->setLink('modView', 'backwardEngineer', array('current' => $this->request->id, 'id' => $name))->setSize(ButtonControl::SIZE_SMALL);
         $listView = new ListViewControl($panel, '');
         $listView->setSkinfile(__DIR__ . '/FeldListView.template.html');
         $listView->setItemSkinFile(__DIR__ . '/FeldListItem.skin');
         $listView->setVar('moduleName', $this->request->id);
         $listView->setVar('entityName', $name);
         $listView->addItems($entity['felder']);
     }
 }