Index: trunk/extensions/SemanticForms/specials/SF_RunQuery.php |
— | — | @@ -56,10 +56,11 @@ |
57 | 57 | $raw = $wgRequest->getBool( 'raw', false ); |
58 | 58 | } |
59 | 59 | $form_submitted = ( $run_query ); |
60 | | - if ( $raw ) |
| 60 | + if ( $raw ) { |
61 | 61 | $wgOut->setArticleBodyOnly( true ); |
62 | | - // if user already made some action, ignore the edited |
63 | | - // page and just get data from the query string |
| 62 | + } |
| 63 | + // If user already made some action, ignore the edited |
| 64 | + // page and just get data from the query string. |
64 | 65 | if ( !$embedded && $wgRequest->getVal( 'query' ) == 'true' ) { |
65 | 66 | $edit_content = null; |
66 | 67 | $is_text_source = false; |
— | — | @@ -114,19 +115,21 @@ |
115 | 116 | $action = htmlspecialchars( SpecialPage::getTitleFor( "RunQuery", $form_name )->getLocalURL() ); |
116 | 117 | $text .= <<<END |
117 | 118 | <form id="sfForm" name="createbox" action="$action" method="post" class="createbox"> |
118 | | - <input type="hidden" name="query" value="true" /> |
119 | 119 | |
120 | 120 | END; |
| 121 | + $text .= "\t" . Xml::hidden( 'query', 'true' ) . "\n"; |
121 | 122 | $text .= $form_text; |
122 | 123 | } |
123 | 124 | if ( $embedded ) { |
124 | 125 | $text = "<div class='runQueryEmbedded'>$text</div>"; |
125 | 126 | } |
126 | 127 | |
| 128 | + // Armor against doBlockLevels() |
| 129 | + $text = preg_replace( '/^ +/m', '', $text ); |
127 | 130 | // Now write everything to the screen. |
128 | 131 | $wgOut->addHTML( $text ); |
129 | 132 | SFUtils::addJavascriptAndCSS( $embedded ? $wgParser : null ); |
130 | | - $script = ' <script type="text/javascript">' . "\n" . $javascript_text . '</script>' . "\n"; |
| 133 | + $script = "\t\t" . '<script type="text/javascript">' . "\n" . $javascript_text . '</script>' . "\n"; |
131 | 134 | if ( $embedded ) { |
132 | 135 | $wgParser->getOutput()->addHeadItem( $script ); |
133 | 136 | } else { |