Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php |
— | — | @@ -359,8 +359,8 @@ |
360 | 360 | $original_page_content = $existing_page_content; |
361 | 361 | } else { |
362 | 362 | $original_page_content = null; |
363 | | - if ( $wgRequest->getCheck( 'free_text' ) ) { |
364 | | - $existing_page_content = $wgRequest->getVal( 'free_text' ); |
| 363 | + if ( $wgRequest->getCheck( 'sf_free_text' ) ) { |
| 364 | + $existing_page_content = $wgRequest->getVal( 'sf_free_text' ); |
365 | 365 | $form_is_partial = true; |
366 | 366 | } |
367 | 367 | } |
— | — | @@ -951,7 +951,7 @@ |
952 | 952 | // the page, using <free_text> tags - once all the free text |
953 | 953 | // is known (at the end), it will get substituted in. |
954 | 954 | if ( $is_hidden ) { |
955 | | - $new_text = Html::hidden( 'free_text', '!free_text!' ); |
| 955 | + $new_text = Html::hidden( 'sf_free_text', '!free_text!' ); |
956 | 956 | } else { |
957 | 957 | $sfgTabIndex++; |
958 | 958 | $sfgFieldNum++; |
— | — | @@ -970,7 +970,7 @@ |
971 | 971 | } |
972 | 972 | } |
973 | 973 | } |
974 | | - $new_text = SFTextAreaInput::getHTML( $default_value, 'free_text', false, ( $form_is_disabled || $is_restricted ), $field_args ); |
| 974 | + $new_text = SFTextAreaInput::getHTML( $default_value, 'sf_free_text', false, ( $form_is_disabled || $is_restricted ), $field_args ); |
975 | 975 | if ( in_array( 'edittools', $free_text_components ) ) { |
976 | 976 | // borrowed from EditPage::showEditTools() |
977 | 977 | $options[] = 'parse'; |
— | — | @@ -1228,7 +1228,7 @@ |
1229 | 1229 | // reason don't submit their value. |
1230 | 1230 | if ( $form_field->isDisabled() ) { |
1231 | 1231 | if ( $field_name == 'free text' || $field_name == '<freetext>' ) { |
1232 | | - $new_text .= Html::hidden( 'free_text', '!free_text!' ); |
| 1232 | + $new_text .= Html::hidden( 'sf_free_text', '!free_text!' ); |
1233 | 1233 | } else { |
1234 | 1234 | $new_text .= Html::hidden( $input_name, $cur_value ); |
1235 | 1235 | } |
— | — | @@ -1463,7 +1463,7 @@ |
1464 | 1464 | // if it wasn't included in the form definition, add the |
1465 | 1465 | // 'free text' input as a hidden field at the bottom |
1466 | 1466 | if ( ! $free_text_was_included ) { |
1467 | | - $form_text .= Html::hidden( 'free_text', '!free_text!' ); |
| 1467 | + $form_text .= Html::hidden( 'sf_free_text', '!free_text!' ); |
1468 | 1468 | } |
1469 | 1469 | // Get free text, and add to page data, as well as retroactively |
1470 | 1470 | // inserting it into the form. |
— | — | @@ -1487,8 +1487,8 @@ |
1488 | 1488 | // page hasn't already been inserted into the form |
1489 | 1489 | $free_text = trim( $existing_page_content ); |
1490 | 1490 | // or get it from a form submission |
1491 | | - } elseif ( $wgRequest->getCheck( 'free_text' ) ) { |
1492 | | - $free_text = $wgRequest->getVal( 'free_text' ); |
| 1491 | + } elseif ( $wgRequest->getCheck( 'sf_free_text' ) ) { |
| 1492 | + $free_text = $wgRequest->getVal( 'sf_free_text' ); |
1493 | 1493 | if ( ! $free_text_was_included ) { |
1494 | 1494 | $data_text .= "!free_text!"; |
1495 | 1495 | } |
Index: trunk/extensions/SemanticForms/includes/SF_FormUtils.php |
— | — | @@ -443,7 +443,7 @@ |
444 | 444 | } |
445 | 445 | |
446 | 446 | $javascript_text .= <<<END |
447 | | -var oFCKeditor = new FCKeditor( "free_text" ); |
| 447 | +var oFCKeditor = new FCKeditor( "sf_free_text" ); |
448 | 448 | |
449 | 449 | //Set config |
450 | 450 | oFCKeditor.BasePath = '$wgScriptPath/$wgFCKEditorDir'; |
— | — | @@ -478,7 +478,7 @@ |
479 | 479 | return y; |
480 | 480 | } |
481 | 481 | function getWindowHeight4editor() { |
482 | | - var fsize = getFontSize('free_text'); |
| 482 | + var fsize = getFontSize('sf_free_text'); |
483 | 483 | // if value was not determined, return default val from $wgFCKEditorHeight |
484 | 484 | if (!fsize) return $FCKEditorHeight; |
485 | 485 | if (fsize.indexOf('px') == -1) // we didn't get pixels |
— | — | @@ -495,7 +495,7 @@ |
496 | 496 | if (!(showFCKEditor & RTE_VISIBLE)) |
497 | 497 | showFCKEditor += RTE_VISIBLE; |
498 | 498 | firstLoad = false; |
499 | | - realTextarea = document.getElementById('free_text'); |
| 499 | + realTextarea = document.getElementById('sf_free_text'); |
500 | 500 | if ( realTextarea ) |
501 | 501 | { |
502 | 502 | // Create the editor instance and replace the textarea. |
— | — | @@ -522,7 +522,7 @@ |
523 | 523 | // if we have FCK enabled, behave differently... |
524 | 524 | if ( showFCKEditor & RTE_VISIBLE ) |
525 | 525 | { |
526 | | - SRCiframe = oDoc.getElementById ('free_text___Frame') ; |
| 526 | + SRCiframe = oDoc.getElementById ('sf_free_text___Frame') ; |
527 | 527 | if ( SRCiframe ) |
528 | 528 | { |
529 | 529 | if (window.frames[SRCiframe]) |
— | — | @@ -545,7 +545,7 @@ |
546 | 546 | } |
547 | 547 | else |
548 | 548 | { |
549 | | - txtarea = oDoc.editform.free_text ; |
| 549 | + txtarea = oDoc.editform.sf_free_text ; |
550 | 550 | } |
551 | 551 | } |
552 | 552 | else |
— | — | @@ -642,24 +642,24 @@ |
643 | 643 | } |
644 | 644 | function initEditor() |
645 | 645 | { |
646 | | - var toolbar = document.getElementById('free_text'); |
| 646 | + var toolbar = document.getElementById('sf_free_text'); |
647 | 647 | //show popup or toogle link |
648 | 648 | if (showFCKEditor & (RTE_POPUP|RTE_TOGGLE_LINK)){ |
649 | 649 | var fckTools = document.createElement('div'); |
650 | 650 | fckTools.setAttribute('id', 'fckTools'); |
651 | 651 | |
652 | | - var SRCtextarea = document.getElementById( "free_text" ) ; |
| 652 | + var SRCtextarea = document.getElementById( "sf_free_text" ) ; |
653 | 653 | if (showFCKEditor & RTE_VISIBLE) SRCtextarea.style.display = "none"; |
654 | 654 | } |
655 | 655 | |
656 | 656 | if (showFCKEditor & RTE_TOGGLE_LINK) |
657 | 657 | { |
658 | | - fckTools.innerHTML='[<a class="fckToogle" id="toggle_free_text" href="javascript:void(0)" onclick="ToggleFCKEditor(\'toggle\',\'free_text\')">'+ editorLink +'</a>] '; |
| 658 | + fckTools.innerHTML='[<a class="fckToogle" id="toggle_sf_free_text" href="javascript:void(0)" onclick="ToggleFCKEditor(\'toggle\',\'sf_free_text\')">'+ editorLink +'</a>] '; |
659 | 659 | } |
660 | 660 | if (showFCKEditor & RTE_POPUP) |
661 | 661 | { |
662 | 662 | var style = (showFCKEditor & RTE_VISIBLE) ? 'style="display:none"' : ""; |
663 | | - fckTools.innerHTML+='<span ' + style + ' id="popup_free_text">[<a class="fckPopup" href="javascript:void(0)" onclick="ToggleFCKEditor(\'popup\',\'free_text\')">{$newWinMsg}</a>]</span>'; |
| 663 | + fckTools.innerHTML+='<span ' + style + ' id="popup_sf_free_text">[<a class="fckPopup" href="javascript:void(0)" onclick="ToggleFCKEditor(\'popup\',\'sf_free_text\')">{$newWinMsg}</a>]</span>'; |
664 | 664 | } |
665 | 665 | |
666 | 666 | if (showFCKEditor & (RTE_POPUP|RTE_TOGGLE_LINK)){ |
Index: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php |
— | — | @@ -137,6 +137,7 @@ |
138 | 138 | |
139 | 139 | $parser->setFunctionHook( 'forminput', array( 'SFParserFunctions', 'renderFormInput' ) ); |
140 | 140 | $parser->setFunctionHook( 'formlink', array( 'SFParserFunctions', 'renderFormLink' ) ); |
| 141 | + $parser->setFunctionHook( 'queryformlink', array( 'SFParserFunctions', 'renderQueryFormLink' ) ); |
141 | 142 | if ( defined( get_class( $parser ) . '::SFH_OBJECT_ARGS' ) ) { |
142 | 143 | $parser->setFunctionHook( 'arraymap', array( 'SFParserFunctions', 'renderArrayMapObj' ), SFH_OBJECT_ARGS ); |
143 | 144 | $parser->setFunctionHook( 'arraymaptemplate', array( 'SFParserFunctions', 'renderArrayMapTemplateObj' ), SFH_OBJECT_ARGS ); |
— | — | @@ -156,7 +157,6 @@ |
157 | 158 | } |
158 | 159 | |
159 | 160 | static function renderFormLink ( &$parser ) { |
160 | | - |
161 | 161 | $params = func_get_args(); |
162 | 162 | array_shift( $params ); // We don't need the parser. |
163 | 163 | |
— | — | @@ -165,6 +165,15 @@ |
166 | 166 | return $parser->insertStripItem( SFUtils::createFormLink( $parser, 'FormEdit', $params ), $parser->mStripState ); |
167 | 167 | } |
168 | 168 | |
| 169 | + static function renderQueryFormLink ( &$parser ) { |
| 170 | + $params = func_get_args(); |
| 171 | + array_shift( $params ); // We don't need the parser. |
| 172 | + |
| 173 | + // hack to remove newline from beginning of output, thanks to |
| 174 | + // http://jimbojw.com/wiki/index.php?title=Raw_HTML_Output_from_a_MediaWiki_Parser_Function |
| 175 | + return $parser->insertStripItem( SFUtils::createFormLink( $parser, 'RunQuery', $params ), $parser->mStripState ); |
| 176 | + } |
| 177 | + |
169 | 178 | static function renderFormInput ( &$parser ) { |
170 | 179 | global $wgVersion; |
171 | 180 | |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_TextAreaInput.php |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | global $sfgTabIndex, $sfgFieldNum; |
38 | 38 | |
39 | 39 | // Use a special ID for the free text field, for FCK's needs. |
40 | | - $input_id = $input_name == 'free_text' ? 'free_text' : "input_$sfgFieldNum"; |
| 40 | + $input_id = $input_name == 'sf_free_text' ? 'sf_free_text' : "input_$sfgFieldNum"; |
41 | 41 | |
42 | 42 | if ( array_key_exists( 'editor', $other_args ) && |
43 | 43 | $other_args['editor'] == 'wikieditor' && |