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

Protected Member Functions

 getGroupName ()
 Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-group-*' for valid names This method defaults to group 'other'.

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:
string$isbnUnclean ISBN
Returns:
string

Definition at line 108 of file SpecialBooksources.php.

References $isbn.

Referenced by execute(), and isValidISBN().

Show the special page.

Parameters:
string$isbnISBN 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().

Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-group-*' for valid names This method defaults to group 'other'.

Returns:
string
Since:
1.21

Reimplemented from SpecialPage.

Definition at line 190 of file SpecialBooksources.php.

static SpecialBookSources::isValidISBN ( isbn) [static]

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

True indicates validity.

Parameters:
string$isbnISBN 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 117 of file SpecialBooksources.php.

References $form, array(), Html\closeElement(), Html\element(), SpecialPage\getTitle(), global, Html\hidden(), Xml\inputLabel(), SpecialPage\msg(), Html\openElement(), Xml\submitButton(), and text.

Referenced by execute().

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

Format a book source list item.

Parameters:
string$labelBook source label
string$urlBook source URL
Returns:
string

Definition at line 183 of file SpecialBooksources.php.

References array(), Html\element(), and Html\rawElement().

Referenced by showList().

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

Exceptions:
MWException
Returns:
string

Definition at line 138 of file SpecialBooksources.php.

References $rev, $title, $wgContLang, array(), as, content, SpecialPage\getOutput(), global, in, language, list, 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: