You are here

function ng_lightbox_link in NG Lightbox 7

Implements theme_link().

1 string reference to 'ng_lightbox_link'
ng_lightbox_theme_registry_alter in ./ng_lightbox.module
Implements hook_theme_registry_alter().

File

./ng_lightbox.module, line 27
The NG Lightbox module.

Code

function ng_lightbox_link($vars) {

  // If this path matches the patterns, add the lightbox.
  if (_ng_lightbox_check_path($vars['path'])) {

    // Safety check if class isn't an array.
    if (!isset($vars['options']['attributes']['class'])) {
      $vars['options']['attributes']['class'] = array();
    }

    // Add our lightbox class.
    $vars['options']['attributes']['class'][] = 'ng-lightbox';
  }

  // Allow other modules to alter whether this link uses the lightbox. Helpful
  // if you have admin paths disabled but want to enable it for certain ones or
  // vice versa.
  drupal_alter('ng_lightbox_ajax_path', $vars);
  return theme_link($vars);
}