| Conditions | 3 |
| Paths | 3 |
| Total Lines | 26 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function getHTMLFragments($grid) { |
||
| 21 | $classes = $this->getClasses($grid); |
||
| 22 | |||
| 23 | if(!count($classes)) { |
||
| 24 | return array(); |
||
| 25 | } |
||
| 26 | |||
| 27 | GridFieldExtensions::include_requirements(); |
||
| 28 | |||
| 29 | $field = new DropdownField(sprintf('%s[ClassName]', __CLASS__), '', $classes, $this->defaultClass); |
||
| 30 | $field->setAttribute('id', uniqid()); |
||
| 31 | if (Config::inst()->get('GridFieldAddNewMultiClass', 'showEmptyString')) { |
||
| 32 | $field->setEmptyString(_t('GridFieldExtensions.SELECTTYPETOCREATE', '(Select type to create)')); |
||
| 33 | } |
||
| 34 | $field->addExtraClass('no-change-track'); |
||
| 35 | |||
| 36 | $data = new ArrayData(array( |
||
| 37 | 'Title' => $this->getTitle(), |
||
| 38 | 'Link' => Controller::join_links($grid->Link(), 'add-multi-class', '{class}'), |
||
| 39 | 'ClassField' => $field |
||
| 40 | )); |
||
| 41 | |||
| 42 | return array( |
||
| 43 | $this->getFragment() => $data->renderWith('GridFieldAddNewMultiClass') |
||
| 44 | ); |
||
| 45 | } |
||
| 46 | } |
This check marks private properties in classes that are never used. Those properties can be removed.