MediaWiki  REL1_21
WikitextContentHandler.php
Go to the documentation of this file.
00001 <?php
00031 class WikitextContentHandler extends TextContentHandler {
00032 
00033         public function __construct( $modelId = CONTENT_MODEL_WIKITEXT ) {
00034                 parent::__construct( $modelId, array( CONTENT_FORMAT_WIKITEXT ) );
00035         }
00036 
00037         public function unserializeContent( $text, $format = null ) {
00038                 $this->checkFormat( $format );
00039 
00040                 return new WikitextContent( $text );
00041         }
00042 
00048         public function makeEmptyContent() {
00049                 return new WikitextContent( '' );
00050         }
00051 
00061         public function makeRedirectContent( Title $destination ) {
00062                 $mwRedir = MagicWord::get( 'redirect' );
00063                 $redirectText = $mwRedir->getSynonym( 0 ) . ' [[' . $destination->getPrefixedText() . ']]';
00064 
00065                 return new WikitextContent( $redirectText );
00066         }
00067 
00075         public function supportsRedirects() {
00076                 return true;
00077         }
00078 
00084         public function supportsSections() {
00085                 return true;
00086         }
00087 
00095         public function isParserCacheSupported() {
00096                 return true;
00097         }
00098 }