Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / paragraphs / tests / modules / paragraphs_test / paragraphs_test.module
1 <?php
2
3 /**
4  * @file
5  * Test module for testing the paragraphs module.
6  */
7
8 use Drupal\paragraphs\Plugin\Field\FieldWidget\ParagraphsWidget;
9
10 /**
11  * Implements hook_paragraphs_widget_actions_alter().
12  */
13 function paragraphs_test_paragraphs_widget_actions_alter(&$widget_actions, &$context) {
14   if (\Drupal::state()->get('paragraphs_test_dropbutton')) {
15     $widget_actions['dropdown_actions']['test_button'] = ParagraphsWidget::expandButton([
16       '#type' => 'submit',
17       '#value' => t('Add to library'),
18       '#delta' => 0,
19       '#name' => 'field_paragraphs_test',
20       '#weight' => 504,
21       '#paragraphs_mode' => 'remove',
22       '#access' => TRUE,
23     ]);
24   }
25 }