You are here

class GProfileExtraFieldsController in Group 7

Controller for generating extra fields for group member profiles.

Hierarchy

Expanded class hierarchy of GProfileExtraFieldsController

1 string reference to 'GProfileExtraFieldsController'
gprofile_entity_info in modules/gprofile/gprofile.entity.inc
Implements hook_entity_info().

File

modules/gprofile/classes/gprofile.extra_fields_controller.inc, line 10
Defines the Entity API extra fields class for group member profiles.

View source
class GProfileExtraFieldsController extends EntityDefaultExtraFieldsController {

  /**
   * Implements EntityExtraFieldsControllerInterface::fieldExtraFields().
   */
  public function fieldExtraFields() {
    $extra = array();
    foreach (gprofile_types() as $name => $gprofile_type) {

      // Get the redirect link for the edit and delete action.
      $options = array(
        'query' => drupal_get_destination(),
      );

      // Add an extra field and display for every member profile.
      foreach (array(
        'form',
        'display',
      ) as $context) {
        $extra['group_membership']['group_membership'][$context]["gprofile_{$name}"] = array(
          'label' => $gprofile_type
            ->label(),
          'description' => t('The %profile profile fields', array(
            '%profile' => $gprofile_type
              ->label(),
          )),
          'weight' => 86,
          'edit' => l(t('edit'), "admin/group/member/manage/{$name}", $options),
          'delete' => l(t('delete'), "admin/group/member/manage/{$name}/delete", $options),
        );
      }
    }
    return $extra;
  }

}

Members