Merge "Content::convert() for conv. betw. content models."
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 7 Nov 2012 20:39:09 +0000 (20:39 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 7 Nov 2012 20:39:09 +0000 (20:39 +0000)
1  2 
docs/hooks.txt

diff --combined docs/hooks.txt
@@@ -752,6 -752,16 +752,16 @@@ cointent model name, but no entry for t
  $modeName: the requested content model name
  &$handler: set this to a ContentHandler object, if desired.
  
+ 'ConvertContent': Called by AbstractContent::convert when a conversion to another
+ content model is requested.
+ $content: The Content object to be converted.
+ $toModel: The ID of the content model to convert to.
+ $lossy:   boolean indicating whether lossy conversion is allowed.
+ &$result: Output parameter, in case the handler function wants to provide a
+ converted Content object. Note that $result->getContentModel() must return $toModel.
+ Handler functions that modify $result should generally return false to further
+ attempts at conversion.
  'ContribsPager::getQueryInfo': Before the contributions query is about to run
  &$pager: Pager object for contributions
  &$queryInfo: The query for the contribs Pager
@@@ -1831,21 -1841,6 +1841,21 @@@ $result: The search resul
  $terms: The search terms entered
  $page: The SpecialSearch object.
  
 +'ShowSearchHit': Customize display of search hit.
 +$searchPage: The SpecialSearch instance.
 +$result: The SearchResult to show
 +$terms: Search terms, for highlighting
 +&$link: HTML of link to the matching page. May be modified.
 +&$redirect: HTML of redirect info. May be modified.
 +&$section: HTML of matching section. May be modified.
 +&$extract: HTML of content extract. May be modified.
 +&$score: HTML of score. May be modified.
 +&$size: HTML of page size. May be modified.
 +&$date: HTML of of page modification date. May be modified.
 +&$related: HTML of additional info for the matching page. May be modified.
 +&$html: May be set to the full HTML that should be used to represent the search hit. Must include
 +the <li> ... </li> tags. Will only be used if the hook function returned false.
 +
  'SiteNoticeBefore': Before the sitenotice/anonnotice is composed
  &$siteNotice: HTML returned as the sitenotice
  $skin: Skin object
@@@ -2125,7 -2120,7 +2135,7 @@@ $result: Boolean; whether MediaWiki cur
  Allows overriding default behaviour for determining if a page exists.
  If $isKnown is kept as null, regular checks happen. If it's a boolean, this value is returned by the isKnown method.
  $title: Title object that is being checked
 -$result: Boolean|null; whether MediaWiki currently thinks this page is known
 +&$isKnown: Boolean|null; whether MediaWiki currently thinks this page is known
  
  'TitleIsMovable': Called when determining if it is possible to move a page.
  Note that this hook is not called for interwiki pages or pages in immovable namespaces: for these, isMovable() always returns false.