Subversion Repositories Applications.papyrus

Rev

Rev 1688 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1688 Rev 1921
Line 1... Line 1...
1
<?php
1
<?php
2
header('Content-type: text/html; charset=utf-8');
2
header('Content-type: text/html; charset=utf-8');
Line 3... Line 3...
3
 
3
 
-
 
4
// The following variables values must reflect your installation needs.
4
//$spellercss = '/speller/spellerStyle.css';	// by FredCK
5
 
5
$spellercss = '../spellerStyle.css';			// by FredCK
-
 
6
//$word_win_src = '/speller/wordWindow.js';		// by FredCK
-
 
7
$word_win_src = '../wordWindow.js';				// by FredCK
-
 
8
$textinputs = $_POST['textinputs']; # array
6
$aspell_prog	= '"C:\Program Files\Aspell\bin\aspell.exe"';	// by FredCK (for Windows)
9
//$aspell_prog = 'aspell';									// by FredCK (for Linux)
-
 
-
 
7
//$aspell_prog	= 'aspell';										// by FredCK (for Linux)
10
$aspell_prog = '"C:\Program Files\Aspell\bin\aspell.exe"';	// by FredCK (for Windows)
8
 
11
$lang = 'en_US';
-
 
12
//$aspell_opts = "-a --lang=$lang --encoding=utf-8";	// by FredCK
9
$lang			= 'en_US';
-
 
10
$aspell_opts	= "-a --lang=$lang --encoding=utf-8 -H --rem-sgml-check=alt";		// by FredCK
13
$aspell_opts = "-a --lang=$lang --encoding=utf-8 -H";	// by FredCK
11
 
-
 
12
$tempfiledir	= "./";
-
 
13
 
-
 
14
$spellercss		= '../spellerStyle.css';						// by FredCK
-
 
15
$word_win_src	= '../wordWindow.js';							// by FredCK
-
 
16
 
14
$tempfiledir = "./";
17
$textinputs		= $_POST['textinputs']; # array
Line 15... Line 18...
15
$input_separator = "A";
18
$input_separator = "A";
16
 
19
 
17
# set the JavaScript variable to the submitted text.
20
# set the JavaScript variable to the submitted text.
Line 57... Line 60...
57
}
60
}
Line 58... Line 61...
58
 
61
 
59
 
62
 
60
# handle a server-side error.
63
# handle a server-side error.
61
function error_handler( $err ) {
64
function error_handler( $err ) {
Line 62... Line 65...
62
	echo "error = '" . escape_quote( $err ) . "';\n";
65
	echo "error = '" . preg_replace( "/['\\\\]/", "\\\\$0", $err ) . "';\n";
63
}
66
}
64
 
67
 
Line 77... Line 80...
77
 
80
 
78
	# open temp file, add the submitted text.
81
	# open temp file, add the submitted text.
79
	if( $fh = fopen( $tempfile, 'w' )) {
82
	if( $fh = fopen( $tempfile, 'w' )) {
80
		for( $i = 0; $i < count( $textinputs ); $i++ ) {
83
		for( $i = 0; $i < count( $textinputs ); $i++ ) {
-
 
84
			$text = urldecode( $textinputs[$i] );
-
 
85
 
-
 
86
			// Strip all tags for the text. (by FredCK - #339 / #681)
-
 
87
			$text = preg_replace( "/<[^>]+>/", " ", $text ) ;
81
			$text = urldecode( $textinputs[$i] );
88
 
82
			$lines = explode( "\n", $text );
89
			$lines = explode( "\n", $text );
83
			fwrite ( $fh, "%\n" ); # exit terse mode
90
			fwrite ( $fh, "%\n" ); # exit terse mode
84
			fwrite ( $fh, "^$input_separator\n" );
91
			fwrite ( $fh, "^$input_separator\n" );
85
			fwrite ( $fh, "!\n" ); # enter terse mode
92
			fwrite ( $fh, "!\n" ); # enter terse mode
Line 188... Line 195...
188
wordWindowObj.writeBody();
195
wordWindowObj.writeBody();
189
</script>
196
</script>
Line 190... Line 197...
190
 
197
 
191
</body>
198
</body>
192
</html>
-