Book Image

Learning Drupal 6 Module Development

Book Image

Learning Drupal 6 Module Development

Overview of this book

Table of Contents (14 chapters)
Learning Drupal 6 Module Development
Credits
About the Author
About the Reviewers
Preface

The Beginning of the Module


As with all modules, we will begin by creating a module folder, emailusers/. This folder will be located inside drupal/sites/all/modules.

Inside this folder, we will place the two required files: emailusers.info and emailusers.module. The info file is boilerplate:

; $Id$
name = "Email Users"
description = "Email a user from within the user administration screen."
core = 6.x
php = 5.1

The fields here were described in Chapter 2, and nothing should be surprising.

We will start with a stubbed-out module, as well. It is always advisable to implement hook_help(), as we have done with the previous modules. Here's the beginning of our emailusers.module file:

<?php
// $Id$
/**
* This module provides an email interface for administrators.
* Using this module, administrators can send email to a user from the
* user's "view" page.
* @file
*/
/**
* implementation of hook_help()
*/
function emailusers_help($path, $arg) {
if ($path == 'admin/help#emailusers') {
$txt = ...