Projet

Général

Profil

Révision 582db59d

Ajouté par Assos Assos il y a plus de 8 ans

Update Drupal core to version 7.40

Voir les différences:

drupal7/modules/block/block.api.php
363 363
  }
364 364
}
365 365

  
366
/**
367
 * Act on block cache ID (cid) parts before the cid is generated.
368
 *
369
 * This hook allows you to add, remove or modify the custom keys used to
370
 * generate a block cache ID (by default, these keys are set to the block
371
 * module and delta). These keys will be combined with the standard ones
372
 * provided by drupal_render_cid_parts() to generate the final block cache ID.
373
 *
374
 * To change the cache granularity used by drupal_render_cid_parts(), this hook
375
 * cannot be used; instead, set the 'cache' key in the block's definition in
376
 * hook_block_info().
377
 *
378
 * @params $cid_parts
379
 *   An array of elements used to build the cid.
380
 * @param $block
381
 *   The block object being acted on.
382
 *
383
 * @see _block_get_cache_id()
384
 */
385
function hook_block_cid_parts_alter(&$cid_parts, $block) {
386
  global $user;
387
  // This example shows how to cache a block based on the user's timezone.
388
  $cid_parts[] = $user->timezone;
389
}
390

  
366 391
/**
367 392
 * @} End of "addtogroup hooks".
368 393
 */

Formats disponibles : Unified diff