/**
  * @param Form $form
  */
 protected function configure(Form $form)
 {
     $form->addGroup('Basic settings');
     $form->addSelect('driver', 'Driver')->setItems($this->drivers, false)->setDefaultValue('pdo_mysql');
     $form['driver']->addCondition($form::IS_IN, array('pdo_mysql', 'oci8', 'pdo_oci'))->toggle('group-charset');
     $form['driver']->addCondition($form::IS_IN, array('pdo_pgsql', 'pdo_mysql', 'oci8', 'pdo_oci', 'pdo_sqlsrv'))->toggle('group-connection');
     $form['driver']->addCondition($form::EQUAL, 'pdo_sqlite')->toggle('group-sqlite');
     $form->addGroup('Connection settings');
     $form->addText('user', 'Username');
     $form->addPassword('password', 'Password');
     $form->addGroup()->setOption('id', 'group-connection');
     $form->addText('host', 'Host');
     $form->addText('port', 'Port')->getControlPrototype()->placeholder[] = 'default';
     $form->addText('dbname', 'Database');
     $form->addGroup()->setOption('id', 'group-sqlite');
     $form->addTextWithSelect('path', 'Path')->setItems(array('%tempDir%/database.db'), false);
     $form->addCheckbox('memory', 'Db in memory');
     $form->addGroup()->setOption('id', 'group-charset');
     $form->addTextWithSelect('charset', 'Charset')->setItems(array('utf8'), false);
     $backups = $this->getBackups();
     if (count($backups)) {
         $form->addGroup('Restore from backup');
         $form->addSelect('_backup', 'Backup name', $backups)->setPrompt('--------');
     }
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
Example #2
0
 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addTextWithSelect('name', 'Name')->setItems(array('English', 'Deutsch', 'Čeština'), false)->setOption('description', '(english, deutsch,...)')->addRule($form::FILLED, 'Please set name');
     $form->addTextWithSelect('short', 'Short')->setItems(array('en', 'de', 'cs'), false)->setOption('description', '(en, de,...)')->addRule($form::FILLED, 'Please set short');
     $form->addTextWithSelect('alias', 'Alias')->setItems(array('en', 'de', 'cs', 'www'), false)->setOption('description', '(www, en, de,...)')->addRule($form::FILLED, 'Please set alias');
     $form->addSaveButton('Save');
 }
Example #3
0
 /**
  * @param Form $form
  */
 protected function configure(Form $form)
 {
     $form->addGroup('Global meta informations');
     $form->addText('name', 'Website name')->addRule($form::FILLED);
     $form->addText('title', 'Title')->setOption('description', '(%n - name, %s - separator, %t - local title)');
     $form->addText('titleSeparator', 'Title separator');
     $form->addText('keywords', 'Keywords');
     $form->addText('description', 'Description');
     $form->addText('author', 'Author');
     $form->addGroup('System');
     $form->addTextWithSelect('routePrefix', 'Route prefix');
     $form->addTextWithSelect('oneWayRoutePrefix', 'One way route prefix');
     $form->addSelect('theme', 'Module width theme', $this->getModules())->setPrompt('off');
     $form->addSelect('cacheMode', 'Cache strategy')->setItems(\CmsModule\Content\Entities\RouteEntity::getCacheModes(), FALSE)->setPrompt('off');
     $form['cacheMode']->addCondition($form::EQUAL, 'time')->toggle('cacheValue');
     $form->addGroup()->setOption('id', 'cacheValue');
     $form->addSelect('cacheValue', 'Minutes')->setItems(array(1, 2, 5, 10, 15, 20, 30, 40, 50, 60, 90, 120), FALSE);
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }