SpecialBookSources Class Reference

Special page outputs information on sourcing a book with a particular ISBN The parser creates links to this page when dealing with ISBNs in wikitext. More...

Inherits SpecialPage.

List of all members.

Public Member Functions

 __construct ()
 Constructor.
 execute ($isbn)
 Show the special page.

Static Public Member Functions

static isValidISBN ($isbn)
 Returns whether a given ISBN (10 or 13) is valid.

Private Member Functions

 makeForm ()
 Generate a form to allow users to enter an ISBN.
 showList ()
 Determine where to get the list of book sources from, format and output them.
 makeListItem ($label, $url)
 Format a book source list item.

Static Private Member Functions

static cleanIsbn ($isbn)
 Trim ISBN and remove characters which aren't required.

Private Attributes

 $isbn = ''
 ISBN passed to the page, if any.


Detailed Description

Special page outputs information on sourcing a book with a particular ISBN The parser creates links to this page when dealing with ISBNs in wikitext.

Author:
Rob Church <robchur@gmail.com>
Todo:
Validate ISBNs using the standard check-digit method

Definition at line 11 of file SpecialBooksources.php.


Constructor & Destructor Documentation

SpecialBookSources::__construct (  ) 

Constructor.

Definition at line 21 of file SpecialBooksources.php.


Member Function Documentation

static SpecialBookSources::cleanIsbn ( isbn  )  [static, private]

Trim ISBN and remove characters which aren't required.

Parameters:
$isbn Unclean ISBN
Returns:
string

Definition at line 88 of file SpecialBooksources.php.

References $isbn.

Referenced by execute(), and isValidISBN().

SpecialBookSources::execute ( isbn  ) 

Show the special page.

Parameters:
$isbn ISBN passed as a subpage parameter

Reimplemented from SpecialPage.

Definition at line 30 of file SpecialBooksources.php.

References $isbn, $wgOut, $wgRequest, cleanIsbn(), makeForm(), SpecialPage::setHeaders(), and showList().

static SpecialBookSources::isValidISBN ( isbn  )  [static]

Returns whether a given ISBN (10 or 13) is valid.

True indicates validity.

Parameters:
isbn ISBN passed for check

Definition at line 48 of file SpecialBooksources.php.

References $i, $isbn, and cleanIsbn().

SpecialBookSources::makeForm (  )  [private]

Generate a form to allow users to enter an ISBN.

Returns:
string

Definition at line 97 of file SpecialBooksources.php.

References $title, $wgScript, Xml::closeElement(), SpecialPage::getTitleFor(), Xml::hidden(), Xml::inputLabel(), Xml::openElement(), Xml::submitButton(), wfMsg(), and wfMsgHtml().

Referenced by execute().

SpecialBookSources::makeListItem ( label,
url 
) [private]

Format a book source list item.

Parameters:
$label Book source label
$url Book source URL
Returns:
string

Definition at line 148 of file SpecialBooksources.php.

References $url.

Referenced by showList().

SpecialBookSources::showList (  )  [private]

Determine where to get the list of book sources from, format and output them.

Returns:
string

Definition at line 116 of file SpecialBooksources.php.

References $title, $url, $wgContLang, $wgOut, makeListItem(), Title::makeTitleSafe(), Revision::newFromTitle(), wfMsgForContent(), and wfRunHooks().

Referenced by execute().


Member Data Documentation

SpecialBookSources::$isbn = '' [private]

ISBN passed to the page, if any.

Definition at line 16 of file SpecialBooksources.php.

Referenced by cleanIsbn(), execute(), and isValidISBN().


The documentation for this class was generated from the following file:

Generated on Sat Sep 5 02:08:47 2009 for MediaWiki by  doxygen 1.5.9