commons_profile_base.module in Drupal Commons 7.3
File
modules/commons/commons_profile_base/commons_profile_base.module
View source
<?php
include_once 'commons_profile_base.features.inc';
function commons_profile_base_form_user_login_alter(&$form, &$form_state, $form_id) {
drupal_set_title(t('Log in'));
}
function commons_profile_base_form_user_register_form_alter(&$form, &$form_state, $form_id) {
drupal_set_title(t('Sign up'));
$form['field_name_first']['#weight'] = -100;
$form['field_name_last']['#weight'] = -99;
if (empty($form['administer_users']['#value'])) {
$form['actions']['submit']['#value'] = t('Sign up');
}
}
function commons_profile_base_menu_alter(&$items) {
$items['user/register']['title'] = 'Sign up';
}
function commons_profile_base_modules_enabled($modules) {
if (in_array('realname', $modules)) {
features_revert(array(
'commons_profile_base' => array(
'variable',
),
));
}
}
function commons_profile_base_modules_disabled($modules) {
if (in_array('realname', $modules)) {
features_revert(array(
'commons_profile_base' => array(
'variable',
),
));
}
}
function commons_profile_base_strongarm_alter(&$items) {
if (module_exists('realname')) {
if (isset($items['user_mail_register_admin_created_body'])) {
$items['user_mail_register_admin_created_body']->value = '[user:name-raw],
A site administrator at [site:name] has created an account for you. You may now log in by clicking this link or copying and pasting it to your browser:
[user:one-time-login-url]
This link can only be used once to log in and will lead you to a page where you can set your password.
After setting your password, you will be able to log in at [site:login-url] in the future using:
username: [user:name-raw]
password: Your password
-- [site:name] team';
}
if (isset($items['user_mail_register_no_approval_required_body'])) {
$items['user_mail_register_no_approval_required_body']->value = '[user:name-raw],
Thank you for registering at [site:name]. You may now log in by clicking this link or copying and pasting it to your browser:
[user:one-time-login-url]
This link can only be used once to log in and will lead you to a page where you can set your password.
After setting your password, you will be able to log in at [site:login-url] in the future using:
username: [user:name-raw]
password: Your password
-- [site:name] team';
}
if (isset($items['user_mail_status_activated_body'])) {
$items['user_mail_status_activated_body']->value = '[user:name],
Your account at [site:name] has been activated.
You may now log in by clicking this link or copying and pasting it into your browser:
[user:one-time-login-url]
This link can only be used once to log in and will lead you to a page where you can set your password.
After setting your password, you will be able to log in at [site:login-url] in the future using:
username: [user:name-raw]
password: Your password
-- [site:name] team';
}
}
}