+ /**
+ * Show a drop down list to select a group as well as a user name
+ * search box.
+ * @TODO: localize
+ */
+ function getPageHeader( ) {
+ global $wgScript;
+
+ // Various variables used for the form
+ $action = htmlspecialchars( $wgScript );
+ $title = Title::makeTitle( NS_SPECIAL, 'Listusers' );
+ $special = htmlspecialchars( $title->getPrefixedDBkey() );
+
+ // form header
+ $out = '<form method="get" action="'.$action.'">' .
+ '<input type="hidden" name="title" value="'.$special.'" />' .
+ 'Group: <select name="group">' .
+
+ // get all group names and id
+ $dbr = & wfGetDB( DB_SLAVE );
+ $group = $dbr->tableName( 'group' );
+ $sql = "SELECT group_id, group_name FROM $group;";
+ $result = $dbr->query($sql);
+
+ // we want a default empty group
+ $out.= '<option value=""></option>';
+
+ // build the dropdown list menu using datas from the database
+ while($agroup = $dbr->fetchObject( $result )) {
+ $selected = ($agroup->group_id == $this->requestedGroup) ? " selected " : "" ;
+ $out.= '<option value="'.$agroup->group_id.'" '.$selected.'>'.$agroup->group_name.'</option>';
+ }
+ $out .= '</select> ';
+
+ $out .= 'User: <input type="text" name="username" /> ';
+
+ // OK button, end of form.
+ $out .= '<input type="submit" /></form>';
+ // congratulations the form is now build
+ return $out;
+ }
+