You are here

class AuthcacheFieldAdminEntry in Authenticated User Page Caching (Authcache) 7.2

Block admin entry class.

Hierarchy

Expanded class hierarchy of AuthcacheFieldAdminEntry

1 string reference to 'AuthcacheFieldAdminEntry'
authcache_field_authcache_p13n_assembly in modules/authcache_field/authcache_field.module
Implements hook_authcache_p13n_assembly().

File

modules/authcache_field/includes/AuthcacheFieldAdminEntry.inc, line 10
Defines the block admin entry class.

View source
class AuthcacheFieldAdminEntry {

  /**
   * Construct a new block admin entry.
   */
  public function __construct($entity_type, $field_name, $bundle_name, $config, $defaults) {

    // Copy over defaults.
    foreach ($defaults as $key => $value) {
      $this->{$key} = $value;
    }

    // Specify group.
    $this->group = t('Fields');

    // Add name, description, adminPath and clients properties.
    $instance = field_info_instance($entity_type, $field_name, $bundle_name);
    $entity_info = entity_get_info($entity_type);
    $entity_type_label = $entity_info['label'];
    $bundle_definitions = field_info_bundles();
    $bundle_label = $bundle_definitions[$entity_type][$bundle_name]['label'];
    $this->name = check_plain($instance['label']);
    $this->description = t('Field on bundle %bundle_label of type %entity_type_label', array(
      '%entity_type_label' => $entity_type_label,
      '%bundle_label' => $bundle_label,
    ));
    $this->clients = isset($config['clients']) ? $config['clients'] : array();
    if (module_exists('field_ui')) {
      $this->adminPath = _field_ui_bundle_admin_path($entity_type, $bundle_name) . '/fields/' . $field_name;
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AuthcacheFieldAdminEntry::__construct public function Construct a new block admin entry.