AddDataPolicyRevision.php in Open Social 8.4
Same filename and directory in other branches
- 8.9 modules/custom/social_gdpr/src/Plugin/Block/AddDataPolicyRevision.php
- 8.2 modules/custom/social_gdpr/src/Plugin/Block/AddDataPolicyRevision.php
- 8.3 modules/custom/social_gdpr/src/Plugin/Block/AddDataPolicyRevision.php
- 8.5 modules/custom/social_gdpr/src/Plugin/Block/AddDataPolicyRevision.php
- 8.6 modules/custom/social_gdpr/src/Plugin/Block/AddDataPolicyRevision.php
- 8.7 modules/custom/social_gdpr/src/Plugin/Block/AddDataPolicyRevision.php
- 8.8 modules/custom/social_gdpr/src/Plugin/Block/AddDataPolicyRevision.php
- 10.0.x modules/custom/social_gdpr/src/Plugin/Block/AddDataPolicyRevision.php
- 10.1.x modules/custom/social_gdpr/src/Plugin/Block/AddDataPolicyRevision.php
Namespace
Drupal\social_gdpr\Plugin\BlockFile
modules/custom/social_gdpr/src/Plugin/Block/AddDataPolicyRevision.phpView source
<?php
namespace Drupal\social_gdpr\Plugin\Block;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Url;
/**
* Provides a 'AddDataPolicyRevision' block.
*
* @Block(
* id = "add_data_policy_revision",
* admin_label = @Translation("Add Data Policy Revision"),
* )
*/
class AddDataPolicyRevision extends BlockBase {
/**
* {@inheritdoc}
*/
public function build() {
return [
'content' => [
'#type' => 'link',
'#title' => $this
->t('Add new revision'),
'#url' => Url::fromRoute('social_gdpr.data_policy.add'),
'#attributes' => [
'class' => [
'btn',
'btn-primary',
'btn-raised',
'btn-full',
'waves-effect',
'brand-bg-primary',
],
],
],
];
}
/**
* {@inheritdoc}
*/
protected function blockAccess(AccountInterface $account) {
return AccessResult::allowedIfHasPermission($account, 'edit data policy');
}
}
Classes
Name | Description |
---|---|
AddDataPolicyRevision | Provides a 'AddDataPolicyRevision' block. |