* @author Michael Slusarz * @category Horde * @copyright 2006-2017 Horde LLC * @license http://www.horde.org/licenses/gpl GPL * @package IMP */ class IMP_Mime_Viewer_Smil extends Horde_Mime_Viewer_Smil { /** * User-defined function callback for start elements. * * @param object $parser Handle to the parser instance (not used). * @param string $name The name of this XML element. * @param array $attrs List of this element's attributes. */ protected function _startElement($parser, $name, $attrs) { switch ($name) { case 'IMG': if (isset($attrs['SRC']) && (($rp = $this->_getRelatedLink($attrs['SRC'])) !== false)) { $this->_content .= '
'; } break; case 'TEXT': if (isset($attrs['SRC']) && (($rp = $this->_getRelatedLink($attrs['SRC'])) !== false)) { $this->_content .= htmlspecialchars($rp->getContents()) . '
'; } break; } } /** * Get related parts. * * @param string $cid The CID to search for. * * @return mixed Either the related MIME_Part or false. */ protected function _getRelatedLink($cid) { return (($related_part = $this->getConfigParam('imp_contents')->findMimeType($this->_mimepart->getMimeId(), 'multipart/related')) && (($key = $related_part->getMetadata('related_ob')->cidSearch($cid)) !== false)) ? $this->getConfigParam('imp_contents')->getMIMEPart($key) : false; } }