protected function DisplayPluginBase::formatThemes

Format a list of theme templates for output by the theme info helper.

1 call to DisplayPluginBase::formatThemes()
DisplayPluginBase::buildOptionsForm in drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
Provide the default form for setting options.

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php, line 2076
Contains Drupal\views\Plugin\views\display\DisplayPluginBase.

Class

DisplayPluginBase
The default display plugin handler. Display plugins handle options and basic mechanisms for different output methods.

Namespace

Drupal\views\Plugin\views\display

Code

protected function formatThemes($themes) {
  $registry = $this->theme_registry;
  $extension = $this->theme_extension;
  $output = '';
  $picked = FALSE;
  foreach ($themes as $theme) {
    $template = strtr($theme, '_', '-') . $extension;
    if (!$picked && !empty($registry[$theme])) {
      $template_path = isset($registry[$theme]['path']) ? $registry[$theme]['path'] . '/' : './';
      if (file_exists($template_path . $template)) {
        $hint = t('File found in folder @template-path', array(
          '@template-path' => $template_path,
        ));
        $template = '<strong title="' . $hint . '">' . $template . '</strong>';
      }
      else {
        $template = '<strong class="error">' . $template . ' ' . t('(File not found, in folder @template-path)', array(
          '@template-path' => $template_path,
        )) . '</strong>';
      }
      $picked = TRUE;
    }
    $fixed[] = $template;
  }
  $item_list = array(
    '#theme' => 'item_list',
    '#items' => array_reverse($fixed),
  );
  return drupal_render($item_list);
}