| Total Complexity | 4 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class ContentItemAdmin extends Admin |
||
|
|
|||
| 17 | { |
||
| 18 | /** |
||
| 19 | * @{inheritDoc} |
||
| 20 | */ |
||
| 21 | protected function configureFormFields(FormMapper $form) |
||
| 22 | { |
||
| 23 | if (!$this->isChild()) { |
||
| 24 | $form->add('page'); |
||
| 25 | } else { |
||
| 26 | $page = $this->getParentFieldDescription()->getAdmin()->getSubject(); |
||
| 27 | |||
| 28 | // This fixes a weird bug where the router does not get the correct parameters for the containing page. |
||
| 29 | $this->getParentFieldDescription()->setOption('link_parameters', array('id' => $page->getId())); |
||
| 30 | |||
| 31 | $form |
||
| 32 | ->add('weight') |
||
| 33 | ->add('internalName', 'text', array('disabled' => true, 'read_only' => true, 'required' => false)) |
||
| 34 | ->add('content_item_region', 'zicht_content_item_region', array('container' => $page)) |
||
| 35 | ->add('content_item_type', 'zicht_content_item_type', array('container' => $page)); |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @{inheritDoc} |
||
| 41 | */ |
||
| 42 | protected function configureDatagridFilters(DatagridMapper $filter) |
||
| 45 | } |
||
| 46 | |||
| 47 | |||
| 48 | /** |
||
| 49 | * @{inheritDoc} |
||
| 50 | */ |
||
| 51 | public function configureListFields(ListMapper $listMapper) |
||
| 63 | ) |
||
| 64 | ) |
||
| 68 |