You are here

varbase_tweaks.module in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 7.2

Same filename and directory in other branches
  1. 7 modules/custom/varbase_tweaks/varbase_tweaks.module

Applies some tweaks for a more usable and standardized Drupal site.

File

modules/custom/varbase_tweaks/varbase_tweaks.module
View source
<?php

/**
 * @file
 * Applies some tweaks for a more usable and standardized Drupal site.
 */

/**
 * Implements hook_form_FORM_ID_alter().
 *
 * Allows the profile to alter the site configuration form.
 */
function varbase_tweaks_form_system_site_information_settings_alter(&$form, $form_state) {
  global $user;
  if ($user->uid != 1) {
    $form['front_page']['#access'] = FALSE;
  }
}

/**
 * Implements hook_init().
 */
function varbase_tweaks_init() {
  if (arg(0) == 'node' && arg(1) == NULL && variable_get('site_frontpage', 'node') != 'node') {
    drupal_goto('<front>', array(), 301);
  }
  drupal_add_css(drupal_get_path('module', 'varbase_tweaks') . '/varbase_tweaks.css');
  drupal_add_js(drupal_get_path('module', 'varbase_tweaks') . '/varbase_tweaks.js');
}

/**
 * Implements hook_admin_paths().
 */
function varbase_tweaks_admin_paths_alter(&$paths) {
  $paths['user'] = FALSE;
  $paths['user/*'] = FALSE;
}