[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] email/inc/class.spell.inc.php, 1.2.2.5
From: |
nomail |
Subject: |
[Phpgroupware-cvs] email/inc/class.spell.inc.php, 1.2.2.5 |
Date: |
Sat, 6 Nov 2004 17:13:46 +0100 |
Update of /email/inc
Modified Files:
Branch: Version-0_9_16-branch
class.spell.inc.php
date: 2004/11/06 16:13:46; author: powerstat; state: Exp; lines: +45 -45
Log Message:
replaced <br> with <br /> and <hr> with <hr /> for better w3c compatibility
=====================================================================
Index: email/inc/class.spell.inc.php
diff -u email/inc/class.spell.inc.php:1.2.2.4
email/inc/class.spell.inc.php:1.2.2.5
--- email/inc/class.spell.inc.php:1.2.2.4 Tue May 25 23:29:38 2004
+++ email/inc/class.spell.inc.php Sat Nov 6 16:13:46 2004
@@ -114,7 +114,7 @@
\**************************************************************************/
function spell()
{
- if ($this->debug_init > 0) { echo 'ENTERING:
email.spell.CONSTRUCTOR'.'<br>'."\r\n"; }
+ if ($this->debug_init > 0) { echo 'ENTERING:
email.spell.CONSTRUCTOR'.'<br />'."\r\n"; }
/*!
@class requires including header utility file
spell_struct
@@ -172,7 +172,7 @@
//if ('one' == 'two')
if (function_exists('pspell_new') &&
function_exists('pspell_check'))
{
- if ($this->debug_init > 0) { echo
'email.spell.CONSTRUCTOR: loading real spell service
"spell_svc_php"'.'<br>'."\r\n"; }
+ if ($this->debug_init > 0) { echo
'email.spell.CONSTRUCTOR: loading real spell service "spell_svc_php"'.'<br
/>'."\r\n"; }
// load the spell service class for php builtin
pspell extension
$this->spell_svc =
CreateObject("email.spell_svc_php");
// open connection to dictionary backend
@@ -180,7 +180,7 @@
}
else
{
- if ($this->debug_init > 0) { echo
'email.spell.CONSTRUCTOR: loading DUMMY spell service'.'<br>'."\r\n"; }
+ if ($this->debug_init > 0) { echo
'email.spell.CONSTRUCTOR: loading DUMMY spell service'.'<br />'."\r\n"; }
// load the DUMMY spell service class so php
does not complain about undefined functions.
$this->spell_svc =
CreateObject("email.spell_svc_none");
@@ -193,9 +193,9 @@
// ask this service how it wants its input, single
words or lines of text
// This spell class is required to discover that and
make it public
$this->set_sp_feed_type($this->spell_svc->get_sp_feed_type());
- if ($this->debug_init > 0) { echo
'email.spell.CONSTRUCTOR: $this->get_can_spell() returns:
['.serialize($this->get_can_spell()).']<br>'."\r\n"; }
+ if ($this->debug_init > 0) { echo
'email.spell.CONSTRUCTOR: $this->get_can_spell() returns:
['.serialize($this->get_can_spell()).']<br />'."\r\n"; }
- if ($this->debug_init > 0) { echo 'EXIT:
email.spell.CONSTRUCTOR'.'<br>'."\r\n"; }
+ if ($this->debug_init > 0) { echo 'EXIT:
email.spell.CONSTRUCTOR'.'<br />'."\r\n"; }
return;
}
@@ -428,9 +428,9 @@
// to make the body DISPLAYABLE to the user, do 2 things
// 1) enc ode any offensive ASCII (&, ", ', <, >) into
their html specialchars equivalents
$body_display =
$GLOBALS['phpgw']->msg->htmlspecialchars_encode($body_display);
- // 2) convert linebreaks to <br> tags
+ // 2) convert linebreaks to <br /> tags
//$body_display =
ereg_replace("\r\n","_CRLF_",$body_display);
- $body_display =
ereg_replace("\r\n","<br>",$body_display);
+ $body_display = ereg_replace("\r\n","<br
/>",$body_display);
return $body_display;
}
@@ -592,7 +592,7 @@
$this_bad_word_element = $this->bad_words[$x];
if ($this_bad_word_element->line_num ==
$line_num)
{
- if ($this->debug_spellcheck > 0) { echo
'bad word ['.$this_bad_word_element->orig_word.'] exists on this line num
['.$this_bad_word_element->line_num.'], it is word num
['.$this_bad_word_element->word_num.']<br>'; }
+ if ($this->debug_spellcheck > 0) { echo
'bad word ['.$this_bad_word_element->orig_word.'] exists on this line num
['.$this_bad_word_element->line_num.'], it is word num
['.$this_bad_word_element->word_num.']<br />'; }
// make this particular bad word bolded
$word_in_question =
$line_array[$this_bad_word_element->word_num];
// is there any punctuation we need to
consider seperate from this word?
@@ -683,7 +683,7 @@
$this_bad_word_element = $this->bad_words[$x];
if ($this_bad_word_element->line_num ==
$line_num)
{
- if ($this->debug_spellcheck > 0) { echo
'bad word ['.$this_bad_word_element->orig_word.'] exists on this line num
['.$this_bad_word_element->line_num.'], it is word num
['.$this_bad_word_element->word_num.']<br>'; }
+ if ($this->debug_spellcheck > 0) { echo
'bad word ['.$this_bad_word_element->orig_word.'] exists on this line num
['.$this_bad_word_element->line_num.'], it is word num
['.$this_bad_word_element->word_num.']<br />'; }
// make this particular bad word bolded
// update: we don;t care about this
unclean version, we want the word that the spellchecker got, stripped of
punctuation
// however the punctuation around it
must be preserved for the email message
@@ -817,8 +817,8 @@
$this_bad_word_element = $this->bad_words[$x];
if ($this_bad_word_element->line_num ==
$line_num)
{
- //if ($this->debug_spell_finished > 1)
{ echo 'email.spell.replace_badwords_this_line: bad word
['.$this_bad_word_element->orig_word_clean.'] exists on this line num
['.$this_bad_word_element->line_num.'], it is word num
['.$this_bad_word_element->word_num.']<br>'; }
- //if ($this->debug_spell_finished > 2)
{ echo 'email.spell.replace_badwords_this_line: bad word:
['.$this_bad_word_element->orig_word_clean.'] :: user wants this replacement:
['.$this_bad_word_element->suggestions[0].'], if it is "K_E_E_P", do not
replace<br>'; }
+ //if ($this->debug_spell_finished > 1)
{ echo 'email.spell.replace_badwords_this_line: bad word
['.$this_bad_word_element->orig_word_clean.'] exists on this line num
['.$this_bad_word_element->line_num.'], it is word num
['.$this_bad_word_element->word_num.']<br />'; }
+ //if ($this->debug_spell_finished > 2)
{ echo 'email.spell.replace_badwords_this_line: bad word:
['.$this_bad_word_element->orig_word_clean.'] :: user wants this replacement:
['.$this_bad_word_element->suggestions[0].'], if it is "K_E_E_P", do not
replace<br />'; }
if
($this_bad_word_element->suggestions[0] == "K_E_E_P")
{
if ($this->debug_spell_finished
> 1) { echo 'email.spell.replace_badwords_this_line: bad word:
['.$this_bad_word_element->orig_word_clean.'] :: user wants NO CHANGE, found
"K_E_E_P" as suggextion[0], skipping to next bad_word loop via "continue"'; }
@@ -826,7 +826,7 @@
}
// ... replace the word ...
- if ($this->debug_spell_finished > 1) {
echo 'email.spell.replace_badwords_this_line: bad word:
['.$this_bad_word_element->orig_word_clean.'] :: user wants it replaced with
['.$this_bad_word_element->suggestions[0].']<br>'; }
+ if ($this->debug_spell_finished > 1) {
echo 'email.spell.replace_badwords_this_line: bad word:
['.$this_bad_word_element->orig_word_clean.'] :: user wants it replaced with
['.$this_bad_word_element->suggestions[0].']<br />'; }
$word_in_quesion_raw =
$line_array[$this_bad_word_element->word_num];
$processed_word =
str_replace($this_bad_word_element->orig_word_clean,
$this_bad_word_element->suggestions[0], $word_in_quesion_raw);
$line_array[$this_bad_word_element->word_num] = $processed_word;
@@ -841,11 +841,11 @@
// DEPRECIATED
function basic_spcheck()
{
- if ($this->debug_spellcheck > 0) { echo 'ENTERING:
email.spell.basic_spcheck'.'<br>'; }
+ if ($this->debug_spellcheck > 0) { echo 'ENTERING:
email.spell.basic_spcheck'.'<br />'; }
// DEPRECIATED
- if ($this->debug_spellcheck > 0) { echo 'LEAVING:
email.spell.basic_spcheck'.'<br>'; }
+ if ($this->debug_spellcheck > 0) { echo 'LEAVING:
email.spell.basic_spcheck'.'<br />'; }
}
/*!
@@ -857,9 +857,9 @@
function spell_review()
{
- if ($this->debug_spellcheck > 0) { echo 'ENTERING:
email.spell.spell_review'.'<br>'; }
- if ($this->debug_spellcheck > 0) { echo 'spell_review
lang(charset): ['.lang('charset').']<br>'; }
- if ($this->debug_spellcheck > 0) { echo 'spell_review
$this->user_lang: ['.$this->user_lang.']<br>'; }
+ if ($this->debug_spellcheck > 0) { echo 'ENTERING:
email.spell.spell_review'.'<br />'; }
+ if ($this->debug_spellcheck > 0) { echo 'spell_review
lang(charset): ['.lang('charset').']<br />'; }
+ if ($this->debug_spellcheck > 0) { echo 'spell_review
$this->user_lang: ['.$this->user_lang.']<br />'; }
unset($GLOBALS['phpgw_info']['flags']['noheader']);
unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
@@ -901,23 +901,23 @@
for ($i=0; $i < $loops; $i++)
{
$this_line_str = $this->body_array[$i];
- if ($this->debug_spellcheck > 0) { echo
'<br>spell_review: this_line: ['.$this_line_str.']<br>'; }
+ if ($this->debug_spellcheck > 0) { echo '<br
/>spell_review: this_line: ['.$this_line_str.']<br />'; }
if (strlen($this_line_str) == 0)
{
// is this a blank line
- if ($this->debug_spellcheck > 0) { echo
'spell_review: skipping this line, it\'s blank'.'<br>'; }
+ if ($this->debug_spellcheck > 0) { echo
'spell_review: skipping this line, it\'s blank'.'<br />'; }
}
elseif ((stristr($this_line_str, ">"))
&& ($this_line_str[0] == '>'))
{
// does the line begin with a repoly
quoting char
- if ($this->debug_spellcheck > 0) { echo
'spell_review: skipping this line, it starts with a reply quote >
char'.'<br>'; }
+ if ($this->debug_spellcheck > 0) { echo
'spell_review: skipping this line, it starts with a reply quote > char'.'<br
/>'; }
}
else
{
// Line OK to check
- if ($this->debug_spellcheck > 0) { echo
'spell_review: we will examine this line... '.'<br>'; }
+ if ($this->debug_spellcheck > 0) { echo
'spell_review: we will examine this line... '.'<br />'; }
$word_for_word = array();
$word_for_word = explode(' ',
$this_line_str);
//echo 'spell_review: $word_for_word
DUMP <pre>'; print_r($word_for_word); echo '</pre>';
@@ -925,28 +925,28 @@
for ($x=0; $x < $words; $x++)
{
$this_word = $word_for_word[$x];
- if ($this->debug_spellcheck >
0) { echo ' spell_review: $this_word: ['.$this_word.'] ;
htmlspecialchars($this_word) ['.htmlspecialchars($this_word).']<br>'; }
+ if ($this->debug_spellcheck >
0) { echo ' spell_review: $this_word: ['.$this_word.'] ;
htmlspecialchars($this_word) ['.htmlspecialchars($this_word).']<br />'; }
if
($this->care_about_word($this_word) == False)
{
- if
($this->debug_spellcheck > 0) { echo ' spell_review: 1st test
$this->care_about_word advises to IGNORE this word, skipping to next word via
"continue"'.'<br> ... reject_reason: '.$this->reject_reason.'<br> . . . <br>'; }
+ if
($this->debug_spellcheck > 0) { echo ' spell_review: 1st test
$this->care_about_word advises to IGNORE this word, skipping to next word via
"continue"'.'<br /> ... reject_reason: '.$this->reject_reason.'<br /> . . . <br
/>'; }
continue;
}
//strip punctuation
$this_word_clean =
$this->strip_punctuation($this_word);
- if ($this->debug_spellcheck >
0) { echo ' spell_review: $this->strip_punctuation('.$this_word.')
returns ['.$this_word_clean.']<br>'; }
+ if ($this->debug_spellcheck >
0) { echo ' spell_review: $this->strip_punctuation('.$this_word.')
returns ['.$this_word_clean.']<br />'; }
if
($this->care_about_word($this_word_clean) == False)
{
- if
($this->debug_spellcheck > 0) { echo ' spell_review: 2nd test
$this->care_about_word advises to IGNORE this word, skipping to next word via
"continue"'.'<br> ... reject_reason: '.$this->reject_reason.'<br> . . . <br>'; }
+ if
($this->debug_spellcheck > 0) { echo ' spell_review: 2nd test
$this->care_about_word advises to IGNORE this word, skipping to next word via
"continue"'.'<br /> ... reject_reason: '.$this->reject_reason.'<br /> . . . <br
/>'; }
continue;
}
- if ($this->debug_spellcheck >
0) { echo ' spell_review: Spell Check OK to proceed on word:
['.$this_word_clean.']<br>'; }
+ if ($this->debug_spellcheck >
0) { echo ' spell_review: Spell Check OK to proceed on word:
['.$this_word_clean.']<br />'; }
// DO THE SPELL CHECK
if
($this->spell_svc->pgw_pspell_check ($this->pspell_link, $this_word_clean))
{
- if
($this->debug_spellcheck > 0) { echo ' spell_review: spelling OK
for ['.$this_word_clean.']<br>'; }
+ if
($this->debug_spellcheck > 0) { echo ' spell_review: spelling OK
for ['.$this_word_clean.']<br />'; }
}
else
{
@@ -963,7 +963,7 @@
$suggestions =
$this->spell_svc->pgw_pspell_suggest ($this->pspell_link, $this_word_clean);
if (
count($suggestions) == 0)
{
- if
($this->debug_spellcheck > 0) { echo ' spell_review:
['.$this_word_clean.'] has spelling problems, got '.count($suggestions).'
suggestions, sorry'.'<br>'; }
+ if
($this->debug_spellcheck > 0) { echo ' spell_review:
['.$this_word_clean.'] has spelling problems, got '.count($suggestions).'
suggestions, sorry'.'<br />'; }
}
else
{
@@ -974,22 +974,22 @@
{
break;
}
- //echo
' * for ['.$this_word.'] Possible spelling: ['.$suggestion.']'.'<br>'."\r\n";
- if
($this->debug_spellcheck > 0) { echo ' * '.$suggestion.'<br>'."\r\n"; }
+ //echo
' * for ['.$this_word.'] Possible spelling: ['.$suggestion.']'.'<br />'."\r\n";
+ if
($this->debug_spellcheck > 0) { echo ' * '.$suggestion.'<br />'."\r\n"; }
$this->bad_words[$idx]->suggestions[$cur_suggest] = $suggestion;
$cur_suggest++;
}
- //echo 'done
suggesting'.'<br><br>'."\r\n";
+ //echo 'done
suggesting'.'<br /><br />'."\r\n";
if
($this->debug_spellcheck > 0) { echo '</pre>'."\r\n"; }
}
}
// debug out a spacer before we
go to the next word
- if ($this->debug_spellcheck >
0) { echo ' . . . <br>'."\r\n"; }
+ if ($this->debug_spellcheck >
0) { echo ' . . . <br />'."\r\n"; }
}
}
}
- if ($this->debug_spellcheck > 0) { echo 'spell_review:
done with body array spell check loop'.'<br>'; }
+ if ($this->debug_spellcheck > 0) { echo 'spell_review:
done with body array spell check loop'.'<br />'; }
if ($this->debug_spellcheck > 0) { echo 'spell_review:
$this->bad_words DUMP<pre>'; print_r($this->bad_words); echo '</pre>'; }
@@ -1001,7 +1001,7 @@
// first, we can encode the html specialchars
that exist in the orig line
// this *should* not add any spaces, so word
number data should still be valid
$this_line_str =
$GLOBALS['phpgw']->msg->htmlspecialchars_encode($this_line_str);
- if ($this->debug_spellcheck > 0) { echo
'spell_review: RECONSTRUCT BODY this_line: ['.$this_line_str.']<br>'; }
+ if ($this->debug_spellcheck > 0) { echo
'spell_review: RECONSTRUCT BODY this_line: ['.$this_line_str.']<br />'; }
// any and all bad words in this line of text
are flagged now
//$this_line_str =
$this->html_mark_entire_line($this_line_str, $i);
@@ -1010,7 +1010,7 @@
$this->body_with_suggest .=
$this_line_str."\r\n";
}
- $this->body_with_suggest =
ereg_replace("\r\n","<br>",$this->body_with_suggest);
+ $this->body_with_suggest = ereg_replace("\r\n","<br
/>",$this->body_with_suggest);
$GLOBALS['phpgw']->template->set_var('body_with_suggestions',
$this->body_with_suggest);
// BUTTONS
@@ -1021,7 +1021,7 @@
$GLOBALS['phpgw']->template->set_var('btn_cancel',
$btn_cancel);
$GLOBALS['phpgw']->template->pfp('out','T_spell_main');
- if ($this->debug_spellcheck > 0) { echo 'EXITT:
email.spell.spell_review'.'<br>'; }
+ if ($this->debug_spellcheck > 0) { echo 'EXITT:
email.spell.spell_review'.'<br />'; }
}
@@ -1038,7 +1038,7 @@
*/
function spell_finished()
{
- if ($this->debug_spell_finished > 0) { echo 'ENTERING:
email.spell.spell_finished'.'<br>'; }
+ if ($this->debug_spell_finished > 0) { echo 'ENTERING:
email.spell.spell_finished'.'<br />'; }
// this function is in class.msgl_bootstrap.inc.php, we
created in the constructor for this class.
$this->msg_bootstrap->ensure_mail_msg_exists('email.spell.spell_finished',
$this->debug_spell_finished);
@@ -1054,14 +1054,14 @@
if
((isset($GLOBALS['phpgw']->msg->ref_POST['btn_apply']))
&& ($GLOBALS['phpgw']->msg->ref_POST['btn_apply'] !=
''))
{
- if ($this->debug_spell_finished > 1) { echo
'email.spell.spell_finished: btn_apply was pressed<br>'; }
+ if ($this->debug_spell_finished > 1) { echo
'email.spell.spell_finished: btn_apply was pressed<br />'; }
// recover the spellcheck data which was
encooded as a URI get string in the spelling comboboxes
$all_badwords = array();
// ---- extract any "fake_uri" embedded data
from HTTP_POST_VARS ----
// note: this happens automatically for
HTTP_GET_VARS
if (is_array($GLOBALS['phpgw']->msg->ref_POST))
{
- if ($this->debug_spell_finished > 1) {
echo '$GLOBALS[HTTP_POST_VARS] is array<br>'; }
+ if ($this->debug_spell_finished > 1) {
echo '$GLOBALS[HTTP_POST_VARS] is array<br />'; }
@reset($GLOBALS['phpgw']->msg->ref_POST);
while(list($key,$value) =
each($GLOBALS['phpgw']->msg->ref_POST))
{
@@ -1089,7 +1089,7 @@
if ($this->debug_spell_finished > 1) { echo
'email.spell.spell_finished:
$this->make_correction_struct_from_array($all_badwords) Fills
$this->bad_words[] DUMP:<pre>'; print_r($this->bad_words); echo '</pre>'; }
// REPLACE WORDS
- if ($this->debug_spell_finished > 1) { echo
'email.spell.spell_finished: btn_apply was pressed, fix misspelled words if
necessary <br>'; }
+ if ($this->debug_spell_finished > 1) { echo
'email.spell.spell_finished: btn_apply was pressed, fix misspelled words if
necessary <br />'; }
$this->body_array = array();
$this->body_array =
$GLOBALS['phpgw']->msg->explode_linebreaks($this->body_orig);
@@ -1102,7 +1102,7 @@
for ($i=0; $i < $loops; $i++)
{
$this_line_str = $this->body_array[$i];
- if ($this->debug_spell_finished > 0) {
echo '<br>email.spell.spell_finished: this_line: ['.$this_line_str.']<br>'; }
+ if ($this->debug_spell_finished > 0) {
echo '<br />email.spell.spell_finished: this_line: ['.$this_line_str.']<br />';
}
// any and all replacable bad words in
this line of text are replaced now, the entire line os processed at the same
time
$this_line_str =
$this->replace_badwords_this_line($this_line_str, $i);
$this->body_with_suggest .=
$this_line_str."\r\n";
@@ -1111,13 +1111,13 @@
}
else
{
- if ($this->debug_spell_finished > 1) { echo
'email.spell.spell_finished: btn_cancel was pressed (or at lease, btn_apply was
not pressed ...)<br>'; }
+ if ($this->debug_spell_finished > 1) { echo
'email.spell.spell_finished: btn_cancel was pressed (or at lease, btn_apply was
not pressed ...)<br />'; }
// CANCEL was pressed, user wants no word
substitutions
// simply fill $this->body_with_suggest with
$this->body_orig, then the rest of the code is the same
$this->body_with_suggest = $this->body_orig;
}
- //$this->body_with_suggest =
ereg_replace("\r\n","<br>",$this->body_with_suggest);
+ //$this->body_with_suggest = ereg_replace("\r\n","<br
/>",$this->body_with_suggest);
if ($this->debug_spell_finished > 1) { echo
'email.spell.spell_finished: FINAL PROCESSED BODY:
$this->body_with_suggest:<pre>'.$this->body_with_suggest.'</pre>'; }
// TELL BOCOMPOSE TO DO ITS THING WITH THIS SPELL FIXED
BODY
@@ -1127,7 +1127,7 @@
- if ($this->debug_spell_finished > 0) { echo 'EXIT:
email.spell.spell_finished'.'<br>'; }
+ if ($this->debug_spell_finished > 0) { echo 'EXIT:
email.spell.spell_finished'.'<br />'; }
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] email/inc/class.spell.inc.php, 1.2.2.5,
nomail <=