<?php

/**
 * @file
 * Contains panels_ipe.module.
 */

use Drupal\Core\Routing\RouteMatchInterface;

/**
 * Implements hook_help().
 */
function panels_ipe_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    // Main module help for the panels_ipe module.
    case 'help.page.panels_ipe':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('Panels In-place editor.') . '</p>';
      // @todo: Add useful help text for Panels In-place editor.
      return $output;

    default:
  }
}

/**
 * Implements hook_entity_type_build().
 *
 * Adds a custom Form Class to Block Content entities, so we can add custom
 * actions and potentially override normal Entity CRUD operations.
 */
function panels_ipe_entity_type_build(array &$entity_types) {
  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
  if (isset($entity_types['block_content'])) {
    $entity_types['block_content']->setFormClass('panels_ipe', 'Drupal\panels_ipe\Form\PanelsIPEBlockContentForm');
  }
}
