languagesHelper = $languagesHelper; $this->permissions = $permissions; $this->skinOptions = $skinOptions; $this->skinUserPageHelper = $skinUserPageHelper; $this->watchlistManager = $watchlistManager; } public function getPageActionsDirector( IContextSource $context ): PageActionsDirector { $title = $context->getTitle(); if ( !$title ) { $title = SpecialPage::getTitleFor( 'Badtitle' ); } $user = $context->getUser(); $this->skinUserPageHelper ->setContext( $context ) ->setTitle( $title->inNamespace( NS_USER_TALK ) ? $context->getSkin()->getRelevantTitle()->getSubjectPage() : $title ); $toolbarBuilder = new ToolbarBuilder( $title, $user, $context, $this->permissions, $this->skinOptions, $this->skinUserPageHelper, $this->languagesHelper, new ServiceOptions( ToolbarBuilder::CONSTRUCTOR_OPTIONS, $context->getConfig() ), $this->watchlistManager ); if ( $this->skinOptions->get( SkinOptions::TOOLBAR_SUBMENU ) ) { $overflowBuilder = $this->skinUserPageHelper->isUserPage() ? new UserNamespaceOverflowBuilder( $title, $context, $this->permissions, $this->languagesHelper ) : new DefaultOverflowBuilder( $title, $context, $this->permissions ); } else { $overflowBuilder = new EmptyOverflowBuilder(); } return new PageActionsDirector( $toolbarBuilder, $overflowBuilder, $context ); } }