Move some providers in new MediaWikiProvide class
[lhc/web/wiklou.git] / includes / ChangeTags.php
index 3589560..b893d30 100644 (file)
@@ -28,11 +28,8 @@ class ChangeTags {
        }
 
        static function tagDescription( $tag ) {
-               $msg = wfMsgExt( "tag-$tag", 'parseinline' );
-               if ( wfEmptyMsg( "tag-$tag", $msg ) ) {
-                       return htmlspecialchars( $tag );
-               }
-               return $msg;
+               $msg = wfMessage( "tag-$tag" );
+               return $msg->exists() ? $msg->parse() : htmlspecialchars( $tag ); 
        }
 
        ## Basic utility method to add tags to a particular change, given its rc_id, rev_id and/or log_id.
@@ -119,7 +116,6 @@ class ChangeTags {
                }
 
                // Figure out which conditions can be done.
-               $join_field = '';
                if ( in_array( 'recentchanges', $tables ) ) {
                        $join_cond = 'rc_id';
                } elseif( in_array( 'logging', $tables ) ) {
@@ -170,7 +166,7 @@ class ChangeTags {
 
                $html = implode( ' ', $data );
                $html .= "\n" . Xml::element( 'input', array( 'type' => 'submit', 'value' => wfMsg( 'tag-filter-submit' ) ) );
-               $html .= "\n" . Xml::hidden( 'title', $wgTitle-> getPrefixedText() );
+               $html .= "\n" . Html::hidden( 'title', $wgTitle-> getPrefixedText() );
                $html = Xml::tags( 'form', array( 'action' => $wgTitle->getLocalURL(), 'method' => 'get' ), $html );
 
                return $html;
@@ -181,16 +177,17 @@ class ChangeTags {
                // Caching...
                global $wgMemc;
                $key = wfMemcKey( 'valid-tags' );
-
-               if ( $tags = $wgMemc->get( $key ) )
+               $tags = $wgMemc->get( $key );
+               if ( $tags ) {
                        return $tags;
+               }
 
                $emptyTags = array();
 
                // Some DB stuff
                $dbr = wfGetDB( DB_SLAVE );
                $res = $dbr->select( 'valid_tag', 'vt_tag', array(), __METHOD__ );
-               while( $row = $res->fetchObject() ) {
+               foreach ( $res as $row ) {
                        $emptyTags[] = $row->vt_tag;
                }