Merge "Simplify showtabdialog logic a little bit"

This commit is contained in:
jenkins-bot 2016-03-07 23:28:50 +00:00 committed by Gerrit Code Review
commit 1a64d83138

View file

@ -234,32 +234,28 @@ class VisualEditorHooks {
return true; return true;
} }
$dbr = wfGetDB( DB_SLAVE );
if ( if (
$config->get( 'VisualEditorUseSingleEditTab' ) && $config->get( 'VisualEditorUseSingleEditTab' ) &&
$user->getOption( 'visualeditor-tabs' ) !== 'multi-tab' !$user->isAnon() &&
!$user->getOption( 'visualeditor-autodisable' ) &&
!$user->getOption( 'visualeditor-betatempdisable' ) &&
!$user->getOption( 'visualeditor-hidetabdialog' ) &&
$user->getOption( 'visualeditor-tabs' ) === 'remember-last' &&
$dbr->select(
'revision',
'1',
[
'rev_user' => $user->getId(),
'rev_timestamp < ' . $dbr->addQuotes(
$config->get( 'VisualEditorSingleEditTabSwitchTime' )
)
],
__METHOD__,
[ 'LIMIT' => 1 ]
)->numRows() === 1
) { ) {
$dbr = wfGetDB( DB_SLAVE ); $links['views']['edit']['class'] .= ' visualeditor-showtabdialog';
if (
!$user->isAnon() &&
!$user->getOption( 'visualeditor-autodisable' ) &&
!$user->getOption( 'visualeditor-betatempdisable' ) &&
!$user->getOption( 'visualeditor-hidetabdialog' ) &&
$user->getOption( 'visualeditor-tabs' ) === 'remember-last' &&
$dbr->select(
'revision',
'1',
[
'rev_user' => $user->getId(),
'rev_timestamp < ' . $dbr->addQuotes(
$config->get( 'VisualEditorSingleEditTabSwitchTime' )
)
],
__METHOD__,
[ 'LIMIT' => 1 ]
)->numRows() === 1
) {
$links['views']['edit']['class'] .= ' visualeditor-showtabdialog';
}
} }
// Exit if the user doesn't have VE enabled // Exit if the user doesn't have VE enabled