-/**
- * Generates a form used to restrict display of contributions
- * to a specific namespace
- *
- * @return none
- * @param string $target target user to show contributions for
- * @param string $hideminor whether minor contributions are hidden
- * @param string $namespace currently selected namespace, NULL for show all
- * @param bool $invert inverts the namespace selection on true (default null)
- */
-function ucNamespaceForm ( $target, $hideminor, $namespace, $invert ) {
- global $wgContLang, $wgScript;
-
- $namespaceselect = "<select name='namespace' id='nsselectbox'>";
- $namespaceselect .= '<option value="" '.(is_null($namespace) ? ' selected="selected"' : '').'>'.wfMsgHtml( 'contributionsall' ).'</option>';
- $arr = $wgContLang->getFormattedNamespaces();
- foreach( $arr as $ns => $name ) {
- if( $ns < NS_MAIN )
- continue;
- $n = $ns === NS_MAIN ? wfMsgHtml( 'blanknamespace' ) : htmlspecialchars( $name );
- $sel = $namespace == $ns ? ' selected="selected"' : '';
- $namespaceselect .= "<option value='$ns'$sel>$n</option>";
- }
- $namespaceselect .= '</select>';
-
- $action = htmlspecialchars( $wgScript );
- $out = "<div class='namespaceselector'><form method='get' action=\"$action\">";
- $out .= '<input type="hidden" name="title" value="' . htmlspecialchars( $wgContLang->specialpage( 'Contributions' ) ) . '" />';
- $out .= '<input type="hidden" name="target" value="' . htmlspecialchars( $target ) . '" />';
- $out .= '<input type="hidden" name="hideminor" value="' . ( $hideminor ? 1 : 0 ) .'" />';
- $out .= "
-<div id='nsselect' class='contributions'>
- <label for='nsselectbox'>" . wfMsgHtml('namespace') . "</label>
- $namespaceselect
- <input type='submit' value=\"" . wfMsgHtml( 'allpagessubmit' ) . "\" />
- <input type='checkbox' name='invert' value='1' id='nsinvert'" . ( $invert ? ' checked="checked"' : '' ) . " />
- <label for='nsinvert'>" . wfMsgHtml('invert') . "</label>
-</div>";
- $out .= '</form></div>';
- return $out;
-}