Ticket #3625: FCKeditor.php.patch

File FCKeditor.php.patch, 8.2 KB (added by Don Stringham, 11 years ago)

Added constants to this file to help with settings in LocalSettings.php

  • FCKeditor.php

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