add css
This commit is contained in:
@@ -13,8 +13,9 @@ class Feed extends PhpObject {
|
|||||||
|
|
||||||
private $asDesc;
|
private $asDesc;
|
||||||
private $asItems;
|
private $asItems;
|
||||||
|
private $sCssFile;
|
||||||
|
|
||||||
public function __construct($asDesc, $asItems=array())
|
public function __construct($asDesc, $asItems=array(), $sCssFile='')
|
||||||
{
|
{
|
||||||
parent::__construct(__CLASS__, Settings::DEBUG);
|
parent::__construct(__CLASS__, Settings::DEBUG);
|
||||||
if(!array_key_exists('link', $asDesc))
|
if(!array_key_exists('link', $asDesc))
|
||||||
@@ -23,6 +24,7 @@ class Feed extends PhpObject {
|
|||||||
}
|
}
|
||||||
$this->asDesc = $asDesc;
|
$this->asDesc = $asDesc;
|
||||||
array_walk($asItems, array($this, 'addItem'));
|
array_walk($asItems, array($this, 'addItem'));
|
||||||
|
$this->sCssFile = $sCssFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addItem($asItem)
|
public function addItem($asItem)
|
||||||
@@ -72,6 +74,7 @@ class Feed extends PhpObject {
|
|||||||
|
|
||||||
//Global Feed
|
//Global Feed
|
||||||
$sFeed = '<?xml version="1.0" encoding="'.Settings::TEXT_ENC.'" ?>';
|
$sFeed = '<?xml version="1.0" encoding="'.Settings::TEXT_ENC.'" ?>';
|
||||||
|
if($this->sCssFile!='') $sFeed .= "\n".'<?xml-stylesheet type="text/css" href="'.$this->sCssFile.'"?>';
|
||||||
$sFeed .= self::getHtml(self::getHtml($sRssFeedHeader.$sItems, 'channel'), 'rss', '', '', array('version'=>'2.0', 'xmlns:atom'=>'http://www.w3.org/2005/Atom'));
|
$sFeed .= self::getHtml(self::getHtml($sRssFeedHeader.$sItems, 'channel'), 'rss', '', '', array('version'=>'2.0', 'xmlns:atom'=>'http://www.w3.org/2005/Atom'));
|
||||||
|
|
||||||
return $sFeed;
|
return $sFeed;
|
||||||
|
|||||||
Reference in New Issue
Block a user