| Total Complexity | 4 |
| Total Lines | 67 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 5 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 20 | class UrlAliasAdmin extends Admin |
||
|
|
|||
| 21 | { |
||
| 22 | protected $datagridValues = array( |
||
| 23 | '_sort_order' => 'DESC', // Descendant ordering (default = 'ASC') |
||
| 24 | ); |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @{inheritDoc} |
||
| 28 | */ |
||
| 29 | public function configureListFields(ListMapper $listMapper) |
||
| 30 | { |
||
| 31 | $listMapper |
||
| 32 | ->add('id') |
||
| 33 | ->add('public_url', 'string', array('template' => 'ZichtAdminBundle:CRUD:list_url.html.twig')) |
||
| 34 | ->add('internal_url', 'string', array('template' => 'ZichtAdminBundle:CRUD:list_url.html.twig')) |
||
| 35 | ->add( |
||
| 36 | '_action', |
||
| 37 | 'actions', |
||
| 38 | array( |
||
| 39 | 'actions' => array( |
||
| 40 | 'show' => array(), |
||
| 41 | 'edit' => array(), |
||
| 42 | 'delete' => array() |
||
| 43 | ) |
||
| 44 | ) |
||
| 45 | ); |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @{inheritDoc} |
||
| 50 | */ |
||
| 51 | protected function configureDatagridFilters(DatagridMapper $filter) |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @{inheritDoc} |
||
| 60 | */ |
||
| 61 | protected function configureFormFields(FormMapper $form) |
||
| 62 | { |
||
| 63 | $form->add('public_url') |
||
| 64 | ->add('internal_url', 'zicht_url', ['no_transform_public' => true]) |
||
| 65 | ->add( |
||
| 66 | 'mode', |
||
| 67 | 'choice', |
||
| 68 | array( |
||
| 69 | 'choices' => array( |
||
| 70 | UrlAlias::ALIAS => 'alias (302 redirect)', |
||
| 71 | UrlAlias::MOVE => 'move (301 redirect)', |
||
| 72 | UrlAlias::REWRITE => 'rewrite', |
||
| 73 | ) |
||
| 74 | ) |
||
| 75 | ); |
||
| 76 | } |
||
| 77 | |||
| 78 | /** |
||
| 79 | * @{inheritDoc} |
||
| 80 | */ |
||
| 81 | protected function configureShowFields(ShowMapper $show) |
||
| 87 | } |
||
| 88 | } |
||
| 89 |