~ubuntu-branches/ubuntu/trusty/fusionforge/trusty

« back to all changes in this revision

Viewing changes to plugins/fckeditor/www/_samples/afp/sample02.afp

  • Committer: Bazaar Package Importer
  • Author(s): Roland Mas
  • Date: 2011-04-15 14:55:34 UTC
  • mfrom: (4.1.10 sid)
  • Revision ID: james.westby@ubuntu.com-20110415145534-mvn1nochufjmw177
Tags: 5.0.3-1
New upstream bugfix release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<%
 
2
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 
3
 * Copyright (C) 2003-2008 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
 
 
25
<html>
 
26
        <head>
 
27
                <title>FCKeditor - AFP Sample 2</title>
 
28
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 
29
                <meta name="robots" content="noindex, nofollow">
 
30
                <link href="../sample.css" rel="stylesheet" type="text/css" />
 
31
 
 
32
                <script type="text/javascript">
 
33
                function FCKeditor_OnComplete( editorInstance )
 
34
                {
 
35
                                var oCombo = document.getElementById( 'cmbLanguages' ) ;
 
36
                        for ( code in editorInstance.Language.AvailableLanguages )
 
37
                        {
 
38
                                AddComboOption( oCombo, editorInstance.Language.AvailableLanguages[code] + ' (' + code + ')', code ) ;
 
39
                        }
 
40
                        oCombo.value = editorInstance.Language.ActiveLanguage.Code ;
 
41
                }
 
42
 
 
43
                function AddComboOption(combo, optionText, optionValue)
 
44
                {
 
45
                        var oOption = document.createElement("OPTION") ;
 
46
 
 
47
                        combo.options.add(oOption) ;
 
48
 
 
49
                        oOption.innerHTML = optionText ;
 
50
                        oOption.value     = optionValue ;
 
51
 
 
52
                        return oOption ;
 
53
                }
 
54
 
 
55
                function ChangeLanguage( languageCode )
 
56
                {
 
57
                        window.location.href = window.location.pathname + "?Lang=" + languageCode ;
 
58
                }
 
59
                </script>
 
60
                </head>
 
61
        <body>
 
62
                <h1>FCKeditor - AFP - Sample 2</h1>
 
63
                This sample shows the editor in all its available languages.
 
64
                <hr>
 
65
                <table cellpadding="0" cellspacing="0" border="0">
 
66
                        <tr>
 
67
                                <td>
 
68
                                        Select a language:&nbsp;
 
69
                                </td>
 
70
                                <td>
 
71
                                        <select id="cmbLanguages" onchange="ChangeLanguage(this.value);">
 
72
                                        </select>
 
73
                                </td>
 
74
                        </tr>
 
75
                </table>
 
76
                <br>
 
77
                <form action="sampleposteddata.afp" method="post" target="_blank">
 
78
<%
 
79
 
 
80
                        sBasePath="../../../fckeditor/"                                         && Change this to your local path
 
81
 
 
82
                        oFCKeditor = CREATEOBJECT("FCKeditor")
 
83
                        oFCKeditor.fckeditor("FCKeditor1")
 
84
 
 
85
                        lcLanguage=""                                                                           && Initialize Variable
 
86
                        lcLanguage=request.querystring("Lang")                          && Request Parameter
 
87
                        lcLanguage=oFCKeditor.StripAttacks(lcLanguage)          && Remove special escape characters
 
88
                        IF EMPTY(lcLanguage)
 
89
                                oFCKeditor.aconfig[1,1]="AutoDetectLanguage"
 
90
                                oFCKeditor.aconfig[1,2]="true"
 
91
                                oFCKeditor.aconfig[2,1]="DefaultLanguage"
 
92
                                oFCKeditor.aconfig[2,2]="en"
 
93
                        ELSE
 
94
                                oFCKeditor.aconfig[1,1]="AutoDetectLanguage"
 
95
                                oFCKeditor.aconfig[1,2]="false"
 
96
                                oFCKeditor.aconfig[2,1]="DefaultLanguage"
 
97
                                oFCKeditor.aconfig[2,2]=lcLanguage
 
98
                        ENDIF
 
99
 
 
100
                        lcText=[<p>This is some <strong>sample text</strong>. You are using ]
 
101
                        lcText=lcText+[<a href='http://www.fckeditor.net/'>FCKeditor</a>.]
 
102
 
 
103
                        oFCKeditor.BasePath     = sBasePath
 
104
                        oFCKeditor.cValue       = lcText
 
105
 
 
106
                        ? oFCKeditor.Create()
 
107
 
 
108
%>
 
109
                        <br>
 
110
                        <input type="submit" value="Submit">
 
111
                </form>
 
112
        </body>
 
113
</html>