You are here

function _site_disclaimer_enabled in Site Disclaimer 6

Same name and namespace in other branches
  1. 7 site_disclaimer.module \_site_disclaimer_enabled()

Determine if site_disclaimer is enabled.

2 calls to _site_disclaimer_enabled()
site_disclaimer_confirm in ./site_disclaimer.pages.inc
Display the Site Disclaimer, when a user needs to confirm them after registering.
site_disclaimer_init in ./site_disclaimer.module
Implementation of hook_init().

File

./site_disclaimer.module, line 280
This module adds Site Disclaimer to the registration page.

Code

function _site_disclaimer_enabled() {

  // Will we show the full text of the Terms or only provide a link to the Terms.
  // Reading the checkbox label to find out.
  $nid = _site_disclaimer_nid_translated(variable_get('site_disclaimer_node_id', ''));
  $checkbox_label = filter_xss_admin(variable_get('site_disclaimer_checkbox_label', SITE_DISCLAIMER_DEFAULT_CHECKBOX_LABEL));
  $use_link = strpos($checkbox_label, '@link') !== FALSE;
  $use_named_links = strpos($checkbox_label, '@"') !== FALSE;

  // If there is no node to show and no links in the $checkbox_label, we don't show the terms form.
  $site_disclaimer_enabled = $use_link || $use_named_links || !empty($nid);
  return $site_disclaimer_enabled;
}