From ce2b69675075444c9e40b72bcdd42ab7edbbe633 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Fri, 28 Jan 2011 22:51:06 +0100 Subject: update to CI 2.0 Signed-off-by: Florian Pritz --- system/application/libraries/contrib/cssgen.php | 456 ------------------------ 1 file changed, 456 deletions(-) delete mode 100644 system/application/libraries/contrib/cssgen.php (limited to 'system/application/libraries/contrib/cssgen.php') diff --git a/system/application/libraries/contrib/cssgen.php b/system/application/libraries/contrib/cssgen.php deleted file mode 100644 index f746b00c3..000000000 --- a/system/application/libraries/contrib/cssgen.php +++ /dev/null @@ -1,456 +0,0 @@ - - - - GeSHi CSS Generator :: ' . $title . ' - - - - -

' . $title . '

-'; -} - -function make_footer () -{ - echo ' -'; -} - - -function get_var ( $var_name ) -{ - if ( isset($_GET[$var_name]) ) - { - return str_replace("\'", "'", $_GET[$var_name]); - } - elseif ( isset($_POST[$var_name]) ) - { - return str_replace("\'", "'", $_POST[$var_name]); - } - return null; -} - - - -// -// Unset everything -// -foreach ( $_REQUEST as $var ) -{ - unset($$var); -} -foreach ( array( - '_POST' => 'HTTP_POST_VARS', - '_GET' => 'HTTP_GET_VARS', - '_COOKIE' => 'HTTP_COOKIE_VARS', - '_SERVER' => 'HTTP_SERVER_VARS', - '_ENV' => 'HTTP_ENV_VARS', - '_FILES' => 'HTTP_POST_FILES') as $array => $other ) -{ - if ( !isset($$array) ) - { - $$array = $$other; - } - unset($$other); -} - - -// Get what step we're up to -$step = get_var('step'); - -if ( !$step || $step == 1 ) -{ - $errors = 0; - make_header('Step 1'); - echo "Welcome to the GeSHi CSS generator.
Searching for GeSHi...          ";
-
-    // Find GeSHi
-    $geshi_path = get_var('geshi-path');
-    $geshi_lang_path = get_var('geshi-lang-path');
-
-    if ( !$geshi_path )
-    {
-        $geshi_path = '../geshi.php';
-    }
-    if ( !$geshi_lang_path )
-    {
-        $geshi_lang_path = '../geshi/';
-    }
-
-
-    if ( is_file($geshi_path) && is_readable($geshi_path) )
-    {
-        // Get file contents and see if GeSHi is in here
-        $file = @file($geshi_path);
-        $contents = '';
-        foreach ( $file as $line )
-        {
-            $contents .= $line;
-        }
-        if ( strpos($contents, 'Found at ' . realpath($geshi_path) . '';
-        }
-        else
-        {
-            ++$errors;
-            $no_geshi_dot_php_error = true;
-            echo 'Not found';
-        }
-    }
-    else
-    {
-        ++$errors;
-        $no_geshi_dot_php_error = true;
-        echo 'Not found';
-    }
-
-    // Find language files
-    echo "\nSearching for language files... ";
-    if ( is_readable($geshi_lang_path . 'css-gen.cfg') )
-    {
-
-        echo 'Found at ' . realpath($geshi_lang_path) . '';
-    }
-    else
-    {
-        ++$errors;
-        $no_lang_dir_error = true;
-        echo 'Not found';
-    }
-    echo "
\n"; - - if ( $errors > 0 ) - { - // We're gonna have to ask for the paths... - echo 'Unfortunately CSSGen could not detect the following paths. Please input them and press "submit" to try again.'; - echo " -
"; - if ( $no_geshi_dot_php_error ) - { - echo " -
geshi.php: "; - } - else - { - echo ''; - } - if ( $no_lang_dir_error ) - { - echo " -
language files directory: (should have a trailing slash)"; - } - else - { - echo ''; - } - - echo " -
"; - } - else - { - // no errors - echo continue form - echo 'Everything seems to be detected successfully. Use the button to continue. -

- -'; - } - - make_footer(); -} -// Step 2 -elseif ( $step == 2 ) -{ - make_header('Step 2'); - - $geshi_path = get_var('geshi-path'); - $geshi_lang_path = get_var('geshi-lang-path'); - - $dh = opendir($geshi_lang_path); - $lang_files = array(); - $file = readdir($dh); - while ( $file !== false ) - { - if ( $file == '.' || $file == '..' || $file == 'CVS' || $file == 'css-gen.cfg' ) - { - $file = readdir($dh); - continue; - } - $lang_files[] = $file; - $file = readdir($dh); - } - closedir($dh); - sort($lang_files); - - // Now installed languages are in $lang_files - - echo ' -What languages are you wanting to make this stylesheet for?

-Detected languages:
'; - - foreach ( $lang_files as $lang ) - { - $lang = substr($lang, 0, strpos($lang, '.')); - if ($lang) { - echo " $lang
\n"; - } - } - - echo "Select: All, None, Invert
\n"; - - echo 'If you\'d like any other languages not detected here to be supported, please enter -them here, one per line:

-'; - - echo '
Styles: - - - - - - - - - - - - - - -
Style for the overall code block:
Default Styles
Keywords I (if, do, while etc)
Keywords II (null, true, false etc)
Inbuilt Functions (echo, print etc)
Data Types (int, boolean etc)
Comments (//, etc)
Escaped Characters (\n, \t etc)
Brackets ( ([{}]) etc)
Strings ("foo" etc)
Numbers (1, -54, 2.5 etc)
Methods (Foo.bar() etc)
'; - - echo ' -
'; - - make_footer(); -} -// Step 3 -elseif ( $step == 3 ) -{ - make_header('Step 3'); - echo '

Here is your completed stylesheet. Note that it may not be perfect - no regular expression styles are included for one thing, -you\'ll have to add those yourself (php and xml are just two languages that use them), and line numbers are not included, however -it includes most of the basic information.

'; - - // Make the stylesheet - $part_selector_1 = ''; - $part_selector_2 = ''; - $part_selector_3 = ''; - - $langs = get_var('langs'); - $extra_langs = trim(get_var('extra-langs')); - if ( $extra_langs != '' ) - { - $l = explode("\r\n", $extra_langs); - foreach ( $l as $lng ) - { - $langs[$lng] = true; - } - } - - - foreach ( $langs as $lang => $dummy ) - { - $part_selector_1 .= ".$lang {PART}, "; - $part_selector_2 .= ".$lang {PART1}, .$lang {PART2}, "; - $part_selector_3 .= ".$lang {PART1}, .$lang {PART2}, .$lang {PART3}, "; - } - $part_selector_1 = substr($part_selector_1, 0, -2); - $part_selector_2 = substr($part_selector_2, 0, -2); - $part_selector_3 = substr($part_selector_3, 0, -2); - - - $default_styles = get_var('default-styles'); - $ol_selector = str_replace('{PART}', 'ol', $part_selector_1); - $overall_styles = get_var('overall'); - $overall_selector = str_replace('{PART}', '', $part_selector_1); - - $stylesheet = "/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */"; - - if ( $overall != '' ) - { - $stylesheet .= "\n$overall_selector {{$overall_styles}}"; - } - if ( $default_styles != '' ) - { - $default_selector = str_replace(array('{PART1}', '{PART2}'), array('.de1', '.de2'), $part_selector_2); - $stylesheet .= "\n$default_selector {{$default_styles}}"; - } - - // Do keywords - $keywords_1 = get_var('keywords-1'); - $keyword_selector_1 = str_replace('{PART}', '.kw1', $part_selector_1); - if ( $keywords_1 != '' ) - { - $stylesheet .= "\n$keyword_selector_1 {{$keywords_1}}"; - } - - $keywords_2 = get_var('keywords-2'); - $keyword_selector_2 = str_replace('{PART}', '.kw2', $part_selector_1); - if ( $keywords_2 != '' ) - { - $stylesheet .= "\n$keyword_selector_2 {{$keywords_2}}"; - } - - $keywords_3 = get_var('keywords-3'); - $keyword_selector_3 = str_replace('{PART}', '.kw3', $part_selector_1); - if ( $keywords_3 != '' ) - { - $stylesheet .= "\n$keyword_selector_3 {{$keywords_3}}"; - } - - $keywords_4 = get_var('keywords-4'); - $keyword_selector_4 = str_replace('{PART}', '.kw4', $part_selector_1); - if ( $keywords_4 != '' ) - { - $stylesheet .= "\n$keyword_selector_4 {{$keywords_4}}"; - } - - // Do other lexics - $comments = get_var('comments'); - $comment_selector = str_replace(array('{PART1}', '{PART2}', '{PART3}'), array('.co1', '.co2', '.coMULTI'), $part_selector_3); - if ( $comments != '' ) - { - $stylesheet .= "\n$comment_selector {{$comments}}"; - } - - $esc = get_var('escaped-chars'); - $esc_selector = str_replace('{PART}', '.es0', $part_selector_1); - if ( $esc != '' ) - { - $stylesheet .= "\n$esc_selector {{$esc}}"; - } - - $brackets = get_var('brackets'); - $brk_selector = str_replace('{PART}', '.br0', $part_selector_1); - if ( $brackets != '' ) - { - $stylesheet .= "\n$brk_selector {{$brackets}}"; - } - - $strings = get_var('strings'); - $string_selector = str_replace('{PART}', '.st0', $part_selector_1); - if ( $strings != '' ) - { - $stylesheet .= "\n$string_selector {{$strings}}"; - } - - $numbers = get_var('numbers'); - $num_selector = str_replace('{PART}', '.nu0', $part_selector_1); - if ( $numbers != '' ) - { - $stylesheet .= "\n$num_selector {{$numbers}}"; - } - - $methods = get_var('methods'); - $method_selector = str_replace('{PART}', '.me0', $part_selector_1); - if ( $methods != '' ) - { - $stylesheet .= "\n$method_selector {{$methods}}"; - } - - echo "
$stylesheet
"; - - make_footer(); -} - -?> -- cgit v1.2.3-24-g4f1b