/**
  * Returns the {@Link FieldList} of cms form fields for editing this object
  *
  * @return FieldList
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // Remove LinkedStateID in order to filter out current record ID
     $fields->removeByName('LinkedStateID');
     // Remove parentID. Re-add as TreeDropdownField where needed
     $fields->removeByName('ParentID');
     $number = $fields->dataFieldByName('Number');
     $title = $fields->dataFieldByName('TitleText');
     $content = $fields->dataFieldByName('Content');
     $number->setRightTitle("Displayed in flow state box");
     $title->setRightTitle("Displayed in flow state box");
     $content->setDescription("Extra information related to state. May be displayed on hover, or click");
     $spanOpt = array("two" => "two", "four" => "four", "six" => "six", "eight" => "eight");
     $fields->insertAfter(new DropdownField('Size', "Relative display width", $spanOpt), 'TitleText');
     $fields->insertAfter($linkedState = new DropdownField('LinkedStateID', "Linked State", FlowState::get()->exclude('ID', $this->ID)->map('ID', 'Title')), 'Content');
     $linkedState->setEmptyString(' ')->setRightTitle("HTML link to another State");
     // If not within a flowchart page re-add parentID as DropdownField
     if (Controller::curr() instanceof FlowchartAdmin) {
         $fields->insertAfter(new DropdownField('ParentID', "Belongs to", FlowchartPage::get()->map('ID', 'Title')), 'Content');
     }
     return $fields;
 }