From db220a21c3d49e0ac0ff5eb0789bb718f177e0b8 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 9 Oct 2012 22:40:07 +0200 Subject: Rename $mode to $lexer Pygments calls it that and mode was an undescriptive name anyway. Signed-off-by: Florian Pritz --- application/models/mfile.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'application/models') diff --git a/application/models/mfile.php b/application/models/mfile.php index 97c9ecfcd..e298850a5 100644 --- a/application/models/mfile.php +++ b/application/models/mfile.php @@ -201,7 +201,7 @@ class Mfile extends CI_Model { function should_highlight($type) { - if ($this->mime2mode($type)) return true; + if ($this->mime2lexer($type)) return true; return false; } @@ -214,27 +214,27 @@ class Mfile extends CI_Model { ); if (in_array($type, $typearray)) return true; - if ($this->mime2mode($type)) return true; + if ($this->mime2lexer($type)) return true; return false; } - // Return the mode that should be used for highlighting - function get_highlight_mode($type, $filename) + // Return the lexer that should be used for highlighting + function autodetect_lexer($type, $filename) { - $mode = $this->mime2mode($type); + $lexer = $this->mime2lexer($type); - // filename modes overwrite mime type mappings - $filename_mode = $this->filename2mode($filename); - if ($filename_mode) { - return $filename_mode; + // filename lexers overwrite mime type mappings + $filename_lexer = $this->filename2lexer($filename); + if ($filename_lexer) { + return $filename_lexer; } - return $mode; + return $lexer; } - // Map MIME types to modes needed for highlighting - private function mime2mode($type) + // Map MIME types to lexers needed for highlighting + private function mime2lexer($type) { $typearray = array( 'text/plain' => 'text', @@ -286,8 +286,8 @@ class Mfile extends CI_Model { return false; } - // Map special filenames to modes - private function filename2mode($name) + // Map special filenames to lexers + private function filename2lexer($name) { $namearray = array( 'PKGBUILD' => 'bash', @@ -298,8 +298,8 @@ class Mfile extends CI_Model { return false; } - // Handle mode aliases - function resolve_mode_alias($alias) + // Handle lexer aliases + function resolve_lexer_alias($alias) { if ($alias === false) return false; $aliasarray = array( -- cgit v1.2.3-24-g4f1b