* Check if the given namespace might be moved
* @return bool
*/
- function isMovable( $index ) {
+ static function isMovable( $index ) {
return !( $index < NS_MAIN || $index == NS_IMAGE || $index == NS_CATEGORY );
}
* Check if the given namespace is not a talk page
* @return bool
*/
- function isMain( $index ) {
+ static function isMain( $index ) {
return ! Namespace::isTalk( $index );
}
/**
* Get the talk namespace corresponding to the given index
*/
- function getTalk( $index ) {
+ static function getTalk( $index ) {
if ( Namespace::isTalk( $index ) ) {
return $index;
} else {
}
}
- function getSubject( $index ) {
+ static function getSubject( $index ) {
if ( Namespace::isTalk( $index ) ) {
return $index - 1;
} else {
/**
* Returns the canonical (English Wikipedia) name for a given index
*/
- function getCanonicalName( $index ) {
+ static function getCanonicalName( $index ) {
global $wgCanonicalNamespaceNames;
return $wgCanonicalNamespaceNames[$index];
}
* Returns the index for a given canonical name, or NULL
* The input *must* be converted to lower case first
*/
- function getCanonicalIndex( $name ) {
+ static function getCanonicalIndex( $name ) {
global $wgCanonicalNamespaceNames;
static $xNamespaces = false;
if ( $xNamespaces === false ) {
* Can this namespace ever have a talk namespace?
* @param $index Namespace index
*/
- function canTalk( $index ) {
+ static function canTalk( $index ) {
return( $index >= NS_MAIN );
}
}
* @param $contents String: NULL to make an open tag only; '' for a contentless closed tag (default)\r
* @return string\r
*/\r
- function element( $element, $attribs = null, $contents = '') {\r
+ public static function element( $element, $attribs = null, $contents = '') {\r
$out = '<' . $element;\r
if( !is_null( $attribs ) ) {\r
foreach( $attribs as $name => $val ) {\r
* @param $contents String: NULL to make an open tag only; '' for a contentless closed tag (default)\r
* @return string\r
*/\r
- function elementClean( $element, $attribs = array(), $contents = '') {\r
+ public static function elementClean( $element, $attribs = array(), $contents = '') {\r
if( $attribs ) {\r
$attribs = array_map( array( 'UtfNormal', 'cleanUp' ), $attribs );\r
}\r
* @param $includehidden Bool: include hidden namespaces?\r
* @return String: Html string containing the namespace selector\r
*/\r
- function &namespaceSelector($selected = '', $allnamespaces = null, $includehidden=false) {\r
+ public static function &namespaceSelector($selected = '', $allnamespaces = null, $includehidden=false) {\r
global $wgContLang;\r
if( $selected !== '' ) {\r
if( is_null( $selected ) ) {\r
return $s;\r
}\r
\r
- function span( $text, $class, $attribs=array() ) {\r
+ public static function span( $text, $class, $attribs=array() ) {\r
return self::element( 'span', array( 'class' => $class ) + $attribs, $text );\r
}\r
\r
* Convenience function to build an HTML text input field\r
* @return string HTML\r
*/\r
- function input( $name, $size=false, $value=false, $attribs=array() ) {\r
+ public static function input( $name, $size=false, $value=false, $attribs=array() ) {\r
return self::element( 'input', array(\r
'name' => $name,\r
'size' => $size,\r
* Internal function for use in checkboxes and radio buttons and such.\r
* @return array\r
*/\r
- function attrib( $name, $present = true ) {\r
+ public static function attrib( $name, $present = true ) {\r
return $present ? array( $name => $name ) : array();\r
}\r
\r
* Convenience function to build an HTML checkbox\r
* @return string HTML\r
*/\r
- function check( $name, $checked=false, $attribs=array() ) {\r
+ public static function check( $name, $checked=false, $attribs=array() ) {\r
return self::element( 'input', array(\r
'name' => $name,\r
'type' => 'checkbox',\r
* Convenience function to build an HTML radio button\r
* @return string HTML\r
*/\r
- function radio( $name, $value, $checked=false, $attribs=array() ) {\r
+ public static function radio( $name, $value, $checked=false, $attribs=array() ) {\r
return self::element( 'input', array(\r
'name' => $name,\r
'type' => 'radio',\r
* Convenience function to build an HTML form label\r
* @return string HTML\r
*/\r
- function label( $label, $id ) {\r
+ public static function label( $label, $id ) {\r
return self::element( 'label', array( 'for' => $id ), $label );\r
}\r
\r
* Convenience function to build an HTML text input field with a label\r
* @return string HTML\r
*/\r
- function inputLabel( $label, $name, $id, $size=false, $value=false, $attribs=array() ) {\r
+ public static function inputLabel( $label, $name, $id, $size=false, $value=false, $attribs=array() ) {\r
return Xml::label( $label, $id ) .\r
' ' .\r
self::input( $name, $size, $value, array( 'id' => $id ) + $attribs );\r
* Convenience function to build an HTML checkbox with a label\r
* @return string HTML\r
*/\r
- function checkLabel( $label, $name, $id, $checked=false, $attribs=array() ) {\r
+ public static function checkLabel( $label, $name, $id, $checked=false, $attribs=array() ) {\r
return self::check( $name, $checked, array( 'id' => $id ) + $attribs ) .\r
' ' .\r
self::label( $label, $id );\r
* Convenience function to build an HTML radio button with a label\r
* @return string HTML\r
*/\r
- function radioLabel( $label, $name, $value, $id, $checked=false, $attribs=array() ) {\r
+ public static function radioLabel( $label, $name, $value, $id, $checked=false, $attribs=array() ) {\r
return self::radio( $name, $value, $checked, array( 'id' => $id ) + $attribs ) .\r
' ' .\r
self::label( $label, $id );\r
* @param $attribs Array: optional custom attributes\r
* @return string HTML\r
*/\r
- function submitButton( $value, $attribs=array() ) {\r
+ public static function submitButton( $value, $attribs=array() ) {\r
return self::element( 'input', array( 'type' => 'submit', 'value' => $value ) + $attribs );\r
}\r
\r
* @param $attribs Array: optional custom attributes\r
* @return string HTML\r
*/\r
- function hidden( $name, $value, $attribs=array() ) {\r
+ public static function hidden( $name, $value, $attribs=array() ) {\r
return self::element( 'input', array(\r
'name' => $name,\r
'type' => 'hidden',\r
*\r
* @todo Error position reporting return\r
*/\r
- function isWellFormed( $text ) {\r
+ public static function isWellFormed( $text ) {\r
$parser = xml_parser_create( "UTF-8" );\r
\r
# case folding violates XML standard, turn it off\r
* @param $text String:\r
* @return bool\r
*/\r
- function isWellFormedXmlFragment( $text ) {\r
+ public static function isWellFormedXmlFragment( $text ) {\r
$html =\r
Sanitizer::hackDocType() .\r
'<html>' .\r