/**
  * {@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);
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account)
 {
     /** @var \Drupal\page_manager\PageVariantInterface $entity */
     if ($operation === 'view') {
         $contexts = $entity->getContexts();
         $conditions = $entity->getSelectionConditions();
         foreach ($conditions as $condition) {
             if ($condition instanceof ContextAwarePluginInterface) {
                 $this->contextHandler()->applyContextMapping($condition, $contexts);
             }
         }
         return AccessResult::allowedIf($this->resolveConditions($conditions, $entity->getSelectionLogic()));
     }
     return parent::checkAccess($entity, $operation, $account);
 }