MediaWiki  REL1_22
RandomPage Class Reference

Special page to direct the user to a random page. More...

Inheritance diagram for RandomPage:
Collaboration diagram for RandomPage:

List of all members.

Public Member Functions

 __construct ($name= 'Randompage')
 execute ($par)
 Default execute method Checks user permissions, calls the function given in mFunction.
 getNamespaces ()
 getRandomTitle ()
 Choose a random title.
 isRedirect ()
 setNamespace ($ns)

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'.
 getQueryInfo ($randstr)

Protected Attributes

 $extra = array()
 $isRedir = false

Private Member Functions

 getNsList ()
 Get a comma-delimited list of namespaces we don't have any pages in.
 selectRandomPageFromDB ($randstr, $fname=__METHOD__)

Private Attributes

 $namespaces

Detailed Description

Special page to direct the user to a random page.

Definition at line 30 of file SpecialRandompage.php.


Constructor & Destructor Documentation

RandomPage::__construct ( name = 'Randompage')

Definition at line 35 of file SpecialRandompage.php.

References $name, MWNamespace\getContentNamespaces(), and namespaces.


Member Function Documentation

RandomPage::execute ( subPage)

Default execute method Checks user permissions, calls the function given in mFunction.

This must be overridden by subclasses; it will be made abstract in a future version

Parameters:
$subPagestring|null

Reimplemented from SpecialPage.

Definition at line 56 of file SpecialRandompage.php.

References $query, $title, $wgContLang, array(), SpecialPage\getName(), getNsList(), SpecialPage\getOutput(), getRandomTitle(), SpecialPage\getRequest(), global, isRedirect(), namespaces, SpecialPage\setHeaders(), and setNamespace().

RandomPage::getGroupName ( ) [protected]

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 170 of file SpecialRandompage.php.

Definition at line 40 of file SpecialRandompage.php.

References namespaces.

RandomPage::getNsList ( ) [private]

Get a comma-delimited list of namespaces we don't have any pages in.

Returns:
String

Definition at line 85 of file SpecialRandompage.php.

References $n, $wgContLang, array(), as, global, SpecialPage\msg(), and namespaces.

Referenced by execute().

RandomPage::getQueryInfo ( randstr) [protected]

Definition at line 134 of file SpecialRandompage.php.

References array(), isRedirect(), and namespaces.

Referenced by selectRandomPageFromDB().

Choose a random title.

Returns:
Title object (or null if nothing to choose from)

Definition at line 103 of file SpecialRandompage.php.

References $title, array(), Title\makeTitleSafe(), namespaces, selectRandomPageFromDB(), wfRandom(), and wfRunHooks().

Referenced by execute().

Definition at line 52 of file SpecialRandompage.php.

Referenced by execute(), and getQueryInfo().

RandomPage::selectRandomPageFromDB ( randstr,
fname = __METHOD__ 
) [private]

Definition at line 154 of file SpecialRandompage.php.

References $dbr, $fname, $query, $res, getQueryInfo(), and wfGetDB().

Referenced by getRandomTitle().

Definition at line 44 of file SpecialRandompage.php.

References array(), and namespaces.

Referenced by execute().


Member Data Documentation

RandomPage::$extra = array() [protected]

Definition at line 33 of file SpecialRandompage.php.

RandomPage::$isRedir = false [protected]

Definition at line 32 of file SpecialRandompage.php.

RandomPage::$namespaces [private]

Definition at line 31 of file SpecialRandompage.php.


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