Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function save(array $form, FormStateInterface $form_state)
 {
     /* @var $entity \Drupal\workflow\Entity\Workflow */
     $entity = $this->entity;
     // Prevent leading and trailing spaces.
     $entity->set('label', trim($entity->label()));
     $entity->set('options', array('name_as_title' => $form_state->getValue('name_as_title'), 'fieldset' => $form_state->getValue('fieldset'), 'options' => $form_state->getValue('options'), 'schedule_timezone' => $form_state->getValue('schedule_timezone'), 'comment_log_node' => $form_state->getValue('comment_log_node'), 'comment_log_tab' => $form_state->getValue('comment_log_tab'), 'watchdog_log' => $form_state->getValue('watchdog_log')));
     $status = parent::save($form, $form_state);
     $action = $status == SAVED_UPDATED ? 'updated' : 'added';
     // Tell the user we've updated the data.
     $args = ['%label' => $entity->label(), '%action' => $action, 'link' => $entity->link(t('Edit'))];
     drupal_set_message($this->t('Workflow %label has been %action. Please maintain the permissions, states and transitions.', $args));
     $this->logger('workflow')->notice('Workflow %label has been %action.', $args);
     if ($status == SAVED_NEW) {
         $form_state->setRedirect('entity.workflow_type.edit_form', ['workflow_type' => $entity->id()]);
     }
 }
 /**
  * {@inheritdoc}
  */
 public function save(array $form, FormStateInterface $form_state)
 {
     parent::save($form, $form_state);
     $form_state->setRedirectUrl($this->entity->urlInfo('edit-form'));
 }
Beispiel #3
0
 /**
  * {@inheritdoc}
  */
 public function save(array $form, FormStateInterface $form_state)
 {
     $status = parent::save($form, $form_state);
     if ($status) {
         drupal_set_message($this->t('Saved the %label Key.', array('%label' => $this->entity->label())));
     } else {
         drupal_set_message($this->t('The %label Key was not saved.', array('%label' => $this->entity->label())));
     }
     $form_state->setRedirectUrl($this->entity->urlInfo('collection'));
 }
 /**
  * {@inheritDoc}
  */
 public function save(array $form, FormStateInterface $form_state)
 {
     parent::save($form, $form_state);
     drupal_set_message($this->t('Pattern @label saved.', ['@label' => $this->entity->label()]));
     $form_state->setRedirectUrl($this->entity->toUrl('collection'));
 }
 /**
  * {@inheritdoc}
  */
 public function save(array $form, FormStateInterface $form_state)
 {
     /** @var \Drupal\flexslider\Entity\Flexslider $flexslider */
     $flexslider = $this->entity;
     $status = parent::save($form, $form_state);
     switch ($status) {
         case SAVED_NEW:
             drupal_set_message($this->t('Created the %label FlexSlider optionset.', ['%label' => $flexslider->label()]));
             break;
         default:
             drupal_set_message($this->t('Saved the %label FlexSlider optionset.', ['%label' => $flexslider->label()]));
     }
     $form_state->setRedirectUrl($flexslider->toUrl('collection'));
 }
 /**
  * {@inheritdoc}
  */
 public function save(array $form, FormStateInterface $form_state)
 {
     parent::save($form, $form_state);
     $payment_method_configuration = $this->getEntity();
     drupal_set_message($this->t('@label has been saved.', array('@label' => $payment_method_configuration->label())));
     $form_state->setRedirectUrl($payment_method_configuration->urlInfo('collection'));
 }
 /**
  * {@inheritdoc}
  */
 public function save(array $form, FormStateInterface $form_state)
 {
     $status = parent::save($form, $form_state);
     if ($status) {
         drupal_set_message($this->t('Saved the %label variant.', ['%label' => $this->entity->label()]));
     } else {
         drupal_set_message($this->t('The %label variant was not saved.', ['%label' => $this->entity->label()]));
     }
 }