XHTML fixes.
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 9 Apr 2004 01:37:41 +0000 (01:37 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 9 Apr 2004 01:37:41 +0000 (01:37 +0000)
includes/Article.php
includes/DifferenceEngine.php
includes/ImagePage.php
includes/OutputPage.php
includes/SearchEngine.php
includes/Skin.php
includes/SpecialImagelist.php
includes/SpecialIpblocklist.php
includes/SpecialUnusedimages.php

index 8305d3a..7ba998f 100644 (file)
@@ -791,7 +791,7 @@ class Article {
                if( ($old=wfFetchObject($res)) && !$confirm ) {
                        $skin=$wgUser->getSkin();
                        $wgOut->addHTML("<b>".wfMsg("historywarning"));
-                       $wgOut->addHTML( $skin->historyLink() ."</b><p>");
+                       $wgOut->addHTML( $skin->historyLink() ."</b>");
                }
 
                $sql="SELECT cur_text FROM cur WHERE cur_namespace=$ns and cur_title='$etitle'";
@@ -915,7 +915,7 @@ class Article {
 
                        $text = wfMsg( "deletedtext", $deleted, $loglink );
 
-                       $wgOut->addHTML( "<p>" . $text );
+                       $wgOut->addHTML( "<p>" . $text . "</p>\n" );
                        $wgOut->returnToMain( false );
                } else {
                        $wgOut->fatalError( wfMsg( "cannotdelete" ) );
index 4664515..28e95f1 100644 (file)
@@ -1114,7 +1114,7 @@ class TableDiffFormatter extends DiffFormatter
        }
 
        function emptyLine() {
-               return "<td colspan=2>&nbsp;</td>";
+               return "<td colspan='2'>&nbsp;</td>";
        }
 
        function contextLine( $line ) {
index 4ba864d..4373462 100644 (file)
@@ -100,10 +100,10 @@ class ImagePage extends Article {
                $res = wfQuery( $sql, DB_READ, "Article::imageLinks" );
 
                if ( 0 == wfNumRows( $res ) ) {
-                       $wgOut->addHtml( "<p>" . wfMsg( "nolinkstoimage" ) . "\n" );
+                       $wgOut->addHtml( "<p>" . wfMsg( "nolinkstoimage" ) . "</p>\n" );
                        return;
                }
-               $wgOut->addHTML( "<p>" . wfMsg( "linkstoimage" ) .  "\n<ul>" );
+               $wgOut->addHTML( "<p>" . wfMsg( "linkstoimage" ) .  "</p>\n<ul>" );
 
                $sk = $wgUser->getSkin();
                while ( $s = wfFetchObject( $res ) ) {
@@ -245,7 +245,7 @@ class ImagePage extends Article {
 
                $text = wfMsg( "deletedtext", $deleted, $loglink );
 
-               $wgOut->addHTML( "<p>" . $text );
+               $wgOut->addHTML( "<p>" . $text . "</p>\n" );
                $wgOut->returnToMain( false );
        }
 
index 4c11403..f42c9f8 100644 (file)
@@ -385,7 +385,7 @@ class OutputPage {
                $this->enableClientCache( false );
 
                $this->mBodytext = "";
-               $this->addHTML( "<p>" . wfMsg( $msg ) . "\n" );
+               $this->addHTML( "<p>" . wfMsg( $msg ) . "</p>\n" );
                $this->returnToMain( false );
 
                $this->output();
index 08607d4..dd512e9 100644 (file)
@@ -91,7 +91,7 @@ class SearchEngine {
 
                        $checked = "";
                        if ( $checkboxValue == 1 ) {
-                               $checked = " checked";
+                               $checked = " checked='checked'";
                                $this->addtoquery["ns{$i}"] = 1;
                                array_push( $this->namespacesToSearch, $i );
                        }
@@ -103,8 +103,8 @@ class SearchEngine {
                        if ( $tempText !== "" ) { 
                                $tempText .= " "; 
                        }
-                       $tempText .= "<input type=checkbox value=\"1\" name=\"" .
-                         "ns{$i}\"{$checked}>{$name}\n";
+                       $tempText .= "<input type='checkbox' value=\"1\" name=\"" .
+                         "ns{$i}\"{$checked} />{$name}\n";
                }
                $ret = str_replace ( "$1", $tempText, $ret );
 
@@ -113,25 +113,25 @@ class SearchEngine {
                $checked = "";
                if ( $listredirs == 1 ) {
                        $this->addtoquery["redirs"] = 1;
-                       $checked = " checked";
+                       $checked = " checked='checked'";
                }
-               $tempText = "<input type=checkbox value=1 name=\"redirs\"{$checked}>\n";
+               $tempText = "<input type='checkbox' value='1' name=\"redirs\"{$checked} />\n";
                $ret = str_replace( "$2", $tempText, $ret );
 
                # Search field
 
-               $tempText = "<input type=text name=\"search\" value=\"" .
-                       htmlspecialchars( $search ) ."\" width=80>\n";
+               $tempText = "<input type='text' name=\"search\" value=\"" .
+                       htmlspecialchars( $search ) ."\" width='80' />\n";
         $ret = str_replace( "$3", $tempText, $ret );
 
                # Searchx button
 
-               $tempText = "<input type=submit name=\"searchx\" value=\"" .
-                 wfMsg("powersearch") . "\">\n";
+               $tempText = "<input type='submit' name=\"searchx\" value=\"" .
+                 wfMsg("powersearch") . "\" />\n";
                $ret = str_replace( "$9", $tempText, $ret );
 
                global $wgScript;
-               $ret = "<br><br>\n<form id=\"powersearch\" method=\"get\" " .
+               $ret = "<br /><br />\n<form id=\"powersearch\" method=\"get\" " .
                  "action=\"$wgScript\">\n{$ret}\n</form>\n";
 
                if ( isset ( $searchx ) ) {
@@ -167,7 +167,7 @@ class SearchEngine {
                $this->parseQuery();
                if ( "" == $this->mTitlecond || "" == $this->mTextcond ) {
                        $wgOut->addHTML( "<h2>" . wfMsg( "badquery" ) . "</h2>\n" .
-                         "<p>" . wfMsg( "badquerytext" ) );
+                         "<p>" . wfMsg( "badquerytext" ) . "</p>\n" );
                        return;
                }
                list( $limit, $offset ) = wfCheckLimits( 20, "searchlimit" );
@@ -193,7 +193,7 @@ class SearchEngine {
                        $this->parseQuery();
                        if ( "" == $this->mTitlecond || "" == $this->mTextcond ) {
                                $wgOut->addHTML( "<h2>" . wfMsg( "badquery" ) . "</h2>\n" .
-                                 "<p>" . wfMsg( "badquerytext" ) );
+                                 "<p>" . wfMsg( "badquerytext" ) . "</p>\n" );
                                return;
                        }
                        list( $limit, $offset ) = wfCheckLimits( 20, "searchlimit" );
@@ -222,7 +222,7 @@ class SearchEngine {
                        } else {
                          $top = wfShowingResultsNum( $offset, $limit, $num );
                        }
-                       $wgOut->addHTML( "<p>{$top}\n" );
+                       $wgOut->addHTML( "<p>{$top}</p>\n" );
        
                        # For powersearch
        
@@ -234,7 +234,7 @@ class SearchEngine {
        
                        $sl = wfViewPrevNext( $offset, $limit, "",
                          "search=" . wfUrlencode( $this->mUsertext ) . $a2l );
-                       $wgOut->addHTML( "<br>{$sl}\n" );
+                       $wgOut->addHTML( "<br />{$sl}\n" );
        
                        $foundsome = false;
        
@@ -269,9 +269,9 @@ class SearchEngine {
                                $wgOut->addHTML( "</ol>\n" );
                        }
                        if ( ! $foundsome ) {
-                               $wgOut->addHTML( "<p>" . wfMsg( "nonefound" ) . "\n" );
+                               $wgOut->addHTML( "<p>" . wfMsg( "nonefound" ) . "</p>\n" );
                        }
-                       $wgOut->addHTML( "<p>{$sl}\n" );
+                       $wgOut->addHTML( "<p>{$sl}</p>\n" );
                        $wgOut->addHTML( $powersearch );
                }
        }
@@ -411,7 +411,7 @@ class SearchEngine {
                        $line = preg_replace( $pat2,
                          "<font color='red'>\\1</font>", $line );
 
-                       $wgOut->addHTML( "<br><small>{$lineno}: {$line}</small>\n" );
+                       $wgOut->addHTML( "<br /><small>{$lineno}: {$line}</small>\n" );
                }
                $wgOut->addHTML( "</li>\n" );
        }
@@ -464,7 +464,7 @@ class SearchEngine {
 
                # No match, generate an edit URL
                $t = Title::newFromText( $this->mUsertext );
-               $wgOut->addHTML( wfMsg("nogomatch", $t->escapeLocalURL( "action=edit" ) ) . "\n<p>" );
+               $wgOut->addHTML( "<p>" . wfMsg("nogomatch", $t->escapeLocalURL( "action=edit" ) ) . "</p>\n" );
 
                # Try a fuzzy title search
                $anyhit = false;
index 593b513..8803339 100644 (file)
@@ -1763,7 +1763,7 @@ class Skin {
        function beginImageHistoryList()
        {
                $s = "\n<h2>" . wfMsg( "imghistory" ) . "</h2>\n" .
-                 "<p>" . wfMsg( "imghistlegend" ) . "\n<ul class='special'>";
+                 "<p>" . wfMsg( "imghistlegend" ) . "</p>\n<ul class='special'>";
                return $s;
        }
 
@@ -2204,7 +2204,7 @@ class Skin {
           and by the user contributions list. It is responsible for formatting edit
           comments. It escapes any HTML in the comment, but adds some CSS to format
           auto-generated comments (from section editing) and formats [[wikilinks]].
-          Main author: Erik Möller (moeller@scireview.de)
+          Main author: Erik Möller (moeller@scireview.de)
        */
        function formatComment($comment)
        {
index 7432ebc..39737fe 100644 (file)
@@ -38,11 +38,11 @@ function wfSpecialImagelist()
                $lt = $wgLang->formatNum( "${limit}" );
                $sql .= " LIMIT {$limit}";
        }
-       $wgOut->addHTML( "<p>" . wfMsg( "imglegend" ) . "\n" );
+       $wgOut->addHTML( "<p>" . wfMsg( "imglegend" ) . "</p>\n" );
 
        $text = wfMsg( "imagelisttext",
                "<strong>{$lt}</strong>", "<strong>{$st}</strong>" );
-       $wgOut->addHTML( "<p>{$text}\n<p>" );
+       $wgOut->addHTML( "<p>{$text}\n</p>" );
 
        $sk = $wgUser->getSkin();
        $cap = wfMsg( "ilshowmatch" );
@@ -52,9 +52,8 @@ function wfSpecialImagelist()
 
        $wgOut->addHTML( "<form id=\"imagesearch\" method=\"post\" action=\"" .
          "{$action}\">" .
-         "{$cap}: <input type=text size=8 name=\"wpIlMatch\" value=\"\"> " .
-         "<input type=submit name=\"wpIlSubmit\" value=\"{$sub}\"></form>" );
-
+         "{$cap}: <input type='text' size='8' name=\"wpIlMatch\" value=\"\" /> " .
+         "<input type='submit' name=\"wpIlSubmit\" value=\"{$sub}\" /></form>" );
        $nums = array( 50, 100, 250, 500 );
        $here = $wgLang->specialPage( "Imagelist" );
 
@@ -68,7 +67,7 @@ function wfSpecialImagelist()
                  "sort=bysize&limit={$num}" );
        }
        $text = wfMsg( "showlast", $fill, $bysize );
-       $wgOut->addHTML( "{$text}<br>\n" );
+       $wgOut->addHTML( "<p>{$text}<br />\n" );
 
        $fill = "";
        $first = true;
@@ -80,7 +79,7 @@ function wfSpecialImagelist()
                  "sort=bydate&limit={$num}" );
        }
        $text = wfMsg( "showlast", $fill, $bydate );
-       $wgOut->addHTML( "{$text}<br>\n<p>" );
+       $wgOut->addHTML( "{$text}</p>\n<p>" );
 
        $res = wfQuery( $sql, DB_READ, "wfSpecialImagelist" );
        while ( $s = wfFetchObject( $res ) ) {
@@ -103,8 +102,9 @@ function wfSpecialImagelist()
                if ( "" != $s->img_description ) {
                        $l .= " <em>({$s->img_description})</em>";
                }
-               $wgOut->addHTML( "{$l}<br>\n" );
+               $wgOut->addHTML( "{$l}<br />\n" );
        }
+       $wgOut->addHTML( "</p>" );
        wfFreeResult( $res );
 }
 
index f4547df..5b16cb1 100644 (file)
@@ -49,23 +49,31 @@ class IPUnblockForm {
 
                if ( "" != $err ) {
                        $wgOut->setSubtitle( wfMsg( "formerror" ) );
-                       $wgOut->addHTML( "<p><font color='red' size='+1'>{$err}</font>\n" );
+                       $wgOut->addHTML( "<p class='error'>{$err}</p>\n" );
                }
                
-               $wgOut->addHTML( "<p>
+               $wgOut->addHTML( "
 <form id=\"unblockip\" method=\"post\" action=\"{$action}\">
-<table border=0><tr>
-<td align=right>{$ipa}:</td>
-<td align=left>
-<input tabindex=1 type=text size=20 name=\"wpUnblockAddress\" value=\"" . htmlspecialchars( $this->ip ) . "\">
-</td></tr><tr>
-<td align=right>{$ipr}:</td>
-<td align=left>
-<input tabindex=1 type=text size=40 name=\"wpUnblockReason\" value=\"" . htmlspecialchars( $this->reason ) . "\">
-</td></tr><tr>
-<td>&nbsp;</td><td align=left>
-<input tabindex=2 type=submit name=\"wpBlock\" value=\"{$ipus}\">
-</td></tr></table>
+       <table border='0'>
+               <tr>
+                       <td align='right'>{$ipa}:</td>
+                       <td align='left'>
+                               <input tabindex='1' type='text' size='20' name=\"wpUnblockAddress\" value=\"" . htmlspecialchars( $this->ip ) . "\" />
+                       </td>
+               </tr>
+               <tr>
+                       <td align='right'>{$ipr}:</td>
+                       <td align='left'>
+                               <input tabindex='1' type='text' size='40' name=\"wpUnblockReason\" value=\"" . htmlspecialchars( $this->reason ) . "\" />
+                       </td>
+               </tr>
+               <tr>
+                       <td>&nbsp;</td>
+                       <td align='left'>
+                               <input tabindex='2' type='submit' name=\"wpBlock\" value=\"{$ipus}\" />
+                       </td>
+               </tr>
+       </table>
 </form>\n" );
 
        }
index 5f05a31..09ac253 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 
-function wfSpecialUnusedimages()
-{
+function wfSpecialUnusedimages() {
        global $wgUser, $wgOut, $wgLang, $wgTitle;
        $fname = "wfSpecialUnusedimages";
 
@@ -20,10 +19,10 @@ function wfSpecialUnusedimages()
 
        $sl = wfViewPrevNext( $offset, $limit,
          $wgLang->specialPage( "Unusedimages" ) );
-       $wgOut->addHTML( "<br>{$sl}\n" );
+       $wgOut->addHTML( "<br />{$sl}</p>\n" );
 
        $ins = $wgLang->getNsText ( 6 ) ;
-       $s = "<ol start=" . ( $offset + 1 ) . ">";
+       $s = "<ol start='" . ( $offset + 1 ) . "'>";
        while ( $obj = wfFetchObject( $res ) ) {
                $name = $obj->img_name;
                $dlink = $sk->makeKnownLink( "{$ins}:{$name}", wfMsg( "imgdesc" ) );
@@ -43,9 +42,9 @@ function wfSpecialUnusedimages()
                $s .= "</li>\n";
        }
        wfFreeResult( $res );
-       $s .= "</ol>";
+       $s .= "</ol>\n\n";
        $wgOut->addHTML( $s );
-       $wgOut->addHTML( "<p>{$sl}\n" );
+       $wgOut->addHTML( "<p>{$sl}</p>\n" );
 }
 
 ?>