| Conditions | 2 |
| Paths | 2 |
| Total Lines | 43 |
| Code Lines | 30 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function getCMSFields() |
||
| 33 | { |
||
| 34 | $objects = DataObject::get("SmartChimpSignupPage"); |
||
| 35 | $fields = new FieldSet(); |
||
| 36 | if ($objects) { |
||
| 37 | $fields->push( |
||
| 38 | new TextField( |
||
| 39 | 'BetterTitle', |
||
| 40 | 'Title' |
||
| 41 | ) |
||
| 42 | ); |
||
| 43 | $fields->push( |
||
| 44 | new TextAreaField( |
||
| 45 | 'Introduction', |
||
| 46 | 'Introduction', |
||
| 47 | $row = 5, |
||
| 48 | $cols = 5 |
||
| 49 | ) |
||
| 50 | ); |
||
| 51 | $fields->push( |
||
| 52 | new TextField( |
||
| 53 | 'TextOnButton', |
||
| 54 | 'Text On Button' |
||
| 55 | ) |
||
| 56 | ); |
||
| 57 | $fields->push( |
||
| 58 | new DropdownField( |
||
| 59 | 'NewsletterSignUpPageID', |
||
| 60 | 'Signup Page', |
||
| 61 | $objects->toDropdownMap() |
||
| 62 | ) |
||
| 63 | ); |
||
| 64 | } else { |
||
| 65 | $fields->push( |
||
| 66 | new LiteralField( |
||
| 67 | 'NoSmartChimpSignupPage', |
||
| 68 | '<p>Please first create a sign-up page.</p>' |
||
| 69 | ) |
||
| 70 | ); |
||
| 71 | } |
||
| 72 | $this->extend('updateCMSFields', $fields); |
||
| 73 | return $fields; |
||
| 74 | } |
||
| 75 | } |
||
| 76 |
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.