User:A.allison/FCKeditor parser.php

From WikiVet English
< User:A.allison
Revision as of 13:46, 29 January 2011 by A.allison (talk | contribs) (Created page with "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 they...")

(diff) ← Older revision | Approved revision (diff) | Latest revision (diff) | Newer revision → (diff)

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>