- if ( !isset( $params['contentmodel'] ) || $params['contentmodel'] == '' ) {
- $contentHandler = $pageObj->getContentHandler();
- } else {
- $contentHandler = ContentHandler::getForModelID( $params['contentmodel'] );
- }
-
- // @todo ask handler whether direct editing is supported at all! make allowFlatEdit() method or some such
-
- if ( !isset( $params['contentformat'] ) || $params['contentformat'] == '' ) {
- $params['contentformat'] = $contentHandler->getDefaultFormat();
- }
-
- $contentFormat = $params['contentformat'];
-
- if ( !$contentHandler->isSupportedFormat( $contentFormat ) ) {
- $name = $titleObj->getPrefixedDBkey();
- $model = $contentHandler->getModelID();
-
- $this->dieUsage( "The requested format $contentFormat is not supported for content model ".
- " $model used by $name", 'badformat' );
- }
-