You are here

function ad_link_target in Advertisement 6

Same name and namespace in other branches
  1. 5.2 ad.module \ad_link_target()
  2. 5 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.admin.inc
Display a form for the ad module settings.
ad_admin_configure_settings_submit in ./ad.admin.inc
Save updated values from settings form.
ad_uninstall in ./ad.install
Allow complete uninstallation of the ad module.

File

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

Code

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