Example #1
0
 /**
  * Deactivate some buttons for edit all mode.
  *
  * @param GetSelectModeButtonsEvent $event The event.
  *
  * @return void
  *
  * Todo remove this if the deactivated buttons correct worked
  */
 public function deactivateButtonsForEditAll(GetSelectModeButtonsEvent $event)
 {
     if ($event->getEnvironment()->getInputProvider()->getParameter('act') !== 'select') {
         return;
     }
     $buttons = $event->getButtons();
     foreach (array('override', 'edit') as $button) {
         unset($buttons[$button]);
     }
     if (in_array($event->getEnvironment()->getDataDefinition()->getName(), array('orm_avisota_mailing_list', 'orm_avisota_transport', 'orm_avisota_queue', 'orm_avisota_recipient_source'))) {
         foreach (array('cut') as $button) {
             unset($buttons[$button]);
         }
     }
     $event->setButtons($buttons);
 }
 /**
  * @param GetSelectModeButtonsEvent $event
  */
 public function deactivateButtonsForEditAll(GetSelectModeButtonsEvent $event)
 {
     $environment = $event->getEnvironment();
     $dataDefinition = $environment->getDataDefinition();
     if ($environment->getInputProvider()->getParameter('act') !== 'select' || !in_array($dataDefinition->getName(), array('orm_avisota_layout', 'orm_avisota_message_category', 'orm_avisota_theme'))) {
         return;
     }
     $buttons = $event->getButtons();
     foreach (array('cut') as $button) {
         if (!array_key_exists($button, $buttons)) {
             continue;
         }
         unset($buttons[$button]);
     }
     if (in_array($dataDefinition->getName(), array('orm_avisota_layout', 'orm_avisota_theme'))) {
         foreach (array('delete', 'copy') as $button) {
             if (!array_key_exists($button, $buttons)) {
                 continue;
             }
             unset($buttons[$button]);
         }
     }
     $event->setButtons($buttons);
 }
 /**
  * @param GetSelectModeButtonsEvent $event
  */
 public function deactivateSelectButtons(GetSelectModeButtonsEvent $event)
 {
     if ($event->getEnvironment()->getInputProvider()->getParameter('act') !== 'select' || !in_array($event->getEnvironment()->getDataDefinition()->getName(), array('orm_avisota_salutation_group', 'orm_avisota_salutation'))) {
         return;
     }
     $buttons = $event->getButtons();
     foreach (array('cut') as $button) {
         unset($buttons[$button]);
     }
     $event->setButtons($buttons);
 }