. */ require_once 'Compiler.php'; /** * Live Compiler to render widget as a Live.com XML manifest. */ class Compiler_Live extends Compiler { /** * Javascript UWA environment. * * @var string */ protected $_environment = 'Live2'; /** * Stylesheet. * * @var string */ protected $_stylesheet = 'uwa-iframe.css'; /** * Platform Name. * * @var string */ protected $_platform = 'live'; /** * Main rendering function. * * @return string */ public function render() { $metas = $this->_widget->getMetas(); $richIcon = $this->_widget->getRichIcon(); $description = isset($metas['description']) ? $metas['description'] : ''; $l = array(); $l[] = ''; $l[] = ''; $l[] = ''; $l[] = '' . htmlspecialchars( $this->_widget->getTitle() ) . ''; $l[] = '' . htmlspecialchars($description) . ''; $l[] = 'en-us'; $l[] = 'Netvibes.UWA.Live'; $javascripts = $this->_getJavascripts( array('platform' => $this->_platform) ); foreach ($javascripts as $javascript) { $l[] = ''; $l[] = '' . htmlspecialchars($javascript) . ''; $l[] = ''; } foreach ($this->_getStylesheets() as $stylesheet) { $l[] = ''; $l[] = '' . htmlspecialchars($stylesheet) . ''; $l[] = ''; } if (isset($richIcon)) { $l[] = ''; $l[] = '' . $richIcon . ''; $l[] = ''; } $l[] = ''; $l[] = ''; return implode("\n", $l); } }