- $this->out->addHTML( "<form action=\"$action\" method=\"get\"><fieldset>" .
- Xml::element( 'legend', array(), wfMsg( 'log' ) ) .
- Xml::hidden( 'title', $special ) . "\n" .
- $this->getTypeMenu( $type ) . "\n" .
- $this->getUserInput( $user ) . "\n" .
- $this->getTitleInput( $page ) . "\n" .
- ( !$wgMiserMode ? ($this->getTitlePattern( $pattern )."\n") : "" ) .
- "<p>" . $this->getDateMenu( $year, $month ) . "\n" .
- Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "</p>\n" .
- "</fieldset></form>" );
+ $this->out->addHTML( $html );
+ }
+
+ /**
+ * @param $filter Array
+ * @return String: Formatted HTML
+ */
+ private function getFilterLinks( $filter ) {
+ global $wgTitle, $wgLang;
+ // show/hide links
+ $messages = array( wfMsgHtml( 'show' ), wfMsgHtml( 'hide' ) );
+ // Option value -> message mapping
+ $links = array();
+ $hiddens = ''; // keep track for "go" button
+ foreach( $filter as $type => $val ) {
+ // Should the below assignment be outside the foreach?
+ // Then it would have to be copied. Not certain what is more expensive.
+ $query = $this->getDefaultQuery();
+ $queryKey = "hide_{$type}_log";
+
+ $hideVal = 1 - intval($val);
+ $query[$queryKey] = $hideVal;
+
+ $link = $this->skin->link(
+ $wgTitle,
+ $messages[$hideVal],
+ array(),
+ $query,
+ array( 'known', 'noclasses' )
+ );
+
+ $links[$type] = wfMsgHtml( "log-show-hide-{$type}", $link );
+ $hiddens .= Xml::hidden( "hide_{$type}_log", $val ) . "\n";
+ }
+ // Build links
+ return '<small>'.$wgLang->pipeList( $links ) . '</small>' . $hiddens;
+ }
+
+ private function getDefaultQuery() {
+ if ( !isset( $this->mDefaultQuery ) ) {
+ $this->mDefaultQuery = $_GET;
+ unset( $this->mDefaultQuery['title'] );
+ unset( $this->mDefaultQuery['dir'] );
+ unset( $this->mDefaultQuery['offset'] );
+ unset( $this->mDefaultQuery['limit'] );
+ unset( $this->mDefaultQuery['order'] );
+ unset( $this->mDefaultQuery['month'] );
+ unset( $this->mDefaultQuery['year'] );
+ }
+ return $this->mDefaultQuery;