r84027 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84026‎ | r84027 | r84028 >
Date:15:56, 15 March 2011
Author:purodha
Status:reverted (Comments)
Tags:
Comment:
More systematic handling of cellspacing and cellpadding attributes.
Modified paths:
  • /trunk/extensions/Babel/Babel.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Babel/Babel.class.php
@@ -53,20 +53,6 @@
5454 }
5555 }
5656
57 - $cellspacing = wfMsgForContent( 'babel-box-cellspacing' );
58 - if ( strlen( $cellspacing ) == 0 ) {
59 - $cellspacing = '';
60 - } else {
61 - $cellspacing = ' cellspacing="'.$cellspacing.'"';
62 - }
63 -
64 - $cellpadding = wfMsgForContent( 'babel-box-cellpadding' );
65 - if ( strlen( $cellpadding ) == 0 ) {
66 - $cellpadding = '';
67 - } else {
68 - $cellpadding = ' cellpadding="'.$cellpadding.'"';
69 - }
70 -
7157 $top = wfMsgExt( 'babel', array( 'parsemag', 'content' ), self::$title->getDBkey() );
7258 if ( strlen( $top ) == 0 ) {
7359 $top = '';
@@ -89,6 +75,9 @@
9076 $footer = '! class="mw-babel-footer" | ' . $footer;
9177 }
9278
 79+ $cellspacing = Babel::mHtmlAttrib( 'cellspacing', 'babel-box-cellspacing' );
 80+ $cellpadding = Babel::mHtmlAttrib( 'cellpadding', 'babel-box-cellpadding' );
 81+
9382 $tower = <<<EOT
9483 {|$cellspacing$cellpadding class="mw-babel-wrapper"
9584 $top
@@ -199,11 +188,13 @@
200189
201190 $dir_content = wfMsgForContent( 'babel-directionality' );
202191 $dir_current = wfMsgExt( 'babel-directionality', array( 'language' => $code ) );
203 - $cellspacing = wfMsgForContent( 'babel-cellspacing' );
204192
 193+ $cellspacing = Babel::mHtmlAttrib( 'cellspacing', 'babel-cellspacing' );
 194+ $cellpadding = Babel::mHtmlAttrib( 'cellpadding', 'babel-cellpadding' );
 195+
205196 $box = <<<EOT
206197 <div class="mw-babel-box mw-babel-box-$level" dir="$dir_content">
207 -{| cellspacing="$cellspacing"
 198+{|$cellspacing$cellpadding
208199 ! dir="$dir_content" | $header
209200 | dir="$dir_current" lang="$lang" xml:lang="$lang" | $text
210201 |}

Follow-up revisions

RevisionCommit summaryAuthorDate
r84030Revert r84027 for now: PHP Fatal error: Call to undefined method Babel::mHtml...raymond16:20, 15 March 2011
r84078Fixing r84027.purodha03:21, 16 March 2011
r84248Minor enhancements and fixes following up r84229, r84078, 84027, 84015.purodha14:17, 18 March 2011

Comments

#Comment by Raymond (talk | contribs)   16:12, 15 March 2011

PHP Fatal error: Call to undefined method Babel::mHtmlAttrib() in /www/w/extensions/Babel/Babel.class.php on line 192

#Comment by Purodha (talk | contribs)   03:23, 16 March 2011

Hopfully, fixed with r84078.

Status & tagging log