/EQT_V2/EQT/EQTWebApp/fckeditor/_samples/afp/sample02.afp

http://sgsoft-las.googlecode.com/ · Unknown · 113 lines · 99 code · 14 blank · 0 comment · 0 complexity · b9dcc45d0ad3b67b33f9f2b923bca949 MD5 · raw file

  1. <%
  2. * FCKeditor - The text editor for Internet - http://www.fckeditor.net
  3. * Copyright (C) 2003-2009 Frederico Caldeira Knabben
  4. *
  5. * == BEGIN LICENSE ==
  6. *
  7. * Licensed under the terms of any of the following licenses at your
  8. * choice:
  9. *
  10. * - GNU General Public License Version 2 or later (the "GPL")
  11. * http://www.gnu.org/licenses/gpl.html
  12. *
  13. * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
  14. * http://www.gnu.org/licenses/lgpl.html
  15. *
  16. * - Mozilla Public License Version 1.1 or later (the "MPL")
  17. * http://www.mozilla.org/MPL/MPL-1.1.html
  18. *
  19. * == END LICENSE ==
  20. *
  21. * This page is a basic Sample for FCKeditor integration in the AFP script language (www.afpages.de)
  22. *
  23. %>
  24. <html>
  25. <head>
  26. <title>FCKeditor - AFP Sample 2</title>
  27. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  28. <meta name="robots" content="noindex, nofollow">
  29. <link href="../sample.css" rel="stylesheet" type="text/css" />
  30. <script type="text/javascript">
  31. function FCKeditor_OnComplete( editorInstance )
  32. {
  33. var oCombo = document.getElementById( 'cmbLanguages' ) ;
  34. for ( code in editorInstance.Language.AvailableLanguages )
  35. {
  36. AddComboOption( oCombo, editorInstance.Language.AvailableLanguages[code] + ' (' + code + ')', code ) ;
  37. }
  38. oCombo.value = editorInstance.Language.ActiveLanguage.Code ;
  39. }
  40. function AddComboOption(combo, optionText, optionValue)
  41. {
  42. var oOption = document.createElement("OPTION") ;
  43. combo.options.add(oOption) ;
  44. oOption.innerHTML = optionText ;
  45. oOption.value = optionValue ;
  46. return oOption ;
  47. }
  48. function ChangeLanguage( languageCode )
  49. {
  50. window.location.href = window.location.pathname + "?Lang=" + languageCode ;
  51. }
  52. </script>
  53. </head>
  54. <body>
  55. <h1>FCKeditor - AFP - Sample 2</h1>
  56. This sample shows the editor in all its available languages.
  57. <hr>
  58. <table cellpadding="0" cellspacing="0" border="0">
  59. <tr>
  60. <td>
  61. Select a language:&nbsp;
  62. </td>
  63. <td>
  64. <select id="cmbLanguages" onchange="ChangeLanguage(this.value);">
  65. </select>
  66. </td>
  67. </tr>
  68. </table>
  69. <br>
  70. <form action="sampleposteddata.afp" method="post" target="_blank">
  71. <%
  72. sBasePath="../../../fckeditor/" && Change this to your local path
  73. oFCKeditor = CREATEOBJECT("FCKeditor")
  74. oFCKeditor.fckeditor("FCKeditor1")
  75. lcLanguage="" && Initialize Variable
  76. lcLanguage=request.querystring("Lang") && Request Parameter
  77. lcLanguage=oFCKeditor.StripAttacks(lcLanguage) && Remove special escape characters
  78. IF EMPTY(lcLanguage)
  79. oFCKeditor.aconfig[1,1]="AutoDetectLanguage"
  80. oFCKeditor.aconfig[1,2]="true"
  81. oFCKeditor.aconfig[2,1]="DefaultLanguage"
  82. oFCKeditor.aconfig[2,2]="en"
  83. ELSE
  84. oFCKeditor.aconfig[1,1]="AutoDetectLanguage"
  85. oFCKeditor.aconfig[1,2]="false"
  86. oFCKeditor.aconfig[2,1]="DefaultLanguage"
  87. oFCKeditor.aconfig[2,2]=lcLanguage
  88. ENDIF
  89. lcText=[<p>This is some <strong>sample text</strong>. You are using ]
  90. lcText=lcText+[<a href='http://www.fckeditor.net/'>FCKeditor</a>.]
  91. oFCKeditor.BasePath = sBasePath
  92. oFCKeditor.cValue = lcText
  93. ? oFCKeditor.Create()
  94. %>
  95. <br>
  96. <input type="submit" value="Submit">
  97. </form>
  98. </body>
  99. </html>