From 8a046e3c7e4feca1e868168e6c3dc34a057c42c2 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Thu, 13 Mar 2014 22:46:25 -0500 Subject: [PATCH] Adding some extension mapping to FileUtil Fixing wiki page update preview --- indefero/src/IDF/FileUtil.php | 6 ++++-- indefero/src/IDF/templates/idf/wiki/updatePage.html | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/indefero/src/IDF/FileUtil.php b/indefero/src/IDF/FileUtil.php index 2a6256d..355efe3 100644 --- a/indefero/src/IDF/FileUtil.php +++ b/indefero/src/IDF/FileUtil.php @@ -38,7 +38,7 @@ class IDF_FileUtil 'skin', 'sln', 'svc', 'vala', 'vb', 'vbproj', 'vbs', 'wsdl', 'xhtml', 'xml', 'xsd', 'xsl', 'xslt'); - public static $map = array("h" => "cpp", "hpp" => "cpp", "rc"=>"text", "sh"=>"bash", "cs"=>"csharp"); + public static $map = array("cxx" => "cpp", "h" => "cpp", "hpp" => "cpp", "rc"=>"text", "sh"=>"bash", "cs"=>"csharp"); public static $syntaxhighlightext = array("as3", "cf", "cpp", "c", "css", "pas", "diff", "patch", "erl", "java", "jfx", "js", "pl", "php", "py", "rb", "sass", "scss", "scala", "sql", "vb", ); @@ -63,6 +63,7 @@ class IDF_FileUtil */ public static function highLight($fileinfo, $content) { + $pretty = ''; if (self::isSupportedExtension($fileinfo[2])) { $pretty = ' prettyprint'; @@ -83,7 +84,8 @@ class IDF_FileUtil $ext = self::$map[$fileinfo[2]]; else $ext = "text"; - $content = ''; + + $content = '
'; return Pluf_Template::markSafe($content); } diff --git a/indefero/src/IDF/templates/idf/wiki/updatePage.html b/indefero/src/IDF/templates/idf/wiki/updatePage.html index e40778b..0533a7a 100644 --- a/indefero/src/IDF/templates/idf/wiki/updatePage.html +++ b/indefero/src/IDF/templates/idf/wiki/updatePage.html @@ -4,7 +4,7 @@ {if $preview}

{trans 'Preview of the Page'}

-{$preview} + {markdown $preview, $request} {/if}