# Pre-fill content with error message so that if something
# fails we'll have something telling us what we intended.
- // @todo: this isn't page content but a UI message. horrible.
+ //XXX: this isn't page content but a UI message. horrible.
$this->mContentObject = new MessageContent( 'missing-revision', array( $oldid ), array() ) ;
if ( $oldid ) {
*/
public function matchMagicWord( MagicWord $word );
- # TODO: handle ImagePage and CategoryPage
- # TODO: make sure we cover lucene search / wikisearch.
- # TODO: make sure ReplaceTemplates still works
- # FUTURE: nice&sane integration of GeSHi syntax highlighting
+ # TODO: ImagePage and CategoryPage interfere with per-content action handlers
+ # TODO: make sure WikiSearch extension still works
+ # TODO: make sure ReplaceTemplates extension still works
+ # TODO: nice&sane integration of GeSHi syntax highlighting
# [11:59] <vvv> Hooks are ugly; make CodeHighlighter interface and a
# config to set the class which handles syntax highlighting
# [12:00] <vvv> And default it to a DummyHighlighter
-
- # TODO: make sure we cover the external editor interface (does anyone actually use that?!)
-
- # TODO: tie into API to provide contentModel for Revisions
- # TODO: tie into API to provide serialized version and contentFormat for Revisions
- # TODO: tie into API edit interface
- # FUTURE: make EditForm plugin for EditPage
-
- # FUTURE: special type for redirects?!
- # FUTURE: MultipartMultipart < WikipageContent (Main + Links + X)
- # FUTURE: LinksContent < LanguageLinksContent, CategoriesContent
}
*
* This default implementation just returns $wgContLang (except for pages in the MediaWiki namespace)
*
- * Note that a page's language must be permanent and cacheable, that is, it must not depend
- * on user preferences, request parameters or session state. The only exception is pages in the
- * MediaWiki namespace.
+ * Note that the pages language is not cacheable, since it may in some cases depend on user settings.
*
* Also note that the page language may or may not depend on the actual content of the page,
* that is, this method may load the content in order to determine the language.
* @param Title $title the page to determine the language for.
* @param Content|null $content the page's content, if you have it handy, to avoid reloading it.
*
- * @return Language the page's language code
+ * @return Language the page's language
*/
public function getPageLanguage( Title $title, Content $content = null ) {
global $wgContLang;
* @param Title $title the page to determine the language for.
* @param Content|null $content the page's content, if you have it handy, to avoid reloading it.
*
- * @return Language the page's language code for viewing
+ * @return Language the page's language for viewing
*/
public function getPageViewLanguage( Title $title, Content $content = null ) {
$pageLang = $this->getPageLanguage( $title, $content );
return $wgLang;
}
- //TODO: use the LinkCache to cache this!
+ //TODO: use the LinkCache to cache this! Note that this may depend on user settings, so the cache should be only per-request.
//NOTE: ContentHandler::getPageLanguage() may need to load the content to determine the page language!
$contentHandler = ContentHandler::getForTitle( $this );
$pageLang = $contentHandler->getPageLanguage( $this );
return $wgLang;
}
- //NOTE: can't be cached, depends on user settings
+ //NOTE: can't be cached persistently, depends on user settings
//NOTE: ContentHandler::getPageViewLanguage() may need to load the content to determine the page language!
$contentHandler = ContentHandler::getForTitle( $this );
$pageLang = $contentHandler->getPageViewLanguage( $this );
* Compatibility note: this function previously returned a boolean value indicating success/failure
*
* @deprecated since 1.WD: use doEditContent() instead.
- * @todo: use doEditContent() instead everywhere
*/
public function doEdit( $text, $summary, $flags = 0, $baseRevId = false, $user = null ) {
wfDeprecated( __METHOD__, '1.WD' );
public function prepareContentForEdit( Content $content, $revid = null, User $user = null, $serialization_format = null ) {
global $wgParser, $wgContLang, $wgUser;
$user = is_null( $user ) ? $wgUser : $user;
- // @TODO fixme: check $user->getId() here???
+ //XXX: check $user->getId() here???
if ( $this->mPreparedEdit
&& $this->mPreparedEdit->newContent
{
$content = $pageObj->getContent();
+ // @todo: Add support for appending/prepending to the Content interface
+
if ( !( $content instanceof TextContent ) ) {
- // @todo: ContentHandler should have an isFlat() method or some such
- // @todo: XXX: or perhaps there should be Content::append(), Content::prepend()
- // @todo: ...and Content::supportsConcatenation()
$mode = $contentHandler->getModelID();
$this->dieUsage( "Can't append to pages using content model $mode", 'appendnotsupported' );
}
$ep = new EditPage( $articleObject );
// allow editing of non-textual content.
- //@todo: let the ContentHandler decide whether direct editing is OK
$ep->allowNonTextContent = true;
$ep->setContextTitle( $titleObj );
wfDebugLog( 'MessageCache', __METHOD__ . ": failed to load message page text for {$title} ($code)" );
$message = null; // no negative caching
} else {
- #XXX: is this the reight way to turn a Content object into a mesage?
+ #XXX: Is this the right way to turn a Content object into a message?
$message = $content->getWikitextForTransclusion();
if ( $message === false || $message === null ) {
protected function initText() {
if ( !isset( $this->mText ) ) {
if ( $this->mRevision != null ) {
- //TODO: don't use the text, but the content object!
+ //TODO: if we could plug in some code that knows about special content models *and* about
+ // special features of the search engine, the search could benefit.
$content = $this->mRevision->getContent();
$this->mText = $content->getTextForSearchIndex();
} else { // TODO: can we fetch raw wikitext for commons images?