Replaced all instances of <<<END (which breaks vim syntax highlighting), with a type...
authorTim Starling <tstarling@users.mediawiki.org>
Mon, 7 Dec 2009 08:51:52 +0000 (08:51 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Mon, 7 Dec 2009 08:51:52 +0000 (08:51 +0000)
15 files changed:
includes/EditPage.php
includes/Skin.php
includes/db/DatabaseIbm_db2.php
includes/db/DatabasePostgres.php
includes/specials/SpecialLockdb.php
includes/specials/SpecialUnlockdb.php
maintenance/importImages.php
maintenance/importUseModWiki.php
maintenance/language/checkDupeMessages.php
maintenance/language/checkExtensions.php
maintenance/language/rebuildLanguage.php
maintenance/language/transstat.php
skins/Simple.php
skins/common/edit.js
tests/SearchEngineTest.php

index 3d4d192..9f01ee0 100644 (file)
@@ -1299,10 +1299,10 @@ class EditPage {
                        $toolbar = '';
                        // @todo move this to a cleaner conditional instead of blanking a variable
                }
-               $wgOut->addHTML( <<<END
+               $wgOut->addHTML( <<<HTML
 {$toolbar}
 <form id="editform" name="editform" method="post" action="$action" enctype="multipart/form-data">
-END
+HTML
 );
 
                if ( is_callable( $formCallback ) ) {
@@ -1372,7 +1372,7 @@ END
                $this->showTosSummary();
                $this->showEditTools();
 
-               $wgOut->addHTML( <<<END
+               $wgOut->addHTML( <<<HTML
 {$this->editFormTextAfterTools}
 <div class='templatesUsed'>
 {$formattedtemplates}
@@ -1380,7 +1380,7 @@ END
 <div class='hiddencats'>
 {$formattedhiddencats}
 </div>
-END
+HTML
 );
 
                if ( $this->isConflict )
index 4dc62df..2d428a1 100644 (file)
@@ -547,7 +547,7 @@ class Skin extends Linker {
                if( $wgUser->getOption( 'highlightbroken' ) ) {
                        $s .= "a.new, #quickbar a.new { color: #CC2200; }\n";
                } else {
-                       $s .= <<<END
+                       $s .= <<<CSS
 a.new, #quickbar a.new,
 a.stub, #quickbar a.stub {
        color: inherit;
@@ -560,7 +560,7 @@ a.stub:after, #quickbar a.stub:after {
        content: "!";
        color: #772233;
 }
-END;
+CSS;
                }
                if( $wgUser->getOption( 'justify' ) ) {
                        $s .= "#article, #bodyContent, #mw_content { text-align: justify; }\n";
index 5163f25..15d0b68 100644 (file)
@@ -29,13 +29,13 @@ class IBM_DB2Field {
        static function fromText($db, $table, $field) {
                global $wgDBmwschema;
 
-               $q = <<<END
+               $q = <<<SQL
 SELECT
 lcase(coltype) AS typname,
 nulls AS attnotnull, length AS attlen
 FROM sysibm.syscolumns
 WHERE tbcreator=%s AND tbname=%s AND name=%s;
-END;
+SQL;
                $res = $db->query(sprintf($q,
                                $db->addQuotes($wgDBmwschema),
                                $db->addQuotes($table),
index 89aff3c..d864570 100644 (file)
@@ -11,7 +11,7 @@ class PostgresField {
        static function fromText($db, $table, $field) {
        global $wgDBmwschema;
 
-               $q = <<<END
+               $q = <<<SQL
 SELECT
 CASE WHEN typname = 'int2' THEN 'smallint'
 WHEN typname = 'int4' THEN 'integer'
@@ -27,7 +27,7 @@ AND atttypid=pg_type.oid
 AND nspname=%s
 AND relname=%s
 AND attname=%s;
-END;
+SQL;
                $res = $db->query(sprintf($q,
                                $db->addQuotes($wgDBmwschema),
                                $db->addQuotes($table),
@@ -1181,12 +1181,12 @@ class DatabasePostgres extends DatabaseBase {
        function triggerExists( $table, $trigger ) {
                global $wgDBmwschema;
 
-               $q = <<<END
+               $q = <<<SQL
        SELECT 1 FROM pg_class, pg_namespace, pg_trigger
                WHERE relnamespace=pg_namespace.oid AND relkind='r'
                      AND tgrelid=pg_class.oid
                      AND nspname=%s AND relname=%s AND tgname=%s
-END;
+SQL;
                $res = $this->query(sprintf($q,
                                $this->addQuotes($wgDBmwschema),
                                $this->addQuotes($table),
index 5859d5b..a1d0dc8 100644 (file)
@@ -65,7 +65,7 @@ class DBLockForm {
                $reason = htmlspecialchars( $this->reason );
                $token = htmlspecialchars( $wgUser->editToken() );
 
-               $wgOut->addHTML( <<<END
+               $wgOut->addHTML( <<<HTML
 <form id="lockdb" method="post" action="{$action}">
 {$elr}:
 <textarea name="wpLockReason" rows="10" cols="60" wrap="virtual">{$reason}</textarea>
@@ -85,7 +85,7 @@ class DBLockForm {
 </table>
 <input type="hidden" name="wpEditToken" value="{$token}" />
 </form>
-END
+HTML
 );
 
        }
index a3e8a0c..73e0e68 100644 (file)
@@ -55,7 +55,7 @@ class DBUnlockForm {
                $action = $titleObj->escapeLocalURL( "action=submit" );
                $token = htmlspecialchars( $wgUser->editToken() );
 
-               $wgOut->addHTML( <<<END
+               $wgOut->addHTML( <<<HTML
 
 <form id="unlockdb" method="post" action="{$action}">
 <table border="0">
@@ -74,7 +74,7 @@ class DBUnlockForm {
 </table>
 <input type="hidden" name="wpEditToken" value="{$token}" />
 </form>
-END
+HTML
 );
 
        }
index a85b8bd..97be19a 100644 (file)
@@ -254,7 +254,7 @@ function showUsage( $reason = false ) {
                echo( $reason . "\n" );
        }
 
-       echo <<<END
+       echo <<<TEXT
 Imports images and other media files into the wiki
 USAGE: php importImages.php [options] <dir>
 
@@ -279,6 +279,6 @@ Options:
 --protect=<protect>     Specify the protect value (autoconfirmed,sysop)
 --unprotect             Unprotects all uploaded images
 
-END;
+TEXT;
        exit(1);
-}
\ No newline at end of file
+}
index 05a4c78..0d01414 100644 (file)
@@ -59,7 +59,7 @@ function importPages()
        global $wgRootDirectory;
 
        $gt = '>';
-       echo <<<END
+       echo <<<XML
 <?xml version="1.0" encoding="UTF-8" ?$gt
 <mediawiki xmlns="http://www.mediawiki.org/xml/export-0.1/"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -69,7 +69,7 @@ function importPages()
            xml:lang="en">
 <!-- generated by importUseModWiki.php -->
 
-END;
+XML;
        $letters = array(
                'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
@@ -79,10 +79,10 @@ END;
                if( is_dir( $dir ) )
                        importPageDirectory( $dir );
        }
-       echo <<<END
+       echo <<<XML
 </mediawiki>
 
-END;
+XML;
 }
 
 function importPageDirectory( $dir, $prefix = "" )
@@ -227,11 +227,11 @@ function importPage( $title )
                 */
                $revisions = array( $page );
        }
-       $xml = <<<END
+       $xml = <<<XML
        <page>
                <title>$newtitle</title>
 
-END;
+XML;
 
        # History
        $revisions = array_merge( $revisions, fetchKeptPages( $title ) );
@@ -247,7 +247,7 @@ END;
                $timestamp = xmlsafe( timestamp2ISO8601( $rev->ts ) );
                $comment   = xmlsafe( recodeText( $rev->summary ) );
 
-               $xml .= <<<END
+               $xml .= <<<XML
                <revision>
                        <timestamp>$timestamp</timestamp>
                        <contributor><username>$username</username></contributor>
@@ -256,7 +256,7 @@ END;
                        <text>$text</text>
                </revision>
 
-END;
+XML;
        }
        $xml .= "</page>\n\n";
        return $xml;
index 49171bf..81eafcc 100644 (file)
@@ -27,7 +27,7 @@ if ( isset( $options['lang'] ) && isset( $options['clang'] )) {
        }
        $runTest = true;
 } else {
-       echo <<<END
+       echo <<<TEXT
 Run this script to print out the duplicates against a message array.
 Parameters:
        * lang:  Language code to be checked.
@@ -38,7 +38,7 @@ Options:
                * wiki:   Wiki format, with * at beginning of each line
                * php:    Output text as PHP syntax in a array $dupeMessages
                * raw:    Raw output for duplicates
-END;
+TEXT;
 }
 
 // Check file exists
index ab6f9ba..ed1855c 100644 (file)
@@ -11,13 +11,13 @@ require_once( 'languages.inc' );
 require_once( 'checkLanguage.inc' );
 
 if( !class_exists( 'MessageGroups' ) || !class_exists( 'PremadeMediawikiExtensionGroups' ) ) {
-       echo <<<END
+       echo <<<TEXT
 Please add the Translate extension to LocalSettings.php, and enable the extension groups:
        require_once( 'extensions/Translate/Translate.php' );
        \$wgTranslateEC = array_keys( \$wgTranslateAC );
 If you still get this message, update Translate to its latest version.
 
-END;
+TEXT;
        exit(-1);
 }
 
index d493c34..dd3bbd1 100644 (file)
@@ -60,7 +60,7 @@ function removeDupes( $oldMsgArray, $dupeMsgSource ) {
 
 # Show help
 if ( isset( $options['help'] ) ) {
-       echo <<<END
+       echo <<<TEXT
 Run this script to rewrite the messages array in the files languages/messages/MessagesXX.php.
 Parameters:
        * lang: Language code (default: the installation default language). You can also specify "all" to check all the languages.
@@ -71,7 +71,7 @@ Options:
        * remove-unknown: Remove unknown messages.
        * remove-duplicates: Remove duplicated messages based on a PHP source file.
 
-END;
+TEXT;
        exit(1);
 }
 
index 68ff9e2..73d6374 100644 (file)
@@ -29,7 +29,7 @@ if ( !isset( $options['output'] ) ) {
 
 /** Print a usage message*/
 function showUsage() {
-       print <<<END
+       print <<<TEXT
 Usage: php transstat.php [--help] [--output=csv|text|wiki]
        --help : this helpful message
        --output : select an output engine one of:
@@ -39,7 +39,7 @@ Usage: php transstat.php [--help] [--output=csv|text|wiki]
                * 'text'     : Text with tabs.
 Example: php maintenance/transstat.php --output=text
 
-END;
+TEXT;
        exit(1);
 }
 
index b636d5c..416dc3f 100644 (file)
@@ -36,7 +36,7 @@ class SkinSimple extends SkinTemplate {
                if( $wgUser->getOption( 'highlightbroken' ) ) {
                        $s .= "a.new, #quickbar a.new { text-decoration: line-through; }\n";
                } else {
-                       $s .= <<<END
+                       $s .= <<<CSS
 a.new, #quickbar a.new,
 a.stub, #quickbar a.stub {
        color: inherit;
@@ -52,7 +52,7 @@ a.stub:after, #quickbar a.stub:after {
        color: #772233;
        text-decoration: $underline;
 }
-END;
+CSS;
                }
                if( $wgUser->getOption( 'justify' ) ) {
                        $s .= "#article, #bodyContent { text-align: justify; }\n";
index 17bf113..d7c9bdd 100644 (file)
@@ -46,7 +46,9 @@ function mwSetupToolbar() {
 
        // Don't generate buttons for browsers which don't fully
        // support it.
-       var textbox = document.createElement('textarea'); // abstract, don't assume wpTextbox1 is always there
+       var textbox = document.getElementById('wpTextbox1');
+       if (!textbox) { return false; }
+       //var textbox = document.createElement('textarea'); // abstract, don't assume wpTextbox1 is always there
        if (!(document.selection && document.selection.createRange)
                && textbox.selectionStart === null) {
                return false;
index 1732600..4fc4b2f 100644 (file)
@@ -7,7 +7,7 @@ class SearchEngineTest extends MediaWiki_TestCase {
        var $db, $search;
 
        function insertSearchData() {
-               $this->db->safeQuery( <<<END
+               $this->db->safeQuery( <<<SQL
                INSERT INTO ! (page_id,page_namespace,page_title,page_latest)
                VALUES (1, 0, 'Main_Page', 1),
                           (2, 1, 'Main_Page', 2),
@@ -19,9 +19,9 @@ class SearchEngineTest extends MediaWiki_TestCase {
                           (8, 0, 'Thppt', 8),
                           (9, 0, 'Alan_Smithee', 9),
                           (10, 0, 'Pages', 10)
-END
+SQL
                        , $this->db->tableName( 'page' ) );
-               $this->db->safeQuery( <<<END
+               $this->db->safeQuery( <<<SQL
                INSERT INTO ! (rev_id,rev_page)
                VALUES (1, 1),
                       (2, 2),
@@ -33,9 +33,9 @@ END
                       (8, 8),
                       (9, 9),
                       (10, 10)
-END
+SQL
                        , $this->db->tableName( 'revision' ) );
-               $this->db->safeQuery( <<<END
+               $this->db->safeQuery( <<<SQL
                INSERT INTO ! (old_id,old_text)
                VALUES (1, 'This is a main page'),
                           (2, 'This is a talk page to the main page, see [[smithee]]'),
@@ -47,9 +47,9 @@ END
                           (8, 'Blah blah'),
                           (9, 'yum'),
                           (10,'are food')
-END
+SQL
                        , $this->db->tableName( 'text' ) );
-               $this->db->safeQuery( <<<END
+               $this->db->safeQuery( <<<SQL
                INSERT INTO ! (si_page,si_title,si_text)
                VALUES (1, 'main page', 'this is a main page'),
                           (2, 'main page', 'this is a talk page to the main page, see smithee'),
@@ -61,7 +61,7 @@ END
                           (8, 'thppt', 'blah blah'),
                           (9, 'alan smithee', 'yum'),
                           (10, 'pages', 'are food')
-END
+SQL
                        , $this->db->tableName( 'searchindex' ) );
        }