2 // +-----------------------------------------------------------------------------+
3 // Copyright (C) 2011 Z&H Consultancy Services Private Limited <sam@zhservices.com>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
18 // A copy of the GNU General Public License is included along with this program:
19 // openemr/interface/login/GnuGPL.html
20 // For more information write to the Free Software
21 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 // Author: Eldho Chacko <eldho@zhservices.com>
24 // Jacob T Paul <jacob@zhservices.com>
26 // +------------------------------------------------------------------------------+
28 //SANITIZE ALL ESCAPES
29 $sanitize_all_escapes=true;
32 //STOP FAKE REGISTER GLOBALS
33 $fake_register_globals=false;
36 require_once("../../interface/globals.php");
37 $content = $_REQUEST['content'];
41 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
42 <script type
="text/javascript">
43 function showWhereInTextarea(){
44 opener
.restoreSession();
45 var textarea
= document
.getElementById('quest');
46 start
= textarea
.value
.indexOf("??");
48 if(textarea
.setSelectionRange
){
49 textarea
.setSelectionRange(parseInt(start
), (parseInt(start
)+
parseInt(len
)));
52 var range
= textarea
.createTextRange();
55 range
.moveStart('character',parseInt(start
) );
56 range
.moveEnd('character',parseInt(len
));
60 document
.getElementById('quest').focus();
62 function replace_quest(val
){
63 opener
.restoreSession();
64 var textarea
= document
.getElementById('quest').value
;
65 textarea
=textarea
.replace(/\?\?/i
,val
);
66 document
.getElementById('quest').value
=textarea
;
69 opener
.restoreSession();
70 var textFrom
= document
.getElementById('quest').value
;
71 window
.opener
.CKEDITOR
.instances
.textarea1
.insertText(textFrom
);
76 <body
class="body_top" onload
="showWhereInTextarea()">
81 $res = sqlStatement("SELECT * FROM list_options WHERE list_id='nation_notes_replace_buttons' ORDER BY seq");
82 while($row = sqlFetchArray($res)){
84 <a href
="#" onclick
="replace_quest('<?php echo htmlspecialchars($row['option_id'],ENT_QUOTES);?>')" class="css_button"><span
><?php
echo htmlspecialchars($row['title'],ENT_QUOTES
);?
></span
></a
>
92 <textarea name
="quest" id
="quest" rows
="5" cols
="70"><?php
echo htmlspecialchars($content,ENT_QUOTES
);?
></textarea
>
96 <td colspan
="2" align
="center">
97 <input type
="button" name
="save" value
="<?php echo htmlspecialchars(xl('Save'),ENT_QUOTES);?>" onclick
="save_this()">
98 <input type
="button" name
="cancel" value
="<?php echo htmlspecialchars(xl('Cancel'),ENT_QUOTES);?>" onclick
="javascript:window.close()">