Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / paragraphs / tests / modules / paragraphs_test / paragraphs_test.module
diff --git a/web/modules/contrib/paragraphs/tests/modules/paragraphs_test/paragraphs_test.module b/web/modules/contrib/paragraphs/tests/modules/paragraphs_test/paragraphs_test.module
new file mode 100644 (file)
index 0000000..cbe8c31
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+
+/**
+ * @file
+ * Test module for testing the paragraphs module.
+ */
+
+use Drupal\paragraphs\Plugin\Field\FieldWidget\ParagraphsWidget;
+
+/**
+ * Implements hook_paragraphs_widget_actions_alter().
+ */
+function paragraphs_test_paragraphs_widget_actions_alter(&$widget_actions, &$context) {
+  if (\Drupal::state()->get('paragraphs_test_dropbutton')) {
+    $widget_actions['dropdown_actions']['test_button'] = ParagraphsWidget::expandButton([
+      '#type' => 'submit',
+      '#value' => t('Add to library'),
+      '#delta' => 0,
+      '#name' => 'field_paragraphs_test',
+      '#weight' => 504,
+      '#paragraphs_mode' => 'remove',
+      '#access' => TRUE,
+    ]);
+  }
+}