Index: trunk/extensions/SemanticForms/includes/SF_FormUtils.php |
— | — | @@ -373,13 +373,13 @@ |
374 | 374 | global $wgUser, $wgDefaultUserOptions; |
375 | 375 | |
376 | 376 | $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' ) ) { |
378 | 378 | $showFCKEditor += RTE_VISIBLE; |
379 | 379 | } |
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' ) ) { |
381 | 381 | $showFCKEditor += RTE_POPUP; |
382 | 382 | } |
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' ) ) { |
384 | 384 | $showFCKEditor += RTE_TOGGLE_LINK; |
385 | 385 | } |
386 | 386 | |
— | — | @@ -440,7 +440,8 @@ |
441 | 441 | $wgFCKEditorDir .= '/'; |
442 | 442 | } |
443 | 443 | |
444 | | - $javascript_text .= <<<END |
| 444 | + if ( class_exists('FCKeditor') ) { |
| 445 | + $javascript_text .= <<<END |
445 | 446 | var oFCKeditor = new FCKeditor( "free_text" ); |
446 | 447 | |
447 | 448 | //Set config |
— | — | @@ -659,12 +660,17 @@ |
660 | 661 | addOnloadHook( initEditor ); |
661 | 662 | |
662 | 663 | END; |
| 664 | + } else { |
| 665 | + // CKeditor instead of FCKeditor |
| 666 | + $javascript_text = CKeditor_MediaWiki::InitializeScripts('free_text', $newWinMsg); |
| 667 | + } |
663 | 668 | return $javascript_text; |
664 | 669 | } |
665 | 670 | |
666 | 671 | static function FCKToggleJavascript() { |
667 | 672 | // add toggle link and handler |
668 | | - $javascript_text = <<<END |
| 673 | + if ( class_exists('FCKeditor') ) { |
| 674 | + $javascript_text = <<<END |
669 | 675 | |
670 | 676 | function ToggleFCKEditor(mode, objId) |
671 | 677 | { |
— | — | @@ -769,6 +775,10 @@ |
770 | 776 | } |
771 | 777 | |
772 | 778 | END; |
| 779 | + } else { |
| 780 | + // CKeditor instead of FCKeditor |
| 781 | + $javascript_text = CKeditor_MediaWiki::ToggleScript(); |
| 782 | + } |
773 | 783 | return $javascript_text; |
774 | 784 | } |
775 | 785 | |