26 require_once dirname(__FILE__).
'/../../../../core/include/init.inc';
27 require_once SQ_LIB_PATH.
'/html_form/html_form.inc';
28 require_once SQ_FUDGE_PATH.
'/var_serialise/var_serialise.inc';
30 if (empty($GLOBALS[
'SQ_SYSTEM']->user) || !($GLOBALS[
'SQ_SYSTEM']->user->canAccessBackend() || $GLOBALS[
'SQ_SYSTEM']->user->type() ==
'simple_edit_user')){
34 if (!isset($_GET[
'name'])) $_GET[
'name'] =
'';
38 <html style=
"width: 420px; height: 500px;">
41 <title>Replace Text</title>
44 $include_list = Array(sq_web_path(
'lib').
'/js/translation.js');
46 $locales = $GLOBALS[
'SQ_SYSTEM']->lm->getCumulativeLocaleParts($GLOBALS[
'SQ_SYSTEM']->lm->getCurrentLocale());
48 foreach ($locales as $locale) {
49 if (file_exists(SQ_DATA_PATH.
'/public/system/core/js_strings.'.$locale.
'.js')) {
50 $include_list[] = sq_web_path(
'data').
'/system/core/js_strings.'.$locale.
'.js';
54 foreach ($include_list as $link) {
55 ?><script type=
"text/javascript" src=
"<?php echo $link; ?>"></script>
59 <script type=
"text/javascript" src=
"../../core/popup.js"></script>
60 <script type=
"text/javascript" src=
"<?php echo sq_web_path('fudge').'/var_serialise/var_serialise.js' ?>"></script>
61 <script type=
"text/javascript" src=
"<?php echo sq_web_path('lib').'/html_form/html_form.js' ?>"></script>
62 <script type=
"text/javascript" src=
"<?php echo sq_web_path('lib').'/js/general.js' ?>"></script>
64 <script type=
"text/javascript">
67 setTimeout(
'self.focus()',100);
71 __dlg_init(
"ReplaceText");
72 setTimeout(
'self.focus()',100);
76 var confirm_str =
"WARNING!\nThe appearance of the content may be affected and the action cannot be undone.\nAre you sure you want to apply the replacement?";
78 if (confirm(confirm_str)) {
79 var rep_types =
new Array();
80 var selected_only = parseInt(document.getElementById(
"rep_type0").value);
81 rep_types.push(selected_only);
83 while (document.getElementById(
"rep_type"+i) != null)
85 rep_types.push(document.getElementById(
"rep_type"+i).checked);
88 __dlg_close(
"ReplaceText", rep_types);
95 __dlg_close(
"ReplaceText", null);
99 function checkAll(val) {
100 document.getElementById(
"checkAllSpan").innerHTML = (val)?
" Uncheck All":
" Check All";
102 while (document.getElementById(
"rep_type"+i) != null)
104 document.getElementById(
"rep_type"+i).checked = val;
110 <style type=
"text/css">
114 font: 11px Tahoma,Verdana,sans-serif;
121 font: 11px Tahoma,Verdana,sans-serif;
132 border-bottom: 1px solid black;
138 padding: 0px 10px 5px 5px;
139 border-color: #725B7D;
142 .fl { width: 9em;
float: left; padding: 2px 5px; text-align: right; }
143 .fr { width: 7em;
float: left; padding: 2px 5px; text-align: right; }
146 form { padding: 0px; margin: 0px; }
148 select, input, button {
149 font: 11px Tahoma,Verdana,sans-serif;
158 <body onload=
"Init()">
160 <div
class=
"title">Replace Text</div>
162 <form action=
"" method=
"get" name=
"Form1">
163 <table border=
"0" width=
"100%">
167 <legend><b>Replacement types</b></legend>
168 <table style=
"width:100%">
170 <td>Selected text only?
171 <select
id=
"rep_type0" name=
"rep_type0">
172 <option value=
"1">Yes</option>
173 <option value=
"0">No</option>
178 <input type=
"checkbox" name=
"rep_type" id=
"rep_type" onclick=
"checkAll(this.checked)"/><label
for=
"rep_type"><span
id=
"checkAllSpan"> Check All</span></label>
188 <legend><b>Non-extreme options</b></legend>
189 <table style=
"width:100%">
192 <input type=
"checkbox" name=
"rep_type1" id=
"rep_type1" checked=
"checked"/><label
for=
"rep_type1"> Remove <b><font></b> tags</label><br/>
193 <input type=
"checkbox" name=
"rep_type2" id=
"rep_type2" checked=
"checked"/><label
for=
"rep_type2"> Remove
double spaces</label><br/>
194 <input type=
"checkbox" name=
"rep_type3" id=
"rep_type3" checked=
"checked"/><label
for=
"rep_type3"> Remove <b>non-HTML</b> tags</label><br/>
195 <input type=
"checkbox" name=
"rep_type4" id=
"rep_type4" checked=
"checked"/><label
for=
"rep_type4"> Change Microsoft Word<sup>®</sup>
's bullets</label><br/>
196 <input type="checkbox" name="rep_type5" id="rep_type5" checked="checked"/><label for="rep_type5"> Remove soft hyphens (&shy;)</label><br/>
207 <legend><b>Extreme options</b></legend>
208 <table style="width:100%">
211 <input type="checkbox" name="rep_type6" id="rep_type6" /><label for="rep_type6"> Remove <b>style</b> attribute</label><br/>
212 <input type="checkbox" name="rep_type7" id="rep_type7" /><label for="rep_type7"> Remove <b>class</b> attribute</label><br/>
213 <input type="checkbox" name="rep_type8" id="rep_type8" /><label for="rep_type8"> Remove <b><table></b> tags</label><br/>
214 <input type="checkbox" name="rep_type9" id="rep_type9" /><label for="rep_type9"> Remove <b><span></b> tags</label><br/>
215 <input type="checkbox" name="rep_type10" id="rep_type10" /><label for="rep_type10"> Remove all empty tags</label><br/>
216 <input type="checkbox" name="rep_type11" id="rep_type11" /><label for="rep_type11"> Remove all tags' attributes (except HREF and SRC)</label><br/>
225 <div style=
"text-align: right;">
227 <button type=
"button" name=
"ok" onclick=
"if (!onOK()) return;">OK</button>
229 <button type=
"button" name=
"cancel" onclick=
"window.close();">Cancel</button>