You are here

function theme_site_disclaimer_checkbox_label in Site Disclaimer 6

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

Theme the Site Disclaimer checkbox label.

Parameters

$checkbox_label: The label from the admin form saved in the DB.

$node: The Site Disclaimer $node.

Return value

HTML output.

1 theme call to theme_site_disclaimer_checkbox_label()
site_disclaimer_form_user_register_alter in ./site_disclaimer.module
Implementation of hook_form_form_id_alter().

File

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

Code

function theme_site_disclaimer_checkbox_label($checkbox_label = '', $node = NULL) {
  if (!drupal_strlen($checkbox_label)) {
    return '';
  }
  $output = $checkbox_label;
  if (!empty($node)) {

    //We are linking to the terms instead, replace the link.
    $output = str_replace('@link', l($node->title, 'node/' . $node->nid), $output);
  }
  $output = _site_disclaimer_checkbox_label_substitute_links($output);

  // The following adds "required" styling to the checkbox (patches core missing functionality as of D6.16)
  // Checkbox validate handles denoting required checkboxes for us
  if (!module_exists('checkbox_validate')) {
    $output .= '&nbsp;<span class="form-required" title="' . t('This field is required.') . '">*</span>';
  }
  return $output;
}