Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simple_oauth_account_picker
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
simple_oauth_account_picker
Merge requests
!3
add block.
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
add block.
issue/simple_oauth_account_picker-3419241:3419241-add-block
into
1.0.x
Overview
0
Commits
4
Pipelines
6
Changes
3
Merged
Revathi B
requested to merge
issue/simple_oauth_account_picker-3419241:3419241-add-block
into
1.0.x
1 year ago
Overview
0
Commits
4
Pipelines
6
Changes
3
Expand
Closes
#3419241
0
0
Merge request reports
Compare
1.0.x
version 4
aaf082db
1 year ago
version 3
b31da977
1 year ago
version 2
ca8c2c6d
1 year ago
version 1
d4423ea1
1 year ago
1.0.x (base)
and
latest version
latest version
b46dc126
4 commits,
1 year ago
version 4
aaf082db
4 commits,
1 year ago
version 3
b31da977
4 commits,
1 year ago
version 2
ca8c2c6d
2 commits,
1 year ago
version 1
d4423ea1
1 commit,
1 year ago
3 files
+
120
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
src/Plugin/Block/AccountPickerBlock.php
0 → 100644
+
64
−
0
Options
<?php
namespace
Drupal\simple_oauth_account_picker\Plugin\Block
;
use
Drupal\Core\Block\BlockBase
;
use
Drupal\Core\Form\FormBuilderInterface
;
use
Drupal\Core\Plugin\ContainerFactoryPluginInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
/**
* Provides an account picker block.
*
* @Block(
* id = "simple_oauth_account_picker_block",
* admin_label = @Translation("Simple Oauth Account Picker Block")
* )
*/
class
AccountPickerBlock
extends
BlockBase
implements
ContainerFactoryPluginInterface
{
/**
* Get FormBuilder service.
*
* @var \Drupal\Core\Form\FormBuilderInterface
*/
protected
$formBuilder
;
/**
* Load services.
*
* @param array $configuration
* The configuration.
* @param string $plugin_id
* The plugin id.
* @param mixed $plugin_definition
* The plugin definition.
* @param \Drupal\Core\Form\FormBuilderInterface $formBuilder
* The form builder.
*/
public
function
__construct
(
array
$configuration
,
$plugin_id
,
$plugin_definition
,
FormBuilderInterface
$formBuilder
)
{
parent
::
__construct
(
$configuration
,
$plugin_id
,
$plugin_definition
);
$this
->
formBuilder
=
$formBuilder
;
}
/**
* {@inheritdoc}
*/
public
static
function
create
(
ContainerInterface
$container
,
array
$configuration
,
$plugin_id
,
$plugin_definition
)
{
// Load the service required to construct this class.
return
new
static
(
$configuration
,
$plugin_id
,
$plugin_definition
,
$container
->
get
(
'form_builder'
)
);
}
/**
* {@inheritdoc}
*/
public
function
build
()
{
return
$this
->
formBuilder
->
getForm
(
'Drupal\simple_oauth_account_picker\Form\AccountPickerForm'
);
}
}
Loading