Index: trunk/extensions/CategoryStepper/CategoryStepper.php |
— | — | @@ -56,14 +56,12 @@ |
57 | 57 | */ |
58 | 58 | function efCategoryStepper( $out, $text ) { |
59 | 59 | // Get various variables needed for this extension. |
60 | | - global $wgCategoryStepper, $wgTitle, $wgArticlePath, $wgRequest, $IP, |
61 | | - $wgUser, $wgOut; |
| 60 | + global $wgCategoryStepper, $wgArticlePath, $wgRequest, $IP, $wgUser; |
62 | 61 | |
63 | 62 | // Only render on the actual view page; not edit, delete etc. |
64 | 63 | if ( $wgRequest->getBool( 'action' ) ) return true; |
65 | 64 | |
66 | | - // Load messages into the message cache. |
67 | | - wfLoadExtensionMessages( 'CategoryStepper' ); |
| 65 | + $titleObj = $out->getTitle(); |
68 | 66 | |
69 | 67 | // Open a database connection. |
70 | 68 | $dbr = wfGetDB( DB_SLAVE ); |
— | — | @@ -84,7 +82,7 @@ |
85 | 83 | // Loop through all the categories. |
86 | 84 | foreach ( $wgCategoryStepper as $name => $title ) { |
87 | 85 | // Check if the current page is in this category and if so render the box. |
88 | | - if ( $dbr->fetchRow( $dbr->select( "categorylinks", "*", array( "cl_from" => $wgTitle->getArticleID(), "cl_to" => $name ) ) ) ) { |
| 86 | + if ( $dbr->fetchRow( $dbr->select( "categorylinks", "*", array( "cl_from" => $titleObj->getArticleID(), "cl_to" => $name ) ) ) ) { |
89 | 87 | $prev = false; |
90 | 88 | $nextI = false; |
91 | 89 | |
— | — | @@ -94,7 +92,7 @@ |
95 | 93 | if ( isset( $donext ) ) { |
96 | 94 | $nextI = $row[ 'cl_from' ]; |
97 | 95 | break; |
98 | | - } elseif ( $row[ 'cl_from' ] == $wgTitle->getArticleID() ) { |
| 96 | + } elseif ( $row[ 'cl_from' ] == $titleObj->getArticleID() ) { |
99 | 97 | $prevI = $prev; |
100 | 98 | $donext = true; |
101 | 99 | } |
— | — | @@ -128,7 +126,7 @@ |
129 | 127 | Xml::closeElement( "tr" ) . |
130 | 128 | Xml::openElement( "tr" ) . |
131 | 129 | Xml::tags( "td", array(), $previous ) . |
132 | | - Xml::tags( "td", array(), $wgTitle->getText() ) . |
| 130 | + Xml::tags( "td", array(), $titleObj->getText() ) . |
133 | 131 | Xml::tags( "td", array(), $next ) . |
134 | 132 | Xml::closeElement( "tr" ) . |
135 | 133 | Xml::closeElement( "table" ); |
— | — | @@ -138,7 +136,7 @@ |
139 | 137 | } |
140 | 138 | |
141 | 139 | // Add style file to the output headers if it exists. |
142 | | - if ( file_exists( "$IP/skins/CategoryStepper.css" ) ) $wgOut->addStyle( 'CategoryStepper.css' ); |
| 140 | + if ( file_exists( "$IP/skins/CategoryStepper.css" ) ) $out->addStyle( 'CategoryStepper.css' ); |
143 | 141 | |
144 | 142 | // Return true so things don't break. |
145 | 143 | return true; |