2 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
\r
3 * Copyright (C) 2003-2009 Frederico Caldeira Knabben
\r
5 * == BEGIN LICENSE ==
\r
7 * Licensed under the terms of any of the following licenses at your
\r
10 * - GNU General Public License Version 2 or later (the "GPL")
\r
11 * http://www.gnu.org/licenses/gpl.html
\r
13 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
\r
14 * http://www.gnu.org/licenses/lgpl.html
\r
16 * - Mozilla Public License Version 1.1 or later (the "MPL")
\r
17 * http://www.mozilla.org/MPL/MPL-1.1.html
\r
21 * FCKPlugin Class: Represents a single plugin.
\r
24 var FCKPlugin = function( name, availableLangs, basePath )
\r
27 this.BasePath = basePath ? basePath : FCKConfig.PluginsPath ;
\r
28 this.Path = this.BasePath + name + '/' ;
\r
30 if ( !availableLangs || availableLangs.length == 0 )
\r
31 this.AvailableLangs = new Array() ;
\r
33 this.AvailableLangs = availableLangs.split(',') ;
\r
36 FCKPlugin.prototype.Load = function()
\r
38 // Load the language file, if defined.
\r
39 if ( this.AvailableLangs.length > 0 )
\r
43 // Check if the plugin has the language file for the active language.
\r
44 if ( this.AvailableLangs.IndexOf( FCKLanguageManager.ActiveLanguage.Code ) >= 0 )
\r
45 sLang = FCKLanguageManager.ActiveLanguage.Code ;
\r
47 // Load the default language file (first one) if the current one is not available.
\r
48 sLang = this.AvailableLangs[0] ;
\r
50 // Add the main plugin script.
\r
51 LoadScript( this.Path + 'lang/' + sLang + '.js' ) ;
\r
54 // Add the main plugin script.
\r
55 LoadScript( this.Path + 'fckplugin.js' ) ;
\r