r87891 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87890‎ | r87891 | r87892 >
Date:20:29, 11 May 2011
Author:yaron
Status:deferred
Tags:
Comment:
Added changes suggested by ontoprise/SMW+, to improved support for FCKeditor
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormUtils.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormUtils.php
@@ -373,13 +373,13 @@
374374 global $wgUser, $wgDefaultUserOptions;
375375
376376 $showFCKEditor = 0;
377 - if ( !$wgUser->getOption( 'riched_start_disabled', $wgDefaultUserOptions['riched_start_disabled'] ) ) {
 377+ if ( !array_key_exists( 'riched_start_disabled', $wgDefaultUserOptions) && !$wgUser->getOption( 'riched_start_disabled' ) ) {
378378 $showFCKEditor += RTE_VISIBLE;
379379 }
380 - if ( $wgUser->getOption( 'riched_use_popup', $wgDefaultUserOptions['riched_use_popup'] ) ) {
 380+ if ( array_key_exists( 'riched_use_popup', $wgDefaultUserOptions ) || $wgUser->getOption( 'riched_use_popup' ) ) {
381381 $showFCKEditor += RTE_POPUP;
382382 }
383 - if ( $wgUser->getOption( 'riched_use_toggle', $wgDefaultUserOptions['riched_use_toggle'] ) ) {
 383+ if ( array_key_exists( 'riched_use_toggle', $wgDefaultUserOptions ) || $wgUser->getOption( 'riched_use_toggle' ) ) {
384384 $showFCKEditor += RTE_TOGGLE_LINK;
385385 }
386386
@@ -440,7 +440,8 @@
441441 $wgFCKEditorDir .= '/';
442442 }
443443
444 - $javascript_text .= <<<END
 444+ if ( class_exists('FCKeditor') ) {
 445+ $javascript_text .= <<<END
445446 var oFCKeditor = new FCKeditor( "free_text" );
446447
447448 //Set config
@@ -659,12 +660,17 @@
660661 addOnloadHook( initEditor );
661662
662663 END;
 664+ } else {
 665+ // CKeditor instead of FCKeditor
 666+ $javascript_text = CKeditor_MediaWiki::InitializeScripts('free_text', $newWinMsg);
 667+ }
663668 return $javascript_text;
664669 }
665670
666671 static function FCKToggleJavascript() {
667672 // add toggle link and handler
668 - $javascript_text = <<<END
 673+ if ( class_exists('FCKeditor') ) {
 674+ $javascript_text = <<<END
669675
670676 function ToggleFCKEditor(mode, objId)
671677 {
@@ -769,6 +775,10 @@
770776 }
771777
772778 END;
 779+ } else {
 780+ // CKeditor instead of FCKeditor
 781+ $javascript_text = CKeditor_MediaWiki::ToggleScript();
 782+ }
773783 return $javascript_text;
774784 }
775785

Follow-up revisions

RevisionCommit summaryAuthorDate
r88592Added some code to improve FCKeditor display, from ontoprise; removed handlin...yaron18:12, 22 May 2011