+
+ function whatlinkshereForm( $options ) {
+ global $wgScript, $wgTitle;
+
+ $options['title'] = $wgTitle->getPrefixedText();
+
+ $f = Xml::openElement( 'form', array( 'method' => 'get', 'action' => "$wgScript" ) ) .
+ '<fieldset>' .
+ Xml::element( 'legend', array(), wfMsg( 'whatlinkshere' ) );
+
+ foreach ( $options as $name => $value ) {
+ if( $name === 'namespace') continue;
+ $f .= "\t" . Xml::hidden( $name, $value ). "\n";
+ }
+
+ $f .= Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' .
+ Xml::namespaceSelector( $options['namespace'], '' ) .
+ Xml::submitButton( wfMsg( 'allpagessubmit' ) ) .
+ '</fieldset>' .
+ Xml::closeElement( 'form' ) . "\n";
+
+ return $f;
+ }
+
+ function setNamespace( $ns ) {
+ $this->namespace = $ns;
+ }
+