--- /dev/null
+<div class="file-view">
+<h3 class="file-view-header"><?php echo $this->h($this->title) ?></h3>
+<div class="file-view-contents">
+<?php
+if (strpos($this->mimeType, 'text/plain') !== false) {
+ $data = $this->pretty->render('inline');
+ $data = reset($data);
+ echo '<div class="fixed">' . $GLOBALS['injector']->getInstance('Horde_Core_Factory_TextFilter')->filter($data['data'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) . '</div>';
+} elseif (strpos($this->mimeType, 'image/') !== false) {
+ echo Horde::img(Horde_Util::addParameter(Horde::selfUrl(true), 'p', 1), '', '', '');
+} elseif ($this->pretty->canRender('inline')) {
+ $data = $this->pretty->render('inline');
+ $data = reset($data);
+ echo $data['data'];
+} else {
+ echo Horde::link(Horde_Util::addParameter(Horde::selfUrl(true), 'p', 1)) . Horde::img('download.png') . ' ' . sprintf(_("Download revision %s"), $r) . '</a>';
+}
+?>
+</div>
+</div>
+++ /dev/null
-<div class="file-view">
-<h3 class="file-view-header"><?php echo $this->h($this->title) ?></h3>
-<div class="file-view-contents">
-<?php
-if (strpos($this->mimeType, 'text/plain') !== false) {
- $data = $this->pretty->render('inline');
- $data = reset($data);
- echo '<div class="fixed">' . $GLOBALS['injector']->getInstance('Horde_Core_Factory_TextFilter')->filter($data['data'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) . '</div>';
-} elseif (strpos($this->mimeType, 'image/') !== false) {
- echo Horde::img(Horde_Util::addParameter(Horde::selfUrl(true), 'p', 1), '', '', '');
-} elseif ($this->pretty->canRender('inline')) {
- $data = $this->pretty->render('inline');
- $data = reset($data);
- echo $data['data'];
-} else {
- echo Horde::link(Horde_Util::addParameter(Horde::selfUrl(true), 'p', 1)) . Horde::img('download.png') . ' ' . sprintf(_("Download revision %s"), $r) . '</a>';
-}
-?>
-</div>
-</div>
if ($readmes) {
$readmeCollection = new Chora_Readme_Collection($readmes);
$readmeFile = $readmeCollection->chooseReadme();
- $readmeRenderer = new Chora_Renderer_File_Pretty($injector->createInstance('Horde_View_Base'), $readmeFile, $readmeFile->queryRevision());
+ $readmeRenderer = new Chora_Renderer_File_Html($injector->createInstance('Horde_View_Base'), $readmeFile, $readmeFile->queryRevision());
echo $readmeRenderer->render();
}
require $registry->get('templates', 'horde') . '/common-footer.inc';
--- /dev/null
+<?php
+/**
+ * Copyright 2000-2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Chuck Hagenbuch <chuck@horde.org>
+ * @package Chora
+ */
+class Chora_Renderer_File_Html extends Chora_Renderer_File
+{
+ public function render()
+ {
+ // need the checkout
+ $checkOut = $GLOBALS['VC']->checkout($this->_file->queryPath(), $this->_revision);
+
+ // Pretty-print the checked out copy */
+ if ($this->_file->mimeType == 'application/octet-stream') {
+ $this->_view->mimeType = 'text/plain';
+ } else {
+ $this->_view->mimeType = $this->_file->mimeType;
+ }
+
+ $this->_view->title = $this->_file->queryName();
+ $this->_view->pretty = Chora::pretty($this->_view->mimeType, $checkOut);
+ if ($this->_view->mimeType == 'text/html') {
+ $this->_view->pretty->setConfigParam('inline', true);
+ }
+
+ return $this->_view->render('app/views/file/html.html.php');
+ }
+}
+++ /dev/null
-<?php
-/**
- * Copyright 2000-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Chuck Hagenbuch <chuck@horde.org>
- * @package Chora
- */
-class Chora_Renderer_File_Pretty extends Chora_Renderer_File
-{
- public function render()
- {
- // need the checkout
- $checkOut = $GLOBALS['VC']->checkout($this->_file->queryPath(), $this->_revision);
-
- // Pretty-print the checked out copy */
- if ($this->_file->mimeType == 'application/octet-stream') {
- $this->_view->mimeType = 'text/plain';
- } else {
- $this->_view->mimeType = $this->_file->mimeType;
- }
-
- $this->_view->title = $this->_file->queryName();
- $this->_view->pretty = Chora::pretty($this->_view->mimeType, $checkOut);
- if ($this->_view->mimeType == 'text/html') {
- $this->_view->pretty->setConfigParam('inline', true);
- }
-
- return $this->_view->render('app/views/file/pretty.html.php');
- }
-}