ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
cssgen2.php
Go to the documentation of this file.
1<?php
31require dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'geshi.php';
33
34$languages = array();
35if ($handle = opendir($geshi->language_path)) {
36 while (($file = readdir($handle)) !== false) {
37 $pos = strpos($file, '.');
38 if ($pos > 0 && substr($file, $pos) == '.php') {
39 $languages[] = substr($file, 0, $pos);
40 }
41 }
42 closedir($handle);
43}
44sort($languages);
45
46header('Content-Type: application/octet-stream');
47header('Content-Disposition: attachment; filename="geshi.css"');
48
49echo "/**\n".
50 " * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann\n" .
51 " * (http://qbnz.com/highlighter/ and http://geshi.org/)\n".
52 " */\n";
53
54foreach ($languages as $language) {
55 $geshi->set_language($language);
56 // note: the false argument is required for stylesheet generators, see API documentation
57 $css = $geshi->get_stylesheet(false);
58 echo preg_replace('/^\/\*\*.*?\*\//s', '', $css);
59}
An exception for terminatinating execution or to throw for unit testing.
Definition: geshi.php:226
$geshi
Definition: cssgen2.php:32
$languages
Definition: cssgen2.php:34