Aggiunta estensione al costruttore di media model image
Fixato bug per cui la get path del media image renderer non funzionava Aggiunto campo estensione al costruttore dei media image renderer Fixato rss helper che non riusciva ad ottenere la dimensione delle immaginni Signed-off-by: Riccardo Di Dato <r.didato@asdynamics.it>
This commit is contained in:
@@ -11,7 +11,7 @@ class RSSHelper {
|
||||
header('Content-Type: application/xml');
|
||||
|
||||
echo '<?xml version="1.0"?>',PHP_EOL;
|
||||
echo '<rss version="2.0">',PHP_EOL;
|
||||
echo '<rss version="2.0" encoding="UTF-8">',PHP_EOL;
|
||||
echo '<channel>',PHP_EOL;
|
||||
|
||||
self::generateChannelInfo();
|
||||
@@ -30,7 +30,7 @@ class RSSHelper {
|
||||
|
||||
echo '<title>'.$conf->info->projectName.'</title>',PHP_EOL;
|
||||
echo '<link>'.GUIHandler::getBaseUrl().'</link>',PHP_EOL;
|
||||
echo '<description>'.$conf->info->projectDescription.'</description>',PHP_EOL;
|
||||
echo '<description>'.html_entity_decode($conf->info->projectDescription).'</description>',PHP_EOL; // Entity decode perchè in config contiene à e non ho intenzione di controllare tutta l'applicazione
|
||||
echo '<language>it-IT</language>',PHP_EOL;
|
||||
echo '<webMaster>webmaster@ifattidinapoli.it</webMaster>',PHP_EOL;
|
||||
|
||||
@@ -47,9 +47,9 @@ class RSSHelper {
|
||||
$conf = GlobalVariables::get("config");
|
||||
|
||||
echo '<item>',PHP_EOL;
|
||||
echo '<title>'.htmlentities($notizia->titolo).'</title>',PHP_EOL;
|
||||
echo '<title>'.$notizia->titolo.'</title>',PHP_EOL;
|
||||
echo '<description>'.htmlentities($notizia->testo).'</description>',PHP_EOL;
|
||||
echo '<link>'.GUIHandler::getBaseUrl().'/articolo_'.$notizia->id.'</link>',PHP_EOL;
|
||||
echo '<link>'.GUIHandler::getBaseUrl().'articolo_'.$notizia->id.'</link>',PHP_EOL;
|
||||
|
||||
$mainMedia = DaoMediaHandler::getMainMediaFromModel($notizia);
|
||||
if (!is_null($mainMedia) && $mainMedia->hasProperty("mediaType") && $mainMedia->mediaType == MediaModel::TYPE_IMAGE){
|
||||
@@ -61,7 +61,7 @@ class RSSHelper {
|
||||
}
|
||||
|
||||
echo '<pubDate>'.date(DATE_RFC2822,$notizia->about->data->sec).'</pubDate>',PHP_EOL;
|
||||
echo '<guid>'.GUIHandler::getBaseUrl().'/articolo_'.$notizia->id.'</guid>',PHP_EOL;
|
||||
echo '<guid>'.GUIHandler::getBaseUrl().'articolo_'.$notizia->id.'</guid>',PHP_EOL;
|
||||
|
||||
echo '</item>',PHP_EOL;
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class MediaModel extends Model implements MediaInterface{
|
||||
$this->mediaRenderer = new MediaLocalVideo($this);
|
||||
}
|
||||
if ($this->mediaType == self::TYPE_IMAGE){
|
||||
$this->mediaRenderer = new MediaImage($this->id);
|
||||
$this->mediaRenderer = new MediaImage($this->id, $this->extension);
|
||||
}
|
||||
if ($this->mediaType == self::TYPE_PDF){
|
||||
$this->mediaRenderer = new MediaPdf($this);
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<?php
|
||||
class MediaImage extends MediaRenderer{
|
||||
private $id;
|
||||
private $extension;
|
||||
|
||||
|
||||
|
||||
public function __construct($id){
|
||||
public function __construct($id, $extension){
|
||||
$this->id = $id;
|
||||
$this->extension = $extension;
|
||||
}
|
||||
|
||||
public function asText(array $opt = array()){
|
||||
|
||||
Reference in New Issue
Block a user