|
@@ -5,6 +5,7 @@ use Drupal\Core\Controller\ControllerBase;
|
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
|
|
use Drupal\Core\Template\TwigEnvironment;
|
|
|
+use Drupal\node\NodeInterface;
|
|
|
|
|
|
class PodcastRorController extends ControllerBase {
|
|
|
protected $state;
|
|
@@ -48,6 +49,7 @@ class PodcastRorController extends ControllerBase {
|
|
|
$data['nodes'][$nid]['img'] = array();
|
|
|
foreach( $node->get('field_contenuti_audio')->referencedEntities() as $ai => $entity) {
|
|
|
$data['nodes'][$nid]['audio'][$ai] = $entity->toArray();
|
|
|
+ //$data['nodes'][$nid]['audio'][$ai]['text'] = print_r($data['nodes'][$nid]['audio'][$ai]['field_audio_link'], true);
|
|
|
}
|
|
|
foreach( $node->get('field_image')->referencedEntities() as $ai => $entity) {
|
|
|
$arr = $entity->toArray();
|
|
@@ -63,15 +65,22 @@ class PodcastRorController extends ControllerBase {
|
|
|
}
|
|
|
return $data;
|
|
|
}
|
|
|
- public function podcastAll() {
|
|
|
+ public function podcast($path) {
|
|
|
+ // TODO: use $path
|
|
|
$template = $this->twig->loadTemplate(drupal_get_path('module', 'podcast_ror') . '/templates/podcast.html.twig');
|
|
|
$tmpl_data = [ 'ror' => array('podcast' => $this->query(),
|
|
|
'url' => \Drupal::service('path.current')->getPath(),
|
|
|
)];
|
|
|
- $variables['ror']['url'] =
|
|
|
+ //$variables['ror']['url'] =
|
|
|
$xml = $template->render($tmpl_data);
|
|
|
- $resp = new Response($xml, 200, array(
|
|
|
- 'Content-Type' => 'application/rss+xml'));
|
|
|
+ $resp = new Response($xml, 200, array( 'Content-Type' => 'application/rss+xml'));
|
|
|
return $resp;
|
|
|
}
|
|
|
+ public function podcastAll() {
|
|
|
+ return $this->podcast('all.xml');
|
|
|
+ }
|
|
|
+ public function podcastAny(NodeInterface $ctype) {
|
|
|
+ return new Response('tipo: BOH', 200,array( 'Content-Type' => 'application/rss+xml'));
|
|
|
+ // return $this->podcast($ctype);
|
|
|
+ }
|
|
|
}
|