Skip to content

Commit

Permalink
UI: supply element icon, replace type dropdown with radiobuttons
Browse files Browse the repository at this point in the history
  • Loading branch information
adrexia committed Apr 10, 2019
1 parent 9b97827 commit 0f283a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Model/DecisionTreeStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use SilverStripe\Control\Controller;
use SilverStripe\Forms\ReadOnlyField;
use SilverStripe\Forms\GridField\GridField;
use SilverStripe\Forms\OptionsetField;
use SilverStripe\Forms\GridField\GridFieldConfig_RecordEditor;
use Symbiote\GridFieldExtensions\GridFieldOrderableRows;
use UncleCheese\DisplayLogic\Forms\Wrapper as DisplayLogicWrapper;
Expand Down Expand Up @@ -58,10 +59,12 @@ public function getCMSFields()

$fields->removeByName('Answers');

$fields->replaceField('Type', $type = OptionsetField::create('Type', 'Type' ,$this->dbObject('Type')->enumValues()));

// Allow to hide the title only on Result
$hideTitle = CheckboxField::create('HideTitle', 'HideTitle');
$hideTitle = CheckboxField::create('HideTitle', 'Hide title');
$hideTitle->displayIf('Type')->isEqualTo('Result')->end();
$fields->insertAfter($hideTitle, 'Title');
$fields->insertAfter($hideTitle, 'Type');

if ($this->IsInDB()) {
// Display Parent Answer
Expand Down
2 changes: 2 additions & 0 deletions src/Model/ElementDecisionTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class ElementDecisionTree extends BaseElement

private static $enable_title_in_template = true;

private static $icon = 'font-icon-flow-tree';

private static $db = [
'Introduction' => 'HTMLText'
];
Expand Down

0 comments on commit 0f283a1

Please sign in to comment.