/**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     $row['to']['#markup'] = $this->stateStorage->load($entity->getToState())->label();
     $row['label'] = $entity->label();
     $row['roles']['#markup'] = implode(', ', user_role_names(FALSE, 'use ' . $entity->id() . ' transition'));
     return $row + parent::buildRow($entity);
 }
 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     $row['label'] = $this->getLabel($entity);
     $row['color'] = ['#markup' => SafeMarkup::checkPlain($entity->getColor())];
     $row['point_value'] = ['#markup' => SafeMarkup::checkPlain($entity->getPointValue())];
     return $row + parent::buildRow($entity);
 }
 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     $row['label'] = $entity->label();
     $definition = $entity->getPlugin()->getPluginDefinition();
     $row['plugin']['#markup'] = $definition['name'];
     $row['status']['#markup'] = $entity->status() ? $this->t('Enabled') : $this->t('Disabled');
     return $row + parent::buildRow($entity);
 }
 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     $plugin = $this->shippingQuotePluginManager->createInstance($entity->getPluginId(), $entity->getPluginConfiguration());
     $row['label'] = $entity->label();
     $row['description']['#markup'] = $plugin->getDescription();
     $row['status']['#markup'] = $entity->status() ? $this->t('Enabled') : $this->t('Disabled');
     return $row + parent::buildRow($entity);
 }
 /**
  * {@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);
 }
 /**
  * {@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 buildRow(EntityInterface $entity)
 {
     $row['label'] = $this->getLabel($entity);
     return $row + parent::buildRow($entity);
 }
 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     /** @var $entity \Drupal\search\SearchPageInterface */
     $row['label'] = $entity->label();
     $row['url']['#markup'] = 'search/' . $entity->getPath();
     // If the search page is active, link to it.
     if ($entity->status()) {
         $row['url'] = array('#type' => 'link', '#title' => $row['url'], '#url' => Url::fromRoute('search.view_' . $entity->id()));
     }
     $definition = $entity->getPlugin()->getPluginDefinition();
     $row['plugin']['#markup'] = $definition['title'];
     if ($entity->isDefaultSearch()) {
         $status = $this->t('Default');
     } elseif ($entity->status()) {
         $status = $this->t('Enabled');
     } else {
         $status = $this->t('Disabled');
     }
     $row['status']['#markup'] = $status;
     if ($entity->isIndexable()) {
         $status = $entity->getPlugin()->indexStatus();
         $row['progress']['#markup'] = $this->t('%num_indexed of %num_total indexed', array('%num_indexed' => $status['total'] - $status['remaining'], '%num_total' => $status['total']));
     } else {
         $row['progress']['#markup'] = $this->t('Does not use index');
     }
     return $row + parent::buildRow($entity);
 }
 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     // Check whether this is the fallback text format. This format is available
     // to all roles and cannot be disabled via the admin interface.
     if ($entity->isFallbackFormat()) {
         $row['label'] = SafeMarkup::placeholder($entity->label());
         $fallback_choice = $this->configFactory->get('filter.settings')->get('always_show_fallback_choice');
         if ($fallback_choice) {
             $roles_markup = SafeMarkup::placeholder($this->t('All roles may use this format'));
         } else {
             $roles_markup = SafeMarkup::placeholder($this->t('This format is shown when no other formats are available'));
         }
     } else {
         $row['label'] = $this->getLabel($entity);
         $roles = array_map('\\Drupal\\Component\\Utility\\SafeMarkup::checkPlain', filter_get_roles_by_format($entity));
         $roles_markup = $roles ? implode(', ', $roles) : $this->t('No roles may use this format');
     }
     $row['roles'] = !empty($this->weightKey) ? array('#markup' => $roles_markup) : $roles_markup;
     return $row + parent::buildRow($entity);
 }
 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     $row['label'] = $entity->label();
     $row['default'] = array('#type' => 'radio', '#parents' => array('site_default_language'), '#title' => t('Set @title as default', array('@title' => $entity->label())), '#title_display' => 'invisible', '#return_value' => $entity->id(), '#id' => 'edit-site-default-language-' . $entity->id());
     // Mark the right language as default in the form.
     if ($entity->id() == $this->languageManager->getDefaultLanguage()->getId()) {
         $row['default']['#default_value'] = $entity->id();
     }
     return $row + parent::buildRow($entity);
 }
Example #11
0
 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     $row['label'] = $this->getLabel($entity);
     $row['hostname'] = array('#markup' => $entity->getLink());
     if ($entity->isActive()) {
         $row['hostname']['#prefix'] = '<strong>';
         $row['hostname']['#suffix'] = '</strong>';
     }
     $row['status'] = array('#markup' => $entity->status() ? $this->t('Active') : $this->t('Inactive'));
     $row['is_default'] = array('#markup' => $entity->isDefault() ? $this->t('Yes') : $this->t('No'));
     $row += parent::buildRow($entity);
     $row['weight']['#delta'] = count(\Drupal::service('domain.loader')->loadMultiple()) + 1;
     return $row;
 }
 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     // Check whether this is the fallback text format. This format is available
     // to all roles and cannot be disabled via the admin interface.
     $row['label'] = $entity->label();
     $row['roles'] = [];
     if ($entity->isFallbackFormat()) {
         $fallback_choice = $this->configFactory->get('filter.settings')->get('always_show_fallback_choice');
         if ($fallback_choice) {
             $row['roles']['#markup'] = $this->t('All roles may use this format');
         } else {
             $row['roles']['#markup'] = $this->t('This format is shown when no other formats are available');
         }
         // Emphasize the fallback role text since it is important to understand
         // how it works which configuring filter formats. Additionally, it is not
         // a list of roles unlike the other values in this column.
         $row['roles']['#prefix'] = '<em>';
         $row['roles']['#suffix'] = '</em>';
     } else {
         $row['roles'] = ['#theme' => 'item_list', '#items' => filter_get_roles_by_format($entity), '#empty' => $this->t('No roles may use this format'), '#context' => ['list_style' => 'comma-list']];
     }
     return $row + parent::buildRow($entity);
 }
  /**
   * {@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 buildRow(EntityInterface $entity)
 {
     $row = array();
     // Get the Workflow from the page.
     /* @var $workflow \Drupal\workflow\Entity\Workflow */
     if (!($workflow = workflow_ui_url_get_workflow())) {
         workflow_debug(__FILE__, __FUNCTION__, __LINE__);
         // @todo D8-port: still test this snippet.
     }
     $wid = $url_wid = $workflow->id();
     /* @var $entity \Drupal\workflow\Entity\WorkflowState */
     $state = $entity;
     $sid = $state->id();
     $label = $state->label();
     $count = $state->count();
     // Build select options for reassigning states.
     // We put a blank state first for validation.
     $state_options = array('' => ' ');
     $state_options += workflow_get_workflow_state_names($wid, $grouped = FALSE, $all = FALSE);
     // Make it impossible to reassign to the same state that is disabled.
     if ($state->isCreationState() || !$sid || !$state->isActive()) {
         $current_state_options = array();
     } else {
         $current_state = array($sid => $state_options[$sid]);
         $current_state_options = array_diff($state_options, $current_state);
     }
     /*
      *  Build the Row.
      */
     // The column 'weight' is added magically in the draggable EntityList.
     //  $row['weight'] = $state->weight;
     // Some columns are not welcome in the list.
     //  $row['module'] = $state->getModule();
     //  $row['wid'] = $state->getWorkflow();
     // Column 'label' is manipulated in parent::buildForm(). So, we use 'label_new'.
     //  $row['label'] = $state->label();
     $row['label_new'] = ['#markup' => $label, '#type' => 'textfield', '#size' => 30, '#maxlength' => 255, '#default_value' => $label, '#title' => NULL];
     $row['id'] = ['#type' => 'machine_name', '#title' => NULL, '#size' => 30, '#description' => NULL, '#disabled' => !$state->isNew(), '#default_value' => $state->id(), '#required' => FALSE, '#machine_name' => ['exists' => [$this, 'exists'], 'source' => array('states', $state->id(), 'label_new'), 'replace_pattern' => '[^a-z0-9_()]+', 'error' => $this->t('The machine-readable name must be unique, and can only contain lowercase letters, numbers, and underscores.')]];
     $row['sysid'] = ['#type' => 'value', '#value' => $state->sysid];
     $row['status'] = ['#type' => 'checkbox', '#default_value' => $state->isActive()];
     // The new value of states that are inactivated.
     $row['reassign'] = ['#type' => 'select', '#options' => $current_state_options];
     $row['count'] = ['#type' => 'value', '#value' => $count, '#markup' => $count];
     // Don't let the creation state change weight or status or name.
     if ($state->isCreationState()) {
         $row['label_new']['#disabled'] = TRUE;
         $row['status']['#disabled'] = TRUE;
         $row['reassign']['#type'] = 'hidden';
         $row['reassign']['#disabled'] = TRUE;
     }
     // New state and disabled states cannot be reassigned.
     if (!$sid || !$state->isActive() || $count == 0) {
         $row['reassign']['#type'] = 'hidden';
         $row['reassign']['#disabled'] = TRUE;
     }
     // Disabled states cannot be renamed (and is a visual clue, too).
     if (!$state->isActive()) {
         $row['label_new']['#disabled'] = TRUE;
     }
     return $row + parent::buildRow($entity);
 }
 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     $row['label'] = $entity->label();
     $row['id']['#markup'] = $entity->id();
     return $row + parent::buildRow($entity);
 }
Example #16
0
 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     // Check whether this is the fallback text format. This format is available
     // to all roles and cannot be disabled via the admin interface.
     $row['label'] = $this->getLabel($entity);
     $row['roles'] = [];
     if ($entity->isFallbackFormat()) {
         $fallback_choice = $this->configFactory->get('filter.settings')->get('always_show_fallback_choice');
         if ($fallback_choice) {
             $roles_markup = $this->t('All roles may use this format');
         } else {
             $roles_markup = $this->t('This format is shown when no other formats are available');
         }
         // Emphasize the fallback role text since it is important to understand
         // how it works which configuring filter formats. Additionally, it is not
         // a list of roles unlike the other values in this column.
         $row['roles']['#prefix'] = '<em>';
         $row['roles']['#suffix'] = '</em>';
     } else {
         $roles = array_map('\\Drupal\\Component\\Utility\\SafeMarkup::checkPlain', filter_get_roles_by_format($entity));
         $roles_markup = $roles ? implode(', ', $roles) : $this->t('No roles may use this format');
     }
     $row['roles']['#markup'] = $roles_markup;
     return $row + parent::buildRow($entity);
 }