mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 08:10:35 +00:00
Merge "Simplify showtabdialog logic a little bit"
This commit is contained in:
commit
1a64d83138
|
@ -234,32 +234,28 @@ class VisualEditorHooks {
|
|||
return true;
|
||||
}
|
||||
|
||||
$dbr = wfGetDB( DB_SLAVE );
|
||||
if (
|
||||
$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 );
|
||||
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';
|
||||
}
|
||||
$links['views']['edit']['class'] .= ' visualeditor-showtabdialog';
|
||||
}
|
||||
|
||||
// Exit if the user doesn't have VE enabled
|
||||
|
|
Loading…
Reference in a new issue