| Conditions | 2 |
| Paths | 2 |
| Total Lines | 25 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function updateCMSFields(FieldList $fields) |
||
| 24 | { |
||
| 25 | $fieldLabels = $this->owner->FieldLabels(); |
||
| 26 | $fieldLabelsRight = Config::inst()->get('CallToActionPageExtension', 'field_labels_right'); |
||
| 27 | $tabTitle = _t('CallToActionPageExtension.CALL_TO_ACTION', 'Call to Action'); |
||
| 28 | $link = '/admin/calltoaction/'; |
||
| 29 | if($this->owner->CallToActionID) { |
||
| 30 | $link = $this->owner->CallToAction()->CMSEditLink(); |
||
| 31 | } |
||
| 32 | $fields->addFieldsToTab( |
||
| 33 | 'Root.'.$tabTitle, |
||
| 34 | [ |
||
| 35 | DropdownField::create( |
||
| 36 | 'CallToActionID', |
||
| 37 | $tabTitle, |
||
| 38 | [0 => _t('CallToActionPageExtension', '-- please select --')] +CallToAction::get()->map()->toArray() |
||
| 39 | ), |
||
| 40 | LiteralField::create( |
||
| 41 | 'CallToActionEdit', |
||
| 42 | '<h2><a href="'.$link.'">✎ '.$tabTitle.'</a><h2>' |
||
| 43 | ) |
||
| 44 | ] |
||
| 45 | ); |
||
| 46 | return $fields; |
||
| 47 | } |
||
| 48 | } |
||
| 49 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.