2008-04-02 05:48:16 +00:00
|
|
|
<?php
|
2010-08-08 14:28:01 +00:00
|
|
|
/**
|
|
|
|
|
* Contain classes to list log entries
|
|
|
|
|
*
|
|
|
|
|
* Copyright © 2004 Brion Vibber <brion@pobox.com>, 2008 Aaron Schulz
|
2014-03-13 22:23:56 +00:00
|
|
|
* https://www.mediawiki.org/
|
2010-08-08 14:28:01 +00:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
*
|
|
|
|
|
* @file
|
|
|
|
|
*/
|
2008-04-02 05:48:16 +00:00
|
|
|
|
2012-06-16 15:33:21 +00:00
|
|
|
class LogEventsList extends ContextSource {
|
2008-04-02 05:48:16 +00:00
|
|
|
const NO_ACTION_LINK = 1;
|
2010-03-01 22:47:12 +00:00
|
|
|
const NO_EXTRA_USER_LINKS = 2;
|
2012-06-05 22:58:54 +00:00
|
|
|
const USE_REVDEL_CHECKBOXES = 4;
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2008-04-02 16:24:30 +00:00
|
|
|
public $flags;
|
2008-04-02 05:48:16 +00:00
|
|
|
|
2011-03-13 21:17:37 +00:00
|
|
|
/**
|
2014-04-19 20:22:20 +00:00
|
|
|
* @var array
|
2011-03-13 21:17:37 +00:00
|
|
|
*/
|
|
|
|
|
protected $mDefaultQuery;
|
|
|
|
|
|
2012-06-16 15:33:21 +00:00
|
|
|
/**
|
|
|
|
|
* Constructor.
|
|
|
|
|
* The first two parameters used to be $skin and $out, but now only a context
|
|
|
|
|
* is needed, that's why there's a second unused parameter.
|
|
|
|
|
*
|
2013-12-03 18:26:59 +00:00
|
|
|
* @param IContextSource|Skin $context Context to use; formerly it was
|
|
|
|
|
* a Skin object. Use of Skin is deprecated.
|
|
|
|
|
* @param null $unused Unused; used to be an OutputPage object.
|
|
|
|
|
* @param int $flags Can be a combination of self::NO_ACTION_LINK,
|
|
|
|
|
* self::NO_EXTRA_USER_LINKS or self::USE_REVDEL_CHECKBOXES.
|
2012-06-16 15:33:21 +00:00
|
|
|
*/
|
|
|
|
|
public function __construct( $context, $unused = null, $flags = 0 ) {
|
|
|
|
|
if ( $context instanceof IContextSource ) {
|
|
|
|
|
$this->setContext( $context );
|
|
|
|
|
} else {
|
|
|
|
|
// Old parameters, $context should be a Skin object
|
|
|
|
|
$this->setContext( $context->getContext() );
|
|
|
|
|
}
|
|
|
|
|
|
2008-04-02 05:48:16 +00:00
|
|
|
$this->flags = $flags;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Show options for the log list
|
2010-06-03 21:00:51 +00:00
|
|
|
*
|
2013-12-03 18:26:59 +00:00
|
|
|
* @param array|string $types
|
|
|
|
|
* @param string $user
|
|
|
|
|
* @param string $page
|
|
|
|
|
* @param string $pattern
|
|
|
|
|
* @param int $year Year
|
|
|
|
|
* @param int $month Month
|
|
|
|
|
* @param array $filter
|
|
|
|
|
* @param string $tagFilter Tag to select by default
|
2008-04-02 05:48:16 +00:00
|
|
|
*/
|
2013-12-03 21:52:43 +00:00
|
|
|
public function showOptions( $types = array(), $user = '', $page = '', $pattern = '', $year = 0,
|
|
|
|
|
$month = 0, $filter = null, $tagFilter = ''
|
|
|
|
|
) {
|
2008-04-02 05:48:16 +00:00
|
|
|
global $wgScript, $wgMiserMode;
|
2009-10-11 19:55:56 +00:00
|
|
|
|
2008-04-02 05:48:16 +00:00
|
|
|
$title = SpecialPage::getTitleFor( 'Log' );
|
2009-10-11 19:55:56 +00:00
|
|
|
|
2009-05-02 14:34:45 +00:00
|
|
|
// For B/C, we take strings, but make sure they are converted...
|
2013-04-20 15:38:24 +00:00
|
|
|
$types = ( $types === '' ) ? array() : (array)$types;
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2009-01-30 23:24:29 +00:00
|
|
|
$tagSelector = ChangeTags::buildTagFilterSelector( $tagFilter );
|
2009-10-11 19:55:56 +00:00
|
|
|
|
2012-06-15 20:04:44 +00:00
|
|
|
$html = Html::hidden( 'title', $title->getPrefixedDBkey() );
|
2009-10-11 19:55:56 +00:00
|
|
|
|
2009-08-10 17:36:57 +00:00
|
|
|
// Basic selectors
|
|
|
|
|
$html .= $this->getTypeMenu( $types ) . "\n";
|
|
|
|
|
$html .= $this->getUserInput( $user ) . "\n";
|
|
|
|
|
$html .= $this->getTitleInput( $page ) . "\n";
|
2009-09-14 17:09:13 +00:00
|
|
|
$html .= $this->getExtraInputs( $types ) . "\n";
|
2009-01-30 23:24:29 +00:00
|
|
|
|
2009-08-10 17:36:57 +00:00
|
|
|
// Title pattern, if allowed
|
2013-02-03 18:30:03 +00:00
|
|
|
if ( !$wgMiserMode ) {
|
2009-08-10 17:36:57 +00:00
|
|
|
$html .= $this->getTitlePattern( $pattern ) . "\n";
|
|
|
|
|
}
|
2009-10-11 19:55:56 +00:00
|
|
|
|
2009-08-10 17:36:57 +00:00
|
|
|
// date menu
|
2013-12-03 21:52:43 +00:00
|
|
|
$html .= Xml::tags( 'p', null, Xml::dateMenu( (int)$year, (int)$month ) );
|
2009-10-11 19:55:56 +00:00
|
|
|
|
2009-08-10 17:36:57 +00:00
|
|
|
// Tag filter
|
2013-02-03 18:30:03 +00:00
|
|
|
if ( $tagSelector ) {
|
2010-05-30 17:33:59 +00:00
|
|
|
$html .= Xml::tags( 'p', null, implode( ' ', $tagSelector ) );
|
2009-08-10 17:36:57 +00:00
|
|
|
}
|
2009-10-11 19:55:56 +00:00
|
|
|
|
2009-08-10 17:36:57 +00:00
|
|
|
// Filter links
|
2013-02-03 18:30:03 +00:00
|
|
|
if ( $filter ) {
|
2009-08-10 17:36:57 +00:00
|
|
|
$html .= Xml::tags( 'p', null, $this->getFilterLinks( $filter ) );
|
|
|
|
|
}
|
2009-10-11 19:55:56 +00:00
|
|
|
|
2009-08-10 17:36:57 +00:00
|
|
|
// Submit button
|
2012-06-16 15:33:21 +00:00
|
|
|
$html .= Xml::submitButton( $this->msg( 'allpagessubmit' )->text() );
|
2009-10-11 19:55:56 +00:00
|
|
|
|
2009-08-10 17:36:57 +00:00
|
|
|
// Fieldset
|
2012-06-16 15:33:21 +00:00
|
|
|
$html = Xml::fieldset( $this->msg( 'log' )->text(), $html );
|
2009-10-11 19:55:56 +00:00
|
|
|
|
2009-08-10 17:36:57 +00:00
|
|
|
// Form wrapping
|
2012-06-15 20:04:44 +00:00
|
|
|
$html = Xml::tags( 'form', array( 'action' => $wgScript, 'method' => 'get' ), $html );
|
2009-08-10 17:36:57 +00:00
|
|
|
|
2012-06-16 15:33:21 +00:00
|
|
|
$this->getOutput()->addHTML( $html );
|
2008-10-27 07:18:36 +00:00
|
|
|
}
|
2009-10-11 19:55:56 +00:00
|
|
|
|
2009-05-02 14:34:45 +00:00
|
|
|
/**
|
2013-12-03 18:26:59 +00:00
|
|
|
* @param array $filter
|
|
|
|
|
* @return string Formatted HTML
|
2009-05-02 14:34:45 +00:00
|
|
|
*/
|
|
|
|
|
private function getFilterLinks( $filter ) {
|
2008-10-27 07:18:36 +00:00
|
|
|
// show/hide links
|
2012-06-16 15:33:21 +00:00
|
|
|
$messages = array( $this->msg( 'show' )->escaped(), $this->msg( 'hide' )->escaped() );
|
2008-10-27 07:18:36 +00:00
|
|
|
// Option value -> message mapping
|
|
|
|
|
$links = array();
|
2009-02-12 19:02:14 +00:00
|
|
|
$hiddens = ''; // keep track for "go" button
|
2013-04-20 15:38:24 +00:00
|
|
|
foreach ( $filter as $type => $val ) {
|
2009-06-08 10:07:33 +00:00
|
|
|
// 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";
|
|
|
|
|
|
2013-02-03 18:30:03 +00:00
|
|
|
$hideVal = 1 - intval( $val );
|
2009-06-22 03:06:04 +00:00
|
|
|
$query[$queryKey] = $hideVal;
|
2009-06-08 10:07:33 +00:00
|
|
|
|
2012-06-15 20:04:44 +00:00
|
|
|
$link = Linker::linkKnown(
|
2012-09-07 22:28:16 +00:00
|
|
|
$this->getTitle(),
|
2009-06-08 10:07:33 +00:00
|
|
|
$messages[$hideVal],
|
|
|
|
|
array(),
|
2012-06-15 20:04:44 +00:00
|
|
|
$query
|
2008-10-27 07:18:36 +00:00
|
|
|
);
|
2009-06-08 10:07:33 +00:00
|
|
|
|
2013-09-04 11:56:47 +00:00
|
|
|
// Message: log-show-hide-patrol
|
2012-06-16 15:33:21 +00:00
|
|
|
$links[$type] = $this->msg( "log-show-hide-{$type}" )->rawParams( $link )->escaped();
|
2010-10-31 16:20:48 +00:00
|
|
|
$hiddens .= Html::hidden( "hide_{$type}_log", $val ) . "\n";
|
2008-10-27 07:18:36 +00:00
|
|
|
}
|
2013-12-03 14:36:21 +00:00
|
|
|
|
2008-10-27 07:18:36 +00:00
|
|
|
// Build links
|
2013-02-03 18:30:03 +00:00
|
|
|
return '<small>' . $this->getLanguage()->pipeList( $links ) . '</small>' . $hiddens;
|
2008-10-27 07:18:36 +00:00
|
|
|
}
|
2009-10-11 19:55:56 +00:00
|
|
|
|
2008-10-27 07:18:36 +00:00
|
|
|
private function getDefaultQuery() {
|
|
|
|
|
if ( !isset( $this->mDefaultQuery ) ) {
|
2012-06-16 15:33:21 +00:00
|
|
|
$this->mDefaultQuery = $this->getRequest()->getQueryValues();
|
2008-10-27 07:18:36 +00:00
|
|
|
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'] );
|
|
|
|
|
}
|
2013-12-03 14:36:21 +00:00
|
|
|
|
2008-10-27 07:18:36 +00:00
|
|
|
return $this->mDefaultQuery;
|
2008-04-02 05:48:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2013-12-03 18:26:59 +00:00
|
|
|
* @param array $queryTypes
|
|
|
|
|
* @return string Formatted HTML
|
2008-04-02 05:48:16 +00:00
|
|
|
*/
|
2009-05-02 14:34:45 +00:00
|
|
|
private function getTypeMenu( $queryTypes ) {
|
2013-02-03 18:30:03 +00:00
|
|
|
$queryType = count( $queryTypes ) == 1 ? $queryTypes[0] : '';
|
2011-09-08 08:51:32 +00:00
|
|
|
$selector = $this->getTypeSelector();
|
|
|
|
|
$selector->setDefault( $queryType );
|
2013-12-03 14:36:21 +00:00
|
|
|
|
2011-09-08 08:51:32 +00:00
|
|
|
return $selector->getHtml();
|
|
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2011-09-08 08:51:32 +00:00
|
|
|
/**
|
|
|
|
|
* Returns log page selector.
|
|
|
|
|
* @return XmlSelect
|
|
|
|
|
* @since 1.19
|
|
|
|
|
*/
|
|
|
|
|
public function getTypeSelector() {
|
2008-11-04 00:33:09 +00:00
|
|
|
$typesByName = array(); // Temporary array
|
2008-04-02 05:48:16 +00:00
|
|
|
// First pass to load the log names
|
2013-04-20 15:38:24 +00:00
|
|
|
foreach ( LogPage::validTypes() as $type ) {
|
2011-09-08 08:51:32 +00:00
|
|
|
$page = new LogPage( $type );
|
|
|
|
|
$restriction = $page->getRestriction();
|
2012-06-16 15:33:21 +00:00
|
|
|
if ( $this->getUser()->isAllowed( $restriction ) ) {
|
2011-09-08 08:51:32 +00:00
|
|
|
$typesByName[$type] = $page->getName()->text();
|
|
|
|
|
}
|
2008-04-02 05:48:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Second pass to sort by name
|
2013-02-03 18:30:03 +00:00
|
|
|
asort( $typesByName );
|
2008-04-02 05:48:16 +00:00
|
|
|
|
2010-04-07 12:16:56 +00:00
|
|
|
// Always put "All public logs" on top
|
2011-09-08 08:51:32 +00:00
|
|
|
$public = $typesByName[''];
|
|
|
|
|
unset( $typesByName[''] );
|
|
|
|
|
$typesByName = array( '' => $public ) + $typesByName;
|
2010-04-07 12:16:56 +00:00
|
|
|
|
2011-09-08 08:51:32 +00:00
|
|
|
$select = new XmlSelect( 'type' );
|
2013-04-20 15:38:24 +00:00
|
|
|
foreach ( $typesByName as $type => $name ) {
|
2011-09-08 08:51:32 +00:00
|
|
|
$select->addOption( $name, $type );
|
2008-04-02 05:48:16 +00:00
|
|
|
}
|
|
|
|
|
|
2011-09-08 08:51:32 +00:00
|
|
|
return $select;
|
2008-04-02 05:48:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2013-12-03 18:26:59 +00:00
|
|
|
* @param string $user
|
|
|
|
|
* @return string Formatted HTML
|
2008-04-02 05:48:16 +00:00
|
|
|
*/
|
|
|
|
|
private function getUserInput( $user ) {
|
2013-12-03 14:58:51 +00:00
|
|
|
$label = Xml::inputLabel(
|
|
|
|
|
$this->msg( 'specialloguserlabel' )->text(),
|
|
|
|
|
'user',
|
|
|
|
|
'mw-log-user',
|
|
|
|
|
15,
|
2014-02-01 20:49:12 +00:00
|
|
|
$user,
|
|
|
|
|
array( 'class' => 'mw-autocomplete-user' )
|
2013-12-03 14:58:51 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return '<span style="white-space: nowrap">' . $label . '</span>';
|
2008-04-02 05:48:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2013-12-03 18:26:59 +00:00
|
|
|
* @param string $title
|
|
|
|
|
* @return string Formatted HTML
|
2008-04-02 05:48:16 +00:00
|
|
|
*/
|
|
|
|
|
private function getTitleInput( $title ) {
|
2013-12-03 14:58:51 +00:00
|
|
|
$label = Xml::inputLabel(
|
|
|
|
|
$this->msg( 'speciallogtitlelabel' )->text(),
|
|
|
|
|
'page',
|
|
|
|
|
'mw-log-page',
|
|
|
|
|
20,
|
|
|
|
|
$title
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return '<span style="white-space: nowrap">' . $label . '</span>';
|
2008-04-02 05:48:16 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2008-04-02 05:48:16 +00:00
|
|
|
/**
|
2014-04-19 20:22:20 +00:00
|
|
|
* @param string $pattern
|
2011-09-04 21:40:17 +00:00
|
|
|
* @return string Checkbox
|
2008-04-02 05:48:16 +00:00
|
|
|
*/
|
|
|
|
|
private function getTitlePattern( $pattern ) {
|
2008-04-12 06:11:09 +00:00
|
|
|
return '<span style="white-space: nowrap">' .
|
2012-06-16 15:33:21 +00:00
|
|
|
Xml::checkLabel( $this->msg( 'log-title-wildcard' )->text(), 'pattern', 'pattern', $pattern ) .
|
2008-04-12 06:11:09 +00:00
|
|
|
'</span>';
|
2008-04-02 05:48:16 +00:00
|
|
|
}
|
2009-10-11 19:55:56 +00:00
|
|
|
|
2011-09-04 21:40:17 +00:00
|
|
|
/**
|
2013-12-03 18:26:59 +00:00
|
|
|
* @param array $types
|
2011-09-04 21:40:17 +00:00
|
|
|
* @return string
|
|
|
|
|
*/
|
2009-09-14 17:09:13 +00:00
|
|
|
private function getExtraInputs( $types ) {
|
2014-10-28 17:49:19 +00:00
|
|
|
if ( count( $types ) == 1 ) {
|
|
|
|
|
if ( $types[0] == 'suppress' ) {
|
|
|
|
|
$offender = $this->getRequest()->getVal( 'offender' );
|
|
|
|
|
$user = User::newFromName( $offender, false );
|
|
|
|
|
if ( !$user || ( $user->getId() == 0 && !IP::isIPAddress( $offender ) ) ) {
|
|
|
|
|
$offender = ''; // Blank field if invalid
|
|
|
|
|
}
|
|
|
|
|
return Xml::inputLabel( $this->msg( 'revdelete-offender' )->text(), 'offender',
|
|
|
|
|
'mw-log-offender', 20, $offender );
|
|
|
|
|
} else {
|
|
|
|
|
// Allow extensions to add their own extra inputs
|
|
|
|
|
$input = '';
|
2014-12-09 07:23:30 +00:00
|
|
|
Hooks::run( 'LogEventsListGetExtraInputs', array( $types[0], $this, &$input ) );
|
2014-10-28 17:49:19 +00:00
|
|
|
return $input;
|
|
|
|
|
}
|
2009-09-14 17:09:13 +00:00
|
|
|
}
|
2013-12-03 14:36:21 +00:00
|
|
|
|
2009-09-14 17:09:13 +00:00
|
|
|
return '';
|
|
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2011-09-04 21:40:17 +00:00
|
|
|
/**
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2008-04-02 17:43:57 +00:00
|
|
|
public function beginLogEventsList() {
|
2008-04-08 18:20:28 +00:00
|
|
|
return "<ul>\n";
|
2008-04-02 07:10:41 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2011-09-04 21:40:17 +00:00
|
|
|
/**
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2008-04-02 17:43:57 +00:00
|
|
|
public function endLogEventsList() {
|
2008-04-08 18:20:28 +00:00
|
|
|
return "</ul>\n";
|
2008-04-02 07:10:41 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2008-12-07 19:56:02 +00:00
|
|
|
/**
|
2013-12-03 18:26:59 +00:00
|
|
|
* @param stdClass $row A single row from the result set
|
|
|
|
|
* @return string Formatted HTML list item
|
2008-04-02 05:48:16 +00:00
|
|
|
*/
|
|
|
|
|
public function logLine( $row ) {
|
2011-09-08 08:57:02 +00:00
|
|
|
$entry = DatabaseLogEntry::newFromRow( $row );
|
|
|
|
|
$formatter = LogFormatter::newFromEntry( $entry );
|
2012-06-16 15:33:21 +00:00
|
|
|
$formatter->setContext( $this->getContext() );
|
2011-09-08 08:57:02 +00:00
|
|
|
$formatter->setShowUserToolLinks( !( $this->flags & self::NO_EXTRA_USER_LINKS ) );
|
|
|
|
|
|
2012-06-30 18:18:03 +00:00
|
|
|
$time = htmlspecialchars( $this->getLanguage()->userTimeAndDate(
|
|
|
|
|
$entry->getTimestamp(), $this->getUser() ) );
|
|
|
|
|
|
2011-09-08 08:57:02 +00:00
|
|
|
$action = $formatter->getActionText();
|
|
|
|
|
|
2012-06-30 18:18:03 +00:00
|
|
|
if ( $this->flags & self::NO_ACTION_LINK ) {
|
|
|
|
|
$revert = '';
|
|
|
|
|
} else {
|
|
|
|
|
$revert = $formatter->getActionLinks();
|
|
|
|
|
if ( $revert != '' ) {
|
|
|
|
|
$revert = '<span class="mw-logevent-actionlink">' . $revert . '</span>';
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-09-08 08:57:02 +00:00
|
|
|
|
2012-06-30 18:18:03 +00:00
|
|
|
$comment = $formatter->getComment();
|
2010-03-01 22:47:12 +00:00
|
|
|
|
|
|
|
|
// Some user can hide log items and have review links
|
|
|
|
|
$del = $this->getShowHideLinks( $row );
|
|
|
|
|
|
|
|
|
|
// Any tags...
|
|
|
|
|
list( $tagDisplay, $newClasses ) = ChangeTags::formatSummaryRow( $row->ts_tags, 'logevent' );
|
2012-06-30 18:18:03 +00:00
|
|
|
$classes = array_merge(
|
|
|
|
|
array( 'mw-logline-' . $entry->getType() ),
|
|
|
|
|
$newClasses
|
|
|
|
|
);
|
2010-03-01 22:47:12 +00:00
|
|
|
|
2012-06-30 18:18:03 +00:00
|
|
|
return Html::rawElement( 'li', array( 'class' => $classes ),
|
|
|
|
|
"$del $time $action $comment $revert $tagDisplay" ) . "\n";
|
2008-04-02 05:48:16 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2008-04-02 05:48:16 +00:00
|
|
|
/**
|
2013-12-03 18:26:59 +00:00
|
|
|
* @param stdClass $row Row
|
2008-04-13 15:18:59 +00:00
|
|
|
* @return string
|
2008-04-02 05:48:16 +00:00
|
|
|
*/
|
2008-11-04 00:33:09 +00:00
|
|
|
private function getShowHideLinks( $row ) {
|
2013-12-03 14:36:21 +00:00
|
|
|
// We don't want to see the links and
|
|
|
|
|
// no one can hide items from the suppress log.
|
|
|
|
|
if ( ( $this->flags == self::NO_ACTION_LINK )
|
|
|
|
|
|| $row->log_type == 'suppress'
|
|
|
|
|
) {
|
2010-03-01 22:47:12 +00:00
|
|
|
return '';
|
2009-10-30 02:14:22 +00:00
|
|
|
}
|
2010-03-01 22:47:12 +00:00
|
|
|
$del = '';
|
2012-06-16 15:33:21 +00:00
|
|
|
$user = $this->getUser();
|
2012-06-25 16:07:51 +00:00
|
|
|
// Don't show useless checkbox to people who cannot hide log entries
|
2013-04-20 15:38:24 +00:00
|
|
|
if ( $user->isAllowed( 'deletedhistory' ) ) {
|
2012-09-21 13:16:29 +00:00
|
|
|
$canHide = $user->isAllowed( 'deletelogentry' );
|
2014-07-20 17:13:38 +00:00
|
|
|
$canViewSuppressedOnly = $user->isAllowed( 'viewsuppressed' ) &&
|
|
|
|
|
!$user->isAllowed( 'suppressrevision' );
|
|
|
|
|
$entryIsSuppressed = self::isDeleted( $row, LogPage::DELETED_RESTRICTED );
|
|
|
|
|
$canViewThisSuppressedEntry = $canViewSuppressedOnly && $entryIsSuppressed;
|
2013-04-20 15:38:24 +00:00
|
|
|
if ( $row->log_deleted || $canHide ) {
|
2013-12-03 14:58:51 +00:00
|
|
|
// Show checkboxes instead of links.
|
2014-07-20 17:13:38 +00:00
|
|
|
if ( $canHide && $this->flags & self::USE_REVDEL_CHECKBOXES && !$canViewThisSuppressedEntry ) {
|
2013-12-03 14:58:51 +00:00
|
|
|
// If event was hidden from sysops
|
|
|
|
|
if ( !self::userCan( $row, LogPage::DELETED_RESTRICTED, $user ) ) {
|
2012-06-05 22:58:54 +00:00
|
|
|
$del = Xml::check( 'deleterevisions', false, array( 'disabled' => 'disabled' ) );
|
|
|
|
|
} else {
|
2013-12-03 14:58:51 +00:00
|
|
|
$del = Xml::check(
|
|
|
|
|
'showhiderevisions',
|
|
|
|
|
false,
|
|
|
|
|
array( 'name' => 'ids[' . $row->log_id . ']' )
|
|
|
|
|
);
|
2012-06-05 22:58:54 +00:00
|
|
|
}
|
2010-03-01 22:47:12 +00:00
|
|
|
} else {
|
2013-12-03 14:58:51 +00:00
|
|
|
// If event was hidden from sysops
|
|
|
|
|
if ( !self::userCan( $row, LogPage::DELETED_RESTRICTED, $user ) ) {
|
2012-06-05 22:58:54 +00:00
|
|
|
$del = Linker::revDeleteLinkDisabled( $canHide );
|
|
|
|
|
} else {
|
|
|
|
|
$query = array(
|
|
|
|
|
'target' => SpecialPage::getTitleFor( 'Log', $row->log_type )->getPrefixedDBkey(),
|
2013-04-20 15:38:24 +00:00
|
|
|
'type' => 'logging',
|
|
|
|
|
'ids' => $row->log_id,
|
2012-06-05 22:58:54 +00:00
|
|
|
);
|
2013-12-03 14:58:51 +00:00
|
|
|
$del = Linker::revDeleteLink(
|
|
|
|
|
$query,
|
2014-07-20 17:13:38 +00:00
|
|
|
$entryIsSuppressed,
|
|
|
|
|
$canHide && !$canViewThisSuppressedEntry
|
2013-12-03 14:58:51 +00:00
|
|
|
);
|
2012-06-05 22:58:54 +00:00
|
|
|
}
|
2010-03-01 22:47:12 +00:00
|
|
|
}
|
|
|
|
|
}
|
2008-04-02 05:48:16 +00:00
|
|
|
}
|
2013-12-03 14:36:21 +00:00
|
|
|
|
2009-01-18 21:07:09 +00:00
|
|
|
return $del;
|
2008-04-02 05:48:16 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2008-04-13 15:18:59 +00:00
|
|
|
/**
|
2013-12-03 18:26:59 +00:00
|
|
|
* @param stdClass $row Row
|
|
|
|
|
* @param string|array $type
|
|
|
|
|
* @param string|array $action
|
|
|
|
|
* @param string $right
|
|
|
|
|
* @return bool
|
2008-04-13 15:18:59 +00:00
|
|
|
*/
|
2013-02-03 18:30:03 +00:00
|
|
|
public static function typeAction( $row, $type, $action, $right = '' ) {
|
|
|
|
|
$match = is_array( $type ) ?
|
2009-10-11 19:55:56 +00:00
|
|
|
in_array( $row->log_type, $type ) : $row->log_type == $type;
|
2013-04-20 15:38:24 +00:00
|
|
|
if ( $match ) {
|
2009-10-11 19:55:56 +00:00
|
|
|
$match = is_array( $action ) ?
|
|
|
|
|
in_array( $row->log_action, $action ) : $row->log_action == $action;
|
2013-04-20 15:38:24 +00:00
|
|
|
if ( $match && $right ) {
|
2008-12-16 19:20:35 +00:00
|
|
|
global $wgUser;
|
|
|
|
|
$match = $wgUser->isAllowed( $right );
|
|
|
|
|
}
|
2008-04-16 18:05:54 +00:00
|
|
|
}
|
2013-12-03 14:36:21 +00:00
|
|
|
|
2008-09-05 17:34:44 +00:00
|
|
|
return $match;
|
2008-04-13 15:18:59 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2008-04-02 17:11:58 +00:00
|
|
|
/**
|
|
|
|
|
* Determine if the current user is allowed to view a particular
|
|
|
|
|
* field of this log row, if it's marked as deleted.
|
2010-06-03 21:00:51 +00:00
|
|
|
*
|
2013-12-03 18:26:59 +00:00
|
|
|
* @param stdClass $row Row
|
|
|
|
|
* @param int $field
|
|
|
|
|
* @param User $user User to check, or null to use $wgUser
|
|
|
|
|
* @return bool
|
2008-04-02 17:11:58 +00:00
|
|
|
*/
|
2011-10-12 15:09:04 +00:00
|
|
|
public static function userCan( $row, $field, User $user = null ) {
|
|
|
|
|
return self::userCanBitfield( $row->log_deleted, $field, $user );
|
2009-10-15 11:31:33 +00:00
|
|
|
}
|
2010-06-03 21:00:51 +00:00
|
|
|
|
2009-10-15 11:31:33 +00:00
|
|
|
/**
|
|
|
|
|
* Determine if the current user is allowed to view a particular
|
|
|
|
|
* field of this log row, if it's marked as deleted.
|
2010-06-03 21:00:51 +00:00
|
|
|
*
|
2013-12-03 18:26:59 +00:00
|
|
|
* @param int $bitfield Current field
|
|
|
|
|
* @param int $field
|
|
|
|
|
* @param User $user User to check, or null to use $wgUser
|
|
|
|
|
* @return bool
|
2009-10-15 11:31:33 +00:00
|
|
|
*/
|
2011-10-12 15:09:04 +00:00
|
|
|
public static function userCanBitfield( $bitfield, $field, User $user = null ) {
|
2013-04-20 15:38:24 +00:00
|
|
|
if ( $bitfield & $field ) {
|
2011-10-12 15:09:04 +00:00
|
|
|
if ( $user === null ) {
|
|
|
|
|
global $wgUser;
|
|
|
|
|
$user = $wgUser;
|
|
|
|
|
}
|
2014-06-12 22:18:51 +00:00
|
|
|
if ( $bitfield & LogPage::DELETED_RESTRICTED ) {
|
|
|
|
|
$permissions = array( 'suppressrevision', 'viewsuppressed' );
|
|
|
|
|
} else {
|
|
|
|
|
$permissions = array( 'deletedhistory' );
|
|
|
|
|
}
|
2014-07-20 17:43:39 +00:00
|
|
|
$permissionlist = implode( ', ', $permissions );
|
|
|
|
|
wfDebug( "Checking for $permissionlist due to $field match on $bitfield\n" );
|
2014-06-12 22:18:51 +00:00
|
|
|
return call_user_func_array( array( $user, 'isAllowedAny' ), $permissions );
|
2008-04-02 17:11:58 +00:00
|
|
|
}
|
2013-12-03 21:49:59 +00:00
|
|
|
return true;
|
2008-04-02 17:11:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2013-12-03 18:26:59 +00:00
|
|
|
* @param stdClass $row Row
|
|
|
|
|
* @param int $field One of DELETED_* bitfield constants
|
|
|
|
|
* @return bool
|
2008-04-02 17:11:58 +00:00
|
|
|
*/
|
|
|
|
|
public static function isDeleted( $row, $field ) {
|
2009-10-11 19:55:56 +00:00
|
|
|
return ( $row->log_deleted & $field ) == $field;
|
2008-04-02 17:11:58 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2008-04-02 19:01:41 +00:00
|
|
|
/**
|
2009-09-13 22:21:11 +00:00
|
|
|
* Show log extract. Either with text and a box (set $msgKey) or without (don't set $msgKey)
|
2010-06-03 21:00:51 +00:00
|
|
|
*
|
2013-12-03 18:26:59 +00:00
|
|
|
* @param OutputPage|string $out By-reference
|
2013-03-11 17:15:01 +00:00
|
|
|
* @param string|array $types Log types to show
|
|
|
|
|
* @param string|Title $page The page title to show log entries for
|
|
|
|
|
* @param string $user The user who made the log entries
|
|
|
|
|
* @param array $param Associative Array with the following additional options:
|
2009-10-11 19:55:56 +00:00
|
|
|
* - lim Integer Limit of items to show, default is 50
|
|
|
|
|
* - conds Array Extra conditions for the query (e.g. "log_action != 'revision'")
|
|
|
|
|
* - showIfEmpty boolean Set to false if you don't want any output in case the loglist is empty
|
|
|
|
|
* if set to true (default), "No matching items in log" is displayed if loglist is empty
|
|
|
|
|
* - msgKey Array If you want a nice box with a message, set this to the key of the message.
|
|
|
|
|
* First element is the message key, additional optional elements are parameters for the key
|
2012-06-16 15:33:21 +00:00
|
|
|
* that are processed with wfMessage
|
|
|
|
|
* - offset Set to overwrite offset parameter in WebRequest
|
2009-10-11 19:55:56 +00:00
|
|
|
* set to '' to unset offset
|
2010-03-01 22:47:12 +00:00
|
|
|
* - wrap String Wrap the message in html (usually something like "<div ...>$1</div>").
|
|
|
|
|
* - flags Integer display flags (NO_ACTION_LINK,NO_EXTRA_USER_LINKS)
|
2013-02-02 02:17:02 +00:00
|
|
|
* - useRequestParams boolean Set true to use Pager-related parameters in the WebRequest
|
2013-11-16 22:57:33 +00:00
|
|
|
* - useMaster boolean Use master DB
|
2013-12-03 18:26:59 +00:00
|
|
|
* @return int Number of total log items (not limited by $lim)
|
2008-04-02 20:20:47 +00:00
|
|
|
*/
|
2010-03-01 22:47:12 +00:00
|
|
|
public static function showLogExtract(
|
2013-04-13 11:36:24 +00:00
|
|
|
&$out, $types = array(), $page = '', $user = '', $param = array()
|
2010-03-01 22:47:12 +00:00
|
|
|
) {
|
2009-09-18 13:57:13 +00:00
|
|
|
$defaultParameters = array(
|
2009-10-02 18:04:58 +00:00
|
|
|
'lim' => 25,
|
2009-09-18 13:57:13 +00:00
|
|
|
'conds' => array(),
|
|
|
|
|
'showIfEmpty' => true,
|
2013-02-03 18:30:03 +00:00
|
|
|
'msgKey' => array( '' ),
|
2010-03-01 22:47:12 +00:00
|
|
|
'wrap' => "$1",
|
2013-02-02 02:17:02 +00:00
|
|
|
'flags' => 0,
|
|
|
|
|
'useRequestParams' => false,
|
2013-11-16 22:57:33 +00:00
|
|
|
'useMaster' => false,
|
2009-09-18 13:57:13 +00:00
|
|
|
);
|
|
|
|
|
# The + operator appends elements of remaining keys from the right
|
|
|
|
|
# handed array to the left handed, whereas duplicated keys are NOT overwritten.
|
|
|
|
|
$param += $defaultParameters;
|
2009-09-16 17:17:16 +00:00
|
|
|
# Convert $param array to individual variables
|
|
|
|
|
$lim = $param['lim'];
|
|
|
|
|
$conds = $param['conds'];
|
|
|
|
|
$showIfEmpty = $param['showIfEmpty'];
|
|
|
|
|
$msgKey = $param['msgKey'];
|
2010-01-16 11:24:23 +00:00
|
|
|
$wrap = $param['wrap'];
|
2010-03-01 22:47:12 +00:00
|
|
|
$flags = $param['flags'];
|
2013-02-02 02:17:02 +00:00
|
|
|
$useRequestParams = $param['useRequestParams'];
|
2010-03-01 22:47:12 +00:00
|
|
|
if ( !is_array( $msgKey ) ) {
|
2009-09-16 17:17:16 +00:00
|
|
|
$msgKey = array( $msgKey );
|
2010-03-01 22:47:12 +00:00
|
|
|
}
|
2011-09-20 20:00:05 +00:00
|
|
|
|
|
|
|
|
if ( $out instanceof OutputPage ) {
|
|
|
|
|
$context = $out->getContext();
|
|
|
|
|
} else {
|
|
|
|
|
$context = RequestContext::getMain();
|
|
|
|
|
}
|
|
|
|
|
|
2009-09-16 17:17:16 +00:00
|
|
|
# Insert list of top 50 (or top $lim) items
|
2012-06-16 15:33:21 +00:00
|
|
|
$loglist = new LogEventsList( $context, null, $flags );
|
2009-05-02 14:34:45 +00:00
|
|
|
$pager = new LogPager( $loglist, $types, $user, $page, '', $conds );
|
2013-02-02 02:17:02 +00:00
|
|
|
if ( !$useRequestParams ) {
|
|
|
|
|
# Reset vars that may have been taken from the request
|
|
|
|
|
$pager->mLimit = 50;
|
|
|
|
|
$pager->mDefaultLimit = 50;
|
|
|
|
|
$pager->mOffset = "";
|
|
|
|
|
$pager->mIsBackwards = false;
|
|
|
|
|
}
|
2013-12-03 18:26:59 +00:00
|
|
|
|
2013-11-16 22:57:33 +00:00
|
|
|
if ( $param['useMaster'] ) {
|
|
|
|
|
$pager->mDb = wfGetDB( DB_MASTER );
|
|
|
|
|
}
|
2012-06-16 15:33:21 +00:00
|
|
|
if ( isset( $param['offset'] ) ) { # Tell pager to ignore WebRequest offset
|
2009-09-20 22:07:44 +00:00
|
|
|
$pager->setOffset( $param['offset'] );
|
2010-03-01 22:47:12 +00:00
|
|
|
}
|
2013-12-03 18:26:59 +00:00
|
|
|
|
2013-04-20 15:38:24 +00:00
|
|
|
if ( $lim > 0 ) {
|
|
|
|
|
$pager->mLimit = $lim;
|
|
|
|
|
}
|
2014-10-31 21:16:06 +00:00
|
|
|
// Fetch the log rows and build the HTML if needed
|
2015-04-03 08:28:08 +00:00
|
|
|
$logBody = $pager->getBody();
|
|
|
|
|
$numRows = $pager->getNumRows();
|
2014-10-31 21:16:06 +00:00
|
|
|
|
2009-09-14 02:17:31 +00:00
|
|
|
$s = '';
|
2013-12-03 18:26:59 +00:00
|
|
|
|
2013-04-20 15:38:24 +00:00
|
|
|
if ( $logBody ) {
|
2009-09-16 17:17:16 +00:00
|
|
|
if ( $msgKey[0] ) {
|
2013-12-19 14:20:24 +00:00
|
|
|
$dir = $context->getLanguage()->getDir();
|
2014-11-06 13:22:02 +00:00
|
|
|
$lang = $context->getLanguage()->getHtmlCode();
|
2013-12-19 14:20:24 +00:00
|
|
|
|
|
|
|
|
$s = Xml::openElement( 'div', array(
|
|
|
|
|
'class' => "mw-warning-with-logexcerpt mw-content-$dir",
|
|
|
|
|
'dir' => $dir,
|
|
|
|
|
'lang' => $lang,
|
|
|
|
|
) );
|
2009-09-14 18:58:25 +00:00
|
|
|
|
2009-09-14 19:56:22 +00:00
|
|
|
if ( count( $msgKey ) == 1 ) {
|
2012-06-16 15:33:21 +00:00
|
|
|
$s .= $context->msg( $msgKey[0] )->parseAsBlock();
|
2009-09-14 18:58:25 +00:00
|
|
|
} else { // Process additional arguments
|
|
|
|
|
$args = $msgKey;
|
2009-09-14 19:56:22 +00:00
|
|
|
array_shift( $args );
|
2012-06-16 15:33:21 +00:00
|
|
|
$s .= $context->msg( $msgKey[0], $args )->parseAsBlock();
|
2009-09-14 18:58:25 +00:00
|
|
|
}
|
|
|
|
|
}
|
2009-09-13 22:21:11 +00:00
|
|
|
$s .= $loglist->beginLogEventsList() .
|
2013-02-03 18:30:03 +00:00
|
|
|
$logBody .
|
|
|
|
|
$loglist->endLogEventsList();
|
2013-04-20 15:38:24 +00:00
|
|
|
} elseif ( $showIfEmpty ) {
|
|
|
|
|
$s = Html::rawElement( 'div', array( 'class' => 'mw-warning-logempty' ),
|
|
|
|
|
$context->msg( 'logempty' )->parse() );
|
2009-08-31 11:54:53 +00:00
|
|
|
}
|
2013-12-03 18:26:59 +00:00
|
|
|
|
2014-11-20 08:22:42 +00:00
|
|
|
if ( $numRows > $pager->mLimit ) { # Show "Full log" link
|
2009-09-13 22:21:11 +00:00
|
|
|
$urlParam = array();
|
2011-09-29 19:03:57 +00:00
|
|
|
if ( $page instanceof Title ) {
|
|
|
|
|
$urlParam['page'] = $page->getPrefixedDBkey();
|
|
|
|
|
} elseif ( $page != '' ) {
|
2009-09-13 22:21:11 +00:00
|
|
|
$urlParam['page'] = $page;
|
2011-09-29 19:03:57 +00:00
|
|
|
}
|
2013-12-03 18:26:59 +00:00
|
|
|
|
2013-04-20 15:38:24 +00:00
|
|
|
if ( $user != '' ) {
|
2009-09-13 22:21:11 +00:00
|
|
|
$urlParam['user'] = $user;
|
2013-04-20 15:38:24 +00:00
|
|
|
}
|
2013-12-03 18:26:59 +00:00
|
|
|
|
2013-04-20 15:38:24 +00:00
|
|
|
if ( !is_array( $types ) ) { # Make it an array, if it isn't
|
2009-09-13 22:21:11 +00:00
|
|
|
$types = array( $types );
|
2013-04-20 15:38:24 +00:00
|
|
|
}
|
2013-12-03 18:26:59 +00:00
|
|
|
|
2009-09-13 22:21:11 +00:00
|
|
|
# If there is exactly one log type, we can link to Special:Log?type=foo
|
2013-04-20 15:38:24 +00:00
|
|
|
if ( count( $types ) == 1 ) {
|
2009-09-13 22:21:11 +00:00
|
|
|
$urlParam['type'] = $types[0];
|
2013-04-20 15:38:24 +00:00
|
|
|
}
|
2013-12-03 18:26:59 +00:00
|
|
|
|
2011-07-10 18:12:11 +00:00
|
|
|
$s .= Linker::link(
|
2009-09-13 22:21:11 +00:00
|
|
|
SpecialPage::getTitleFor( 'Log' ),
|
2012-06-16 15:33:21 +00:00
|
|
|
$context->msg( 'log-fulllog' )->escaped(),
|
2009-09-13 22:21:11 +00:00
|
|
|
array(),
|
|
|
|
|
$urlParam
|
|
|
|
|
);
|
|
|
|
|
}
|
2013-12-03 18:26:59 +00:00
|
|
|
|
2010-03-01 22:47:12 +00:00
|
|
|
if ( $logBody && $msgKey[0] ) {
|
2009-09-13 22:21:11 +00:00
|
|
|
$s .= '</div>';
|
2010-03-01 22:47:12 +00:00
|
|
|
}
|
2009-09-13 22:21:11 +00:00
|
|
|
|
2011-11-16 13:22:03 +00:00
|
|
|
if ( $wrap != '' ) { // Wrap message in html
|
2010-01-16 11:24:23 +00:00
|
|
|
$s = str_replace( '$1', $s, $wrap );
|
|
|
|
|
}
|
|
|
|
|
|
2011-09-16 22:30:39 +00:00
|
|
|
/* hook can return false, if we don't want the message to be emitted (Wikia BugId:7093) */
|
2014-12-09 07:23:30 +00:00
|
|
|
if ( Hooks::run( 'LogEventsListShowLogExtract', array( &$s, $types, $page, $user, $param ) ) ) {
|
2011-10-04 14:32:07 +00:00
|
|
|
// $out can be either an OutputPage object or a String-by-reference
|
2013-01-26 21:11:09 +00:00
|
|
|
if ( $out instanceof OutputPage ) {
|
2011-10-04 14:32:07 +00:00
|
|
|
$out->addHTML( $s );
|
|
|
|
|
} else {
|
|
|
|
|
$out = $s;
|
|
|
|
|
}
|
2011-09-16 22:30:39 +00:00
|
|
|
}
|
|
|
|
|
|
2014-11-20 08:22:42 +00:00
|
|
|
return $numRows;
|
2008-09-05 22:46:46 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2008-12-07 19:56:02 +00:00
|
|
|
/**
|
2008-04-02 19:01:41 +00:00
|
|
|
* SQL clause to skip forbidden log types for this user
|
2010-06-03 21:00:51 +00:00
|
|
|
*
|
2013-12-03 18:26:59 +00:00
|
|
|
* @param DatabaseBase $db
|
|
|
|
|
* @param string $audience Public/user
|
|
|
|
|
* @param User $user User to check, or null to use $wgUser
|
|
|
|
|
* @return string|bool String on success, false on failure.
|
2008-04-02 19:01:41 +00:00
|
|
|
*/
|
2012-12-14 14:01:32 +00:00
|
|
|
public static function getExcludeClause( $db, $audience = 'public', User $user = null ) {
|
|
|
|
|
global $wgLogRestrictions;
|
|
|
|
|
|
|
|
|
|
if ( $audience != 'public' && $user === null ) {
|
|
|
|
|
global $wgUser;
|
|
|
|
|
$user = $wgUser;
|
|
|
|
|
}
|
|
|
|
|
|
2008-04-02 19:01:41 +00:00
|
|
|
// Reset the array, clears extra "where" clauses when $par is used
|
|
|
|
|
$hiddenLogs = array();
|
2012-12-14 14:01:32 +00:00
|
|
|
|
2008-04-08 13:58:33 +00:00
|
|
|
// Don't show private logs to unprivileged users
|
2013-04-20 15:38:24 +00:00
|
|
|
foreach ( $wgLogRestrictions as $logType => $right ) {
|
|
|
|
|
if ( $audience == 'public' || !$user->isAllowed( $right ) ) {
|
2012-12-14 14:01:32 +00:00
|
|
|
$hiddenLogs[] = $logType;
|
2008-04-02 19:01:41 +00:00
|
|
|
}
|
|
|
|
|
}
|
2013-04-20 15:38:24 +00:00
|
|
|
if ( count( $hiddenLogs ) == 1 ) {
|
2008-04-08 13:58:33 +00:00
|
|
|
return 'log_type != ' . $db->addQuotes( $hiddenLogs[0] );
|
2013-04-20 15:38:24 +00:00
|
|
|
} elseif ( $hiddenLogs ) {
|
2012-12-14 14:01:32 +00:00
|
|
|
return 'log_type NOT IN (' . $db->makeList( $hiddenLogs ) . ')';
|
2008-04-02 19:01:41 +00:00
|
|
|
}
|
2013-12-03 14:36:21 +00:00
|
|
|
|
2008-04-02 19:01:41 +00:00
|
|
|
return false;
|
|
|
|
|
}
|
2013-02-03 18:30:03 +00:00
|
|
|
}
|