new LinksDeletionUpdate( $title ),
);
}
+
+ /**
+ * Returns true iff this page's content model supports sections.
+ *
+ * This default implementation returns false,
+ *
+ * @return boolean whether sections are supported.
+ */
+ public function supportsSections() {
+ return false;
+ }
}
/**
throw new MWException( "getHtml() not implemented for wikitext. Use getParserOutput()->getText()." );
}
+ /**
+ * Returns true because wikitext supports sections.
+ *
+ * @return boolean whether sections are supported.
+ */
+ public function supportsSections() {
+ return false;
+ }
}
#XXX: make ScriptContentHandler base class with plugin interface for syntax highlighting?
$sectionContent = ContentHandler::makeContent( $text, $this->getTitle() ); #XXX: could make section title, but that's not required.
+ #TODO: check ContentHandler::supportsSections(). throw exception??
$newContent = $this->replaceSectionContent( $section, $sectionContent, $sectionTitle, $edittime );
#TODO: check $newContent == false. throw exception??
- #TODO: add ContentHandler::supportsSections()
return ContentHandler::getContentText( $newContent ); #XXX: unclear what will happen for non-wikitext!
}
+ /**
+ * Returns true iff this page's content model supports sections.
+ *
+ * @return boolean whether sections are supported.
+ *
+ * @todo: the skin should check this and not offer section functionality if sections are not supported.
+ */
+ public function supportsSections() {
+ return $this->getContentHandler()->supportsSections();
+ }
+
/**
* @param $section null|bool|int or a section number (0, 1, 2, T1, T2...)
* @param $content Content: new content of the section