From: Aaron Schulz Date: Sat, 2 May 2009 14:34:45 +0000 (+0000) Subject: Fixed dropdown selector display and other log type issues due to string -> array... X-Git-Tag: 1.31.0-rc.0~41905 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=07146c4b3a502d254955a25bc48f8489b1a6dabb;p=lhc%2Fweb%2Fwiklou.git Fixed dropdown selector display and other log type issues due to string -> array conversion --- diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index 39e9e5aa9c..18a0a7e10b 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -60,7 +60,7 @@ class LogEventsList { /** * Show options for the log list - * @param $type String + * @param $types string or Array * @param $user String * @param $page String * @param $pattern String @@ -69,32 +69,38 @@ class LogEventsList { * @param $filter: array * @param $tagFilter: array? */ - public function showOptions( $type = '', $user = '', $page = '', $pattern = '', $year = '', - $month = '', $filter = null, $tagFilter='' ) + public function showOptions( $types=array(), $user='', $page='', $pattern='', $year='', + $month = '', $filter = null, $tagFilter='' ) { global $wgScript, $wgMiserMode; $action = htmlspecialchars( $wgScript ); $title = SpecialPage::getTitleFor( 'Log' ); $special = htmlspecialchars( $title->getPrefixedDBkey() ); + // For B/C, we take strings, but make sure they are converted... + $types = ($types === '') ? array() : (array)$types; $tagSelector = ChangeTags::buildTagFilterSelector( $tagFilter ); $this->out->addHTML( "
" . Xml::element( 'legend', array(), wfMsg( 'log' ) ) . Xml::hidden( 'title', $special ) . "\n" . - $this->getTypeMenu( $type ) . "\n" . + $this->getTypeMenu( $types ) . "\n" . $this->getUserInput( $user ) . "\n" . $this->getTitleInput( $page ) . "\n" . ( !$wgMiserMode ? ($this->getTitlePattern( $pattern )."\n") : "" ) . "

" . Xml::dateMenu( $year, $month ) . "\n" . ( $tagSelector ? Xml::tags( 'p', null, implode( ' ', $tagSelector ) ) :'' ). "\n" . - ( $filter ? "

".$this->getFilterLinks( $type, $filter )."\n" : "" ) . "\n" . + ( $filter ? "

".$this->getFilterLinks( $filter )."\n" : "" ) . "\n" . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "

\n" . "
" ); } - private function getFilterLinks( $logType, $filter ) { + /** + * @param $filter Array + * @return String: Formatted HTML + */ + private function getFilterLinks( $filter ) { global $wgTitle, $wgLang; // show/hide links $messages = array( wfMsgHtml( 'show' ), wfMsgHtml( 'hide' ) ); @@ -128,10 +134,10 @@ class LogEventsList { } /** - * @param $queryType String + * @param $queryTypes Array * @return String: Formatted HTML */ - private function getTypeMenu( $queryType ) { + private function getTypeMenu( $queryTypes ) { global $wgLogRestrictions, $wgUser; $html = "