You are here

function views_rss_core_preprocess_channel_cloud in Views RSS 8.2

Same name and namespace in other branches
  1. 8.3 modules/views_rss_core/views_rss_core.inc \views_rss_core_preprocess_channel_cloud()
  2. 6.2 modules/views_rss_core/views_rss_core.inc \views_rss_core_preprocess_channel_cloud()
  3. 7.2 modules/views_rss_core/views_rss_core.inc \views_rss_core_preprocess_channel_cloud()

Preprocess function for channel <cloud> element.

1 string reference to 'views_rss_core_preprocess_channel_cloud'
views_rss_core_views_rss_channel_elements in modules/views_rss_core/views_rss_core.module
Implements hook_views_rss_item_elements().

File

modules/views_rss_core/views_rss_core.inc, line 188
Preprocess functions for Views RSS: Core Elements module.

Code

function views_rss_core_preprocess_channel_cloud(&$variables) {

  // No value = no preprocessing.
  if (empty($variables['elements'][0]['value'])) {
    return;
  }
  if ($url = parse_url($variables['elements'][0]['value'])) {
    $variables['elements'][0]['value'] = NULL;
    $variables['elements'][0]['attributes'] = array(
      'domain' => $url['host'],
      'port' => $url['port'],
      'path' => $url['path'],
      'registerProcedure' => $url['fragment'],
      'protocol' => $url['scheme'],
    );
  }
}