You are here

class EntityLegalMethodPopup in Entity Legal 7

Same name and namespace in other branches
  1. 7.2 methods/entity_legal.popup.inc \EntityLegalMethodPopup

Method class for alerting existing users via a jQuery UI popup window.

Hierarchy

Expanded class hierarchy of EntityLegalMethodPopup

File

methods/entity_legal.popup.inc, line 10
Method include file for 'popup'.

View source
class EntityLegalMethodPopup extends EntityLegalMethod {

  /**
   * Execution method for popup method.
   */
  public function execute($method = 'popup') {
    $documents = $this
      ->getDocumentsForMethod($method, ENTITY_LEGAL_USER_EXISTING);
    foreach ($documents as $document) {
      $document_markup = $document
        ->view();
      drupal_add_library('system', 'ui.dialog');
      drupal_add_js(array(
        'entityLegalPopup' => array(
          array(
            'popupTitle' => $document
              ->getVersionLabel(),
            'popupContent' => render($document_markup),
          ),
        ),
      ), 'setting');
      drupal_add_js(drupal_get_path('module', 'entity_legal') . '/js/entity_legal.popup.js', array(
        'every_page' => FALSE,
      ));
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityLegalMethod::getDocumentsForMethod public function Get all Entity Legal Documents for a given user type and method.
EntityLegalMethodPopup::execute public function Execution method for popup method.