SupportAid.php

Go to the documentation of this file.
00001 <?php
00017 class SupportAid extends TranslationAid {
00018     public function getData() {
00019         global $wgTranslateSupportUrl;
00020         if ( !$wgTranslateSupportUrl ) {
00021             throw new TranslationHelperException( "Support page not configured" );
00022         }
00023 
00024         $supportTitle = Title::newFromText( $wgTranslateSupportUrl['page'] );
00025         if ( !$supportTitle ) {
00026             throw new TranslationHelperException( "Support page not configured properly" );
00027         }
00028 
00029         $supportParams = $wgTranslateSupportUrl['params'];
00030         $title = $this->handle->getTitle();
00031         foreach ( $supportParams as &$value ) {
00032             $value = str_replace( '%MESSAGE%', $title->getPrefixedText(), $value );
00033         }
00034 
00035         return array(
00036             'url' => $supportTitle->getFullUrl( $supportParams ),
00037         );
00038     }
00039 }
Generated on Tue Oct 29 00:00:25 2013 for MediaWiki Translate Extension by  doxygen 1.6.3