|
@@ -0,0 +1,122 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace FTTHBundle\Admin;
|
|
|
+
|
|
|
+use Base\AdminBundle\Admin\BaseAdmin;
|
|
|
+use Sonata\AdminBundle\Datagrid\DatagridMapper;
|
|
|
+use Sonata\AdminBundle\Datagrid\ListMapper;
|
|
|
+use Sonata\AdminBundle\Form\FormMapper;
|
|
|
+use Sonata\AdminBundle\Show\ShowMapper;
|
|
|
+
|
|
|
+class PortalCaptiveAdmin extends BaseAdmin
|
|
|
+{
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param DatagridMapper $datagridMapper
|
|
|
+ */
|
|
|
+ protected function configureDatagridFilters(DatagridMapper $datagridMapper)
|
|
|
+ {
|
|
|
+ $datagridMapper
|
|
|
+ ->add('profile')
|
|
|
+ ->add('model');
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param ListMapper $listMapper
|
|
|
+ */
|
|
|
+ protected function configureListFields(ListMapper $listMapper)
|
|
|
+ {
|
|
|
+ $listMapper
|
|
|
+ ->add('model')
|
|
|
+ ->add('profile')
|
|
|
+ ->add('vlan')
|
|
|
+ ->add('vlanProfile')
|
|
|
+ ->add('onuProfile')
|
|
|
+ ->add('vlans')
|
|
|
+ ->add('trafficProfileIn')
|
|
|
+ ->add('trafficProfileOut')
|
|
|
+ ->add('tcontprofile')
|
|
|
+ ->add('base')
|
|
|
+ ->add('created')
|
|
|
+ ->add('_action', null, array(
|
|
|
+ 'actions' => array(
|
|
|
+ 'use' => array('template' => 'FTTHBundle:ONUTemplate:action_use.html.twig'),
|
|
|
+ 'edit' => array(),
|
|
|
+ 'delete' => array()),
|
|
|
+ ));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param FormMapper $formMapper
|
|
|
+ */
|
|
|
+ protected function configureFormFields(FormMapper $formMapper)
|
|
|
+ {
|
|
|
+ $formMapper
|
|
|
+ ->tab('default')
|
|
|
+ ->with('')
|
|
|
+ ->add('model')
|
|
|
+ ->add('profile')
|
|
|
+ ->add('vlans', null, array(
|
|
|
+ 'required' => false,
|
|
|
+ 'multiple' => true,
|
|
|
+ ))
|
|
|
+ ->add('vlan')
|
|
|
+ ->add('vlanProfile')
|
|
|
+ ->add('onuProfile')
|
|
|
+ ->add('trafficProfileIn')
|
|
|
+ ->add('trafficProfileOut')
|
|
|
+ ->add('tcontprofile')
|
|
|
+ ->add('catv')
|
|
|
+ ->end()
|
|
|
+ ->with('Extra')
|
|
|
+ ->add('extraData')
|
|
|
+ ->end()
|
|
|
+ ->end();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param ShowMapper $showMapper
|
|
|
+ */
|
|
|
+ protected function configureShowFields(ShowMapper $showMapper)
|
|
|
+ {
|
|
|
+ $showMapper
|
|
|
+ ->tab('default')
|
|
|
+ ->with('')
|
|
|
+ ->add('model')
|
|
|
+ ->add('profile')
|
|
|
+ ->add('vlans')
|
|
|
+ ->add('vlan')
|
|
|
+ ->add('vlanProfile')
|
|
|
+ ->add('onuProfile')
|
|
|
+ ->add('trafficProfileIn')
|
|
|
+ ->add('trafficProfileOut')
|
|
|
+ ->add('tcontprofile')
|
|
|
+ ->add('created')
|
|
|
+ ->end()
|
|
|
+ ->with('Extra')
|
|
|
+ ->add('extraData')
|
|
|
+ ->end()
|
|
|
+ ->end();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string $action
|
|
|
+ * @param Object $object
|
|
|
+ *
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+ public function configureActionButtons($action, $object = null)
|
|
|
+ {
|
|
|
+ $actions = parent::configureActionButtons($action, $object);
|
|
|
+ $actions['disable_base'] = array('template' => 'FTTHBundle:ONUTemplate:disable_base_button.html.twig');
|
|
|
+
|
|
|
+ return $actions;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function configure()
|
|
|
+ {
|
|
|
+ $this->setTemplate('create', 'FTTHBundle:ONUTemplate:form.html.twig');
|
|
|
+ $this->setTemplate('edit', 'FTTHBundle:ONUTemplate:form.html.twig');
|
|
|
+ }
|
|
|
+
|
|
|
+}
|