diff --git a/_config.php b/_config.php index 9a46730..c388cdf 100644 --- a/_config.php +++ b/_config.php @@ -6,4 +6,8 @@ Object::add_extension('Member', 'FileUploadRole'); Object::add_extension('SiteConfig', 'CMSWorkflowSiteConfigDecorator'); CMSWorkflowSiteConfigDecorator::apply_active_config(); + +Director::addRules(100, array( + 'dev/regress/$Action/$ID' => 'FrameworktestRegressSessionAdmin' +)); ?> \ No newline at end of file diff --git a/code/FrameworktestRegressSessionAdmin.php b/code/FrameworktestRegressSessionAdmin.php new file mode 100644 index 0000000..890e990 --- /dev/null +++ b/code/FrameworktestRegressSessionAdmin.php @@ -0,0 +1,88 @@ +Use this form to set configuration prior to starting a regress.silverstripe.com test session (manual testing).

' + ), + $dbField = new DropdownField( + 'db', + 'Database', + array( + 'mysql' => 'MySQL', + 'postgresql' => 'Postgres', + 'mssql' => 'MSSQL', + 'sqlite3' => 'SQLite3', + ), + Session::get('db') + ), + $chkField = new CheckboxField( + 'enabletranslatable', + 'Translatable?', + Session::get('enabletranslatable') + ) + ), + $actions + ); + $dbField->setHasEmptyDefault(false); + + if($isRunning) { + foreach($form->Fields() as $field) { + $form->Fields()->replaceField($field->Name(), + $field->performReadonlyTransformation() + ); + } + } + + return $form; + } + + function startsession($data, $form) { + Session::set('enabletranslatable', (isset($data['enabletranslatable'])) ? $data['enabletranslatable'] : null); + Session::set('db', $data['db']); + + return $this->redirect('dev/build/?BackURL=admin'); + } + + function endsession() { + Session::set('enabletranslatable', null); + Session::set('db', null); + + return $this->redirectBack(); + } + +} \ No newline at end of file