You are here

function _logintoboggan_toggleboggan in LoginToboggan 5

Same name and namespace in other branches
  1. 6 logintoboggan.module \_logintoboggan_toggleboggan()
  2. 7 logintoboggan.module \_logintoboggan_toggleboggan()

User login block with JavaScript to expand

this should really be themed

Return value

array the reconstituted user login block

1 call to _logintoboggan_toggleboggan()
logintoboggan_form_alter in ./logintoboggan.module
Implementation of hook_form_alter()

File

./logintoboggan.module, line 576
Logintoboggan Module

Code

function _logintoboggan_toggleboggan($form) {
  drupal_add_js(_logintoboggan_toggleboggan_js(), 'inline');
  $pre = '<div id="toboggan-container" class="toboggan-container">';
  $pre .= '<div class="toboggan-login-link">';
  $pre .= l(theme('lt_login_link'), 'user/login', array(
    'onclick' => "toggleboggan();this.blur();return false;",
  ));
  $pre .= '</div>';

  //the block that will be toggled
  $pre .= '<div id="toboggan-login" class="user-login-block">';
  $form['pre'] = array(
    '#value' => $pre,
    '#weight' => -300,
  );
  $form['post'] = array(
    '#value' => '</div></div>',
    '#weight' => 300,
  );
  return $form;
}