User:A.allison/FCKeditor parser.php

From WikiVet English
Jump to navigation Jump to search

FCKeditor as standard removes the captions to all images, this is a problem with how it interacts with mediawiki. The workaround is to stop mediawiki stripping captions when theya re duplicated. The only downside to this is that screen readers will read the captions to images twice.

Parser.php changes

Parser.php is located in /includes/parser/. The following lines need to be added at line 4647 i.e. between

  1. Line 4646 # meter for BC; ...

<syntaxhighlight lang="php">if( $caption !== ' ' && !isset( $params['frame']['alt']) && isset($params['frame']['title'])

           && !isset( $params['frame']['framed'] )
           && !isset( $params['frame']['thumbnail'] )
           && !isset( $params['frame']['manualthumb'] ) ) {
           $params['frame']['alt'] = $params['frame']['title'];
}</syntaxhighlight>

<syntaxhighlight lang="php">if ( $imageIsFramed ) { # Framed image </syntaxhighlight>