File tree 4 files changed +19
-14
lines changed
4 files changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -4,4 +4,4 @@ description: iTunes RSS
4
4
core : 8.x
5
5
package : Custom
6
6
dependencies :
7
- - views
7
+ - drupal: views
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
+ /**
4
+ * @file
5
+ * Provides iTunes RSS feed via views.
6
+ */
7
+
3
8
/**
4
9
* Implements hook_theme().
5
10
*/
6
11
function itunes_rss_theme() {
7
12
$theme_registry['views_view_itunes_rss'] = [
8
13
'variables' => [
9
- 'view' => NULL,
10
- 'options' => NULL,
11
- 'rows' => NULL,
12
- 'title' => NULL,
13
- ],
14
+ 'view' => NULL,
15
+ 'options' => NULL,
16
+ 'rows' => NULL,
17
+ 'title' => NULL,
18
+ ],
14
19
'path' => 'templates',
15
20
'includes' => ['core/modules/views/views.theme.inc'],
16
21
'template' => 'views-view-itunes-rss',
@@ -28,11 +33,10 @@ function itunes_rss_theme() {
28
33
* - view: A ViewExecutable object.
29
34
* - rows: The raw row data.
30
35
*/
31
- function template_preprocess_views_view_itunes_rss(&$variables) {
36
+ function template_preprocess_views_view_itunes_rss(array &$variables) {
32
37
template_preprocess_views_view_rss($variables);
33
38
34
- $view = $variables['view'];
35
- $items = $variables['rows'];
39
+ $view = $variables['view'];
36
40
$style = $view->style_plugin;
37
41
$variables['image_url'] = $style->getImage();
38
42
$variables['itunes_category'] = $style->options['category'];
Original file line number Diff line number Diff line change @@ -144,13 +144,13 @@ public function render($row) {
144
144
$ item ->elements [] = [
145
145
'key ' => 'enclosure ' ,
146
146
'attributes ' => [
147
- // In RSS feeds, it is necessary to use absolute URLs. The 'url.site'
148
- // cache context is already associated with RSS feed responses, so it
149
- // does not need to be specified here.
147
+ // In RSS feeds, it is necessary to use absolute URLs. The
148
+ // 'url.site' cache context is already associated with RSS feed
149
+ // responses, so it does not need to be specified here.
150
150
'url ' => file_create_url ($ file ->getFileUri ()),
151
151
'length ' => $ file ->getSize (),
152
152
'type ' => $ file ->getMimeType (),
153
- ]
153
+ ],
154
154
];
155
155
}
156
156
}
@@ -184,4 +184,5 @@ public function render($row) {
184
184
185
185
return $ build ;
186
186
}
187
+
187
188
}
Original file line number Diff line number Diff line change 3
3
namespace Drupal \itunes_rss \Plugin \views \style ;
4
4
5
5
use Drupal \Core \Form \FormStateInterface ;
6
- use Drupal \Core \Url ;
7
6
use Drupal \views \Plugin \views \style \Rss ;
8
7
9
8
/**
@@ -142,4 +141,5 @@ public function render() {
142
141
143
142
return $ build ;
144
143
}
144
+
145
145
}
You can’t perform that action at this time.
0 commit comments