Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
spell_checker_popup.php
1 <?php
25 require_once dirname(__FILE__).'/../../../../core/include/init.inc';
26 if (empty($GLOBALS['SQ_SYSTEM']->user) || !($GLOBALS['SQ_SYSTEM']->user->canAccessBackend() || $GLOBALS['SQ_SYSTEM']->user->type() == 'simple_edit_user')){
27  exit;
28 }
29 
30 require_once dirname(__FILE__).'/../../wysiwyg_plugin.inc';
31 $wysiwyg = null;
32 $plugin = new wysiwyg_plugin($wysiwyg);
33 ?>
34 
35 <!--
36  htmlArea v3.0 - Copyright (c) 2003 interactivetools.com, inc.
37  This notice MUST stay intact for use (see license.txt).
38 
39  A free WYSIWYG editor replacement for <textarea> fields.
40  For full source code and docs, visit http://www.interactivetools.com/
41 
42  Version 3.0 developed by Mihai Bazon for InteractiveTools.
43  http://students.infoiasi.ro/~mishoo
44 
45  Modifications for PHP Plugin Based System
46  developed by Greg Sherwood for Squiz.Net.
47  http://www.squiz.net/
48  greg@squiz.net
49 
50  Spell Checker Modifications for PHP Plugin Based System
51  developed by Marc McIntyre for Squiz.Net.
52  http://www.squiz.net/
53  mmcintyre@squiz.net
54 -->
55 
56 <html style="width: 600px; height: 400px">
57  <head>
58  <title>Spell Checker</title>
59  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
60  <script type="text/javascript" src="../../core/popup.js"></script>
61  <?php
62  //add required js translation files
63  list($lang, $country, $variant) = $GLOBALS['SQ_SYSTEM']->lm->getLocaleParts($GLOBALS['SQ_SYSTEM']->lm->getCurrentLocale());
64 
65  $include_list[] = sq_web_path('lib').'/js/general.js';
66  $include_list[] = sq_web_path('lib').'/js/translation.js';
67 
68  if (file_exists(SQ_DATA_PATH.'/public/system/core/js_strings.'.$lang.'.js')) {
69  $include_list[] = sq_web_path('data').'/system/core/js_strings.'.$lang.'.js';
70  }
71 
72  if (!empty($country)) {
73  if (file_exists(SQ_DATA_PATH.'/public/system/core/js_strings.'.$lang.'_'.$country.'.js')) {
74  $include_list[] = sq_web_path('data').'/system/core/js_strings.'.$lang.'_'.$country.'.js';
75  }
76 
77  if (!empty($variant)) {
78  if (file_exists(SQ_DATA_PATH.'/public/system/core/js_strings.'.$lang.'_'.$country.'@'.$variant.'.js')) {
79  $include_list[] = sq_web_path('data').'/system/core/js_strings.'.$lang.'_'.$country.'@'.$variant.'.js';
80  }
81  }
82  }
83 
84 
85  foreach($include_list as $link) {
86  ?><script type="text/javascript" src="<?php echo $link; ?>"></script><?php
87  }
88  ?>
89 
90  <script type="text/javascript">
91  var parent_object = opener.editor_<?php echo preg_replace('/[\'"\(\);\[\]{}<>=]+/', '', $_REQUEST['editor_name']); ?>._object;
92 
93  window.opener.onFocus = function() { getFocus(); }
94  parent_object.onFocus = function() { getFocus(); }
95 
96  function getFocus() {
97  setTimeout('self.focus()',100);
98  };
99 
100  function Init() {
101  __dlg_init("spellChecker");
102  };
103 
104  function onOK() {
105  var param = new Object();
106  param["html"] = makeCleanDoc(false);
107  __dlg_close("spellChecker", param);
108  return false;
109  };
110 
111  function onCancel() {
112  __dlg_close("spellChecker", null);
113  return false;
114  };
115  </script>
116 
117  <script type="text/javascript" src="<?php echo $_SERVER['PHP_SELF'].'/../../'.$plugin->get_popup_href('spell_checker.js', 'spell_checker')?>"></script>
118 
119  <style type="text/css">
120  html, body {
121  font-family: Verdana, Arial, Helvetica, san-serif;
122  font-size: xx-small;
123  font-weight: normal;
124  text-decoration: none;
125  background-color: #402F48;
126  color: #FFFFFF;
127  margin: 1px 1px;
128  }
129 
130  a:link, a:visited {
131  color: #FFFFFF; text-decoration: none;
132  }
133 
134  a:hover {
135  color: #B7A9BD; text-decoration: underline;
136  }
137 
138  table {
139  background-color: #402F48; color: ButtonText;
140  font-family: tahoma,verdana,sans-serif; font-size: 11px;
141  }
142 
143  iframe {
144  background-color:#402F48;
145  color: #FFFFFF;
146  font-family: tahoma,verdana,sans-serif; font-size: 11px;
147  }
148 
149  .controls .sectitle {
150  color: #FFFFFF;
151  font-weight: bold; padding: 2px 4px;
152  margin:0px auto;
153  text-align:left;
154 
155  }
156 
157  .controls .secbody {
158  margin-bottom: 0px;
159  }
160 
161  button, select {
162  font-family: tahoma,verdana,sans-serif; font-size: 11px;
163  }
164 
165  button {
166  width: 6em; padding: 0px;
167  }
168 
169  input, select {
170  font-family: fixed,"andale mono",monospace;
171  }
172 
173 
174  #v_currentWord {
175  color: #A7A1AA; font-weight: bold; font-size: 120%;
176  }
177 
178  #statusbar {
179  padding: 0px 0px 0px 5px;
180  }
181 
182  #status {
183  font-weight: bold;
184  }
185 
186  .button2{
187  font-size: 7pt;
188  font-family: Verdana,Arial,Helvetica;
189  color: #FFFFFF;
190  width: 70px;
191  background: #725B7D;
192  border-style: solid;
193  border-width: 1;
194  border-color: #402F48;
195  font-weight: bold;
196  margin: 2px 2px;
197  }
198  .button{
199  margin: 2px 2px;
200  font-size: 7pt;
201  font-family: Verdana,Arial,Helvetica;
202  color: #FFFFFF;
203  width: 70px;
204  background: #725B7D;
205  border-style: solid;
206  border-width: 1;
207  border-color: #7D7582;
208  font-weight: bold;
209  }
210 
211  .status_div {
212  background-color: #7D7582;
213  padding: 2px 2px;
214  }
215 
216  .major_table {
217  height: 100%;
218  width: 100%;
219  border: solid 2px;
220  border-color: #7D7582;
221  padding: 0px 0px 0px 0px;
222  }
223 
224  .status {
225  color: #FFFFFF;
226  }
227  </style>
228  </head>
229 
230  <body onLoad="Init(); initDocument(); if (opener) opener.blockEvents('spellChecker')" onUnload="if (opener) opener.unblockEvents(); parent_object._tmp['disable_toolbar'] = false; parent_object.updateToolbar();">
231  <form style="display: none;" action="spell_checker.php" method="post" target="framecontent" accept-charset="utf-8">
232  <input type="hidden" name="content" id="f_content"/>
233  <input type="hidden" name="dictionary" id="f_dictionary"/>
234  <input type="hidden" name="init" id="f_init" value="1"/>
235  </form>
236  <table class="major_table" cellspacing="0" cellpadding="0">
237  <tr>
238  <td class="status_div" colspan="2">
239  <table width="100%" cellpadding="0" cellspacing="0">
240  <tr>
241  <td class="status_div">
242  <span id="status" class="status">&nbsp;<?php echo translate('please_wait'); ?>...</span>
243  </td>
244  <td class="status_div">
245  <!-- hiding the dictionary chooser for now -->
246  <span style="float: right; display: none">
247  <span class="status"><?php echo translate('dictionary'); ?></span>
248  <select id="v_dictionaries" style="width: 10em"></select>
249  <button class="button2" id="b_recheck"><?php echo translate('re-check'); ?></button>
250  </span>
251  </td>
252  </tr>
253  </table>
254  </td>
255  </tr>
256  <tr>
257  <td valign="top" class="controls" nowrap>
258  <div class="sectitle"><?php echo translate('original_word'); ?></div>
259  <div class="secbody" id="v_currentWord" style="text-align: center"><?php echo translate('please_wait'); ?>...</div>
260  <div class="sectitle"><?php echo translate('replace_with'); ?></div>
261  <div class="secbody">
262  <input type="text" id="v_replacement" style="width: 94%; margin-left: 3%; align: center" /><br />
263  <div style="text-align: center; margin-top: 2px;" nowrap>
264  <button class="button" id="b_replace"><?php echo translate('replace'); ?></button>
265  <button class="button" id="b_replall"><?php echo translate('replace_all'); ?></button><br />
266  <button class="button" id="b_ignore"><?php echo translate('ignore'); ?></button>
267  <button class="button" id="b_ignall"><?php echo translate('ignore_all'); ?></button>
268  </div>
269  </div>
270  <div class="sectitle"><?php echo translate('suggestions'); ?></div>
271  <div class="secbody">
272  <select size="11" style="width: 94%; margin-left: 3%;" id="v_suggestions"></select>
273  </div>
274  <div valign="top" class="secbody" align="center" nowrap>
275  &nbsp;<button class="button" id="b_ok" onclick="return onOK();"><?php echo translate('ok'); ?></button>
276  <button class="button" id="b_cancel" onclick="return onCancel();"><?php echo translate('cancel'); ?></button>
277  </div>
278  </td>
279  <td width="100%">
280  <table width="100%" height="100%">
281  <tr>
282  <td>
283  <iframe src="about:blank" width="100%" height="100%" id="i_framecontent" name="framecontent" class="f_content"></iframe>
284  </td>
285  </tr>
286  </table>
287  </td>
288  </tr>
289  </table>
290  </body>
291 </html>