You are here

class ViewRevisionsFormAlter in Config Entity Revisions 8.2

Class ViewRevisionsFormAlter.

@package Drupal\view_revisions

Hierarchy

Expanded class hierarchy of ViewRevisionsFormAlter

1 file declares its use of ViewRevisionsFormAlter
view_revisions.module in modules/view_revisions/view_revisions.module
view_revisions hook functions.

File

modules/view_revisions/src/ViewRevisionsFormAlter.php, line 13

Namespace

Drupal\view_revisions
View source
class ViewRevisionsFormAlter extends ConfigEntityRevisionsFormAlterBase implements ConfigEntityRevisionsFormAlterInterface {

  /**
   * Route parameter name.
   *
   * @return string
   *   The name of the route parameter used to access the config entity.
   */
  public static function getRouteParameterName() {
    return 'view';
  }

  /**
   * ViewRevisions routes that provide an add form.
   *
   * @return array
   *   ViewRevisions routes that provide an add form.
   */
  public static function getAddFormRoutes() {
    return [
      'entity.view.revision',
    ];
  }

  /**
   * ViewRevisions routes that provide add or edit forms.
   *
   * @return array
   *   ViewRevisions routes that provide add or edit forms.
   */
  public static function getEditFormRoutes() {
    return [
      'entity.view.edit_form',
      'entity.view.edit_display_form',
      'entity.view.revision',
      'views_ui.form_add_handler',
      'views_ui.form_edit_details',
      'views_ui.form_reorder_displays',
      'views_ui.form_analyze',
      'views_ui.form_rearrange',
      'views_ui.form_rearrange_filter',
      'views_ui.form_display',
      'views_ui.form_handler',
      'views_ui.form_handler_extra',
      'views_ui.form_handler_group',
    ];
  }

  /**
   * ViewRevisions routes that get new revision form fields.
   *
   * @return array
   *   ViewRevisions routes that provide add or edit forms.
   */
  public static function getNewRevisionRoutes() {
    return [
      'entity.view.edit_form',
    ];
  }

  /**
   * ViewRevisions routes that view the entity.
   *
   * @return array
   *   ViewRevisions routes that view the entity.
   */
  public static function getViewFormRoutes() {
    return [
      'entity.view.edit_display_form',
      'entity.view.preview_form',
    ];
  }

  /**
   * Additional routes (to $add_edit_form_routes) that need a revision id.
   *
   * @return array
   *   Additional routes (to $add_edit_form_routes) that need a revision id.
   */
  public static function getRevisionRoutes() {
    return array_merge(self::getAddFormRoutes(), self::getEditFormRoutes(), self::getViewFormRoutes(), [
      'view_ui_element_form',
    ]);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigEntityRevisionsFormAlterBase::formAlter public static function Common form_alter hook code. Overrides ConfigEntityRevisionsFormAlterInterface::formAlter
ConfigEntityRevisionsFormAlterBase::getNewRevisionDefault public static function Do we create a new revision by default? (Generally no for config entities). Overrides ConfigEntityRevisionsFormAlterInterface::getNewRevisionDefault
ViewRevisionsFormAlter::getAddFormRoutes public static function ViewRevisions routes that provide an add form. Overrides ConfigEntityRevisionsFormAlterBase::getAddFormRoutes
ViewRevisionsFormAlter::getEditFormRoutes public static function ViewRevisions routes that provide add or edit forms. Overrides ConfigEntityRevisionsFormAlterBase::getEditFormRoutes
ViewRevisionsFormAlter::getNewRevisionRoutes public static function ViewRevisions routes that get new revision form fields. Overrides ConfigEntityRevisionsFormAlterBase::getNewRevisionRoutes
ViewRevisionsFormAlter::getRevisionRoutes public static function Additional routes (to $add_edit_form_routes) that need a revision id. Overrides ConfigEntityRevisionsFormAlterBase::getRevisionRoutes
ViewRevisionsFormAlter::getRouteParameterName public static function Route parameter name. Overrides ConfigEntityRevisionsFormAlterInterface::getRouteParameterName
ViewRevisionsFormAlter::getViewFormRoutes public static function ViewRevisions routes that view the entity. Overrides ConfigEntityRevisionsFormAlterBase::getViewFormRoutes