From: Niklas Laxström Date: Thu, 8 Sep 2011 08:51:32 +0000 (+0000) Subject: Split getTypeMenu into two functions: X-Git-Tag: 1.31.0-rc.0~27803 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=10a47a5324f78c29cb431aef045989f3cc753216;p=lhc%2Fweb%2Fwiklou.git Split getTypeMenu into two functions: * the current functions does the ugly thing extracting the current log type from array * the new function just builds the selector, using XmlSelect - clearer and more flexible --- diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index 43750aebb0..ed65c4e476 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -218,47 +218,45 @@ class LogEventsList { * @return String: Formatted HTML */ private function getTypeMenu( $queryTypes ) { - global $wgLogRestrictions, $wgUser; + $queryType = count($queryTypes) == 1 ? $queryTypes[0] : ''; + $selector = $this->getTypeSelector(); + $selector->setDefault( $queryType ); + return $selector->getHtml(); + } - $html = "'; - return $html; + return $select; } /**