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 // +------------------------------------------------------------------------------+
30 require_once("../../interface/globals.php");
31 $content = $_REQUEST['content'];
35 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
36 <script type
="text/javascript">
37 function showWhereInTextarea(){
38 opener
.restoreSession();
39 var textarea
= document
.getElementById('quest');
40 start
= textarea
.value
.indexOf("??");
42 if(textarea
.setSelectionRange
){
43 textarea
.setSelectionRange(parseInt(start
), (parseInt(start
)+
parseInt(len
)));
46 var range
= textarea
.createTextRange();
49 range
.moveStart('character',parseInt(start
) );
50 range
.moveEnd('character',parseInt(len
));
54 document
.getElementById('quest').focus();
56 function replace_quest(val
){
57 opener
.restoreSession();
58 var textarea
= document
.getElementById('quest').value
;
59 textarea
=textarea
.replace(/\?\?/i
,val
);
60 document
.getElementById('quest').value
=textarea
;
63 opener
.restoreSession();
64 var textFrom
= document
.getElementById('quest').value
;
65 window
.opener
.CKEDITOR
.instances
.textarea1
.insertText(textFrom
);
70 <body
class="body_top" onload
="showWhereInTextarea()">
75 $res = sqlStatement("SELECT * FROM list_options WHERE list_id = 'nation_notes_replace_buttons' AND activity = 1 ORDER BY seq");
76 while($row = sqlFetchArray($res)){
78 <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
>
86 <textarea name
="quest" id
="quest" rows
="5" cols
="70"><?php
echo htmlspecialchars($content,ENT_QUOTES
);?
></textarea
>
90 <td colspan
="2" align
="center">
91 <input type
="button" name
="save" value
="<?php echo htmlspecialchars(xl('Save'),ENT_QUOTES);?>" onclick
="save_this()">
92 <input type
="button" name
="cancel" value
="<?php echo htmlspecialchars(xl('Cancel'),ENT_QUOTES);?>" onclick
="javascript:window.close()">