This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_form_alter(). | |
* - Extends the User Profile Form with the calendar view | |
*/ | |
function pw_profile_extender_form_alter(&$form, &$form_state, $form_id) { | |
if ($form_id == 'user_profile_form') { | |
$form['calendar admin'] = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_form_alter(). | |
*/ | |
function MODULENAME_form_alter(&$form, $form_state, $form_id) { | |
if ($form_id == 'field_ui_field_edit_form') { | |
$max_values = 20; | |
$form['field']['cardinality']['#options'] = array('-1' => t('Unlimited')) + drupal_map_assoc(range(1, $max_values)); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Standalone PHP script to migrate users from Drupal 6 to Drupal 7 programatically. | |
Date: 9-4-2012 | |
*/ | |
// set HTTP_HOST or drupal will refuse to bootstrap | |
$_SERVER['HTTP_HOST'] = 'example.org'; | |
$_SERVER['REMOTE_ADDR'] = '127.0.0.1'; |