/home/banprang/domains/plai.go.th/public_html/coremain/core_editor.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php 
session_start
();
import_request_variables('pG''p_');
if(
$p_data_id=="") {
     echo 
"<script language=\"JavaScript\" type=\"text/javascript\">\n";
     echo 
"function OpenMidWin(url, name,width,height) {\n";
     echo 
"     var left = parseInt( (screen.availWidth/2) - (width/2));\n";
     echo 
"     var top = parseInt( (screen.availHeight/2) - (height/2));\n";
     echo 
"     var windowFeatures =\"width=\" + width + \",height=\" + height + \",alwaysRaised=yes,menubar=yes,titlebar=yes, toolbar=yes, scrollbars=yes, status=yes, resizable, left=\" + left + \",top=\" + top + \",screenX=\" + left + \",screenY=\" + top;\n";
     echo 
"     myWindow = window.open(url, name, windowFeatures).focus();\n";
     echo 
"}\n";
     echo 
"</script>\n";
     
$editor_tip='onmouseover="this.T_WIDTH=250;this.T_SHADOWWIDTH=4;this.T_SHADOWCOLOR=\'#000099\';this.T_BORDERCOLOR=\'#ff0000\';'.
            
'return escape(\''.$tip_msg.'\')"';

}else{
          
$data_id=trim($p_data_id); 
          if(
$p_hidden_var_id!="") {
               
$hidden_var_id=trim($p_hidden_var_id); 
          }
          if(
$p_mode!="") {
               
$mode=trim($p_mode); 
          }
          if(
$p_evar!="") {
               
$evar=trim($p_evar); 
               
$evar ereg_replace(' />','>'$evar);
               
$evar ereg_replace("\n",''$evar);
               
$evar ereg_replace("\r",''$evar);
          }

          if(
$mode=='doit'){
                    echo 
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n";
                    echo 
"<html>\n";
                    echo 
" <head>\n";
                    echo 
" <title>FCKeditor</title>\n";
                    echo 
" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=tis-620\">\n";
                    echo 
" </head>\n";

                    echo 
"<script language=\"JavaScript\" type=\"text/javascript\">\n";
                    echo 
"function change_value() {\n";
                    echo 
"   var new_str = '$evar'; \n";
                       
### change data in paren window
                       ###    inject into html
                       
echo "   opener.document.getElementById(\"$data_id\").innerHTML = new_str;\n";
                       
###    change hidden type value
                       
echo "   opener.document.getElementById(\"$hidden_var_id\").value = new_str;\n";
                    echo 
"}\n";
                    echo 
"</script>\n";

                    echo 
" <body onload=\"change_value(); window.close();\">\n";
                    echo 
" </body>\n";
                    echo 
"</html>\n";
                    exit();
          }


          include(
"editor/fckeditor.php") ;

          echo 
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n";
          echo 
"<html>\n";
          echo 
" <head>\n";
          echo 
" <title>FCKeditor</title>\n";
          echo 
" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=tis-620\">\n";
          echo 
" <link href=\"editor/sample.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
          echo 
" </head>\n";

          echo 
"<style type=\"text/css\">\n";
          echo 
".menu { BACKGROUND: #FFCCFF;COLOR: darkblue;\n";
          echo 
" FONT-SIZE: 12px; FONT-FAMILY: sans-serif; font-size: medium; TEXT-DECORATION: none;\n";
          echo 
" FONT-WEIGHT: 100; border: #C878C8 2PX SOLID; cursor: POINTER; }\n";
          echo 
"</style>\n";

          echo 
" <body >\n";
             
          echo 
"        <form action=\"core_editor.php\" method=\"post\">\n";
          
$oFCKeditor = new FCKeditor('evar') ;
          
$oFCKeditor->BasePath    'editor/';
          
$oFCKeditor->Width "100%";
          
$oFCKeditor->Height "340";
          
$oFCKeditor->Value        "";
          
$oFCKeditor->Create() ;

          echo 
"<script language=\"JavaScript\" type=\"text/javascript\">\n";
          echo 
"      document.getElementById(\"evar\").value=opener.document.getElementById('$data_id').innerHTML;\n";
          echo 
"</script>\n";

          echo 
" <input type=\"hidden\" name =\"mode\" value=\"doit\">\n";
          echo 
" <input type=\"hidden\" name =\"hidden_var_id\" value=\"$hidden_var_id\">\n";
          echo 
" <input type=\"hidden\" name =\"data_id\" value=\"$data_id\">\n";

          echo 
" <input type=\"submit\" value=\"Submit\" onmouseover=this.style.cursor='hand'>\n";
          echo 
" </form>\n";
          echo 
" </body>\n";

          echo 
"</html>\n";
          exit();
}