Index: extensions/SemanticForms/includes/SF_FormPrinter.php =================================================================== --- extensions/SemanticForms/includes/SF_FormPrinter.php (original) +++ extensions/SemanticForms/includes/SF_FormPrinter.php (patched version) @@ -161,6 +161,14 @@ global $sfgAdderButtons; // initialize some variables + /*op-patch|KK|2009-11-04|FCKeditor|use separate variable for FCK Options|start*/ + /*op-patch|KK|2009-11-04|FCKeditor|use separate variable for FCK Options|doc|http://dmwiki.ontoprise.com:8888/dmwiki/index.php/Use_rows_parameter_for_FCK_editor_window_height_in_SF*/ + $fck_options = array(); + /*op-patch|KK|2009-11-04|FCKeditor|use separate variable for FCK Options|end*/ + /*op-patch|DH|2009-04-22|"WYSIWYG" in info tag|start*/ + /*op-patch|DH|2009-04-22|"WYSIWYG" in info tag|doc|http://dmwiki.ontoprise.com:8888/dmwiki/index.php/WYSIWYG_in_info_tag*/ + $show_FCKEditor = false; + /*op-patch|DH|2009-04-22|"WYSIWYG" in info tag|end*/ $sfgTabIndex = 1; $sfgFieldNum = 1; $source_page_matches_this_form = false; @@ -707,9 +715,19 @@ $new_text = SFFormUtils::hiddenFieldHTML( 'free_text', '!free_text!' ); } else { if ( ! array_key_exists( 'rows', $field_args ) ) - $field_args['rows'] = 5; - if ( ! array_key_exists( 'cols', $field_args ) ) - $field_args['cols'] = 80; + /*op-patch|KK|2009-11-04|FCKeditor|use rows parameter for editor window height|start*/ + /*op-patch|KK|2009-11-04|FCKeditor|use rows parameter for editor window height|doc|http://dmwiki.ontoprise.com:8888/dmwiki/index.php/Use_rows_parameter_for_FCK_editor_window_height_in_SF*/ + $fck_options['rows'] = 5; + else + $fck_options['rows'] = $field_args['rows']; + /*op-patch|KK|2009-11-04|FCKeditor|use rows parameter for editor window height|end*/ + if (! array_key_exists('cols', $field_args)) + /*op-patch|KK|2009-11-04|FCKeditor|use cols parameter for editor window width|start*/ + /*op-patch|KK|2009-11-04|FCKeditor|use rows parameter for editor window width|doc|http://dmwiki.ontoprise.com:8888/dmwiki/index.php/Use_rows_parameter_for_FCK_editor_window_height_in_SF*/ + $fck_options['cols'] = 80; + else + $fck_options['cols'] = $field_args['cols']; + /*op-patch|KK|2009-11-04|FCKeditor|use cols parameter for editor window width|end*/ $sfgTabIndex++; $sfgFieldNum++; if ( $cur_value == '' ) { @@ -1053,7 +1071,12 @@ foreach ( array_slice( $tag_components, 1 ) as $component ) { $sub_components = explode( '=', $component, 2 ); $tag = $sub_components[0]; - if ( $tag == 'create title' || $tag == 'add title' ) { + /*op-patch|DH|2009-26-08|SF|free text in includeonly tags and rest in noinclude tags|end*/ + /*op-patch|DH|2009-04-22|"WYSIWYG" in info tag|start*/ + if (($tag == 'WYSIWYG') && (strpos($existing_page_content, '__NORICHEDITOR__') === false)) { + $show_FCKEditor = true; + } elseif ( $tag == 'create title' || $tag == 'add title' ) { + /*op-patch|DH|2009-04-22|"WYSIWYG" in info tag|end*/ // handle this only if we're adding a page if ( ! $this->mPageTitle->exists() ) { $form_page_title = $sub_components[1]; @@ -1206,7 +1229,9 @@ } // if the FCKeditor extension is installed, use that for the free text input global $wgFCKEditorDir; - if ( $wgFCKEditorDir && strpos( $existing_page_content, '__NORICHEDITOR__' ) === false ) { + /*op-patch|DH|2009-04-22|"WYSIWYG" in info tag|start*/ + if ( $wgFCKEditorDir && strpos( $existing_page_content, '__NORICHEDITOR__' ) === false && $show_FCKEditor) { + /*op-patch|DH|2009-04-22|"WYSIWYG" in info tag|end*/ $showFCKEditor = SFFormUtils::getShowFCKEditor(); if ( !$form_submitted && ( $showFCKEditor & RTE_VISIBLE ) ) { $free_text = SFFormUtils::prepareTextForFCK( $free_text ); @@ -1250,7 +1275,11 @@ // add Javascript code for form-wide use $javascript_text = ""; if ( $free_text_was_included && $showFCKEditor > 0 ) { - $javascript_text .= SFFormUtils::mainFCKJavascript( $showFCKEditor ); + /*op-patch|SR|2009-06-04|FCKeditor|use rows parameter for editor window height|start*/ + /*op-patch|SR|2009-06-04|FCKeditor|use rows parameter for editor window height|doc|http://dmwiki.ontoprise.com:8888/dmwiki/index.php/Use_rows_parameter_for_FCK_editor_window_height_in_SF*/ + $rowParam = isset( $fck_options['rows'] ) && $fck_options['rows'] > 0 ? $fck_options['rows'] : 5; + $javascript_text .= SFFormUtils::mainFCKJavascript( $showFCKEditor, $rowParam ); + /*op-patch|SR|2009-06-04|FCKeditor|use rows parameter for editor window height|end*/ if ( $showFCKEditor & ( RTE_TOGGLE_LINK | RTE_POPUP ) ) { $javascript_text .= SFFormUTils::FCKToggleJavascript(); } Index: extensions/SemanticForms/includes/SF_FormUtils.php =================================================================== --- extensions/SemanticForms/includes/SF_FormUtils.php (original) +++ extensions/SemanticForms/includes/SF_FormUtils.php (patched version) @@ -342,19 +348,32 @@ static function prepareTextForFCK( $text ) { global $wgTitle; - - $options = new FCKeditorParserOptions(); + /*op-patch|SR|2010-12-06|CKeditor|check for FCK or CK|start*/ + if (class_exists('FCKeditor')) { + $classParser = 'FCKeditorParser'; + $classParserOptions = 'FCKeditorParserOptions'; + } + else if (class_exists('CKEditor')) { + $classParser = 'CKeditorParser'; + $classParserOptions = 'CKeditorParserOptions'; + } + $options = new $classParserOptions(); $options->setTidy( true ); - $parser = new FCKeditorParser(); + $parser = new $classParser(); + /*op-patch|SR|2010-12-06|CKeditor|check for FCK or CK|end*/ $parser->setOutputType( OT_HTML ); $text = $parser->parse( $text, $wgTitle, $options )->getText(); return $text; } - static function mainFCKJavascript( $showFCKEditor ) { + static function mainFCKJavascript( $showFCKEditor, $rowsHeight= 5 ) { global $wgUser, $wgScriptPath, $wgFCKEditorExtDir, $wgFCKEditorDir, $wgFCKEditorToolbarSet, $wgFCKEditorHeight; global $wgHooks, $wgExtensionFunctions; + /*op-patch|SR|2009-06-04|FCKeditor|use rows parameter for editor window height|start*/ + /*op-patch|SR|2009-06-04|FCKeditor|use rows parameter for editor window height|doc|http://dmwiki.ontoprise.com:8888/dmwiki/index.php/Use_rows_parameter_for_FCK_editor_window_height_in_SF*/ + $FCKEditorHeight = ($wgFCKEditorHeight < 300) ? 300 : $wgFCKEditorHeight; + /*op-patch|SR|2009-06-04|FCKeditor|use rows parameter for editor window height|end*/ $newWinMsg = wfMsg( 'rich_editor_new_window' ); $javascript_text = ' var showFCKEditor = ' . $showFCKEditor . '; @@ -386,7 +405,10 @@ if ( substr( $wgFCKEditorDir, -1 ) != '/' ) { $wgFCKEditorDir .= '/'; } - + /*op-patch|SR|2010-12-06|CKeditor|check for FCK or CK|start*/ + $RichEditor = class_exists('CKEditor') ? 'cke' : 'fck'; + if ($RichEditor == 'fck') { + /*op-patch|SR|2010-12-06|CKeditor|check for FCK or CK|end*/ $javascript_text .= <<