You are here

interface PowerMenuHandlerInterface in Power Menu 7.2

Interface representing a power menu handler.

Hierarchy

Expanded class hierarchy of PowerMenuHandlerInterface

All classes that implement PowerMenuHandlerInterface

File

plugins/menu_handlers/PowerMenuHandler.interface.php, line 6

View source
interface PowerMenuHandlerInterface {

  /**
   * Display a form for configuring this handler.
   *
   * @return array
   *   A form array for configuring this handler, or FALSE if no configuration
   *   is necessary.
   */
  public function configurationForm();

  /**
   * Validation callback for the form returned by configurationForm().
   *
   * @param array &$elements
   *   An associative array containing the structure of the form.
   * @param array &$form_state
   *   A keyed array containing the current state of the form.
   * @param array $form_id
   *   A unique string identifying the form.
   */
  public function configurationFormValidate(array &$elements, array &$form_state, $form_id = NULL);

  /**
   * Submit callback for the form returned by configurationForm().
   *
   * This method should both return the new options and set them internally.
   *
   * @param array $form
   *   The form returned by configurationForm().
   * @param array $form_state
   *   The complete form state.
   *
   * @return array
   *   The new options array for this callback.
   */
  public function configurationFormSubmit(array $form, array &$form_state);

  /**
   * Get the menu path which sould activated.
   *
   * This method is used when a handler plugin should modify the menu router item information.
   *
   * @param $entity
   *     The eintity object
   * @param $type
   *     The eintity type
   * @param array $item
   *     The router item array to alter
   * @param array $alias
   *     The alias or system path for the given entity
   *
   * @return
   *   The path to activate or NULL when no path is found.
   */
  public function getMenuPathToActivate($entity, $type, array $router_item, $alias);

  /**
   * Drupal menu item form alter.
   *
   * Alter the existing form or return a forms array which is added to the menu item form grouped by the handler.
   *
   * @param array &$menu_item_form
   *   An associative array containing the structure of the form.
   * @param array &$form_state
   *   A keyed array containing the current state of the form.
   *
   * @return
   *   Return a form array, otherwise FALSE.
   */
  public function menuFormAlter(&$menu_item_form, &$form_state);

  /**
   * Validation callback for the form returned by form menu_edit_item.
   *
   * @param array &$form
   *   An associative array containing the structure of the form.
   * @param array &$form_state
   *   A keyed array containing the current state of the form.
   * @param array $form_id
   *   A unique string identifying the form.
   */
  public function menuFormValidate(array &$form, array &$form_state, $form_id = NULL);

  /**
   * Submit callback for the form returned by form menu_edit_item.
   *
   * This method should both return the new options and set them internally.
   *
   * @param array $form
   *   The form returned by configurationForm().
   * @param array $form_state
   *   The complete form state.
   */
  public function menuFormSubmit(array $form, array &$form_state);

  /**
   * Callback for the hook_menu_link_delete().
   *
   * This method should cleanup menu link related data from a menu handler.
   *
   * @param array $link
   *   The complete menu link array.
   */
  public function menuLinkDelete(array $link);

}

Members

Namesort descending Modifiers Type Description Overrides
PowerMenuHandlerInterface::configurationForm public function Display a form for configuring this handler. 3
PowerMenuHandlerInterface::configurationFormSubmit public function Submit callback for the form returned by configurationForm(). 3
PowerMenuHandlerInterface::configurationFormValidate public function Validation callback for the form returned by configurationForm(). 3
PowerMenuHandlerInterface::getMenuPathToActivate public function Get the menu path which sould activated. 3
PowerMenuHandlerInterface::menuFormAlter public function Drupal menu item form alter. 3
PowerMenuHandlerInterface::menuFormSubmit public function Submit callback for the form returned by form menu_edit_item. 3
PowerMenuHandlerInterface::menuFormValidate public function Validation callback for the form returned by form menu_edit_item. 3
PowerMenuHandlerInterface::menuLinkDelete public function Callback for the hook_menu_link_delete(). 3