*/ class KMLCreator extends FeedCreator { /** * KMLCreator constructor. */ public function __construct() { $this->contentType = "application/vnd.google-earth.kml+xml"; $this->encoding = "utf-8"; } /** @inheritdoc */ public function createFeed() { $feed = "encoding."\"?>\n"; $feed .= $this->_createStylesheetReferences(); $feed .= "\n"; $feed .= "\n"; if ($_GET['LinkControl']) { $feed .= "\n3600\n\n"; } if (!empty($_GET['simple']) && count($this->items) > 0) { $feed .= " normal #defaultIcon highlight #hoverIcon "; $style = "#defaultStyle"; } else { $style = "root://styleMaps#default?iconId=0x307"; } $feed .= "\n"; $feed .= " ".FeedCreator::iTrunc(htmlspecialchars($this->title), 100)." ".$this->getDescription()." 1\n"; for ($i = 0; $i < count($this->items); $i++) { //added here beucase description gets auto surrounded by cdata $this->items[$i]->description = "".$this->items[$i]->description."
".$this->items[$i]->licence."

items[$i]->link)."\">View Online"; $feed .= " ".$this->items[$i]->getDescription(true)." ".FeedCreator::iTrunc(htmlspecialchars(strip_tags($this->items[$i]->title)), 100)." 1 ".$this->items[$i]->long.",".$this->items[$i]->lat.",25 "; if ($this->items[$i]->thumb != "") { $feed .= " $style "; } $feed .= " \n"; } $feed .= "
\n
\n
\n"; return $feed; } /** * Generate a filename for the feed cache file. Overridden from FeedCreator to prevent XML data types. * * @return string the feed cache filename * @since 1.4 * @access private */ protected function _generateFilename() { $fileInfo = pathinfo($_SERVER["SCRIPT_NAME"]); return substr($fileInfo["basename"], 0, -(strlen($fileInfo["extension"]) + 1)).".kml"; } }