2 require("../../../../config.php");
4 $id = optional_param('id', SITEID
, PARAM_INT
);
6 require_course_login($id);
7 @header
('Content-Type: text/html; charset=utf-8');
9 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
10 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
13 <meta http
-equiv
="content-type" content
="text/html; charset=utf-8" />
14 <title
><?php
print_string("searchandreplace","editor");?
></title
>
15 <script type
="text/javascript" src
="popup.js"></script
>
16 <script type
="text/javascript">
18 function _CloseOnEsc(ev
) {
19 ev ||
(ev
= window
.event
) ||
(ev
= editor
._iframe
.contentWindow
.event
);
20 if (ev
.keyCode
== 27) {
32 document
.body
.onkeypress
= _CloseOnEsc
;
33 var param
= window
.dialogArguments
;
34 document
.getElementById("f_search").value
= param
["f_search"];
36 document
.getElementById("f_search").focus();
37 document
.getElementById("f_search").select();
42 function onReplaceAll() {
43 var searchtxt
= document
.getElementById("f_search").value
;
45 //Check a search string
46 if (searchtxt
.length
< 1 ) {
47 alert ("Search string is empty!");
51 var replacetxt
= document
.getElementById("f_replace").value
;
52 var stringcase
= (document
.getElementById("f_case").checked
) ?
"g" : "gi";
53 var regularx
= (document
.getElementById("f_regx").checked
) ?
1 : 0;
54 //var closesar = (document.getElementById("f_csar").checked) ? 1 : 0;
56 var param
= [ searchtxt
, replacetxt
, stringcase
, regularx
, closesar
];
58 //looks that not workin in ie :( need to fix!
76 <style type
="text/css">
78 background
: ButtonFace
;
80 font
: 11px Tahoma
,Verdana
,sans
-serif
;
84 body
{ padding
: 5px
; }
86 font
: 11px Tahoma
,Verdana
,sans
-serif
;
92 .fl
{ width
: 9em
; float: left
; padding
: 2px
5px
; text
-align
: right
; }
93 .fr
{ width
: 7em
; float: left
; padding
: 2px
5px
; text
-align
: right
; }
94 fieldset
{ padding
: 0px
10px
5px
5px
; }
95 select
, input
, button
{ font
: 11px Tahoma
,Verdana
,sans
-serif
; }
96 button
{ width
: 70px
; }
98 margin
-top
: 1em
; border
-top
: 1px solid
#999;
99 padding
: 2px
; text
-align
: right
;
102 .space
{ padding
: 2px
; }
104 .title
{ background
: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
105 border
-bottom
: 1px solid black
; letter
-spacing
: 2px
;
107 form
{ padding
: 0px
; margin
: 0px
; }
110 <body onload
="Init()">
111 <div
class="title"><?php
print_string("searchandreplace","editor");?
></div
>
113 <table border
="0" style
="width: 100%;">
115 <td
class="label"><?php
print_string("findwhat","editor");?
>:</td
>
116 <td align
="left"><input type
="text" id
="f_search" style
="width: 280px" /></td
>
119 <td
class="label"><?php
print_string("replacewith","editor");?
>:</td
>
120 <td align
="left"><input type
="text" id
="f_replace" style
="width: 280px" /></td
>
125 <legend
><span style
="font-weight: bold;"><?php
print_string("options","editor");?
>:</span
></legend
>
126 <table border
="0" style
="width: 100%;">
128 <td style
="width: 20px;"><input type
="checkbox" id
="f_regx" checked
="checked" /></td
>
129 <td
><label
for="f_regx"><?php
print_string("regularexpressions","editor");?
></label
></td
>
132 <td style
="width: 20px;"><input type
="checkbox" id
="f_case" checked
="checked" /></td
>
133 <td
><label
for="f_case"><?php
print_string("matchcase","editor");?
></label
></td
>
136 <td style
="width: 20px;"><input type
="checkbox" id
="f_csar" checked
="checked" /></td
>
137 <td
><label
for="f_csar"><?php
print_string("closeafterreplace","editor");?
></label
></td
>
142 <button type
="button" name
="ok" onclick
="return onReplaceAll();" style
="width: 120px;"><?php
print_string("replaceall","editor");?
></button
>
143 <button type
="button" name
="cancel" onclick
="return onCancel();"><?php
print_string("cancel","editor");?
></button
>