You are here

interface YamlFormMessageManagerInterface in YAML Form 8

Provides an interface for managing a form's custom, default, and hard-coded messages.

Hierarchy

Expanded class hierarchy of YamlFormMessageManagerInterface

All classes that implement YamlFormMessageManagerInterface

3 files declare their use of YamlFormMessageManagerInterface
yamlform.theme.inc in includes/yamlform.theme.inc
Preprocessors and helper functions to make theming easier.
YamlFormEntityReferenceEntityFormatter.php in src/Plugin/Field/FieldFormatter/YamlFormEntityReferenceEntityFormatter.php
YamlFormEntityReferenceLinkFormatter.php in src/Plugin/Field/FieldFormatter/YamlFormEntityReferenceLinkFormatter.php

File

src/YamlFormMessageManagerInterface.php, line 10

Namespace

Drupal\yamlform
View source
interface YamlFormMessageManagerInterface {

  /****************************************************************************/

  // Hardcode message constants.

  /****************************************************************************/

  /**
   * Admin only access.
   */
  const ADMIN_ACCESS = 1;

  /**
   * Default submission confirmation.
   */
  const SUBMISSION_DEFAULT_CONFIRMATION = 2;

  /**
   * Submission previous.
   */
  const SUBMISSION_PREVIOUS = 3;

  /**
   * Submissions previous.
   */
  const SUBMISSIONS_PREVIOUS = 4;

  /**
   * Submission updates.
   */
  const SUBMISSION_UPDATED = 5;

  /**
   * Submission test.
   */
  const SUBMISSION_TEST = 6;

  /**
   * Form not saving or sending any data.
   */
  const FORM_SAVE_EXCEPTION = 7;

  /**
   * Form not able to handle file uploads.
   */
  const FORM_FILE_UPLOAD_EXCEPTION = 8;

  /****************************************************************************/

  // Configurable message constants.
  // Values corresponds to admin config and form settings.

  /****************************************************************************/

  /**
   * Form exception.
   */
  const FORM_EXCEPTION = 'form_exception_message';

  /**
   * Form preview.
   */
  const FORM_PREVIEW_MESSAGE = 'preview_message';

  /**
   * Form closed.
   */
  const FORM_CLOSED_MESSAGE = 'form_closed_message';

  /**
   * Form confidential.
   */
  const FORM_CONFIDENTIAL_MESSAGE = 'form_confidential_message';

  /**
   * Limit user submission.
   */
  const LIMIT_USER_MESSAGE = 'limit_user_message';

  /**
   * Limit total submission.
   */
  const LIMIT_TOTAL_MESSAGE = 'limit_total_message';

  /**
   * Submission draft saved.
   */
  const SUBMISSION_DRAFT_SAVED = 'draft_saved_message';

  /**
   * Submission draft loaded.
   */
  const SUBMISSION_DRAFT_LOADED = 'draft_loaded_message';

  /**
   * Submission confirmation.
   */
  const SUBMISSION_CONFIRMATION = 'confirmation_message';

  /**
   * Submission confirmation.
   */
  const TEMPLATE_PREVIEW = 'template_preview';

  /**
   * Set the form used for custom messages and token replacement.
   *
   * @param \Drupal\yamlform\YamlFormInterface $yamlform
   *   A form.
   */
  public function setYamlForm(YamlFormInterface $yamlform = NULL);

  /**
   * Set the form source entity whose submissions are being exported.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   An entity.
   */
  public function setSourceEntity(EntityInterface $entity = NULL);

  /**
   * Set the form submission used for token replacement.
   *
   * @param \Drupal\yamlform\YamlFormSubmissionInterface $yamlform_submission
   *   A form submission.
   */
  public function setYamlFormSubmission(YamlFormSubmissionInterface $yamlform_submission = NULL);

  /**
   * Get message.
   *
   * @param string $key
   *   The name of form settings message to be displayed.
   *
   * @return string|bool
   *   A message or FALSE if no message is found.
   */
  public function get($key);

  /**
   * Display message.
   *
   * @param string $key
   *   The name of form settings message to be displayed.
   * @param string $type
   *   (optional) The message's type. Defaults to 'status'. These values are
   *   supported:
   *   - 'status'.
   *   - 'warning'.
   *   - 'error'.
   *
   * @return bool
   *   TRUE if message was displayed.
   */
  public function display($key, $type = 'status');

  /**
   * Build message.
   *
   * @return array
   *   A render array containing a message.
   */
  public function build($key);

  /**
   * Log message.
   *
   * @param string $key
   *   The name of form settings message to be logged.
   * @param string $type
   *   (optional) The message's type. Defaults to 'warning'. These values are
   *   supported:
   *   - 'notice'.
   *   - 'warning'.
   *   - 'error'.
   */
  public function log($key, $type = 'warning');

}

Members

Namesort descending Modifiers Type Description Overrides
YamlFormMessageManagerInterface::ADMIN_ACCESS constant Admin only access.
YamlFormMessageManagerInterface::build public function Build message. 1
YamlFormMessageManagerInterface::display public function Display message. 1
YamlFormMessageManagerInterface::FORM_CLOSED_MESSAGE constant Form closed.
YamlFormMessageManagerInterface::FORM_CONFIDENTIAL_MESSAGE constant Form confidential.
YamlFormMessageManagerInterface::FORM_EXCEPTION constant Form exception.
YamlFormMessageManagerInterface::FORM_FILE_UPLOAD_EXCEPTION constant Form not able to handle file uploads.
YamlFormMessageManagerInterface::FORM_PREVIEW_MESSAGE constant Form preview.
YamlFormMessageManagerInterface::FORM_SAVE_EXCEPTION constant Form not saving or sending any data.
YamlFormMessageManagerInterface::get public function Get message. 1
YamlFormMessageManagerInterface::LIMIT_TOTAL_MESSAGE constant Limit total submission.
YamlFormMessageManagerInterface::LIMIT_USER_MESSAGE constant Limit user submission.
YamlFormMessageManagerInterface::log public function Log message. 1
YamlFormMessageManagerInterface::setSourceEntity public function Set the form source entity whose submissions are being exported. 1
YamlFormMessageManagerInterface::setYamlForm public function Set the form used for custom messages and token replacement. 1
YamlFormMessageManagerInterface::setYamlFormSubmission public function Set the form submission used for token replacement. 1
YamlFormMessageManagerInterface::SUBMISSIONS_PREVIOUS constant Submissions previous.
YamlFormMessageManagerInterface::SUBMISSION_CONFIRMATION constant Submission confirmation.
YamlFormMessageManagerInterface::SUBMISSION_DEFAULT_CONFIRMATION constant Default submission confirmation.
YamlFormMessageManagerInterface::SUBMISSION_DRAFT_LOADED constant Submission draft loaded.
YamlFormMessageManagerInterface::SUBMISSION_DRAFT_SAVED constant Submission draft saved.
YamlFormMessageManagerInterface::SUBMISSION_PREVIOUS constant Submission previous.
YamlFormMessageManagerInterface::SUBMISSION_TEST constant Submission test.
YamlFormMessageManagerInterface::SUBMISSION_UPDATED constant Submission updates.
YamlFormMessageManagerInterface::TEMPLATE_PREVIEW constant Submission confirmation.