Skip to content
Snippets Groups Projects
Commit f56ac78a authored by Kevin Paxman - IST's avatar Kevin Paxman - IST
Browse files

Merge branch '1.0.x' into prod/1.0.x

parents bab7305b a9f3f84f
No related branches found
No related tags found
1 merge request!44Feature/istwcms 7264 kpaxman remove dashboard blocks
......@@ -19,8 +19,10 @@ third_party_settings:
- uw_3_column
- uw_inverted_l_right
- uw_inverted_l_left
restricted_categories: { }
blacklisted_blocks:
'Lists (Views)': { }
'Lists (Views)':
- 'views_block:bibcite_reference-bibcite_reference_block'
Menus: { }
System: { }
'UW Custom Blocks':
......@@ -30,7 +32,6 @@ third_party_settings:
'UW Dashboard Items': { }
Webform: { }
whitelisted_blocks: { }
restricted_categories: { }
id: my_dashboard
admin_label: 'My Dashboard'
category: ''
......@@ -178,6 +179,18 @@ sections:
weight: 2
additional:
layout_builder_id: content-type-list
19d0a4a3-baf8-461f-b9a3-a4bfa58e0d44:
uuid: 19d0a4a3-baf8-461f-b9a3-a4bfa58e0d44
region: first
configuration:
id: uw_publication_reference_block
label: 'Publication references'
label_display: visible
provider: uw_dashboard
context_mapping: { }
weight: 2
additional:
layout_builder_id: ''
third_party_settings: { }
frontend: false
weight: 0
This diff is collapsed.
langcode: en
status: true
dependencies:
module:
- bibcite_entity
- user
- views_autocomplete_filters
id: uw_view_pub_keywords
label: 'Dashboard - publication reference keywords'
module: views
description: 'Find and manage keywords.'
tag: ''
base_table: bibcite_keyword
base_field: id
display:
default:
id: default
display_title: Master
display_plugin: default
position: 0
display_options:
title: Keywords
fields:
name:
id: name
table: bibcite_keyword
field: name
relationship: none
group_type: group
admin_label: ''
entity_type: null
entity_field: name
plugin_id: field
label: Name
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: string
settings:
link_to_entity: true
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
operations:
id: operations
table: bibcite_keyword
field: operations
relationship: none
group_type: group
admin_label: ''
entity_type: bibcite_keyword
plugin_id: entity_operations
label: Operations
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
destination: true
pager:
type: full
options:
offset: 0
items_per_page: 50
total_pages: null
id: 0
tags:
next: ››
previous: ‹‹
first: '« First'
last: 'Last »'
expose:
items_per_page: false
items_per_page_label: 'Items per page'
items_per_page_options: '5, 10, 25, 50'
items_per_page_options_all: false
items_per_page_options_all_label: '- All -'
offset: false
offset_label: Offset
quantity: 9
exposed_form:
type: basic
options:
submit_button: Filter
reset_button: true
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
access:
type: perm
options:
perm: 'view bibcite_keyword'
cache:
type: tag
options: { }
empty:
area_text_custom:
id: area_text_custom
table: views
field: area_text_custom
relationship: none
group_type: group
admin_label: ''
plugin_id: text_custom
empty: true
content: 'No keywords available.'
tokenize: false
sorts: { }
arguments: { }
filters:
name:
id: name
table: bibcite_keyword
field: name
relationship: none
group_type: group
admin_label: ''
entity_type: bibcite_keyword
entity_field: name
plugin_id: string
operator: contains
value: ''
group: 1
exposed: true
expose:
operator_id: name_op
label: Name
description: ''
use_operator: false
operator: name_op
operator_limit_selection: false
operator_list: { }
identifier: name
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
anonymous: '0'
administrator: '0'
placeholder: ''
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
style:
type: table
options:
grouping: { }
row_class: ''
default_row_class: true
columns:
bibcite_keyword_bulk_form: bibcite_keyword_bulk_form
name: name
operations: operations
default: name
info:
bibcite_keyword_bulk_form:
align: ''
separator: ''
empty_column: false
responsive: ''
name:
sortable: true
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
operations:
align: ''
separator: ''
empty_column: false
responsive: ''
override: true
sticky: true
summary: ''
empty_table: true
caption: ''
description: ''
row:
type: fields
query:
type: views_query
options:
query_comment: ''
disable_sql_rewrite: false
distinct: false
replica: false
query_tags: { }
relationships: { }
use_ajax: true
show_admin_links: false
header: { }
footer: { }
display_extenders: { }
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- url.query_args
- user.permissions
tags: { }
pub_reference_keywords:
id: pub_reference_keywords
display_title: Embed
display_plugin: embed
position: 2
display_options:
display_extenders:
metatag_display_extender:
metatags: { }
tokenize: false
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- url.query_args
- user.permissions
tags: { }
This diff is collapsed.
<?php
namespace Drupal\uw_dashboard\Plugin\Block;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Session\AccountProxyInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Provides a 'Publication reference authors' block.
*
* @Block(
* id = "uw_publication_authors_block",
* admin_label = @Translation("Publication reference authors"),
* )
*/
class PublicationAuthorsBlock extends BlockBase implements ContainerFactoryPluginInterface {
/**
* Entity type manager from the core.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* The current user.
*
* @var \Drupal\Core\Session\AccountProxyInterface
*/
protected $currentUser;
/**
* {@inheritdoc}
*/
public static function create(
ContainerInterface $container,
array $configuration,
$plugin_id,
$plugin_definition
) {
return new static(
$configuration,
$plugin_id,
$plugin_definition,
$container->get('entity_type.manager'),
$container->get('current_user')
);
}
/**
* ContentManagementMenuBlock constructor.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager
* Entity type manager.
* @param \Drupal\Core\Session\AccountProxyInterface $currentUser
* The current user.
*/
public function __construct(
array $configuration,
$plugin_id,
$plugin_definition,
EntityTypeManagerInterface $entityTypeManager,
AccountProxyInterface $currentUser
) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityTypeManager = $entityTypeManager;
$this->currentUser = $currentUser;
}
/**
* {@inheritdoc}
*/
public function build() {
// Add a message if the user does not have access to the block.
if (!$this->currentUser->hasPermission('edit bibcite_contributor')) {
return [
'#markup' => 'You do not have permission to view this block.',
];
}
// Load the view.
/** @var \Drupal\views\ViewExecutable $view */
$view = $this->entityTypeManager
->getStorage('view')
->load('uw_view_pub_authors')
->getExecutable();
// Set the display.
$view->setDisplay('pub_reference_authors');
// Execute the view.
$view->execute();
// Get the title.
$title = $view->getTitle();
// Get the rendered title for the view.
$the_title_render_array = [
'#markup' => $this->t('@title', ['@title' => $title]),
'#allowed_tags' => ['h2'],
];
// Display using the view template so ajax works properly.
return [
'#type' => 'view',
'#name' => $the_title_render_array,
'#view' => $view,
'#display_id' => 'pub_reference_authors',
'#embed' => TRUE,
'#cache' => $view->getCacheTags(),
];
}
/**
* {@inheritdoc}
*/
public function blockForm($form, FormStateInterface $form_state) {
// Get the parent form.
$form = parent::blockForm($form, $form_state);
return $form;
}
/**
* {@inheritdoc}
*/
public function blockSubmit($form, FormStateInterface $form_state) {
}
/**
* {@inheritdoc}
*/
protected function blockAccess(AccountInterface $account) {
return AccessResult::allowedIfHasPermission($account, 'edit bibcite_contributor');
}
}
<?php
namespace Drupal\uw_dashboard\Plugin\Block;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Session\AccountProxyInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Provides a 'Publication reference keywords' block.
*
* @Block(
* id = "uw_publication_keywords_block",
* admin_label = @Translation("Publication reference keywords"),
* )
*/
class PublicationKeywordsBlock extends BlockBase implements ContainerFactoryPluginInterface {
/**
* Entity type manager from the core.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* The current user.
*
* @var \Drupal\Core\Session\AccountProxyInterface
*/
protected $currentUser;
/**
* {@inheritdoc}
*/
public static function create(
ContainerInterface $container,
array $configuration,
$plugin_id,
$plugin_definition
) {
return new static(
$configuration,
$plugin_id,
$plugin_definition,
$container->get('entity_type.manager'),
$container->get('current_user')
);
}
/**
* ContentManagementMenuBlock constructor.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager
* Entity type manager.
* @param \Drupal\Core\Session\AccountProxyInterface $currentUser
* The current user.
*/
public function __construct(
array $configuration,
$plugin_id,
$plugin_definition,
EntityTypeManagerInterface $entityTypeManager,
AccountProxyInterface $currentUser
) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityTypeManager = $entityTypeManager;
$this->currentUser = $currentUser;
}
/**
* {@inheritdoc}
*/
public function build() {
// Add a message if the user does not have access to the block.
if (!$this->currentUser->hasPermission('edit bibcite_contributor')) {
return [
'#markup' => 'You do not have permission to view this block.',
];
}
// Load the view.
/** @var \Drupal\views\ViewExecutable $view */
$view = $this->entityTypeManager
->getStorage('view')
->load('uw_view_pub_keywords')
->getExecutable();
// Set the display.
$view->setDisplay('pub_reference_keywords');
// Execute the view.
$view->execute();
// Get the title.
$title = $view->getTitle();
// Get the rendered title for the view.
$the_title_render_array = [
'#markup' => $this->t('@title', ['@title' => $title]),
'#allowed_tags' => ['h2'],
];
// Display using the view template so ajax works properly.
return [
'#type' => 'view',
'#name' => $the_title_render_array,
'#view' => $view,
'#display_id' => 'pub_reference_keywords',
'#embed' => TRUE,
'#cache' => $view->getCacheTags(),
];
}
/**
* {@inheritdoc}
*/
public function blockForm($form, FormStateInterface $form_state) {
// Get the parent form.
$form = parent::blockForm($form, $form_state);
return $form;
}
/**
* {@inheritdoc}
*/
public function blockSubmit($form, FormStateInterface $form_state) {
}
/**
* {@inheritdoc}
*/
protected function blockAccess(AccountInterface $account) {
return AccessResult::allowedIfHasPermission($account, 'edit bibcite_contributor');
}
}
<?php
namespace Drupal\uw_dashboard\Plugin\Block;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Session\AccountProxyInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Provides a 'Publication reference' block.
*
* @Block(
* id = "uw_publication_reference_block",
* admin_label = @Translation("Publication references"),
* )
*/
class PublicationReferenceBlock extends BlockBase implements ContainerFactoryPluginInterface {
/**
* Entity type manager from the core.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* The current user.
*
* @var \Drupal\Core\Session\AccountProxyInterface
*/
protected $currentUser;
/**
* {@inheritdoc}
*/
public static function create(
ContainerInterface $container,
array $configuration,
$plugin_id,
$plugin_definition
) {
return new static(
$configuration,
$plugin_id,
$plugin_definition,
$container->get('entity_type.manager'),
$container->get('current_user')
);
}
/**
* ContentManagementMenuBlock constructor.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager
* Entity type manager.
* @param \Drupal\Core\Session\AccountProxyInterface $currentUser
* The current user.
*/
public function __construct(
array $configuration,
$plugin_id,
$plugin_definition,
EntityTypeManagerInterface $entityTypeManager,
AccountProxyInterface $currentUser
) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityTypeManager = $entityTypeManager;
$this->currentUser = $currentUser;
}
/**
* {@inheritdoc}
*/
public function build() {
// Add a message if the user does not have access to the block.
if (!$this->currentUser->hasPermission('edit any bibcite_reference')) {
return [
'#markup' => 'You do not have permission to view this block.',
];
}
// Load the view.
/** @var \Drupal\views\ViewExecutable $view */
$view = $this->entityTypeManager
->getStorage('view')
->load('uw_view_pub_reference')
->getExecutable();
// Set the display.
$view->setDisplay('pub_reference_list');
// Execute the view.
$view->execute();
// Get the title.
$title = $view->getTitle();
// Get the rendered title for the view.
$the_title_render_array = [
'#markup' => $this->t('@title', ['@title' => $title]),
'#allowed_tags' => ['h2'],
];
// Display using the view template so ajax works properly.
return [
'#type' => 'view',
'#name' => $the_title_render_array,
'#view' => $view,
'#display_id' => 'pub_reference_list',
'#embed' => TRUE,
'#cache' => $view->getCacheTags(),
];
}
/**
* {@inheritdoc}
*/
public function blockForm($form, FormStateInterface $form_state) {
// Get the parent form.
$form = parent::blockForm($form, $form_state);
return $form;
}
/**
* {@inheritdoc}
*/
public function blockSubmit($form, FormStateInterface $form_state) {
}
/**
* {@inheritdoc}
*/
protected function blockAccess(AccountInterface $account) {
return AccessResult::allowedIfHasPermission($account, 'edit any bibcite_reference');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment