<?php
/*
Module développé par l'équipe de Magavenue. Pour plus d'informations, rendez-vous sur notre blog à l'adresse : http://magavenue.com/blog.
Pour nous contacter, merci d'utiliser le formulaire de contact sur notre blog à l'adresse : http://magavenue.com/blog.
*/
include(dirname(__FILE__).'/../../config/config.inc.php');
require_once(dirname(__FILE__).'/../../init.php');

if (file_exists('..//editorial/editorial.xml')){
  if ($xml = simplexml_load_file('../editorial/editorial.xml')){

    global $cookie;

    $homepage_logo = file_exists('../editorial/homepage_logo.jpg');
    $logo_subheading = 'logo_subheading_'.$cookie->id_lang;
    $title = 'title_'.$cookie->id_lang;
    $subheading = 'subheading_'.$cookie->id_lang;
    $paragraph = 'paragraph_'.$cookie->id_lang;
      // Send feed
      header("Content-Type:text/xml; charset=utf-8");
      echo '<?xml version="1.0" encoding="UTF-8"?>'."\n".'
      <rss version="2.0">
      	<channel>
      		<title><![CDATA[Editorial '.Configuration::get('PS_SHOP_NAME').']]></title>
      		<link>http://'.htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'</link>
      		<mail>'.Configuration::get('PS_SHOP_EMAIL').'</mail>
      		<generator>Magavenue</generator>
      		<language>'.Language::getIsoById(intval($cookie->id_lang)).'</language>
            <item>
                <logo_subheading><![CDATA['.$xml->body->$logo_subheading.']]></logo_subheading>
                <title><![CDATA['.$xml->body->$title.']]></title>
                <subheading><![CDATA['.$xml->body->$subheading.']]></subheading>
                <paragraph><![CDATA['.$xml->body->$paragraph.']]></paragraph>
            </item>
          </channel>
      </rss>';

    }
  }

?>