Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Here's my module file:
- <?php
- /**
- * Implements hook_menu().
- */
- /**
- * Implements hook_menu_alter().
- */
- function sparker_registration_menu_alter(&$items) {
- // Ctools registration wizard for standard registration.
- // Overrides default router item defined by core user module.
- $items['user/register']['page callback'] = array('sparker_registration_ctools_wizard');
- // Pass the "first" step key to start the form on step 1 if no step has been specified.
- $items['user/register']['page arguments'] = array('register');
- $items['user/register']['file path'] = drupal_get_path('module', 'sparker_registration');
- $items['user/register']['file'] = 'sparker_registration_ctools_wizard.inc';
- return $items;
- }
- /**
- * Implements hook_menu().
- */
- function sparker_registration_menu() {
- $items['user/register/%'] = array(
- 'title' => 'Create new account',
- 'page callback' => 'sparker_registration_ctools_wizard',
- 'page arguments' => array(2),
- 'access callback' => 'sparker_registration_access',
- 'access arguments' => array(2),
- 'file' => 'sparker_registration_ctools_wizard.inc',
- 'type' => MENU_CALLBACK,
- );
- return $items;
- }
- /**
- * Implements hook_form_FORM_ID_alter().
- */
- function sparker_registration_form_user_register_alter(&$form, &$form_state, $form_id) {
- $form['#submit'] = array(
- 'user_register_submit',
- 'ctools_wizard_submit',
- );
- }
- /**
- * Implements hook_block_view().
- *
- * This hook generates the contents of the blocks themselves.
- */
- function sparker_registration_block_view($delta = '') {
- switch ($delta) {
- case 'register_step1':
- $block['subject'] = 'Create an Account';
- $block['content'] = sparker_registration_block_contents($delta);
- break;
- }
- return $block;
- }
- /**
- * A module-defined block content function.
- */
- function sparker_registration_block_contents($which_block) {
- global $user;
- $content = '';
- switch ($which_block) {
- case 'register_step1':
- if (!$user->uid) {
- module_load_include('inc', 'sparker_registration', 'sparker_registration_ctools_wizard');
- return sparker_registration_ctools_wizard('register');
- }
- break;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement