Loading src/Plugin/Block/AdminFeedbackBlock.php +11 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Drupal\Core\Block\BlockBase; use Drupal\Core\Cache\Cache; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Form\FormBuilder; use Drupal\Core\Render\Markup; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Routing\CurrentRouteMatch; use Drupal\Core\Session\AccountInterface; Loading Loading @@ -92,6 +93,8 @@ class AdminFeedbackBlock extends BlockBase implements ContainerFactoryPluginInte if ($node && !is_string($node)) { $nid = $node->id(); $build = [ 'feedback_content' => [ '#type' => 'container', Loading @@ -111,8 +114,12 @@ class AdminFeedbackBlock extends BlockBase implements ContainerFactoryPluginInte 'yes_button' => [ '#type' => 'button', '#value' => $config->get('yes_button'), '#prefix' => '<span class="feedback-yes-button">', '#suffix' => '</span>', '#markup' => Markup::create('<label for = "feedback-yes-button-' . $nid . '"></label>'), '#attributes' => [ 'class' => ['feedback-btn feedback-btn__yes'], 'id' => ['feedback-yes-button-' . $nid], 'data-node-id' => $node->id(), 'data-feedback' => 'yes', ], Loading @@ -120,8 +127,12 @@ class AdminFeedbackBlock extends BlockBase implements ContainerFactoryPluginInte 'no_button' => [ '#type' => 'button', '#value' => $config->get('no_button'), '#prefix' => '<span class="feedback-no-button">', '#suffix' => '</span>', '#markup' => Markup::create('<label for = "feedback-no-button-' . $nid . '"></label>'), '#attributes' => [ 'class' => ['feedback-btn feedback-btn__no'], 'id' => ['feedback-no-button-' . $nid], 'data-node-id' => $node->id(), 'data-feedback' => 'no', ], Loading Loading
src/Plugin/Block/AdminFeedbackBlock.php +11 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Drupal\Core\Block\BlockBase; use Drupal\Core\Cache\Cache; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Form\FormBuilder; use Drupal\Core\Render\Markup; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Routing\CurrentRouteMatch; use Drupal\Core\Session\AccountInterface; Loading Loading @@ -92,6 +93,8 @@ class AdminFeedbackBlock extends BlockBase implements ContainerFactoryPluginInte if ($node && !is_string($node)) { $nid = $node->id(); $build = [ 'feedback_content' => [ '#type' => 'container', Loading @@ -111,8 +114,12 @@ class AdminFeedbackBlock extends BlockBase implements ContainerFactoryPluginInte 'yes_button' => [ '#type' => 'button', '#value' => $config->get('yes_button'), '#prefix' => '<span class="feedback-yes-button">', '#suffix' => '</span>', '#markup' => Markup::create('<label for = "feedback-yes-button-' . $nid . '"></label>'), '#attributes' => [ 'class' => ['feedback-btn feedback-btn__yes'], 'id' => ['feedback-yes-button-' . $nid], 'data-node-id' => $node->id(), 'data-feedback' => 'yes', ], Loading @@ -120,8 +127,12 @@ class AdminFeedbackBlock extends BlockBase implements ContainerFactoryPluginInte 'no_button' => [ '#type' => 'button', '#value' => $config->get('no_button'), '#prefix' => '<span class="feedback-no-button">', '#suffix' => '</span>', '#markup' => Markup::create('<label for = "feedback-no-button-' . $nid . '"></label>'), '#attributes' => [ 'class' => ['feedback-btn feedback-btn__no'], 'id' => ['feedback-no-button-' . $nid], 'data-node-id' => $node->id(), 'data-feedback' => 'no', ], Loading