From 10a47a5324f78c29cb431aef045989f3cc753216 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Thu, 8 Sep 2011 08:51:32 +0000 Subject: [PATCH] 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 --- includes/LogEventsList.php | 54 ++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 28 deletions(-) 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; } /** -- 2.20.1