Fix MIME rendering.
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 21 Jan 2009 07:30:49 +0000 (00:30 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 21 Jan 2009 07:30:49 +0000 (00:30 -0700)
chora/templates/checkout/checkout.inc

index 80bee06..03eb745 100644 (file)
 <h3 class="checkout"><?php echo _("Checkout") ?></h3>
 <div class="checkout">
 <?php
-$type = $pretty->getType();
-if (strpos($type, 'text/plain') !== false) {
-    echo '<div class="fixed">' . Text_Filter::filter($pretty->render(), 'text2html', array('parselevel' => TEXT_HTML_MICRO)) . '</div>';
-} elseif (strpos($type, 'image/') !== false) {
+if (strpos($mime_type, 'text/plain') !== false) {
+    $data = $pretty->render('inline');
+    $data = reset($data);
+    echo '<div class="fixed">' . Text_Filter::filter($data['data'], 'text2html', array('parselevel' => TEXT_HTML_MICRO)) . '</div>';
+} 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) . '</a>';
 }