You are here

function fancy_login_page_build in Fancy Login 7.3

Same name and namespace in other branches
  1. 7.2 fancy_login.module \fancy_login_page_build()

Implements hook_page_build().

Adds login form and page dimmer to the footer of the page.

File

./fancy_login.module, line 93
Holds hooks for the Fancy Login module.

Code

function fancy_login_page_build(&$page) {
  if (user_is_anonymous()) {
    $form = drupal_get_form('user_login_block');
    $path = drupal_get_path('module', 'fancy_login');
    $login_path = drupal_get_path_alias('user/login');
    $fl_settings = array(
      'screenFadeColor' => variable_get('screen_fade_color', 'white'),
      'screenFadeZIndex' => variable_get('screen_fade_z_index', '10'),
      'loginBoxBackgroundColor' => variable_get('login_box_background_color', 'white'),
      'loginBoxTextColor' => variable_get('login_box_text_color', 'black'),
      'loginBoxBorderColor' => variable_get('login_box_border_color', 'black'),
      'loginBoxBorderWidth' => variable_get('login_box_border_width', '3px'),
      'loginBoxBorderStyle' => variable_get('login_box_border_style', 'solid'),
      'loginPath' => $login_path,
      'dimFadeSpeed' => (int) variable_get('fancy_login_dim_fade_speed', 500),
      'boxFadeSpeed' => (int) variable_get('fancy_login_box_fade_speed', 1000),
      'hideObjects' => variable_get('fancy_login_hide_objects', 0),
      'disableRegistration' => variable_get('fancy_login_disable_registration', 0),
    );
    $page['page_bottom']['fancy_login'] = array(
      '#prefix' => '<div id="fancy_login_dim_screen"></div><div id="fancy_login_login_box">',
      '#suffix' => '</div>',
      'form_wrapper' => array(
        '#prefix' => '<div id="fancy_login_form_contents"><a href="#" id="fancy_login_close_button">X</a>',
        '#suffix' => '</div>',
        'form' => drupal_get_form('fancy_login_user_login_block'),
      ),
      '#attached' => array(
        'js' => array(
          array(
            'type' => 'file',
            'data' => $path . '/js/fancy_login.js',
          ),
          array(
            'type' => 'setting',
            'data' => array(
              'fancyLogin' => $fl_settings,
            ),
          ),
        ),
        'css' => array(
          array(
            'type' => 'file',
            'data' => $path . '/css/fancy_login.css',
          ),
        ),
      ),
    );
  }
}