Projet

Général

Profil

Paste
Télécharger (817 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / jquery_countdown_timer / jquery_countdown_timer.api.php @ 651307cd

1
<?php
2

    
3
/**
4
 * jQuery Countdown timer api
5
 */
6

    
7
/**
8
 * Implements hook_jquery_countdown_timer_date_alter().
9
 *
10
 * @param  [string] &$date   a string based representation of a date
11
 * @param  [mixed] $context optional value that can provide additional context
12
 *  an example of using this could be custom invoking the attachment of the timer
13
 *  to a node form, and passing the node in question into the invoking. This could
14
 *  allow the node to actually influence the time that's shown via fields.
15
 *
16
 *  Default for the context variable is NULL unless otherwise passed in.
17
 */
18
function hook_jquery_countdown_timer_date_alter(&$date, $context) {
19
  // example of using a node-field to dictate the time to show
20
  if ($context != NULL && isset($node->field_time)) {
21
    $date = $node->field_time['und'][0]['value'];
22
  }
23
}