MediaWiki  REL1_20
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...

Inheritance diagram for SpecialBookSources:
Collaboration diagram for SpecialBookSources:

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.
 makeListItem ($label, $url)
 Format a book source list item.
 showList ()
 Determine where to get the list of book sources from, format and output them.

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 <[email protected]>
Todo:
Validate ISBNs using the standard check-digit method

Definition at line 32 of file SpecialBooksources.php.


Constructor & Destructor Documentation

Constructor.

Definition at line 42 of file SpecialBooksources.php.


Member Function Documentation

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

Trim ISBN and remove characters which aren't required.

Parameters:
$isbnstring Unclean ISBN
Returns:
string

Definition at line 107 of file SpecialBooksources.php.

References $isbn.

Referenced by execute(), and isValidISBN().

Show the special page.

Parameters:
$isbnstring ISBN passed as a subpage parameter

Reimplemented from SpecialPage.

Definition at line 51 of file SpecialBooksources.php.

References $isbn, cleanIsbn(), SpecialPage\getOutput(), SpecialPage\getRequest(), makeForm(), SpecialPage\outputHeader(), SpecialPage\setHeaders(), and showList().

static SpecialBookSources::isValidISBN ( isbn) [static]

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

True indicates validity.

Parameters:
isbnstring ISBN passed for check
Returns:
bool

Definition at line 69 of file SpecialBooksources.php.

References $isbn, and cleanIsbn().

Generate a form to allow users to enter an ISBN.

Returns:
string

Definition at line 116 of file SpecialBooksources.php.

References Xml\closeElement(), SpecialPage\getTitle(), Html\hidden(), Xml\inputLabel(), SpecialPage\msg(), Xml\openElement(), and Xml\submitButton().

Referenced by execute().

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

Format a book source list item.

Parameters:
$labelstring Book source label
$urlstring Book source URL
Returns:
string

Definition at line 168 of file SpecialBooksources.php.

References $url.

Referenced by showList().

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

Returns:
string

Definition at line 135 of file SpecialBooksources.php.

References $page, $title, $url, $wgContLang, SpecialPage\getOutput(), makeListItem(), Title\makeTitleSafe(), SpecialPage\msg(), Revision\newFromTitle(), IDBAccessObject\READ_NORMAL, and wfRunHooks().

Referenced by execute().


Member Data Documentation

SpecialBookSources::$isbn = '' [private]

ISBN passed to the page, if any.

Definition at line 37 of file SpecialBooksources.php.

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


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