abigoltree

form

  1. <?php
  2. /**
  3. *       Implementation of hook_perm()
  4. */
  5. function helper_perm(){
  6.         return array('schedule Reservation');
  7. }
  8. /**
  9. *       Implementation of hook_menu()
  10. */
  11. function helper_menu(){
  12.         global $user;

conditional change $title

  1. <?php if(arg(0) == 'user' && is_numeric(arg(1))){
  2.         while($account = user_load(arg(1))){
  3.                 $title = '<h1 class="title">'.$account->profile_fname.' '.$account->profile_lname.'woot</h1>';
  4.         }                                      
  5. } ?

Fix for Fix for Code

  1. <?php
  2. function dmp_install(){
  3.         db_query("UPDATE {system} SET weight = -1 WHERE name = 'dmp'");
  4. }
  5. /**
  6. * Implementation of hook_menu()
  7. */
  8. function dmp_menu(){
  9.         global $user;
  10.         $items['add/user/d

Fix for a hook_form_alter for user_profile_form

  1. function foo_form_alter(&$form, $form_state, $form_id){
  2.         switch ($form_id){
  3.                 case 'user_profile_form':
  4.                         global $user;
  5.                         /**
  6.                         *       Account Info subtab
  7.                         */
  8.                         if(is_array($form['account']))

Fix for Code

  1. <?php
  2.  
  3. function mymodule_menu_alter(&$items){
  4.   $items['user/%user_category/edit']['access callback'] = 'mymodule_role_edit_perms';
  5.   $items['user/%user_category/edit']['access arguments'] = array

hook_menu_alter

  1. function foo_menu_alter(&$items){
  2.         global $user;
  3.         if(in_array('Administrator', array_values($user->roles))){
  4.                 $items['user/%user_category/edit']['access callback'] = 'get_company';
  5.                 $items['user

a hook_form_alter for user_profile_form

  1. switch ($form_id){
  2.                 case 'user_profile_form':
  3.                         global $user;
  4.                         echo '<pre>';
  5.                         print_r($form);
  6.                         echo '</pre>';
  7.                         //Which roles have access to Blocking and Activating users
  8.                         if(!in_arr

insert stuff into database table

  1. <?php
  2. /**
  3. *       User Login History
  4. *
  5. *       The Purpose of this module is to create a database table in which to store the
  6. *       login date/time of users as they login.
  7. *       The Plan is to use hook_form_alter(

Fix for hook_schema issue

  1. /**
  2. *       Implementation of hook_schema()  -- defines database
  3. */
  4. function user_login_history_schema(){
  5.         $schema['login_history'] = array(
  6.                 'description' => t('user.login storage'),
  7.                 'fields' => a

hook_schema issue

  1. function user_login_history_schema(){
  2.         $schema['login_history'] = array(
  3.                 'description' => t('user.login storage'),
  4.                 'fields' => array(
  5.                         'uid' => array(
  6.                                 'description' => t('Users UID'),

Fix for submit handler issues

  1. function dealer_form_submit($form, &$form_state){
  2.         $user_array = array(
  3.                 'name' => $form_state['values']['name'],
  4.                 'pass' => $form_state['values']['password'],
  5.                 'mail' => $form_state['values'][

submit handler issues

  1. function dmp_dealer_form_submit($form, &$form_state){
  2.         $user_array = array(
  3.                 'name' => $form_state['values']['name'],
  4.                 'pass' => $form_state['values']['password'],
  5.                 'mail' => $form_state['value

Fix for Multipage User Registration

  1. <?php
  2. /**
  3. * Implementation of hook_menu()
  4. */
  5. function multipage_register_menu(){
  6.         $items['add/user'] = array(
  7.                 'title' => 'Add a user',
  8.                 'page callback' => 'multipage_register_wizard',
  9.                 'ac

Multipage User Registration

  1. <?php
  2. /**
  3. *       The purpose of this module is to take the user-registration form and make it
  4. *       multipage, where the pages change depending on the options selected during
  5. *       the last step.
Syndicate content