~ubuntu-branches/ubuntu/saucy/mediawiki-extensions/saucy

« back to all changes in this revision

Viewing changes to dist/mediawiki-extensions-fckeditor/usr/share/mediawiki-extensions/fckeditor/FCKeditor.php

  • Committer: Bazaar Package Importer
  • Author(s): Romain Beauxis
  • Date: 2010-05-04 15:13:35 UTC
  • mfrom: (0.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20100504151335-54qeucg3ec108q28
Tags: 2.2
* Added Replaces:/Conflicts: to allow a proper upgrade.
Closes: #580066
* Fixed package descriptions.
Closes: #579667
* Patched mediawiki-extensions-fckeditor to make it work with
  php 5.3. The fix may not be perfect but at least it work.
  Not closing the bug (#579822) for now..

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
# Not a valid entry point, skip unless MEDIAWIKI is defined
 
4
if (!defined('MEDIAWIKI')) {
 
5
        echo <<<HEREDOC
 
6
To install FCKeditor extension, put the following line in LocalSettings.php:
 
7
require_once( "\$IP/extensions/FCKeditor/FCKeditor.php" );
 
8
HEREDOC;
 
9
        exit( 1 );
 
10
}
 
11
 
 
12
/*
 
13
This library is free software; you can redistribute it and/or
 
14
modify it under the terms of the GNU Lesser General Public
 
15
License as published by the Free Software Foundation; either
 
16
version 2.1 of the License, or (at your option) any later version.
 
17
 
 
18
This library is distributed in the hope that it will be useful,
 
19
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
21
Lesser General Public License for more details.
 
22
 
 
23
You should have received a copy of the GNU Lesser General Public
 
24
License along with this library; if not, write to the Free Software
 
25
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 
26
*/
 
27
 
 
28
require_once $IP . "/includes/GlobalFunctions.php";
 
29
require_once $IP . "/includes/EditPage.php";
 
30
 
 
31
if (version_compare("1.14alpha", $wgVersion, "<=")) {
 
32
    require_once $IP . "/includes/parser/ParserOptions.php";
 
33
    require_once $IP . "/includes/parser/Parser.php";
 
34
    require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "mw14/Parser_OldPP.body.php";
 
35
    require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "mw12/FCKeditorParserWrapper.body.php";
 
36
}
 
37
else if (version_compare("1.13alpha", $wgVersion, "<=")) {
 
38
    require_once $IP . "/includes/parser/ParserOptions.php";
 
39
    require_once $IP . "/includes/parser/Parser_OldPP.php";
 
40
    require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "mw12/FCKeditorParserWrapper.body.php";
 
41
}
 
42
else if (version_compare("1.12", $wgVersion, "<")) {
 
43
    require_once $IP . "/includes/ParserOptions.php";
 
44
    require_once $IP . "/includes/Parser_OldPP.php";
 
45
    require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "mw12/FCKeditorParserWrapper.body.php";
 
46
}
 
47
else {
 
48
    require_once $IP . "/includes/ParserOptions.php";
 
49
    require_once $IP . "/includes/Parser.php";
 
50
    require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "mw11/FCKeditorParserWrapper.body.php";
 
51
}
 
52
 
 
53
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "FCKeditorParser.body.php";
 
54
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "FCKeditorSajax.body.php";
 
55
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "FCKeditorParserOptions.body.php";
 
56
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "FCKeditorSkin.body.php";
 
57
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "FCKeditorEditPage.body.php";
 
58
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "FCKeditor.body.php";
 
59
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "fckeditor" . DIRECTORY_SEPARATOR . "fckeditor.php";
 
60
 
 
61
if (empty ($wgFCKEditorExtDir)) {
 
62
    $wgFCKEditorExtDir = "extensions/FCKeditor";
 
63
}
 
64
if (empty ($wgFCKEditorDir)) {
 
65
    $wgFCKEditorDir = "extensions/FCKeditor/fckeditor";
 
66
}
 
67
if (empty ($wgFCKEditorToolbarSet)) {
 
68
    $wgFCKEditorToolbarSet = "Wiki";
 
69
}
 
70
if (empty ($wgFCKEditorHeight)) {
 
71
    $wgFCKEditorHeight = "0"; // "0" for automatic ("300" minimum).
 
72
}
 
73
/**
 
74
 * Enable use of AJAX features.
 
75
 */
 
76
$wgUseAjax = true;
 
77
$wgAjaxExportList[] = 'wfSajaxSearchImageFCKeditor';
 
78
$wgAjaxExportList[] = 'wfSajaxSearchArticleFCKeditor';
 
79
$wgAjaxExportList[] = 'wfSajaxSearchCategoryFCKeditor';
 
80
$wgAjaxExportList[] = 'wfSajaxWikiToHTML';
 
81
$wgAjaxExportList[] = 'wfSajaxGetImageUrl';
 
82
$wgAjaxExportList[] = 'wfSajaxGetMathUrl';
 
83
$wgAjaxExportList[] = 'wfSajaxSearchTemplateFCKeditor';
 
84
$wgAjaxExportList[] = 'wfSajaxSearchSpecialTagFCKeditor';
 
85
$wgAjaxExportList[] = 'wfSajaxToggleFCKeditor';
 
86
 
 
87
$wgExtensionCredits['other'][] = array(
 
88
    'name' => 'FCKeditor',
 
89
    'author' => array('FCKeditor.net', 'Wikia'),
 
90
    'version' => 'fckeditor/mw-extension $Rev$ 2008',
 
91
    'url' => 'http://www.mediawiki.org/wiki/Extension:FCKeditor_%28by_FCKeditor_and_Wikia%29',
 
92
    'description' => 'FCKeditor extension for editing wiki pages (WYSIWYG editor)'
 
93
);
 
94
 
 
95
$fckeditor = new FCKeditor("fake");
 
96
$wgFCKEditorIsCompatible = $fckeditor->IsCompatible();
 
97
 
 
98
$oFCKeditorExtension = new FCKeditor_MediaWiki();
 
99
 
 
100
$oFCKeditorExtension->registerHooks();
 
101
 
 
102
$wgDefaultUserOptions['riched_use_toggle'] = 1;
 
103
$wgDefaultUserOptions['riched_start_disabled'] = 1;
 
104
$wgDefaultUserOptions['riched_use_popup'] = 1;
 
105
$wgDefaultUserOptions['riched_toggle_remember_state'] = 1;