You are here

function ad_link_target in Advertisement 5.2

Same name and namespace in other branches
  1. 5 ad.module \ad_link_target()
  2. 6 ad.module \ad_link_target()
  3. 6.2 ad.module \ad_link_target()
  4. 7 ad.module \ad_link_target()

Ad API Helper Function: Provide XHTML-strict-compatible target window onclick-handlers based on global configuration.

1 call to ad_link_target()
ad_link_attributes in ./ad.module
Ad API Helper Function: Append all necessary attributes to <a> tags.
3 string references to 'ad_link_target'
ad_admin_configure_settings in ./ad.module
Display a form for the ad module settings.
ad_admin_configure_settings_submit in ./ad.module
Save updated values from settings form.
ad_uninstall in ./ad.install
Allow complete uninstallation of the ad module.

File

./ad.module, line 222
An advertising system for Drupal powered websites.

Code

function ad_link_target() {
  switch (variable_get('ad_link_target', '_self')) {
    case '_blank':
      $target = ' onclick="window.open(this.href); return false;"';
      break;
    case '_parent':
      $target = ' onclick="window.parent.location = this.href; return false;"';
      break;
    case '_top':
      $target = ' onclick="window.top.location = this.href; return false;"';
      break;
    default:
      $target = '';
      break;
  }
  return $target;
}