Index: trunk/phase3/includes/LogEventsList.php |
— | — | @@ -583,15 +583,26 @@ |
584 | 584 | * @return Integer Number of total log items (not limited by $lim) |
585 | 585 | */ |
586 | 586 | public static function showLogExtract( &$out, $types=array(), $page='', $user='', |
587 | | - $param = array( 'lim' => 0, 'conds' => array(), 'showIfEmpty' => true, 'msgKey' => array('') ) ) { |
| 587 | + $param = array() ) { |
588 | 588 | |
| 589 | + $defaultParameters = array( |
| 590 | + 'lim' => 0, |
| 591 | + 'conds' => array(), |
| 592 | + 'showIfEmpty' => true, |
| 593 | + 'msgKey' => array('') |
| 594 | + ); |
| 595 | + |
| 596 | + # The + operator appends elements of remaining keys from the right |
| 597 | + # handed array to the left handed, whereas duplicated keys are NOT overwritten. |
| 598 | + $param += $defaultParameters; |
| 599 | + |
589 | 600 | global $wgUser, $wgOut; |
590 | 601 | # Convert $param array to individual variables |
591 | 602 | $lim = $param['lim']; |
592 | 603 | $conds = $param['conds']; |
593 | 604 | $showIfEmpty = $param['showIfEmpty']; |
594 | 605 | $msgKey = $param['msgKey']; |
595 | | - if ( !(is_array($msgKey)) ) |
| 606 | + if ( !is_array($msgKey) ) |
596 | 607 | $msgKey = array( $msgKey ); |
597 | 608 | # Insert list of top 50 (or top $lim) items |
598 | 609 | $loglist = new LogEventsList( $wgUser->getSkin(), $wgOut, 0 ); |