party_profile.module in Party 7
Same filename and directory in other branches
Support for configurable user profiles which are not attached to users.
File
modules/party_profile/party_profile.moduleView source
<?php
/**
* @file
* Support for configurable user profiles which are not attached to users.
*/
/**
* Implements hook_profile2_type_insert().
*/
function party_profile_profile2_type_insert($type) {
cache_clear_all('party:data_set_info', 'cache');
}
/**
* Implements hook_profile2_type_update().
*/
function party_profile_profile2_type_update($type) {
cache_clear_all('party:data_set_info', 'cache');
}
/**
* Implements hook_form_FORM_ID_alter().
*/
function party_profile_form_profile2_type_form_alter(&$form, &$form_state) {
unset($form['data']['registration']);
$form['registration'] = array();
}
/**
* Implements hook_profile2_access().
*/
function party_profile_profile2_access($op, $profile, $account) {
// An object means we're dealing with an actual entity. We will ignore any
// other mode, as creation etc of data sets will need to be done through a
// data controller for it to be attached. Operations on an existing profile
// can be done directly.
if (is_object($profile) && !empty($profile->party_attaching_party)) {
$party = party_load($profile->party_attaching_party);
if (party_access($op, $party, $profile->data_set_name, $account)) {
return TRUE;
}
}
}
Functions
Name | Description |
---|---|
party_profile_form_profile2_type_form_alter | Implements hook_form_FORM_ID_alter(). |
party_profile_profile2_access | Implements hook_profile2_access(). |
party_profile_profile2_type_insert | Implements hook_profile2_type_insert(). |
party_profile_profile2_type_update | Implements hook_profile2_type_update(). |