[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/api/ -> ApiFormatBase.php (summary)

Created on Sep 19, 2006 Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"

File Size: 354 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 20 functions

  __construct()
  getNeedsRawData()
  getFormat()
  setUnescapeAmps()
  getIsHtml()
  getWantsHelp()
  disable()
  isDisabled()
  canPrintErrors()
  initPrinter()
  closePrinter()
  printText()
  getBuffer()
  setBufferResult()
  setHelp()
  formatHTML()
  getExamples()
  getHelpUrls()
  getDescription()
  markDeprecated()

Functions
Functions that are not part of a class:

__construct( ApiMain $main, $format )   X-Ref
If $format ends with 'fm', pretty-print the output in HTML.

param: ApiMain $main
param: string $format Format name

getNeedsRawData()   X-Ref
Whether this formatter needs raw data such as _element tags

return: bool

getFormat()   X-Ref
Get the internal format name

return: string

setUnescapeAmps( $b )   X-Ref
Specify whether or not sequences like &amp;quot; should be unescaped
to &quot; . This should only be set to true for the help message
when rendered in the default (xmlfm) format. This is a temporary
special-case fix that should be removed once the help has been
reworked to use a fully HTML interface.

param: bool $b Whether or not ampersands should be escaped.

getIsHtml()   X-Ref
Returns true when the HTML pretty-printer should be used.
The default implementation assumes that formats ending with 'fm'
should be formatted in HTML.

return: bool

getWantsHelp()   X-Ref
Whether this formatter can format the help message in a nice way.
By default, this returns the same as getIsHtml().
When action=help is set explicitly, the help will always be shown

return: bool

disable()   X-Ref
Disable the formatter completely. This causes calls to initPrinter(),
printText() and closePrinter() to be ignored.


isDisabled()   X-Ref
No description

canPrintErrors()   X-Ref
Whether this formatter can handle printing API errors. If this returns
false, then on API errors the default printer will be instantiated.

return: bool

initPrinter( $isHelpScreen )   X-Ref
Initialize the printer function and prepare the output headers, etc.
This method must be the first outputting method during execution.
A human-targeted notice about available formats is printed for the HTML-based output,
except for help screens (caused by either an error in the API parameters,
the calling of action=help, or requesting the root script api.php).

param: bool $isHelpScreen Whether a help screen is going to be shown

closePrinter()   X-Ref
Finish printing. Closes HTML tags.


printText( $text )   X-Ref
The main format printing function. Call it to output the result
string to the user. This function will automatically output HTML
when format name ends in 'fm'.

param: string $text

getBuffer()   X-Ref
Get the contents of the buffer.

return: string

setBufferResult( $value )   X-Ref
Set the flag to buffer the result instead of printing it.

param: bool $value

setHelp( $help = true )   X-Ref
Sets whether the pretty-printer should format *bold*

param: bool $help

formatHTML( $text )   X-Ref
Pretty-print various elements in HTML format, such as xml tags and
URLs. This method also escapes characters like <

param: string $text
return: string

getExamples()   X-Ref
No description

getHelpUrls()   X-Ref
No description

getDescription()   X-Ref
No description

markDeprecated()   X-Ref
To avoid code duplication with the deprecation of dbg, dump, txt, wddx,
and yaml, this method is added to do the necessary work. It should be
removed when those deprecated formats are removed.




Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1