You are here

drop_down_login.module in Drop Down Login 8

Same filename and directory in other branches
  1. 7 drop_down_login.module

Module file for Drop Down Login.

File

drop_down_login.module
View source
<?php

/**
 * @file
 * Module file for Drop Down Login.
 */
use Drupal\Core\Routing\RouteMatchInterface;

/**
 * Implements hook_help().
 */
function drop_down_login_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.drop_down_login':
      $output = '';
      $output .= '<p>' . t('This module provide a drop down block for user login,User can display this block in any region for all / specified pages.This is a tiny project, Login block display on login button toggle,if javascript is disabled clicking on the button will redirect user to user login page.') . '</p>';
      $output .= '<h6>' . t('Installation') . '</h6>';
      $output .= '<ol>';
      $output .= '<li>' . t('Install as usual, see <a href="@2367405">https://www.drupal.org/node/2367405</a> for further information.', [
        '@2367405' => 'https://www.drupal.org/node/2367405',
      ]) . '</li>';
      $output .= '<li>' . t('Copy the entire drop_down_login directory the Drupal sites/all/modules/custom directory.') . '</li>';
      $output .= '<li>' . t('Login as an administrator. Enable the module in the "Administer" -> "Modules".') . '</li>';
      $output .= '</ol>';
      $output .= '<h6>' . t('Configuration') . '</h6>';
      $output .= '<ul>';
      $output .= '<li>' . t('Add the new block "Drop down Login" to the required region via "Administer" -> "Structure" -> "Blocks".') . '</li>';
      $output .= '</ul>';
      return $output;
  }
}

/**
 * Implements hook_theme().
 */
function drop_down_login_theme($existing, $type, $theme, $path) {
  return [
    'drop_down_login' => [
      'variables' => [
        'login_form' => NULL,
        'login_url' => NULL,
        'login_link_text' => NULL,
      ],
    ],
    'drop_down_logout' => [
      'variables' => [
        'logout_url' => NULL,
        'logout_link_text' => NULL,
      ],
    ],
    'drop_down_myaccount' => [
      'variables' => [
        'myaccount_links' => NULL,
        'myaccount_url' => NULL,
        'myaccount_link_text' => NULL,
        'name' => NULL,
        'logout_url' => NULL,
        'logout_link_text' => NULL,
      ],
    ],
  ];
}

Functions

Namesort descending Description
drop_down_login_help Implements hook_help().
drop_down_login_theme Implements hook_theme().