From: Michael M Slusarz Date: Wed, 21 Jan 2009 07:30:49 +0000 (-0700) Subject: Fix MIME rendering. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=0d9f0bd9cece20bfe8277b54b325674847c5220c;p=horde.git Fix MIME rendering. --- diff --git a/chora/templates/checkout/checkout.inc b/chora/templates/checkout/checkout.inc index 80bee0619..03eb74518 100644 --- a/chora/templates/checkout/checkout.inc +++ b/chora/templates/checkout/checkout.inc @@ -12,13 +12,16 @@

getType(); -if (strpos($type, 'text/plain') !== false) { - echo '
' . Text_Filter::filter($pretty->render(), 'text2html', array('parselevel' => TEXT_HTML_MICRO)) . '
'; -} elseif (strpos($type, 'image/') !== false) { +if (strpos($mime_type, 'text/plain') !== false) { + $data = $pretty->render('inline'); + $data = reset($data); + echo '
' . Text_Filter::filter($data['data'], 'text2html', array('parselevel' => TEXT_HTML_MICRO)) . '
'; +} elseif (strpos($mime_type, 'image/') !== false) { echo Horde::img(Util::addParameter(Horde::selfUrl(true), 'p', 1), '', '', ''); -} elseif ($pretty->canDisplayInline()) { - echo $pretty->render(); +} elseif ($pretty->canRender('inline')) { + $data = $pretty->render('inline'); + $data = reset($data); + echo $data['data']; } else { echo Horde::link(Util::addParameter(Horde::selfUrl(true), 'p', 1)) . Horde::img('download.png', '', '', $registry->getImageDir('horde')) . ' ' . sprintf(_("Download revision %s"), $r) . ''; }