You are here

function _site_map_video in Site map 8

Same name and namespace in other branches
  1. 5 site_map.module \_site_map_video()
  2. 6.2 site_map.module \_site_map_video()
  3. 6 site_map.module \_site_map_video()
  4. 7 site_map.module \_site_map_video()

Render the latest maps for video.

Return value

string Returns HTML string of site map for video.

File

./site_map.module, line 267
Provides a site map functionality.

Code

function _site_map_video() {
  $config = \Drupal::config('site_map.settings');
  $output = '';
  $class = array();
  $options = array();
  if (\Drupal::service('module_handler')
    ->moduleExists('video')) {
    $title = t('Video');
    $output = \Drupal::l(t('Video content'), Url::fromUri('base://' . 'video'));
    if ($config
      ->get('show_rss_links') != 0) {
      $feed_icon = array(
        '#theme' => 'site_map_feed_icon',
        '#url' => 'video/feed',
        '#name' => 'video content',
      );
      $rss_link = drupal_render($feed_icon);
      if ($config
        ->get('show_rss_links') == 1) {
        $output .= ' ' . $rss_link;
      }
      else {
        $class[] = 'site-map-rss-left';
        $output = $rss_link . '  ' . $output;
      }
    }
    \Drupal::service('site_map.helper')
      ->setOption($options, 'show_titles', 1, 'show_titles', TRUE);
    $class[] = 'site-map-box-video';
    $attributes = array(
      'class' => $class,
    );
    $site_map_box = array(
      '#theme' => 'site_map_box',
      '#title' => $title,
      '#content' => $output,
      '#attributes' => $attributes,
      '#options' => $options,
    );
    $output = drupal_render($site_map_box);
  }
  return $output;
}