/**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     /** @var ModerationStateTransitionInterface $entity */
     $row['label'] = $entity->label();
     $row['id']['#markup'] = $entity->id();
     $row['from']['#markup'] = $this->stateStorage->load($entity->getFromState())->label();
     $row['to']['#markup'] = $this->stateStorage->load($entity->getToState())->label();
     return $row + parent::buildRow($entity);
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, array &$form_state)
 {
     parent::submitForm($form, $form_state);
     $language_manager = \Drupal::languageManager();
     $language_manager->reset();
     if ($language_manager instanceof ConfigurableLanguageManagerInterface) {
         $language_manager->updateLockedLanguageWeights();
     }
     drupal_set_message(t('Configuration saved.'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     /* @var \Drupal\pathauto\PathautoPatternInterface $entity */
     $row['label'] = $entity->label();
     $row['patern']['#markup'] = $entity->getPattern();
     $row['type']['#markup'] = $entity->getAliasType()->getLabel();
     $row['conditions']['#theme'] = 'item_list';
     foreach ($entity->getSelectionConditions() as $condition) {
         $row['conditions']['#items'][] = $condition->summary();
     }
     return $row + parent::buildRow($entity);
 }
 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     parent::submitForm($form, $form_state);
     drupal_set_message(t('The configuration options have been saved.'));
 }
Exemplo n.º 5
0
 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     parent::submitForm($form, $form_state);
     $search_settings = $this->config('search.settings');
     // If these settings change, the default index needs to be rebuilt.
     if ($search_settings->get('index.minimum_word_size') != $form_state->getValue('minimum_word_size') || $search_settings->get('index.overlap_cjk') != $form_state->getValue('overlap_cjk')) {
         $search_settings->set('index.minimum_word_size', $form_state->getValue('minimum_word_size'));
         $search_settings->set('index.overlap_cjk', $form_state->getValue('overlap_cjk'));
         // Specifically mark items in the default index for reindexing, since
         // these settings are used in the search_index() function.
         drupal_set_message($this->t('The default search index will be rebuilt.'));
         search_mark_for_reindex();
     }
     $search_settings->set('index.cron_limit', $form_state->getValue('cron_limit'))->set('logging', $form_state->getValue('logging'))->save();
     drupal_set_message($this->t('The configuration options have been saved.'));
 }
Exemplo n.º 6
0
 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     parent::submitForm($form, $form_state);
     filter_formats_reset();
     drupal_set_message($this->t('The text format ordering has been saved.'));
 }
 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     parent::submitForm($form, $form_state);
     // Save the default language if changed.
     $new_id = $form_state->getValue('site_default_language');
     if ($new_id != $this->languageManager->getDefaultLanguage()->getId()) {
         $this->configFactory->getEditable('system.site')->set('default_langcode', $new_id)->save();
         $this->languageManager->reset();
     }
     if ($this->languageManager instanceof ConfigurableLanguageManagerInterface) {
         $this->languageManager->updateLockedLanguageWeights();
     }
     drupal_set_message(t('Configuration saved.'));
     // Force the redirection to the page with the language we have just
     // selected as default.
     $form_state->setRedirectUrl($this->entities[$new_id]->urlInfo('collection', array('language' => $this->entities[$new_id])));
 }
Exemplo n.º 8
0
 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     parent::submitForm($form, $form_state);
     drupal_set_message(t('The order of the translators has been saved.'));
 }
Exemplo n.º 9
0
 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     parent::submitForm($form, $form_state);
     drupal_set_message(t('The role settings have been updated.'));
 }
Exemplo n.º 10
0
 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     parent::submitForm($form, $form_state);
     drupal_set_message($this->t('Configuration saved.'));
 }
Exemplo n.º 11
0
  /**
   * {@inheritdoc}
   */
  public function buildRow(EntityInterface $entity) {

    $row['label'] = $entity->label();

    $row['flag_type'] = $this->getFlagType($entity);

    $row['roles'] = $this->getFlagRoles($entity);

    $row['bundles'] = $this->getBundles($entity);

    $row['global'] = [
      '#markup' => $entity->isGlobal() ? t('Global') : t('Personal'),
    ];

    $row['status'] = [
      '#markup' => $entity->isEnabled() ? t('Enabled') : t('Disabled'),
    ];

    return $row + parent::buildRow($entity);
  }
 /**
  * {@inheritdoc}
  */
 public function render()
 {
     $build = parent::render();
     $build['item'] = ['#type' => 'item', '#markup' => $this->t('On this screen you can define <em>transitions</em>. Every time an entity is saved, it undergoes a transition. It is not possible to save an entity if it tries do a transition not defined here. Transitions do not necessarily mean a state change, it is possible to transition from a state to the same state but that transition needs to be defined here as well.'), '#weight' => -5];
     return $build;
 }
Exemplo n.º 13
0
 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     parent::submitForm($form, $form_state);
     $search_settings = $this->configFactory->get('search.settings');
     // If these settings change, the index needs to be rebuilt.
     if ($search_settings->get('index.minimum_word_size') != $form_state['values']['minimum_word_size'] || $search_settings->get('index.overlap_cjk') != $form_state['values']['overlap_cjk']) {
         $search_settings->set('index.minimum_word_size', $form_state['values']['minimum_word_size']);
         $search_settings->set('index.overlap_cjk', $form_state['values']['overlap_cjk']);
         drupal_set_message($this->t('The index will be rebuilt.'));
         search_reindex();
     }
     $search_settings->set('index.cron_limit', $form_state['values']['cron_limit'])->set('logging', $form_state['values']['logging'])->save();
     drupal_set_message($this->t('The configuration options have been saved.'));
 }
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     /* @var $state \Drupal\workflow\Entity\WorkflowState */
     $state = $entity;
     // $workflow = $state->getWorkflow();
     /**
      * Allow modules to insert their own workflow operations to the list.
      */
     // This is what EntityListBuilder::getOperations() does:
     // $operations = $this->getDefaultOperations($entity);
     // $operations += $this->moduleHandler()->invokeAll('entity_operation', array($entity));
     // $this->moduleHandler->alter('entity_operation', $operations, $entity);
     // In D8, the interface of below hook_workflow_operations has changed a bit.
     // @see EntityListBuilder::getOperations, workflow_operations, workflow.api.php.
     $operations += $this->moduleHandler()->invokeAll('workflow_operations', array('state', $state));
     return $operations;
 }
 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     $row['label'] = $entity->label();
     $row['id']['#markup'] = $entity->id();
     return $row + parent::buildRow($entity);
 }