RandomPage Class Reference
[SpecialPage]

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

Inherits SpecialPage.

Inherited by SpecialRandomredirect.

List of all members.

Public Member Functions

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

Protected Attributes

 $isRedir = false
 $extra = array()

Private Member Functions

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

Private Attributes

 $namespaces


Detailed Description

Special page to direct the user to a random page.

Author:
Rob Church <robchur@gmail.com>, Ilmari Karonen GNU General Public Licence 2.0 or later

Definition at line 10 of file SpecialRandompage.php.


Constructor & Destructor Documentation

RandomPage::__construct ( name = 'Randompage'  ) 

Definition at line 15 of file SpecialRandompage.php.

References $name, and $wgContentNamespaces.


Member Function Documentation

RandomPage::addExtraSQL (  ) 

Definition at line 138 of file SpecialRandompage.php.

Referenced by selectRandomPageFromDB().

RandomPage::execute ( par  ) 

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

This may be overridden by subclasses.

Reimplemented from SpecialPage.

Definition at line 35 of file SpecialRandompage.php.

References $title, $wgContLang, $wgOut, getNsList(), getRandomTitle(), isRedirect(), SpecialPage::setHeaders(), and setNamespace().

RandomPage::getNamespaces (  ) 

Definition at line 21 of file SpecialRandompage.php.

RandomPage::getNsList (  )  [private]

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

Returns:
String

Definition at line 60 of file SpecialRandompage.php.

References $n, $wgContLang, and wfMsgForContent().

Referenced by execute().

RandomPage::getRandomTitle (  ) 

Choose a random title.

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

Definition at line 77 of file SpecialRandompage.php.

References $title, Title::makeTitleSafe(), selectRandomPageFromDB(), wfRandom(), and wfRunHooks().

Referenced by execute().

RandomPage::isRedirect (  ) 

Definition at line 31 of file SpecialRandompage.php.

Referenced by execute(), and selectRandomPageFromDB().

RandomPage::selectRandomPageFromDB ( randstr  )  [private]

Definition at line 101 of file SpecialRandompage.php.

References $dbr, $extra, $page, $res, $wgExtraRandompageSQL, addExtraSQL(), isRedirect(), and wfGetDB().

Referenced by getRandomTitle().

RandomPage::setNamespace ( ns  ) 

Definition at line 25 of file SpecialRandompage.php.

Referenced by execute().


Member Data Documentation

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

Definition at line 13 of file SpecialRandompage.php.

Referenced by selectRandomPageFromDB().

RandomPage::$isRedir = false [protected]

Definition at line 12 of file SpecialRandompage.php.

RandomPage::$namespaces [private]

Definition at line 11 of file SpecialRandompage.php.


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

Generated on Sat Apr 30 22:57:47 2011 for MediaWiki by  doxygen 1.5.9