Drupal 6

My Profile - Modiying the standard My Account/User Profile

In this post we'll modify the standard "My Account" user/profile menu and edit forms. We'll code the routines that allow users to edit their own "my profile alias".

In out previous post we discussed the fact that an administrator can turn this feature on or off. In other words, our code needs to check to see what the current system settings are before we allow a user to edit their alias.

First lets add our menu item. Note, we are appending the standard path "user". The following item is added to our hook_menu() impementation:

My Profile - Add Configuration Controls

In this post we are going to add a configuration page for the system administrator.

Our "My Profile" project has grown. So far the system is set up so that logically and administrator performs all the work. The design assumption so far has been that only a user granted special permissions can edit or delete "my profile" records. A new user is allowed to enter their "my profile alias" when they create an account. However, we haven't facilitated a user editing their alias at some later date.

My Profile - Populating Forms from the Database

In the prior post we showed you how to build a parent form which performs an asynchronous (AJAX) call to dynamically repaint a child form.

In this post we'll detail the child form.

First we need to create a path (url) which maps to our form. Drupal calls it's request dispatching mechanism "Menu Callbacks". We implemented hook_menu() already, we'll add a new callback definition:

My Profile - Dynamic Ajax Form Processing

In this post we are going to discuss the final method for administering our user alias records. That method is the add new alias method.

Let's review the business requirements briefly.

A user alias is not mandatory. However, a single user account can never have more than one alias. So we have 0:1 (zero to one) relationship between alias and user accounts.

So for our add dialog, that means we need to display only user accounts that do not have a related alias.

My Profile - Maintenance Forms and Handlers

In our previous post we constructed a maintenance table. That allows our administrators to either add a new alias, modify a current alias, or delete a current alias.

In this post we will detail the edit and delete current alias form and routines.

We will implement hook_form() to display a form that either modifies or deletes a current user alias.

My Profile - Maintenance Table

This post is part of a series on our proof-of-concept module "My Profile". We are going to detail a maintenance table, presumably for a system administrator. The maintenance table allows an administrator to add, modify and delete records.

Before we get in to the code, let's refresh folks on what "My Profile" does and how it fits in to the rest of our Drupal installation.

My Profile adds a simple text field to each Drupal (website) user account. That text field is called "Alias".

A My Profile Alias is optional for user accounts.

My Profile - Persisting User Profile Data

In part 1 of this series we showed you how to custom the Drupal account registration form. We now need to make sure that the new data is stored in the database (after a user completes the user registration form).

We implement hook_user()

My Profile - Installation

In this installment we'll focus on the install and un-install routines for our My Profile module. The first article (Part 1) is located here.. Part 1 discusses the data structure, database table and class model (to store and retrieve our custom data).

The following code should be stored in a file listing called "my_profile.install"

. Our module's name is "My Profile".

My Profile - Object Class Pattern

A simple object pattern for our custom data.

The following listing demonstrates 2 classes:

My Profile - Proof of Concept Module

This is another installment of our series on beginning module development for Drupal

We'll build a "proof of concept" module called "My Profile" which demonstrates the following:

Syndicate content