From 194a081c90848021a58661fe45b8da7f549b8205 Mon Sep 17 00:00:00 2001 From: Mehdi Kabab Date: Tue, 7 Apr 2009 11:38:24 +0200 Subject: [PATCH] Added the highlighted extensions as text extensions. --- src/IDF/Views/Source.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/IDF/Views/Source.php b/src/IDF/Views/Source.php index f396591..992ac61 100644 --- a/src/IDF/Views/Source.php +++ b/src/IDF/Views/Source.php @@ -505,15 +505,16 @@ class IDF_Views_Source if (0 === strpos($fileinfo[0], 'text/')) { return true; } - $ext = 'mdtext php js cpp php-dist h gitignore sh py pl rb diff patch' + $ext = 'mdtext php-dist h gitignore diff patch' .Pluf::f('idf_extra_text_ext', ''); - return (in_array($fileinfo[2], explode(' ', $ext))); + $ext = array_merge(self::$supportedExtenstions, explode(' ' , $ext)); + return (in_array($fileinfo[2], $ext)); } public static function highLight($fileinfo, $content) { $pretty = ''; - if (IDF_Views_Source::isSupportedExtension($fileinfo[2])) { + if (self::isSupportedExtension($fileinfo[2])) { $pretty = ' prettyprint'; } $table = array(); @@ -534,7 +535,7 @@ class IDF_Views_Source */ public static function isSupportedExtension($extension) { - return in_array($extension, IDF_Views_Source::$supportedExtenstions); + return in_array($extension, self::$supportedExtenstions); } /**