You are here

function _disclaimer_render_button in Disclaimer 7

Build links for disclaimer actions.

Parameters

string $key: Button concerned, enter or exit.

Return value

string Html button rendered.

File

./disclaimer.module, line 224
Create and show disclaimer for your site.

Code

function _disclaimer_render_button($key = 'enter') {
  $output = '';
  if ($zone == 'footer') {
    $key = 'disclaimer_footer_';
  }
  else {
    $key = 'disclaimer_main_';
  }
  if (variable_get($key . 'source') == 0) {
    $content = variable_get($key . 'content', array(
      'value' => '',
      'format' => NULL,
    ));
    $output = check_markup($content['value'], $content['format']);
  }
  else {
    $node = node_load(variable_get($key . 'node', 0));
    if (!empty($node)) {
      $node = node_view($node, variable_get($key . 'node_view'));
      if (variable_get($key . 'node_view_links') != 1) {
        $node['links']['#access'] = FALSE;
      }
      $output = drupal_render($node);
    }
  }
  return $output;
}