source: releases/0.9beta/plugins/SpellChecker/spell-check-savedicts.php @ 646

Last change on this file since 646 was 646, checked in by ray, 12 years ago

And the compressed version in the /releases dir

File size: 984 bytes
Line 
1<?php
2  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'aspell_setup.php');
3
4
5  $to_p_dict = $_REQUEST['to_p_dict'] ? $_REQUEST['to_p_dict'] : array();
6  $to_r_list = $_REQUEST['to_r_list'] ? $_REQUEST['to_r_list'] : array();
7print_r($to_r_list);
8  if($to_p_dict || $to_r_list)
9  {
10    if($fh = fopen($temptext, 'w'))
11    {
12      foreach($to_p_dict as $personal_word)
13      {
14        $cmd = '&' . $personal_word . "\n";
15        echo $cmd;
16        fwrite($fh, $cmd, strlen($cmd));
17      }
18
19      foreach($to_r_list as $replace_pair)
20      {
21        $cmd = '$$ra ' . $replace_pair[0] . ' , ' . $replace_pair[1] . "\n";
22        echo $cmd;
23        fwrite($fh, $cmd, strlen($cmd));
24      }
25      $cmd = "#\n";
26      echo $cmd;
27      fwrite($fh, $cmd, strlen($cmd));
28      fclose($fh);
29    }
30    else
31    {
32      die("Can't Write");
33    }
34    echo $aspellcommand."\n";
35    echo shell_exec($aspellcommand . ' 2>&1');
36    unlink($temptext);
37  }
38?>
Note: See TracBrowser for help on using the repository browser.