X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=docs%2Fcontenthandler.txt;h=5f379e7e336493ed35202565cee56c8a6710a98a;hb=9c7f6734c397a954b8eaa5ec73876f2b4bf92afb;hp=899554af57e2812b881f5690e1df41c00410a682;hpb=b3e457400b48d58725a6a49eb0678743ee646f81;p=lhc%2Fweb%2Fwiklou.git diff --git a/docs/contenthandler.txt b/docs/contenthandler.txt index 899554af57..5f379e7e33 100644 --- a/docs/contenthandler.txt +++ b/docs/contenthandler.txt @@ -8,6 +8,7 @@ Built-in content types are: * wikitext - wikitext, as usual * javascript - user provided javascript code +* json - simple implementation for use by extensions, etc. * css - user provided css code * text - plain text @@ -18,12 +19,8 @@ ContentHandler::getDefaultModelFor($title) as follows: * The global setting $wgNamespaceContentModels specifies a content model for the given namespace. * The hook ContentHandlerDefaultModelFor may be used to override the page's default model. -* Pages in NS_MEDIAWIKI and NS_USER default to the CSS or JavaScript model if they end in .js or .css, respectively. +* Pages in NS_MEDIAWIKI and NS_USER default to the CSS or JavaScript model if they end in .css or .js, respectively. Pages in NS_MEDIAWIKI default to the wikitext model otherwise. -* The hook TitleIsCssOrJsPage may be used to force a page to use the CSS or JavaScript model. - This is a compatibility feature. The ContentHandlerDefaultModelFor hook should be used instead if possible. -* The hook TitleIsWikitextPage may be used to force a page to use the wikitext model. - This is a compatibility feature. The ContentHandlerDefaultModelFor hook should be used instead if possible. * Otherwise, the wikitext model is used. Note that is currently no mechanism to convert a page from one content model to another, and there is no guarantee that @@ -95,7 +92,7 @@ used. Most importantly, the following functions have been deprecated: -* Revisions::getText() and Revisions::getRawText() is deprecated in favor Revisions::getContent() +* Revisions::getText() is deprecated in favor Revisions::getContent() * WikiPage::getText() is deprecated in favor WikiPage::getContent() Also, the old Article::getContent() (which returns text) is superceded by Article::getContentObject(). However, both @@ -147,7 +144,8 @@ using a model or format different from the default will result in an error. There are some new globals that can be used to control the behavior of the ContentHandler facility: -* $wgContentHandlers associates content model IDs with the names of the appropriate ContentHandler subclasses. +* $wgContentHandlers associates content model IDs with the names of the appropriate ContentHandler subclasses + or callbacks that create an instance of the appropriate ContentHandler subclass. * $wgNamespaceContentModels maps namespace IDs to a content model that should be the default for that namespace.