Changeset 137
- Timestamp:
- 05/09/05 16:15:58 (8 years ago)
- Files:
-
- 1 modified
-
trunk/plugins/SpellChecker/spell-check-logic.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/SpellChecker/spell-check-logic.php
r117 r137 48 48 <link rel="stylesheet" type="text/css" media="all" href="spell-check-style.css" />'; 49 49 50 // Lets define some values outside the condition below, in case we have an empty 51 // document. 52 $textarray = array(); 53 $varlines = '<script type="text/javascript">var suggested_words = { '; 54 $infolines = 'var spellcheck_info = {'; 55 $counter = 0; 56 $suggest_count = 0; 57 50 58 if (trim($text) != "") 51 59 { … … 70 78 $textlines = count($textarray); 71 79 72 $varlines = '<script type="text/javascript">var suggested_words = { ';73 $infolines = 'var spellcheck_info = {';74 75 80 $lineindex = -1; 76 81 $poscorrect = 0; 77 $counter = 0;78 $suggest_count = 0;79 82 foreach ($returnarray as $key=>$value) 80 83 { … … 128 131 } 129 132 } 130 $infolines .= '"Language Used":"'.$lang.'",';131 $infolines .= '"Mispelled words":"'.$counter.'",';132 $infolines .= '"Total words suggested":"'.$suggest_count.'",';133 $infolines .= '"Total Lines Checked":"'.$returnlines.'"';134 $infolines .= '};';135 $varlines = substr($varlines, 0, strlen($varlines) - 1);136 echo $varlines.'};'.$infolines.'</script>';137 133 } 138 134 else 139 135 { 136 // This one isnt used for anything at the moment! 140 137 $return = 'failed to open!'; 141 138 } 142 143 139 } 144 140 $infolines .= '"Language Used":"'.$lang.'",'; 141 $infolines .= '"Mispelled words":"'.$counter.'",'; 142 $infolines .= '"Total words suggested":"'.$suggest_count.'",'; 143 $infolines .= '"Total Lines Checked":"'.$returnlines.'"'; 144 $infolines .= '};'; 145 $varlines = substr($varlines, 0, strlen($varlines) - 1); 146 echo $varlines.'};'.$infolines.'</script>'; 145 147 146 148 echo '</head> … … 153 155 154 156 $dictionaries = str_replace(chr(10),",", shell_exec($aspelldictionaries)); 157 if(ereg(",$",$dictionaries)) 158 $dictionaries = ereg_replace(",$","",$dictionaries); 155 159 echo '<div id="HA-spellcheck-dictionaries">'.$dictionaries.'</div>'; 156 160 157 161 echo '</body></html>'; 158 //echo '<div id="HA-spellcheck-dictionaries">en_US,es,fr</div></body></html>';159 162 ?>
