Author: cchittleborough
Description:
After taking a look at Cite.php, it seems to me that it might be (*cough*) A
Small Matter of Programming to allow the <references> element to take a class
attribute. For example,
<references class="foo bar"/>
would generate <ol class="references foo bar">.
A patch follows. I have not tested it (or even compiled it!). Feel free to
ignore it, laugh at my feeble PHP skills, etc.
- Chris Chittleborough
========================================== --- Cite.php Fri May 19 17:19:44 2006 +++ Cite.CWC.php Fri May 19 17:35:50 2006 @@ -105,7 +105,7 @@ // Although I could just use # instead of <li> above and nothing here that // will break on input that contains linebreaks - 'cite_references_prefix' => '<ol class="references">', + 'cite_references_prefix' => '<ol class="references $1">', 'cite_references_suffix' => '</ol>', ) ); @@ -311,12 +311,18 @@ */ function references( $str, $argv, $parser ) { $this->mParser = $parser; + $classes = ''; + $cnt = count ( $argv ); + if ( $cnt == 1 and isset( $argv['class'] ) ) { + $classes = ' '. $argv['class']; + $cnt = 0; + } if ( $str !== null ) return $this->error( CITE_ERROR_REFERENCES_INVALID_INPUT ); - else if ( count( $argv ) ) + else if ( $cnt > 0 ) return $this->error( CITE_ERROR_REFERENCES_INVALID_PARAMETERS ); else - return $this->referencesFormat(); + return $this->referencesFormat($classes); } /** @@ -324,13 +330,13 @@ * * @return string XHTML ready for output */ - function referencesFormat() { + function referencesFormat( $classes ) { $ent = array(); foreach ( $this->mRefs as $k => $v ) $ent[] = $this->referencesFormatEntry( $k, $v ); - $prefix = wfMsgForContentNoTrans( 'cite_references_prefix' ); + $prefix = wfMsgForContentNoTrans( 'cite_references_prefix', $classes ); $suffix = wfMsgForContentNoTrans( 'cite_references_suffix' ); $content = implode( "\n", $ent );
See Also: T53260 (bug 51260)