Index: trunk/extensions/SemanticForms/specials/SF_FormEdit.php |
— | — | @@ -66,7 +66,7 @@ |
67 | 67 | // get contents of form and target page - if there's only one, |
68 | 68 | // it might be a target with only alternate forms |
69 | 69 | if ( $form_name == '' ) { |
70 | | - $wgOut->addHTML( "<p class='error'>" . wfMsg( 'sf_formedit_badurl' ) . '</p>' ); |
| 70 | + $wgOut->addHTML( Xml::element( 'p', array( 'class' => 'error' ), wfMsg( 'sf_formedit_badurl' ) ) ); |
71 | 71 | return; |
72 | 72 | } elseif ( $target_name == '' ) { |
73 | 73 | // parse the form to see if it has a 'page name' value set |
— | — | @@ -83,7 +83,7 @@ |
84 | 84 | $page_name_formula = substr( $page_name_formula, 0, $pos ); |
85 | 85 | } |
86 | 86 | } elseif ( count( $alt_forms ) == 0 ) { |
87 | | - $wgOut->addWikiText( "<p class='error'>" . wfMsg( 'sf_formedit_badurl' ) . '</p>' ); |
| 87 | + $wgOut->addHTML( Xml::element( 'p', array( 'class' => 'error' ), wfMsg( 'sf_formedit_badurl' ) ) ); |
88 | 88 | return; |
89 | 89 | } |
90 | 90 | } |
— | — | @@ -117,17 +117,18 @@ |
118 | 118 | |
119 | 119 | if ( ! $form_title || ! $form_title->exists() ) { |
120 | 120 | if ( $form_name == '' ) { |
121 | | - $text = '<p class="error">' . wfMsg( 'sf_formedit_badurl' ) . "</p>\n"; |
| 121 | + $text = Xml::element( 'p', array( 'class' => 'error' ), wfMsg( 'sf_formedit_badurl' ) ) . "\n"; |
122 | 122 | } else { |
123 | 123 | if ( count( $alt_forms ) > 0 ) { |
124 | 124 | $text .= '<div class="infoMessage">' . wfMsg( 'sf_formedit_altformsonly' ) . ' '; |
125 | 125 | $text .= self::printAltFormsList( $alt_forms, $form_name ); |
126 | 126 | $text .= "</div>\n"; |
127 | | - } else |
128 | | - $text = '<p class="error">' . wfMsg( 'sf_formstart_badform', SFUtils::linkText( SF_NS_FORM, $form_name ) ) . ".</p>\n"; |
| 127 | + } else { |
| 128 | + $text = Xml::tags( 'p', array( 'class' => 'error' ), wfMsg( 'sf_formstart_badform', SFUtils::linkText( SF_NS_FORM, $form_name ) ) ) . "\n"; |
| 129 | + } |
129 | 130 | } |
130 | 131 | } elseif ( $target_name == '' && $page_name_formula == '' ) { |
131 | | - $text = '<p class="error">' . wfMsg( 'sf_formedit_badurl' ) . "</p>\n"; |
| 132 | + $text = Xml::element( 'p', array( 'class' => 'error' ), wfMsg( 'sf_formedit_badurl' ) ) . "\n"; |
132 | 133 | } else { |
133 | 134 | $form_article = new Article( $form_title ); |
134 | 135 | $form_definition = $form_article->getContent(); |
Index: trunk/extensions/SemanticForms/specials/SF_RunQuery.php |
— | — | @@ -33,9 +33,8 @@ |
34 | 34 | $form_title = Title::makeTitleSafe( SF_NS_FORM, $form_name ); |
35 | 35 | |
36 | 36 | if ( ! $form_title || ! $form_title->exists() ) { |
37 | | - $javascript_text = ""; |
38 | 37 | if ( $form_name == '' ) { |
39 | | - $text = '<p class="error">' . wfMsg( 'sf_runquery_badurl' ) . "</p>\n"; |
| 38 | + $text = Xml::element( 'p', array( 'class' => 'error' ), wfMsg( 'sf_runquery_badurl' ) ) . "\n"; |
40 | 39 | } else { |
41 | 40 | $text = '<p class="error">Error: No form page was found at ' . SFUtils::linkText( SF_NS_FORM, $form_name ) . ".</p>\n"; |
42 | 41 | } |
— | — | @@ -120,12 +119,13 @@ |
121 | 120 | END; |
122 | 121 | $text .= $form_text; |
123 | 122 | } |
124 | | - if ( $embedded ) |
| 123 | + if ( $embedded ) { |
125 | 124 | $text = "<div class='runQueryEmbedded'>$text</div>"; |
| 125 | + } |
126 | 126 | |
127 | 127 | // Now write everything to the screen. |
128 | 128 | $wgOut->addHTML( $text ); |
129 | | - SFUtils::addJavascriptAndCSS( $embedded ? $wgParser:null ); |
| 129 | + SFUtils::addJavascriptAndCSS( $embedded ? $wgParser : null ); |
130 | 130 | $script = ' <script type="text/javascript">' . "\n" . $javascript_text . '</script>' . "\n"; |
131 | 131 | if ( $embedded ) { |
132 | 132 | $wgParser->getOutput()->addHeadItem( $script ); |