/**
  * {@inheritdoc}
  */
 public function getQuestion()
 {
     if ($this->type == 'system.simple') {
         $type_label = $this->t('Simple configuration');
     } else {
         $definition = $this->configList->getType($this->type);
         $type_label = $definition->get('label');
     }
     return $this->t('Are you sure you want to revert the %type config %item to its source configuration?', array('%type' => $type_label, '%item' => $this->name));
 }
 /**
  * {@inheritdoc}
  */
 public function getQuestion()
 {
     if ($this->type == 'system.simple') {
         $type_label = $this->t('Simple configuration');
     } else {
         $definition = $this->configList->getType($this->type);
         $type_label = $definition->get('label');
     }
     return $this->t('Are you sure you want to delete the %type config %item?', ['%type' => $type_label, '%item' => $this->name]);
 }
 /**
  * Builds a table for the report.
  *
  * @param string[] $names
  *   List of machine names of config items for the table.
  * @param string $storage
  *   Config storage the items can be loaded from, either 'active' or
  *   'extension'.
  * @param string[] $actions
  *   Action links to include, one or more of:
  *   - diff
  *   - revert
  *   - export
  *   - import
  *   - delete
  *
  * @return array
  *   Render array for the table, not including the #empty and #prefix
  *   properties.
  */
 protected function makeReportTable($names, $storage, $actions)
 {
     $build = array();
     $build['#type'] = 'table';
     $build['#attributes'] = array('class' => array('config-update-report'));
     $build['#header'] = array('name' => array('data' => $this->t('Machine name')), 'label' => array('data' => $this->t('Label (if any)'), 'class' => array(RESPONSIVE_PRIORITY_LOW)), 'type' => array('data' => $this->t('Type'), 'class' => array(RESPONSIVE_PRIORITY_MEDIUM)), 'operations' => array('data' => $this->t('Operations')));
     $build['#rows'] = array();
     foreach ($names as $name) {
         $row = array();
         if ($storage == 'active') {
             $config = $this->configRevert->getFromActive('', $name);
         } else {
             $config = $this->configRevert->getFromExtension('', $name);
         }
         // Figure out what type of config it is, and get the ID.
         $entity_type = $this->configList->getTypeNameByConfigName($name);
         if (!$entity_type) {
             // This is simple config.
             $id = $name;
             $type_label = $this->t('Simple configuration');
             $entity_type = 'system.simple';
         } else {
             $definition = $this->configList->getType($entity_type);
             $id_key = $definition->getKey('id');
             $id = $config[$id_key];
             $type_label = $definition->getLabel();
         }
         $label = isset($config['label']) ? $config['label'] : '';
         $row[] = $name;
         $row[] = $label;
         $row[] = $type_label;
         $links = array();
         $routes = array('export' => 'config.export_single', 'import' => 'config_update_ui.import', 'diff' => 'config_update_ui.diff', 'revert' => 'config_update_ui.revert', 'delete' => 'config_update_ui.delete');
         $titles = array('export' => $this->t('Export'), 'import' => $this->t('Import from source'), 'diff' => $this->t('Show differences'), 'revert' => $this->t('Revert to source'), 'delete' => $this->t('Delete'));
         foreach ($actions as $action) {
             $links[$action] = array('url' => Url::fromRoute($routes[$action], array('config_type' => $entity_type, 'config_name' => $id)), 'title' => $titles[$action]);
         }
         $row[] = array('data' => array('#type' => 'operations', '#links' => $links));
         $build['#rows'][] = $row;
     }
     return $build;
 }